From e9a85de1177adff1a1c8241778ff788d4c5be100 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:10:13 +0100 Subject: [PATCH 1/9] bump deno version --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/release-npm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a8c39665..0e2265332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" jobs: build: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eafdb10d1..f3f728de2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" jobs: lint: diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 2a9b2a949..65008696d 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -7,7 +7,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" permissions: {} jobs: From 90ac12b296910e50308744c50fc7259ae8d6ca45 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:16:54 +0100 Subject: [PATCH 2/9] Revert "bump deno version" This reverts commit e9a85de1177adff1a1c8241778ff788d4c5be100. --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/release-npm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e2265332..5a8c39665 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.40.3" + DENO_VERSION: "1.32.1" jobs: build: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3f728de2..eafdb10d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.40.3" + DENO_VERSION: "1.32.1" jobs: lint: diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 65008696d..2a9b2a949 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -7,7 +7,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.40.3" + DENO_VERSION: "1.32.1" permissions: {} jobs: From 1f14bb36d24ca39ee997ebeb5a8b6f90f3edb831 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:10:13 +0100 Subject: [PATCH 3/9] bump deno version --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/release-npm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a8c39665..0e2265332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" jobs: build: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eafdb10d1..f3f728de2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" jobs: lint: diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 2a9b2a949..65008696d 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -7,7 +7,7 @@ on: env: # be sure to also update these in other workflows DENO_DIR: deno_dir - DENO_VERSION: "1.32.1" + DENO_VERSION: "1.40.3" permissions: {} jobs: From 04dfdca23f8a7a5928e952d27bbb21c0e7658e08 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:18:55 +0100 Subject: [PATCH 4/9] upgrade setup-deno action --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release-npm.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e2265332..d4138bbd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: restore-keys: ci- - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3f728de2..51ac1d44a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: restore-keys: ci- - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} @@ -56,7 +56,7 @@ jobs: restore-keys: ci- - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} @@ -81,7 +81,7 @@ jobs: restore-keys: ci- - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} @@ -114,7 +114,7 @@ jobs: restore-keys: ci- - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 65008696d..bca551b0f 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - name: Setup Deno - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 + uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba with: deno-version: ${{ env.DENO_VERSION }} From 65ac97a2f3260ebc20848f55115c006f8fa53303 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:49:52 +0100 Subject: [PATCH 5/9] remove unstable flags from commands --- deno.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deno.json b/deno.json index 09eea3f19..f88a3433c 100644 --- a/deno.json +++ b/deno.json @@ -10,12 +10,12 @@ }, "importMap": "importmap.json", "tasks": { - "dev": "deno run --unstable --allow-env --allow-run --allow-read --allow-write --allow-net scripts/dev.js", - "lint": "deno run --allow-env --allow-read --allow-write --allow-run=git scripts/lint.js", - "check": "deno run --unstable --allow-env --allow-run --allow-read --allow-write --allow-net scripts/check.js", - "test": "deno run --unstable --allow-run --allow-read --allow-write --allow-env --allow-net scripts/test.js", - "build-engine": "deno run --unstable --allow-read --allow-write --allow-net --allow-env scripts/buildEngine.js", - "build-studio": "deno run --unstable -A scripts/buildStudio.js", + "dev": "deno run --allow-env --allow-run --allow-read --allow-write --allow-net scripts/dev.js", + "lint": "deno run --allow-env --allow-read --allow-write --allow-sys --allow-run=git scripts/lint.js", + "check": "deno run --allow-env --allow-run --allow-read --allow-write --allow-net scripts/check.js", + "test": "deno run --allow-run --allow-read --allow-write --allow-env --allow-net scripts/test.js", + "build-engine": "deno run --allow-read --allow-write --allow-net --allow-env scripts/buildEngine.js", + "build-studio": "deno run -A scripts/buildStudio.js", "build-npm-package": "deno run --allow-read --allow-write scripts/buildNpmPackage.js" } } From f5d9cc1084693089d397e8fd9e379a009ea86d93 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:51:09 +0100 Subject: [PATCH 6/9] Use the Deno.Command --- scripts/buildStudio.js | 18 ++++++++------ scripts/check.js | 11 +++++---- scripts/lint.js | 10 ++++---- scripts/test.js | 54 +++++++++++++++++++++++------------------- 4 files changed, 52 insertions(+), 41 deletions(-) diff --git a/scripts/buildStudio.js b/scripts/buildStudio.js index c132b481e..1099548c4 100755 --- a/scripts/buildStudio.js +++ b/scripts/buildStudio.js @@ -112,17 +112,21 @@ function rebaseCssUrl({ * @param {string} cmd */ async function runCmd(cmd) { - const p = Deno.run({ - cmd: cmd.split(" "), + const splitCmd = cmd.split(" "); + if (splitCmd.length <= 0) { + throw new Error("Invalid command: " + cmd); + } + const [exec, ...args] = splitCmd; + const command = new Deno.Command(exec, { + args, stdout: "piped", }); - const status = await p.status(); - if (!status.success) { - throw new Error(`Running "${cmd}" exited with status code ${status.code}`); + const output = await command.output(); + if (!output.success) { + throw new Error(`Running "${cmd}" exited with status code ${output.code}`); } - const outputBuffer = await p.output(); + const outputBuffer = output.stdout; let outputStr = new TextDecoder().decode(outputBuffer); - p.close(); outputStr = outputStr.trim(); if (!outputStr) { throw new Error(`Running "${cmd}" resulted in an empty string`); diff --git a/scripts/check.js b/scripts/check.js index c2001fd0a..36b5c7809 100644 --- a/scripts/check.js +++ b/scripts/check.js @@ -5,13 +5,14 @@ await dev({ needsDependencies: true, }); -const proc = Deno.run({ - // Also update the version in ./scripts/dev.js - cmd: ["deno", "run", "--allow-env", "--allow-read", "npm:typescript@5.0.2/tsc", "--noEmit", "-p", "./jsconfig.json"], +const command = new Deno.Command(Deno.execPath(), { + args: ["run", "--allow-env", "--allow-read", "npm:typescript@5.0.2/tsc", "--noEmit", "-p", "./jsconfig.json"], + stdout: "inherit", + stderr: "inherit", }); -const status = await proc.status(); -if (!status.success) { +const output = await command.output(); +if (!output.success) { Deno.exit(1); } else { console.log("No type errors!"); diff --git a/scripts/lint.js b/scripts/lint.js index 84d3a6803..f34ebb271 100755 --- a/scripts/lint.js +++ b/scripts/lint.js @@ -74,15 +74,15 @@ if (useIo) { if (Deno.args.includes("--all")) { lintFilesStr = "**/*.js"; } else { - const proc = Deno.run({ - cmd: ["git", "status", "-z"], + const command = new Deno.Command("git", { + args: ["status", "-z"], stdout: "piped", }); - const status = await proc.status(); - if (!status.success) { + const output = await command.output(); + if (!output.success) { throw new Error("Failed to determine which files were changed, run with --all to lint all files in the repository."); } - const result = await proc.output(); + const result = output.stdout; let files = []; let i = 0; diff --git a/scripts/test.js b/scripts/test.js index 261ea68a8..58a4f010e 100755 --- a/scripts/test.js +++ b/scripts/test.js @@ -53,7 +53,7 @@ const testCommands = []; // Unit tests if (needsUnitTests) { - const denoTestArgs = ["deno", "test", "--no-check", "--allow-env", "--allow-read", "--allow-net", "--parallel"]; + const denoTestArgs = [Deno.execPath(), "test", "--no-check", "--allow-env", "--allow-read", "--allow-net", "--parallel"]; if (needsCoverage) { denoTestArgs.push("--allow-write"); } @@ -74,19 +74,19 @@ if (needsUnitTests) { // E2e tests if (needsE2eTests) { - const cmd = ["deno", "run", "--allow-env", "--allow-read", "--allow-write", "--allow-run", "--allow-net"]; + const cmd = [Deno.execPath(), "run", "--allow-env", "--allow-read", "--allow-write", "--allow-run", "--allow-net"]; if (inspect) cmd.push("--inspect-brk"); cmd.push("test/e2e/shared/e2eTestRunner.js", ...Deno.args); testCommands.push(cmd); } -let lastTestStatus; for (const cmd of testCommands) { console.log(`Running: ${cmd.join(" ")}`); - const testProcess = Deno.run({cmd}); - lastTestStatus = await testProcess.status(); - if (!lastTestStatus.success) { - Deno.exit(lastTestStatus.code); + const [exec, ...args] = cmd; + const testCommand = new Deno.Command(exec, {args, stdout: "inherit", stderr: "inherit"}); + const testOutput = await testCommand.output(); + if (!testOutput.success) { + Deno.exit(testOutput.code); } } @@ -103,31 +103,37 @@ if (needsCoverage) { } if (coverageMapExists) { console.log("Applying fake-imports coverage map."); - const p = Deno.run({ - cmd: ["deno", "run", "--allow-read", "--no-check", "--allow-write", "https://deno.land/x/fake_imports@v0.8.1/applyCoverageMap.js", FAKE_IMPORTS_COVERAGE_DIR, DENO_COVERAGE_DIR], + const cmd = new Deno.Command(Deno.execPath(), { + args: ["run", "--allow-read", "--no-check", "--allow-write", "https://deno.land/x/fake_imports@v0.8.1/applyCoverageMap.js", FAKE_IMPORTS_COVERAGE_DIR, DENO_COVERAGE_DIR], + stdout: "inherit", + stderr: "inherit", }); - await p.status(); + const output = await cmd.output(); + if (!output.success) { + throw new Error(`Applying fake-imports coverage map failed with status ${output.code}`); + } } console.log("Generating cov.lcov..."); const includeRegex = `^file://${Deno.cwd()}/(src|studio/src|studio/devSocket/src)`; - const coverageProcess = Deno.run({ - cmd: ["deno", "coverage", DENO_COVERAGE_DIR, "--lcov", `--include=${includeRegex}`], + const coverageProcess = new Deno.Command(Deno.execPath(), { + args: ["coverage", DENO_COVERAGE_DIR, "--lcov", `--include=${includeRegex}`], stdout: "piped", }); - const lcov = await coverageProcess.output(); - const coverageStatus = await coverageProcess.status(); - if (!coverageStatus.success) { - Deno.exit(coverageStatus.code); + const coverageOutput = await coverageProcess.output(); + if (!coverageOutput.success) { + Deno.exit(coverageOutput.code); } - await Deno.writeFile(".coverage/cov.lcov", lcov); + await Deno.writeFile(".coverage/cov.lcov", coverageOutput.stdout); if (needsHtmlCoverageReport) { console.log("Generating HTML coverage report..."); - let genHtmlProcess = null; + let genHtmlCommand = null; try { - genHtmlProcess = Deno.run({ - cmd: ["genhtml", "-o", ".coverage/html", ".coverage/cov.lcov"], + genHtmlCommand = new Deno.Command("genhtml", { + args: ["-o", ".coverage/html", ".coverage/cov.lcov"], + stdout: "inherit", + stderr: "inherit", }); } catch { console.error("%cERROR%c Failed to generate html report, is lcov not installed?", "color: red", ""); @@ -140,10 +146,10 @@ if (needsCoverage) { console.log(`Try installing it with: %c${installCmd}`, "color: black; background-color: grey"); } } - if (genHtmlProcess) { - const genHtmlStatus = await genHtmlProcess.status(); - if (!genHtmlStatus.success) { - Deno.exit(genHtmlStatus.code); + if (genHtmlCommand) { + const genHtmlOutput = await genHtmlCommand.output(); + if (!genHtmlOutput.success) { + Deno.exit(genHtmlOutput.code); } } } From 58d7e58a0c8654dd8f78f23423205c5f58e43e09 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:58:16 +0100 Subject: [PATCH 7/9] fix type error --- test/unit/studio/src/misc/ServiceWorkerManager.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/studio/src/misc/ServiceWorkerManager.test.js b/test/unit/studio/src/misc/ServiceWorkerManager.test.js index a48a27fa2..157a82b43 100644 --- a/test/unit/studio/src/misc/ServiceWorkerManager.test.js +++ b/test/unit/studio/src/misc/ServiceWorkerManager.test.js @@ -20,7 +20,7 @@ const SERVICE_WORKER_CLIENT_ID = "service worker client id"; * @property {(now: number) => void} setPreformanceNow Sets the return value for `preformance.now()` * @property {(pending: boolean) => void} setUpdatePromisePending * @property {() => Promise} waitForMicrotasks - * @property {import("std/testing/mock.ts").Stub} reloadSpy + * @property {import("std/testing/mock.ts").Stub} reloadSpy * @property {import("std/testing/mock.ts").Spy} registerClientSpy * @property {import("std/testing/mock.ts").Spy} unregisterClientSpy * @property {import("std/testing/mock.ts").Spy>} skipWaitingSpy From 680f449e4c5c9186ed68ce1f05934b7642af4b7d Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Wed, 7 Feb 2024 23:59:14 +0100 Subject: [PATCH 8/9] Remove deno unstable flag from types generation --- scripts/dev.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/dev.js b/scripts/dev.js index 88777297e..1b7e5c363 100755 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -38,7 +38,6 @@ export async function dev({ const promise = generateTypes({ outputDir: ".denoTypes", - unstable: true, importMap: "importmap.json", include: [ "scripts", From 5522e3f12f2fd284bfb09ec50c3ffe451ac92906 Mon Sep 17 00:00:00 2001 From: Jesper van den Ende Date: Sat, 10 Feb 2024 13:34:53 +0100 Subject: [PATCH 9/9] fix webpgu type error --- scripts/check.js | 1 + scripts/dev.js | 91 ++++++++++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 38 deletions(-) diff --git a/scripts/check.js b/scripts/check.js index 36b5c7809..0ae049928 100644 --- a/scripts/check.js +++ b/scripts/check.js @@ -2,6 +2,7 @@ import {dev} from "./dev.js"; await dev({ needsTypes: true, + needsTypesSync: true, needsDependencies: true, }); diff --git a/scripts/dev.js b/scripts/dev.js index 1b7e5c363..79852b278 100755 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -36,47 +36,62 @@ export async function dev({ if (needsTypes) { const {generateTypes} = await import("https://deno.land/x/deno_tsc_helper@v0.5.0/mod.js"); - const promise = generateTypes({ - outputDir: ".denoTypes", - importMap: "importmap.json", - include: [ - "scripts", - "test/shared/", - "test/unit/", - "test/e2e/shared/", - "test/e2e/studio/shared/", - "test/e2e/studio/src/", - "studio/devSocket", - ], - excludeUrls: [ - "rollup-plugin-cleanup", - "https://deno.land/x/dev@v0.2.0/mod.js", // Temporary workaround for https://github.com/denoland/deno/issues/17210 - "npm:rollup-plugin-resolve-url-objects@0.0.4", - "npm:eslint-plugin-jsdoc@39.8.0", - "npm:jszip@3.5.0", + const cwd = Deno.cwd(); - // The StudioDiscovery references some types from the main Renda repository, - // but some of these files have css import assertions, causing deno vendor to fail - "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/util/util.js", - "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/util/TypedMessenger/TypedMessenger.js", - "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/network/studioConnections/discoveryMethods/WebRtcDiscoveryMethod.js", - "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/network/studioConnections/DiscoveryManager.js", - ], - extraTypeRoots: { + const promise = (async () => { + await generateTypes({ + outputDir: ".denoTypes", + importMap: "importmap.json", + include: [ + "scripts", + "test/shared/", + "test/unit/", + "test/e2e/shared/", + "test/e2e/studio/shared/", + "test/e2e/studio/src/", + "studio/devSocket", + ], + excludeUrls: [ + "rollup-plugin-cleanup", + "https://deno.land/x/dev@v0.2.0/mod.js", // Temporary workaround for https://github.com/denoland/deno/issues/17210 + "npm:rollup-plugin-resolve-url-objects@0.0.4", + "npm:eslint-plugin-jsdoc@39.8.0", + "npm:jszip@3.5.0", + + // The StudioDiscovery references some types from the main Renda repository, + // but some of these files have css import assertions, causing deno vendor to fail + "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/util/util.js", + "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/util/TypedMessenger/TypedMessenger.js", + "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/network/studioConnections/discoveryMethods/WebRtcDiscoveryMethod.js", + "https://raw.githubusercontent.com/rendajs/Renda/3570dc24d41ef1522a97371ebdc2e7b88d15317d/src/network/studioConnections/DiscoveryManager.js", + ], + extraTypeRoots: { // We prefix webgpu with aa to ensure it is placed above deno-types. // The Deno types include webgpu types but they are outdated. - "aa-webgpu": "https://cdn.jsdelivr.net/npm/@webgpu/types@0.1.21/dist/index.d.ts", - "wicg-file-system-access": "https://cdn.jsdelivr.net/npm/@types/wicg-file-system-access@2020.9.5/index.d.ts", - "strict-map": "https://deno.land/x/strictly@v0.0.1/src/map.d.ts", - "strict-set": "https://deno.land/x/strictly@v0.0.1/src/set.d.ts", - }, - exactTypeModules: { - eslint: "https://cdn.jsdelivr.net/npm/@types/eslint@8.4.6/index.d.ts", - estree: "https://cdn.jsdelivr.net/npm/@types/estree@1.0.0/index.d.ts", - "npm:postcss-url@10.1.3": "https://cdn.jsdelivr.net/npm/@types/postcss-url@10.0.0/index.d.ts", - }, - logLevel: suppressTypesLogging ? "WARNING" : "DEBUG", - }); + "aa-webgpu": "https://cdn.jsdelivr.net/npm/@webgpu/types@0.1.21/dist/index.d.ts", + "wicg-file-system-access": "https://cdn.jsdelivr.net/npm/@types/wicg-file-system-access@2020.9.5/index.d.ts", + "strict-map": "https://deno.land/x/strictly@v0.0.1/src/map.d.ts", + "strict-set": "https://deno.land/x/strictly@v0.0.1/src/set.d.ts", + }, + exactTypeModules: { + eslint: "https://cdn.jsdelivr.net/npm/@types/eslint@8.4.6/index.d.ts", + estree: "https://cdn.jsdelivr.net/npm/@types/estree@1.0.0/index.d.ts", + "npm:postcss-url@10.1.3": "https://cdn.jsdelivr.net/npm/@types/postcss-url@10.0.0/index.d.ts", + }, + logLevel: suppressTypesLogging ? "WARNING" : "DEBUG", + }); + + // Some of Deno's webgpu types clash with ours + const pathMod = await import("std/path/mod.ts"); + const denoTypesPath = pathMod.resolve(cwd, ".denoTypes/@types/deno-types/index.d.ts"); + const denoTypes = await Deno.readTextFile(denoTypesPath); + const canvasConfigurationStart = denoTypes.indexOf("declare interface GPUCanvasConfiguration"); + if (canvasConfigurationStart > 0) { + const canvasConfigurationEnd = denoTypes.indexOf("}", canvasConfigurationStart) + 1; + const newDenoTypes = denoTypes.slice(0, canvasConfigurationStart) + denoTypes.slice(canvasConfigurationEnd); + await Deno.writeTextFile(denoTypesPath, newDenoTypes); + } + })(); // eslint-disable-next-line no-constant-condition if (false) {