From b591f33513575b89cfe3f42d5b9de43efcf9ca78 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 1 Oct 2024 08:19:15 +0200 Subject: [PATCH] :up: `jschardet@3.1.4` (#230197) --- build/.moduleignore | 2 +- build/.webignore | 2 +- extensions/git/package-lock.json | 16 ++++++++++++---- extensions/git/package.json | 2 +- package-lock.json | 9 +++++---- package.json | 2 +- remote/package-lock.json | 9 +++++---- remote/package.json | 2 +- remote/web/package-lock.json | 9 +++++---- remote/web/package.json | 2 +- .../services/textfile/common/encoding.ts | 6 +----- 11 files changed, 34 insertions(+), 27 deletions(-) diff --git a/build/.moduleignore b/build/.moduleignore index 3f573e06078..97b504d8522 100644 --- a/build/.moduleignore +++ b/build/.moduleignore @@ -163,7 +163,7 @@ typescript/lib/tsserverlibrary.js jschardet/index.js jschardet/src/** -# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js +jschardet/dist/jschardet.js es6-promise/lib/** diff --git a/build/.webignore b/build/.webignore index 837366b67f7..d42f9775ba9 100644 --- a/build/.webignore +++ b/build/.webignore @@ -14,7 +14,7 @@ jschardet/index.js jschardet/src/** -# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js +jschardet/dist/jschardet.js vscode-textmate/webpack.config.js diff --git a/extensions/git/package-lock.json b/extensions/git/package-lock.json index ef76d2719da..afbadbdfc2f 100644 --- a/extensions/git/package-lock.json +++ b/extensions/git/package-lock.json @@ -14,7 +14,7 @@ "@vscode/iconv-lite-umd": "0.7.0", "byline": "^5.0.0", "file-type": "16.5.4", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "picomatch": "2.3.1", "vscode-uri": "^2.0.0", "which": "4.0.0" @@ -268,9 +268,10 @@ } }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "license": "LGPL-2.1+", "engines": { "node": ">=0.1.90" } @@ -385,6 +386,13 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD", + "peer": true + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/extensions/git/package.json b/extensions/git/package.json index 57e332a8d78..ee3a7a16d27 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -3384,7 +3384,7 @@ "@vscode/iconv-lite-umd": "0.7.0", "byline": "^5.0.0", "file-type": "16.5.4", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "picomatch": "2.3.1", "vscode-uri": "^2.0.0", "which": "4.0.0" diff --git a/package-lock.json b/package-lock.json index 9f7cecd26d5..6cabbae195d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "@xterm/xterm": "^5.6.0-beta.65", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "minimist": "^1.2.6", "native-is-elevated": "0.7.0", @@ -11030,9 +11030,10 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "license": "LGPL-2.1+", "engines": { "node": ">=0.1.90" } diff --git a/package.json b/package.json index d28dfdde063..2bc50f10061 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@xterm/xterm": "^5.6.0-beta.65", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "minimist": "^1.2.6", "native-is-elevated": "0.7.0", diff --git a/remote/package-lock.json b/remote/package-lock.json index 5f8891ee061..34367ce686b 100644 --- a/remote/package-lock.json +++ b/remote/package-lock.json @@ -31,7 +31,7 @@ "cookie": "^0.4.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "minimist": "^1.2.6", "native-watchdog": "^1.4.1", @@ -613,9 +613,10 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "license": "LGPL-2.1+", "engines": { "node": ">=0.1.90" } diff --git a/remote/package.json b/remote/package.json index 0d0a37e4b90..1c0d780abd8 100644 --- a/remote/package.json +++ b/remote/package.json @@ -26,7 +26,7 @@ "cookie": "^0.4.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "minimist": "^1.2.6", "native-watchdog": "^1.4.1", diff --git a/remote/web/package-lock.json b/remote/web/package-lock.json index 04199f4e652..41bf9446996 100644 --- a/remote/web/package-lock.json +++ b/remote/web/package-lock.json @@ -20,7 +20,7 @@ "@xterm/addon-unicode11": "^0.9.0-beta.65", "@xterm/addon-webgl": "^0.19.0-beta.65", "@xterm/xterm": "^5.6.0-beta.65", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "tas-client-umd": "0.2.0", "vscode-oniguruma": "1.7.0", "vscode-textmate": "9.1.0" @@ -148,9 +148,10 @@ "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "license": "LGPL-2.1+", "engines": { "node": ">=0.1.90" } diff --git a/remote/web/package.json b/remote/web/package.json index a4a18b9369c..5529301e4c4 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -15,7 +15,7 @@ "@xterm/addon-unicode11": "^0.9.0-beta.65", "@xterm/addon-webgl": "^0.19.0-beta.65", "@xterm/xterm": "^5.6.0-beta.65", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "tas-client-umd": "0.2.0", "vscode-oniguruma": "1.7.0", "vscode-textmate": "9.1.0" diff --git a/src/vs/workbench/services/textfile/common/encoding.ts b/src/vs/workbench/services/textfile/common/encoding.ts index 56a122772e7..b653dd7a847 100644 --- a/src/vs/workbench/services/textfile/common/encoding.ts +++ b/src/vs/workbench/services/textfile/common/encoding.ts @@ -320,11 +320,7 @@ const IGNORE_ENCODINGS = ['ascii', 'utf-16', 'utf-32']; * Guesses the encoding from buffer. */ async function guessEncodingByBuffer(buffer: VSBuffer, candidateGuessEncodings?: string[]): Promise { - - // TODO@bpasero TODO@esm: this used to be `dist/jschardet.min.js`, but we are running into an issue that - // https://github.com/aadsm/jschardet/pull/96 mitigates. Long-term we should just add minification - // of dependencies into our build process so that we do not depend on how others are doing it. - const jschardet = await importAMDNodeModule('jschardet', 'dist/jschardet.js'); + const jschardet = await importAMDNodeModule('jschardet', 'dist/jschardet.min.js'); // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53 const limitedBuffer = buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES);