diff --git a/examples/basic/package.json b/examples/basic/package.json index 43e4f9b4..43f54c60 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -14,9 +14,8 @@ "author": "Bret Comnes (https://bret.io/)", "license": "MIT", "devDependencies": { - "@voxpelli/tsconfig": "^15.0.0", "npm-run-all2": "^9.0.3", - "typescript": "~5.8.2" + "typescript": "~7.0.2" }, "dependencies": { "@domstack/static": "file:../../.", diff --git a/examples/blog/package.json b/examples/blog/package.json index 5a845399..745d3f57 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,8 +14,7 @@ "author": "Bret Comnes (https://bret.io/)", "license": "MIT", "devDependencies": { - "@voxpelli/tsconfig": "^16.0.0", - "typescript": "~5.9.2" + "typescript": "~7.0.2" }, "dependencies": { "@domstack/static": "file:../../.", diff --git a/examples/cargo-like/package.json b/examples/cargo-like/package.json index 5bf7c156..b40234d6 100644 --- a/examples/cargo-like/package.json +++ b/examples/cargo-like/package.json @@ -22,6 +22,6 @@ "@domstack/static": "file:../../.", "@types/node": "^26.0.1", "playwright": "^1.61.1", - "typescript": "~6.0.3" + "typescript": "~7.0.2" } } diff --git a/examples/preact-isomorphic/package.json b/examples/preact-isomorphic/package.json index 14a81f8e..2906b6f9 100644 --- a/examples/preact-isomorphic/package.json +++ b/examples/preact-isomorphic/package.json @@ -20,8 +20,7 @@ "preact-render-to-string": "^6.5.11" }, "devDependencies": { - "@voxpelli/tsconfig": "^15.0.0", "npm-run-all2": "^9.0.3", - "typescript": "~5.8.2" + "typescript": "~7.0.2" } } diff --git a/examples/react/package.json b/examples/react/package.json index b12bd970..1004f6fb 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -20,10 +20,9 @@ "devDependencies": { "@types/react": "^19.1.10", "@types/react-dom": "^19.1.7", - "@voxpelli/tsconfig": "^15.0.0", "highlight.js": "^11.9.0", "npm-run-all2": "^9.0.3", "react-dom": "^19.1.1", - "typescript": "~5.8.2" + "typescript": "~7.0.2" } } diff --git a/examples/type-stripping/package.json b/examples/type-stripping/package.json index fb3b68b7..d4f6c487 100644 --- a/examples/type-stripping/package.json +++ b/examples/type-stripping/package.json @@ -20,8 +20,7 @@ "preact-render-to-string": "^6.5.11" }, "devDependencies": { - "@voxpelli/tsconfig": "^15.0.0", "npm-run-all2": "^9.0.3", - "typescript": "~5.8.2" + "typescript": "~7.0.2" } } diff --git a/lib/build-pages/layouts/resolve-layout.js b/lib/build-pages/layouts/resolve-layout.js index eb56dd6f..e51cec14 100644 --- a/lib/build-pages/layouts/resolve-layout.js +++ b/lib/build-pages/layouts/resolve-layout.js @@ -65,7 +65,6 @@ export async function resolveLayout (layoutPath) { * * @template {Record} T - The type of variables passed to the layout function * @template [U=any] U - The return type of the page function (defaults to any) - * @template [V=string] V - The return type of the layout function (defaults to string) * @template {object} [D=Record] - Declared global data. * @typedef {object} LayoutFunctionParams * @property {T} vars - All default, global, layout, page, and builder vars shallow merged. @@ -85,7 +84,7 @@ export async function resolveLayout (layoutPath) { * @template [V=string] V - The return type of the layout function (defaults to string) * @template {object} [D=Record] - Declared global data. * @callback LayoutFunction - * @param {LayoutFunctionParams} params - The parameters for the layout. + * @param {LayoutFunctionParams} params - The parameters for the layout. * @returns {V | Promise} The rendered content. */ @@ -97,7 +96,7 @@ export async function resolveLayout (layoutPath) { * @template [V=string] V - The return type of the layout function (defaults to string) * @template {object} [D=Record] - Declared global data. * @callback AsyncLayoutFunction - * @param {LayoutFunctionParams} params - The parameters for the layout. + * @param {LayoutFunctionParams} params - The parameters for the layout. * @returns {Promise} The rendered content. */ diff --git a/lib/build-pages/outputs/page-writer.js b/lib/build-pages/outputs/page-writer.js index 9ba415fe..13d8acd3 100644 --- a/lib/build-pages/outputs/page-writer.js +++ b/lib/build-pages/outputs/page-writer.js @@ -24,7 +24,6 @@ import { writePageOutputs } from './page-output-writer.js' * Common parameters for page functions. * * @template {Record} T - The type of variables passed to the page function - * @template [U=any] U - The return type of the page function (defaults to any) * @template {object} [D=Record] - Declared global data. * @typedef {object} PageFunctionParams * @property {T} vars - All default, global, layout, page, and builder vars shallow merged. @@ -42,7 +41,7 @@ import { writePageOutputs } from './page-output-writer.js' * @template [U=any] U - The return type of the page function (defaults to any) * @template {object} [D=Record] - Declared global data. * @callback PageFunction - * @param {PageFunctionParams} params - The parameters for the pageLayout. + * @param {PageFunctionParams} params - The parameters for the pageLayout. * @returns {U | Promise} The rendered inner page thats compatible with its matched layout */ @@ -53,7 +52,7 @@ import { writePageOutputs } from './page-output-writer.js' * @template [U=any] U - The return type of the page function (defaults to any) * @template {object} [D=Record] - Declared global data. * @callback AsyncPageFunction - * @param {PageFunctionParams} params - The parameters for the pageLayout. + * @param {PageFunctionParams} params - The parameters for the pageLayout. * @returns {Promise} The rendered inner page thats compatible with its matched layout */ diff --git a/lib/domstack-manifest/schema.js b/lib/domstack-manifest/schema.js index fb8bd34c..7336a81d 100644 --- a/lib/domstack-manifest/schema.js +++ b/lib/domstack-manifest/schema.js @@ -246,7 +246,6 @@ export function getDomstackManifestSchemaId (version) { */ /** - * @template [Policy=Record] * @template [ManifestVars=Record] * @typedef {object} DomstackManifestPolicyTransformContext * @property {DomstackManifestEntry[]} entries - Final public manifest entries after excludes, filters, and entry-level manifestVars are applied. @@ -256,7 +255,7 @@ export function getDomstackManifestSchemaId (version) { * @template [Policy=Record] * @template [ManifestVars=Record] * @callback DomstackManifestPolicyTransform - * @param {DomstackManifestPolicyTransformContext} context + * @param {DomstackManifestPolicyTransformContext} context * @returns {Policy | undefined | Promise} */ diff --git a/package.json b/package.json index 1e3be993..7522f011 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@types/mime-types": "^3.0.1", "@types/node": "^26.0.1", "@types/pretty": "^2.0.3", - "@voxpelli/tsconfig": "^16.2.1", + "@voxpelli/tsconfig": "^17.0.0", "cheerio": "^1.0.0-rc.10", "installed-check": "^11.0.0", "jsonfeed-to-atom": "^1.2.5", @@ -107,7 +107,8 @@ "npm-run-all2": "^9.0.2", "preact": "^11.0.0", "releasearoni": "^0.2.0", - "typescript": "~6.0.3" + "typescript": "npm:@typescript/typescript6", + "typescript7": "npm:typescript@~7.0.2" }, "homepage": "https://github.com/bcomnes/domstack", "keywords": [], @@ -126,7 +127,7 @@ "test:neostandard": "eslint . --ignore-pattern 'test-cases/build-errors/src/**/*.js' --ignore-pattern 'test-cases/page-build-errors/src/**/*.js'", "test:node-test": "node --test --experimental-test-coverage --test-reporter=dot --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=lcov.info", "test:playwright": "playwright test", - "test:tsc": "tsc", + "test:tsc": "node ./node_modules/typescript7/bin/tsc", "build-examples": "run-p example:*", "clean": "run-p clean:*", "clean:public": "rm -rf public && mkdir -p public", @@ -139,7 +140,7 @@ "new-blogpost": "node tools/blog/create.ts", "publish-draft": "node tools/blog/publish.ts", "import-author": "node tools/authors/import.ts", - "build:declaration": "tsc -p declaration.tsconfig.json", + "build:declaration": "node ./node_modules/typescript7/bin/tsc -p declaration.tsconfig.json", "build:schema": "node scripts/domstack-manifest-schema.js", "watch": "npm run clean && run-p watch:*", "watch:domstack": "npm run build:domstack -- --watch", diff --git a/test-cases/generated-pages/src/global.client.js b/test-cases/generated-pages/src/global.client.js index 8e4ffaae..778f96bf 100644 --- a/test-cases/generated-pages/src/global.client.js +++ b/test-cases/generated-pages/src/global.client.js @@ -1 +1 @@ -globalThis.generatedPagesGlobalClient = true +/** @type {typeof globalThis & { generatedPagesGlobalClient: boolean }} */ (globalThis).generatedPagesGlobalClient = true diff --git a/test-cases/generated-pages/src/root.layout.client.js b/test-cases/generated-pages/src/root.layout.client.js index dc4b2756..c5c70c7e 100644 --- a/test-cases/generated-pages/src/root.layout.client.js +++ b/test-cases/generated-pages/src/root.layout.client.js @@ -1 +1 @@ -globalThis.generatedPagesRootLayoutClient = true +/** @type {typeof globalThis & { generatedPagesRootLayoutClient: boolean }} */ (globalThis).generatedPagesRootLayoutClient = true diff --git a/type-tests/index.test.ts b/type-tests/index.test.ts index 3f0cdf59..4eeb5450 100644 --- a/type-tests/index.test.ts +++ b/type-tests/index.test.ts @@ -96,14 +96,14 @@ test('PageData exposes typed, named layout variable layers', () => { pageData.layoutVars = [] }) -const layoutParams: LayoutFunctionParams, string, string> = { +const layoutParams: LayoutFunctionParams, string> = { vars: { title: 'Hello' }, children: 'Body', page: pageInfo, data: {}, } -const pageParams: PageFunctionParams, string> = { +const pageParams: PageFunctionParams> = { vars: { title: 'Hello' }, page: pageInfo, data: {}, @@ -212,7 +212,7 @@ const domstackManifestTransformContext: DomstackManifestTransformContext = ({ vars }) => ({ section: vars.section }) -const domstackManifestPolicyTransformContext: DomstackManifestPolicyTransformContext = { +const domstackManifestPolicyTransformContext: DomstackManifestPolicyTransformContext = { entries: [domstackManifestEntry], } const domstackManifestPolicyTransform: DomstackManifestPolicyTransform = () => ({ cache: 'precache' })