From ed0cfc103164e56790f7d02d70280581342ecfd0 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Sat, 5 Sep 2026 21:19:26 -0700 Subject: [PATCH 1/2] Fix offline example TypeScript configs --- examples/static-mpa-offline/tsconfig.json | 2 +- .../static-mpa-workbox-offline/tsconfig.json | 2 +- examples/tsconfig.test.js | 22 +++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 examples/tsconfig.test.js diff --git a/examples/static-mpa-offline/tsconfig.json b/examples/static-mpa-offline/tsconfig.json index 174f9cbf..a5cb75c5 100644 --- a/examples/static-mpa-offline/tsconfig.json +++ b/examples/static-mpa-offline/tsconfig.json @@ -1,4 +1,4 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "include": ["src/**/*.ts"] } diff --git a/examples/static-mpa-workbox-offline/tsconfig.json b/examples/static-mpa-workbox-offline/tsconfig.json index 174f9cbf..a5cb75c5 100644 --- a/examples/static-mpa-workbox-offline/tsconfig.json +++ b/examples/static-mpa-workbox-offline/tsconfig.json @@ -1,4 +1,4 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "include": ["src/**/*.ts"] } diff --git a/examples/tsconfig.test.js b/examples/tsconfig.test.js new file mode 100644 index 00000000..9ad66b34 --- /dev/null +++ b/examples/tsconfig.test.js @@ -0,0 +1,22 @@ +import assert from 'node:assert/strict' +import { access, readFile } from 'node:fs/promises' +import path from 'node:path' +import { test } from 'node:test' + +const tsconfigPaths = [ + 'static-mpa-offline/tsconfig.json', + 'static-mpa-workbox-offline/tsconfig.json', +] + +test('offline example TypeScript configs extend existing files', async () => { + for (const relativePath of tsconfigPaths) { + const tsconfigPath = path.join(import.meta.dirname, relativePath) + const tsconfig = JSON.parse(await readFile(tsconfigPath, 'utf8')) + const extendedPath = path.resolve(path.dirname(tsconfigPath), tsconfig.extends) + + await assert.doesNotReject( + access(extendedPath), + `${relativePath} should extend an existing TypeScript config` + ) + } +}) From c27cc766b504a87d5b5314421b9663e55834921c Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Sat, 5 Sep 2026 21:39:05 -0700 Subject: [PATCH 2/2] Remove unnecessary offline config path test --- examples/tsconfig.test.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 examples/tsconfig.test.js diff --git a/examples/tsconfig.test.js b/examples/tsconfig.test.js deleted file mode 100644 index 9ad66b34..00000000 --- a/examples/tsconfig.test.js +++ /dev/null @@ -1,22 +0,0 @@ -import assert from 'node:assert/strict' -import { access, readFile } from 'node:fs/promises' -import path from 'node:path' -import { test } from 'node:test' - -const tsconfigPaths = [ - 'static-mpa-offline/tsconfig.json', - 'static-mpa-workbox-offline/tsconfig.json', -] - -test('offline example TypeScript configs extend existing files', async () => { - for (const relativePath of tsconfigPaths) { - const tsconfigPath = path.join(import.meta.dirname, relativePath) - const tsconfig = JSON.parse(await readFile(tsconfigPath, 'utf8')) - const extendedPath = path.resolve(path.dirname(tsconfigPath), tsconfig.extends) - - await assert.doesNotReject( - access(extendedPath), - `${relativePath} should extend an existing TypeScript config` - ) - } -})