diff --git a/build/azure-pipelines/darwin/build.yml b/build/azure-pipelines/darwin/build.yml index ff6c12aa..e58d7075 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.15.0' displayName: 'Install Node.js' - script: | diff --git a/build/azure-pipelines/linux/build.yml b/build/azure-pipelines/linux/build.yml index 4c164e74..621462ad 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.15.0' displayName: 'Install Node.js' - script: | diff --git a/build/azure-pipelines/pipeline.yml b/build/azure-pipelines/pipeline.yml index 4b645090..5461d9b7 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.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -81,13 +81,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -107,13 +107,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -133,13 +133,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -159,13 +159,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: @@ -185,13 +185,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.15.1 + - 22.15.0 - name: MacOS nodeVersions: - - 20.15.1 + - 22.15.0 - name: Windows nodeVersions: - - 20.15.1 + - 22.15.0 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..8ecdbf70 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.15.0' displayName: 'Install Node.js' - script: | diff --git a/sync-api-client/package.json b/sync-api-client/package.json index acccc22a..cc2f96c7 100644 --- a/sync-api-client/package.json +++ b/sync-api-client/package.json @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/microsoft/vscode-wasm/blob/main/sync-api-client/README.md", "dependencies": { - "vscode-uri": "^3.0.8", + "vscode-uri": "^3.1.0", "@vscode/sync-api-common": "0.9.0" }, "devDependencies": { diff --git a/sync-api-service/package.json b/sync-api-service/package.json index 80043617..8ae739e1 100644 --- a/sync-api-service/package.json +++ b/sync-api-service/package.json @@ -26,13 +26,11 @@ "fsChunks" ], "dependencies": { - "uuid": "^9.0.1", - "vscode-uri": "^3.0.8", + "vscode-uri": "^3.1.0", "@vscode/sync-api-common": "0.9.0" }, "devDependencies": { - "@types/vscode": "1.71.0", - "@types/uuid": "^9.0.7" + "@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..7cc1b673 100644 --- a/sync-api-service/src/terminal.ts +++ b/sync-api-service/src/terminal.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -import { Event, EventEmitter, Pseudoterminal, Uri } from 'vscode'; +import { randomUUID } from 'node:crypto'; -import * as uuid from 'uuid'; +import { Event, EventEmitter, Pseudoterminal, Uri } from 'vscode'; import { RAL } from '@vscode/sync-api-common'; import { CharacterDeviceDriver, FileDescriptorDescription } from './device'; @@ -232,7 +232,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 = randomUUID(); 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", diff --git a/sync-api-service/tsconfig.publish.json b/sync-api-service/tsconfig.publish.json index 28538ba8..9b399d34 100644 --- a/sync-api-service/tsconfig.publish.json +++ b/sync-api-service/tsconfig.publish.json @@ -2,22 +2,9 @@ "compilerOptions": { "composite": true, "types": [ + "node", "vscode" ], - "module": "Node16", - "moduleResolution": "Node16", - "target": "es2022", - "lib": [ - "es2022" - ], - "rootDir": "./src", - "strict": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "declaration": true, - "stripInternal": true, - "sourceMap": false, "declarationMap": false, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/sync-api-service/tsconfig.watch.json b/sync-api-service/tsconfig.watch.json index c07a2276..5fefd5ca 100644 --- a/sync-api-service/tsconfig.watch.json +++ b/sync-api-service/tsconfig.watch.json @@ -2,24 +2,9 @@ "compilerOptions": { "composite": true, "types": [ + "node", "vscode" ], - "module": "Node16", - "moduleResolution": "Node16", - "target": "es2022", - "lib": [ - "es2022" - ], - "rootDir": "./src", - "strict": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "declaration": true, - "stripInternal": true, - "sourceMap": true, - "declarationMap": true, - "noUnusedLocals": false, "noUnusedParameters": false, "assumeChangesOnlyAffectDirectDependencies": true, "outDir": "./lib", diff --git a/sync-api-tests/package.json b/sync-api-tests/package.json index 9395b902..5f319482 100644 --- a/sync-api-tests/package.json +++ b/sync-api-tests/package.json @@ -32,12 +32,10 @@ }, "dependencies": { "@vscode/sync-api-client": "0.9.0", - "vscode-uri": "^3.0.8" + "vscode-uri": "^3.1.0" }, "devDependencies": { - "@types/uuid": "^9.0.7", "@types/vscode": "1.71.0", - "uuid": "^9.0.1", "find-process": "^1.4.7" } } diff --git a/sync-api-tests/src/desktop/runTests.ts b/sync-api-tests/src/desktop/runTests.ts index 14bec117..8b184cd2 100644 --- a/sync-api-tests/src/desktop/runTests.ts +++ b/sync-api-tests/src/desktop/runTests.ts @@ -6,7 +6,7 @@ import fs from 'fs'; import os from 'os'; import path from 'path'; -import * as uuid from 'uuid'; +import { randomUUID } from 'node:crypto'; import find = require('find-process'); import { runTests } from '@vscode/test-electron'; @@ -29,7 +29,7 @@ function rimraf(location: string) { async function go() { - const testDir = path.join(os.tmpdir(), uuid.v4()); + const testDir = path.join(os.tmpdir(), randomUUID()); try { const extensionDevelopmentPath = path.join(__dirname, '..', '..'); const extensionTestsPath = __dirname; diff --git a/testbeds/package.json b/testbeds/package.json index 516a4786..f71ff718 100644 --- a/testbeds/package.json +++ b/testbeds/package.json @@ -2,7 +2,7 @@ "name": "wasm-testbeds", "private": true, "dependencies": { - "vscode-uri": "3.0.3" + "vscode-uri": "^3.1.0" }, "devDependencies": { "@types/vscode": "^1.92.0" diff --git a/wasm-component-model/package.json b/wasm-component-model/package.json index 71614c82..4053d361 100644 --- a/wasm-component-model/package.json +++ b/wasm-component-model/package.json @@ -42,13 +42,11 @@ ], "dependencies": { "yargs": "^17.7.2", - "semver": "^7.7.2", - "uuid": "^11.1.0" + "semver": "^7.7.2" }, "devDependencies": { "@types/yargs": "^17.0.33", - "@types/semver": "^7.7.0", - "@types/uuid": "^10.0.0" + "@types/semver": "^7.7.0" }, "scripts": { "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", diff --git a/wasm-component-model/src/common/componentModel.ts b/wasm-component-model/src/common/componentModel.ts index d7622d6c..08accc23 100644 --- a/wasm-component-model/src/common/componentModel.ts +++ b/wasm-component-model/src/common/componentModel.ts @@ -2,7 +2,6 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as uuid from 'uuid'; import RAL from './ral'; // Type arrays are stored either little or big endian depending on the platform. @@ -497,7 +496,7 @@ export namespace Memory { if (exports.memory === undefined || exports.cabi_realloc === undefined) { throw new MemoryError('The exports object must contain a memory object and a cabi_realloc function.'); } - this.id = id ?? uuid.v4(); + this.id = id ?? (globalThis as unknown as { crypto: { randomUUID(): string } }).crypto.randomUUID(); this.memory = exports.memory; this.cabi_realloc = exports.cabi_realloc; } diff --git a/wasm-component-model/src/common/connection.ts b/wasm-component-model/src/common/connection.ts index dad145dd..80c10f3c 100644 --- a/wasm-component-model/src/common/connection.ts +++ b/wasm-component-model/src/common/connection.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ /// -import * as uuid from 'uuid'; import { $exports, $imports, Alignment, ComponentModelTrap, Memory, MemoryRange, ReadonlyMemoryRange, WasmContext, type Code, type JType, type MainConnection, type Options, type WasmType, type WorkerConnection, type WorldType } from './componentModel'; import { CapturedPromise } from './promises'; @@ -34,7 +33,7 @@ class ConnectionMemory implements Memory { sizeOrBuffer = 64 * 1024; } if (typeof sizeOrBuffer === 'number') { - this.id = uuid.v4(); + this.id = (globalThis as unknown as { crypto: { randomUUID(): string } }).crypto.randomUUID(); this.buffer = new SharedArrayBuffer(sizeOrBuffer); this.next = new Uint32Array(this.buffer, ConnectionMemory.Header.next.offset, 1); this.next[0] = ConnectionMemory.Header.end.offset; diff --git a/wasm-kit/package.json b/wasm-kit/package.json index 020719e3..075a366b 100644 --- a/wasm-kit/package.json +++ b/wasm-kit/package.json @@ -48,10 +48,8 @@ "simulation": "node ./lib/node/test/arrayMain.js" }, "dependencies": { - "uuid": "^9.0.1", - "vscode-uri": "^3.0.8" + "vscode-uri": "^3.1.0" }, "devDependencies": { - "@types/uuid": "^9.0.8" } } \ No newline at end of file diff --git a/wasm-kit/src/common/sharedObject.ts b/wasm-kit/src/common/sharedObject.ts index 0f2d53f3..82084783 100644 --- a/wasm-kit/src/common/sharedObject.ts +++ b/wasm-kit/src/common/sharedObject.ts @@ -4,8 +4,6 @@ * ------------------------------------------------------------------------------------------ */ import RAL from './ral'; -import * as uuid from 'uuid'; - import { Alignment, ComponentModelContext, ComponentModelTrap, @@ -134,7 +132,7 @@ class MemoryImpl implements SharedMemory { public constructor(module: WebAssembly_.Module, memory: WebAssembly_.Memory, exports: SharedMemory.Exports, size: u32); public constructor(module: WebAssembly_.Module, memory: WebAssembly_.Memory, exports: SharedMemory.Exports, size: u32, id: string, counter: ptr); public constructor(module: WebAssembly_.Module, memory: WebAssembly_.Memory, exports: SharedMemory.Exports, size: u32, id?: string, counter?: ptr) { - this.id = id ?? uuid.v4(); + this.id = id ?? (globalThis as unknown as { crypto: { randomUUID(): string } }).crypto.randomUUID(); this.module = module; this.memory = memory; this.exports = exports; diff --git a/wasm-wasi-core/build/pre-release.yml b/wasm-wasi-core/build/pre-release.yml index c60f5d05..d7e7a3fb 100644 --- a/wasm-wasi-core/build/pre-release.yml +++ b/wasm-wasi-core/build/pre-release.yml @@ -20,7 +20,7 @@ parameters: extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: - nodeVersion: 20.15.1 + nodeVersion: 22.15.0 buildSteps: - script: | npm ci diff --git a/wasm-wasi-core/build/release.yml b/wasm-wasi-core/build/release.yml index 70d27c3f..1c9d090a 100644 --- a/wasm-wasi-core/build/release.yml +++ b/wasm-wasi-core/build/release.yml @@ -23,7 +23,7 @@ parameters: extends: template: azure-pipelines/extension/stable.yml@templates parameters: - nodeVersion: 20.15.1 + nodeVersion: 22.15.0 buildSteps: - script: | npm ci diff --git a/wasm-wasi-core/package.json b/wasm-wasi-core/package.json index 2f9833eb..16e91d91 100644 --- a/wasm-wasi-core/package.json +++ b/wasm-wasi-core/package.json @@ -28,12 +28,10 @@ "browser": "./dist/web/extension.js", "activationEvents": [], "dependencies": { - "uuid": "^9.0.1", - "vscode-uri": "^3.0.8" + "vscode-uri": "^3.1.0" }, "devDependencies": { "@types/vscode": "1.88.0", - "@types/uuid": "^9.0.8", "@types/assert": "^1.5.10", "assert": "^2.1.0", "find-process": "^1.4.7" diff --git a/wasm-wasi-core/src/common/memoryFileSystemDriver.ts b/wasm-wasi-core/src/common/memoryFileSystemDriver.ts index 32acb1a6..22b3f067 100644 --- a/wasm-wasi-core/src/common/memoryFileSystemDriver.ts +++ b/wasm-wasi-core/src/common/memoryFileSystemDriver.ts @@ -2,9 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as uuid from 'uuid'; import { Uri } from 'vscode'; - import RAL from './ral'; import { MemoryFileSystem as ApiMemoryFileSystem, Readable, Writable } from './api'; import { DeviceDriverKind, DeviceId, FileSystemDeviceDriver, NoSysDeviceDriver, ReaddirEntry, ReadonlyFileSystemDeviceDriver, WritePermDeniedDeviceDriver } from './deviceDriver'; @@ -105,7 +103,7 @@ type Node = FileNode | DirectoryNode | CharacterDeviceNode; export class MemoryFileSystem extends fs.BaseFileSystem implements ApiMemoryFileSystem { - public readonly uri: Uri = Uri.from({ scheme: 'wasi-memfs', authority: uuid.v4() }); + public readonly uri: Uri = Uri.from({ scheme: 'wasi-memfs', authority: (globalThis as unknown as { crypto: { randomUUID(): string } }).crypto.randomUUID() }); constructor() { super(DirectoryNode.create(undefined, 1n, '/', timeInNanoseconds(Date.now()))); diff --git a/wasm-wasi-core/src/common/test/wasi.worker.test.ts b/wasm-wasi-core/src/common/test/wasi.worker.test.ts index bba8205c..fd529efa 100644 --- a/wasm-wasi-core/src/common/test/wasi.worker.test.ts +++ b/wasm-wasi-core/src/common/test/wasi.worker.test.ts @@ -5,7 +5,6 @@ import RAL from '../ral'; import assert from 'assert'; -import * as uuid from 'uuid'; import { Clockid, Errno, Prestat, fd, Lookupflags, Oflags, Fdflags, rights, Rights, Filetype, Filestat, Ciovec, WasiError, Advise, fdstat, Fdstat, fdflags, Whence, Fstflags, Dirent } from '../wasi'; import { Environment } from '../api'; @@ -26,6 +25,10 @@ const DirectoryBaseRights: rights = Rights.fd_fdstat_set_flags | Rights.path_cre Rights.path_symlink; const DirectoryInheritingRights: rights = DirectoryBaseRights | FileBaseRights; +function generateUuid(): string { + return (globalThis as unknown as { crypto: { randomUUID(): string } }).crypto.randomUUID(); +} + // namespace Timestamp { // export function inNanoseconds(time: Date): bigint { @@ -342,7 +345,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_write - single ciovec', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const hw = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename); const ciovecs = memory.allocStructArray(1, Ciovec); @@ -362,7 +365,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_open - truncate file', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.close(FileSystem.createFile(memory, rootFd, filename, 'Hello World')); const fd = memory.allocUint32(); const p = memory.allocString(filename); @@ -376,7 +379,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_open - fail if file exists', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.close(FileSystem.createFile(memory, rootFd, filename, 'Hello World')); const fd = memory.allocUint32(0); const p = memory.allocString(filename); @@ -386,7 +389,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_open - fail if not directory', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.close(FileSystem.createFile(memory, rootFd, filename, 'Hello World')); const fd = memory.allocUint32(0); const p = memory.allocString(filename); @@ -407,7 +410,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_open - append mode', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.close(FileSystem.createFile(memory, rootFd, filename, 'Hello')); const fd = memory.allocUint32(0); const p = memory.allocString(filename); @@ -421,7 +424,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_seek', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const hw = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, hw); const newOffset = memory.allocBigUint64(); @@ -442,7 +445,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_advise - sequential', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); // VS Code has no advise support. So all advises should result in success const errno = wasi.fd_advise(fd, 0n, 3n, Advise.sequential); @@ -452,7 +455,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_advise - random', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); // VS Code has no advise support. So all advises should result in success const errno = wasi.fd_advise(fd, 0n, 3n, Advise.random); @@ -462,7 +465,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_advise - willneed', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); // VS Code has no advise support. So all advises should result in success const errno = wasi.fd_advise(fd, 0n, 3n, Advise.willneed); @@ -472,7 +475,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_advise - dontneed', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); // VS Code has no advise support. So all advises should result in success const errno = wasi.fd_advise(fd, 0n, 3n, Advise.dontneed); @@ -482,7 +485,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_advise - noreuse', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); // VS Code has no advise support. So all advises should result in success const errno = wasi.fd_advise(fd, 0n, 3n, Advise.noreuse); @@ -492,7 +495,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_allocate - start', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.createFileClose(memory, rootFd, filename, 'Hello World'); const fd = FileSystem.openFile(memory, rootFd, filename); const before = FileSystem.stat(memory, fd); @@ -510,7 +513,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_allocate - middle', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.createFileClose(memory, rootFd, filename, 'Hello World'); const fd = FileSystem.openFile(memory, rootFd, filename); const before = FileSystem.stat(memory, fd); @@ -528,7 +531,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_allocate - end', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; FileSystem.createFileClose(memory, rootFd, filename, 'Hello World'); const fd = FileSystem.openFile(memory, rootFd, filename); const before = FileSystem.stat(memory, fd); @@ -548,7 +551,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { // In VS Code data sync writes `blindly` to disk since no other // options are available. const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); const before = FileSystem.stat(memory, fd); await new Promise(resolve => RAL().timer.setTimeout(resolve, 5)); @@ -562,7 +565,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_fdstat_get', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename, 'Hello World'); const fdstat: fdstat = memory.allocStruct(Fdstat); const errno = wasi.fd_fdstat_get(fd, fdstat.$ptr); @@ -584,7 +587,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { assert.notStrictEqual(fdstat.fs_flags & flags, 0); } const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const fd = FileSystem.createFile(memory, rootFd, filename); setFlags(memory, fd, Fdflags.dsync); setFlags(memory, fd, Fdflags.nonblock); @@ -595,7 +598,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_filestat_set_size', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const stat = FileSystem.stat(memory, fd); @@ -616,7 +619,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_filestat_set_times', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const errno = wasi.fd_filestat_set_times(fd, 10n, 10n, Fstflags.atim | Fstflags.mtim); @@ -626,7 +629,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_pread', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; FileSystem.createFileClose(memory, rootFd, filename, content); const fd = FileSystem.openFile(memory, rootFd, filename); @@ -645,7 +648,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_create_directory', () => { const memory = createMemory(); - const folderName = `/tmp/${uuid.v4()}`; + const folderName = `/tmp/${generateUuid()}`; const path = memory.allocString(folderName); let errno = wasi.path_create_directory(rootFd, path.$ptr, path.byteLength); assert.strictEqual(errno, Errno.success); @@ -733,7 +736,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_sync', async () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const before = FileSystem.stat(memory, fd); @@ -746,7 +749,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_tell', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const newOffset = memory.allocBigUint64(); @@ -760,7 +763,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('fd_write - multiple ciovec', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const hw = ['Hello ', 'World ', '!!!']; const fd = FileSystem.createFile(memory, rootFd, filename); const ciovecs = memory.allocStructArray(3, Ciovec); @@ -799,7 +802,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_filestat_set_times', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); FileSystem.close(fd); @@ -810,19 +813,19 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_link', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); FileSystem.close(fd); const oldPath = memory.allocString(filename); - const newPath = memory.allocString(`/tmp/${uuid.v4()}`); + const newPath = memory.allocString(`/tmp/${generateUuid()}`); const errno = wasi.path_link(rootFd, Lookupflags.none, oldPath.$ptr, oldPath.byteLength, rootFd, newPath.$ptr, newPath.byteLength); assert.strictEqual(errno, Errno.nosys); }); test('path_readlink', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); FileSystem.close(fd); @@ -835,7 +838,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_remove_directory', () => { const memory = createMemory(); - const foldername = `/tmp/${uuid.v4()}`; + const foldername = `/tmp/${generateUuid()}`; FileSystem.createFolder(memory, rootFd, foldername); const path = memory.allocString(foldername); const filestat = memory.allocStruct(Filestat); @@ -850,12 +853,12 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_rename', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); FileSystem.close(fd); const oldPath = memory.allocString(filename); - const newPath = memory.allocString(`/tmp/${uuid.v4()}`); + const newPath = memory.allocString(`/tmp/${generateUuid()}`); let errno = wasi.path_rename(rootFd, oldPath.$ptr, oldPath.byteLength, rootFd, newPath.$ptr, newPath.byteLength); assert.strictEqual(errno, Errno.success); const filestat = memory.allocStruct(Filestat); @@ -867,11 +870,11 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_rename - open file descriptor', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const oldPath = memory.allocString(filename); - const newPath = memory.allocString(`/tmp/${uuid.v4()}`); + const newPath = memory.allocString(`/tmp/${generateUuid()}`); let errno = wasi.path_rename(rootFd, oldPath.$ptr, oldPath.byteLength, rootFd, newPath.$ptr, newPath.byteLength); assert.strictEqual(errno, Errno.success); const stat = FileSystem.stat(memory, fd); @@ -883,15 +886,15 @@ suite(`Filesystem - ${memoryQualifier}`, () => { // VS Code has no symlink support. So we can only test // that the call is processed correctly. const memory = createMemory(); - const oldPath = memory.allocString(`/tmp/${uuid.v4()}`); - const newPath = memory.allocString(`/tmp/${uuid.v4()}`); + const oldPath = memory.allocString(`/tmp/${generateUuid()}`); + const newPath = memory.allocString(`/tmp/${generateUuid()}`); const errno = wasi.path_symlink(oldPath.$ptr, oldPath.byteLength, rootFd, newPath.$ptr, newPath.byteLength); assert.strictEqual(errno, Errno.nosys); }); test('path_unlink_file', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); FileSystem.close(fd); @@ -905,7 +908,7 @@ suite(`Filesystem - ${memoryQualifier}`, () => { test('path_unlink_file - open file descriptor', () => { const memory = createMemory(); - const filename = `/tmp/${uuid.v4()}`; + const filename = `/tmp/${generateUuid()}`; const content = 'Hello World'; const fd = FileSystem.createFile(memory, rootFd, filename, content); const newOffset = memory.allocBigUint64(); diff --git a/wasm-wasi-core/src/desktop/test/runTests.ts b/wasm-wasi-core/src/desktop/test/runTests.ts index c799a3e9..8ab86e28 100644 --- a/wasm-wasi-core/src/desktop/test/runTests.ts +++ b/wasm-wasi-core/src/desktop/test/runTests.ts @@ -5,9 +5,9 @@ import * as fs from 'node:fs/promises'; import * as os from 'node:os'; import * as path from 'node:path'; +import { randomUUID } from 'node:crypto'; import fp from 'find-process'; -import * as uuid from 'uuid'; import { runTests } from '@vscode/test-electron'; @@ -18,7 +18,7 @@ async function main() { const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); const extensionTestsPath = path.resolve(__dirname, './index'); - testDir = path.join(os.tmpdir(), uuid.v4()); + testDir = path.join(os.tmpdir(), randomUUID()); await fs.mkdir(testDir, { recursive: true }); const userDataDir = path.join(testDir, 'userData'); await fs.mkdir(userDataDir); diff --git a/webshell/build/pre-release.yml b/webshell/build/pre-release.yml index 2cd74977..62108de7 100644 --- a/webshell/build/pre-release.yml +++ b/webshell/build/pre-release.yml @@ -21,7 +21,7 @@ extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: generateNotice: false - nodeVersion: 16.17.1 + nodeVersion: 22.15.0 buildSteps: - script: | npm ci diff --git a/webshell/build/release.yml b/webshell/build/release.yml index b158a82f..6b6cc99d 100644 --- a/webshell/build/release.yml +++ b/webshell/build/release.yml @@ -24,7 +24,7 @@ extends: template: azure-pipelines/extension/stable.yml@templates parameters: generateNotice: false - nodeVersion: 16.17.1 + nodeVersion: 22.15.0 buildSteps: - script: | npm ci