Proper fix for missing node types in web build

Using `path` in web for these cases is ok (but not ideal) because webpack shims it out
This commit is contained in:
Matt Bierner
2025-10-14 12:14:28 -07:00
parent 6699439de0
commit 98ad0f55db
5 changed files with 26 additions and 6 deletions

View File

@@ -26,6 +26,7 @@
"@types/dompurify": "^3.0.5",
"@types/lodash.throttle": "^4.1.9",
"@types/markdown-it": "12.2.3",
"@types/node": "22.x",
"@types/picomatch": "^2.3.0",
"@types/vscode-notebook-renderer": "^1.60.0",
"@types/vscode-webview": "^1.57.0",
@@ -209,6 +210,16 @@
"integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
"dev": true
},
"node_modules/@types/node": {
"version": "22.18.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.10.tgz",
"integrity": "sha512-anNG/V/Efn/YZY4pRzbACnKxNKoBng2VTFydVu8RRs5hQjikP8CQfaeAV59VFSCzKNp90mXiVXW2QzV56rwMrg==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"node_modules/@types/picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.0.tgz",
@@ -577,6 +588,13 @@
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
},
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true,
"license": "MIT"
},
"node_modules/vscode-jsonrpc": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz",

View File

@@ -783,6 +783,7 @@
"@types/dompurify": "^3.0.5",
"@types/lodash.throttle": "^4.1.9",
"@types/markdown-it": "12.2.3",
"@types/node": "22.x",
"@types/picomatch": "^2.3.0",
"@types/vscode-notebook-renderer": "^1.60.0",
"@types/vscode-webview": "^1.57.0",

View File

@@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as picomatch from 'picomatch';
import * as vscode from 'vscode';
import { TextDocumentEdit } from 'vscode-languageclient';
import { Utils } from 'vscode-uri';
import { MdLanguageClient } from '../client/client';
import { Delayer } from '../util/async';
import { noopToken } from '../util/cancellation';
@@ -137,7 +137,7 @@ class UpdateLinksOnFileRenameHandler extends Disposable {
const choice = await vscode.window.showInformationMessage(
newResources.length === 1
? vscode.l10n.t("Update Markdown links for '{0}'?", path.basename(newResources[0].fsPath))
? vscode.l10n.t("Update Markdown links for '{0}'?", Utils.basename(newResources[0]))
: this._getConfirmMessage(vscode.l10n.t("Update Markdown links for the following {0} files?", newResources.length), newResources), {
modal: true,
}, rejectItem, acceptItem, alwaysItem, neverItem);
@@ -197,7 +197,7 @@ class UpdateLinksOnFileRenameHandler extends Disposable {
const paths = [start];
paths.push('');
paths.push(...resourcesToConfirm.slice(0, MAX_CONFIRM_FILES).map(r => path.basename(r.fsPath)));
paths.push(...resourcesToConfirm.slice(0, MAX_CONFIRM_FILES).map(r => Utils.basename(r)));
if (resourcesToConfirm.length > MAX_CONFIRM_FILES) {
if (resourcesToConfirm.length - MAX_CONFIRM_FILES === 1) {

View File

@@ -1,8 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": []
},
"compilerOptions": {},
"exclude": [
"./src/test/**"
]

View File

@@ -2,6 +2,9 @@
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"typeRoots": [
"./node_modules/@types"
],
"skipLibCheck": true
},
"include": [