diff --git a/build/azure-pipelines/darwin/build.yml b/build/azure-pipelines/darwin/build.yml index ff6c12aa..b6299257 100644 --- a/build/azure-pipelines/darwin/build.yml +++ b/build/azure-pipelines/darwin/build.yml @@ -1,7 +1,7 @@ steps: - task: NodeTool@0 inputs: - versionSpec: '20.15.1' + versionSpec: '22.x' displayName: 'Install Node.js' - script: | diff --git a/build/azure-pipelines/linux/build.yml b/build/azure-pipelines/linux/build.yml index 4c164e74..2e79bc3f 100644 --- a/build/azure-pipelines/linux/build.yml +++ b/build/azure-pipelines/linux/build.yml @@ -10,7 +10,7 @@ steps: - task: NodeTool@0 inputs: - versionSpec: '20.15.1' + versionSpec: '22.x' displayName: 'Install Node.js' - script: | diff --git a/build/azure-pipelines/pipeline.yml b/build/azure-pipelines/pipeline.yml index 4b645090..5cea5337 100644 --- a/build/azure-pipelines/pipeline.yml +++ b/build/azure-pipelines/pipeline.yml @@ -55,13 +55,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -81,13 +81,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -107,13 +107,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -133,13 +133,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -159,13 +159,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -185,13 +185,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.x - name: MacOS nodeVersions: - - 20.15.1 + - 22.x - name: Windows nodeVersions: - - 20.15.1 + - 22.x testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: diff --git a/build/azure-pipelines/win32/build.yml b/build/azure-pipelines/win32/build.yml index 74d7b843..b2fb5509 100644 --- a/build/azure-pipelines/win32/build.yml +++ b/build/azure-pipelines/win32/build.yml @@ -1,7 +1,7 @@ steps: - task: NodeTool@0 inputs: - versionSpec: '20.15.1' + versionSpec: '22.x' displayName: 'Install Node.js' - script: | diff --git a/package-lock.json b/package-lock.json index 6ba563ee..146f9861 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@types/assert": "^1.5.11", "@types/glob": "^8.1.0", "@types/mocha": "^10.0.10", - "@types/node": "^18.14.6", + "@types/node": "^22.0.0", "@types/path-browserify": "^1.0.2", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", @@ -904,10 +904,14 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.14.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz", - "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", - "dev": true + "version": "22.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", + "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -6437,6 +6441,13 @@ "node": ">=14.17" } }, + "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/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", @@ -7288,10 +7299,13 @@ "dev": true }, "@types/node": { - "version": "18.14.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz", - "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", - "dev": true + "version": "22.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", + "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", + "dev": true, + "requires": { + "undici-types": "~6.21.0" + } }, "@types/normalize-package-data": { "version": "2.4.1", @@ -11230,6 +11244,12 @@ "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true }, + "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 + }, "union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", diff --git a/package.json b/package.json index 50c09eb1..cfb082ac 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@types/assert": "^1.5.11", "assert": "^2.1.0", - "@types/node": "^18.14.6", + "@types/node": "^22.0.0", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "esbuild": "^0.25.0", diff --git a/sync-api-service/package-lock.json b/sync-api-service/package-lock.json index 31b09f7a..c04a5724 100644 --- a/sync-api-service/package-lock.json +++ b/sync-api-service/package-lock.json @@ -10,11 +10,11 @@ "license": "MIT", "dependencies": { "@vscode/sync-api-common": "0.9.0", - "uuid": "^9.0.1", + "uuid": "^14.0.0", "vscode-uri": "^3.0.8" }, "devDependencies": { - "@types/uuid": "^9.0.7", + "@types/node": "^22.0.0", "@types/vscode": "1.71.0" }, "engines": { @@ -22,11 +22,15 @@ "vscode": "^1.71.0" } }, - "node_modules/@types/uuid": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz", - "integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==", - "dev": true + "node_modules/@types/node": { + "version": "22.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", + "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/vscode": { "version": "1.71.0", @@ -42,16 +46,24 @@ "node": ">=16.14.2" } }, + "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/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz", + "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, "node_modules/vscode-uri": { @@ -61,11 +73,14 @@ } }, "dependencies": { - "@types/uuid": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz", - "integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==", - "dev": true + "@types/node": { + "version": "22.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz", + "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==", + "dev": true, + "requires": { + "undici-types": "~6.21.0" + } }, "@types/vscode": { "version": "1.71.0", @@ -78,10 +93,16 @@ "resolved": "https://registry.npmjs.org/@vscode/sync-api-common/-/sync-api-common-0.9.0.tgz", "integrity": "sha512-8UeaBbC+dNwtBgb+zkx+A3WP3VzDhBNeDwmm2sAjM0SnPMfOsFzjKoXpQ+m/shDJiWF23S7zhICm3I1PFvVlQA==" }, + "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 + }, "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz", + "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==" }, "vscode-uri": { "version": "3.0.8", diff --git a/sync-api-service/package.json b/sync-api-service/package.json index 80043617..aba904a8 100644 --- a/sync-api-service/package.json +++ b/sync-api-service/package.json @@ -26,13 +26,13 @@ "fsChunks" ], "dependencies": { - "uuid": "^9.0.1", - "vscode-uri": "^3.0.8", - "@vscode/sync-api-common": "0.9.0" + "@vscode/sync-api-common": "0.9.0", + "uuid": "^14.0.0", + "vscode-uri": "^3.0.8" }, "devDependencies": { - "@types/vscode": "1.71.0", - "@types/uuid": "^9.0.7" + "@types/node": "^22.0.0", + "@types/vscode": "1.71.0" }, "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", diff --git a/sync-api-service/src/terminal.ts b/sync-api-service/src/terminal.ts index c960da28..f6a50180 100644 --- a/sync-api-service/src/terminal.ts +++ b/sync-api-service/src/terminal.ts @@ -5,11 +5,13 @@ import { Event, EventEmitter, Pseudoterminal, Uri } from 'vscode'; -import * as uuid from 'uuid'; - import { RAL } from '@vscode/sync-api-common'; import { CharacterDeviceDriver, FileDescriptorDescription } from './device'; +// uuid v14 is pure ESM; use require() which Node 22.12+ supports for synchronous ESM +// eslint-disable-next-line @typescript-eslint/no-require-imports +const { v4: uuidV4 } = require('uuid') as { v4: () => string }; + class LineBuffer { private cursor: number; @@ -232,7 +234,7 @@ class ServiceTerminalImpl implements ServicePseudoTerminal, CharacterDeviceDrive this._onAnyKey = new EventEmitter; this.onAnyKey = this._onAnyKey.event; - const id = this.id = uuid.v4(); + const id = this.id = uuidV4(); this.encoder = RAL().TextEncoder.create(); this.decoder = RAL().TextDecoder.create(); diff --git a/sync-api-service/tsconfig.json b/sync-api-service/tsconfig.json index d1d5bec8..aa11e3c2 100644 --- a/sync-api-service/tsconfig.json +++ b/sync-api-service/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "composite": true, "types": [ + "node", "vscode" ], "module": "Node16",