Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
"author": "Bret Comnes <bcomnes@gmail.com> (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:../../.",
Expand Down
3 changes: 1 addition & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)",
"license": "MIT",
"devDependencies": {
"@voxpelli/tsconfig": "^16.0.0",
"typescript": "~5.9.2"
"typescript": "~7.0.2"
},
"dependencies": {
"@domstack/static": "file:../../.",
Expand Down
2 changes: 1 addition & 1 deletion examples/cargo-like/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@domstack/static": "file:../../.",
"@types/node": "^26.0.1",
"playwright": "^1.61.1",
"typescript": "~6.0.3"
"typescript": "~7.0.2"
}
}
3 changes: 1 addition & 2 deletions examples/preact-isomorphic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 1 addition & 2 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 1 addition & 2 deletions examples/type-stripping/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 2 additions & 3 deletions lib/build-pages/layouts/resolve-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export async function resolveLayout (layoutPath) {
*
* @template {Record<string, any>} 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<string, unknown>] - Declared global data.
* @typedef {object} LayoutFunctionParams
* @property {T} vars - All default, global, layout, page, and builder vars shallow merged.
Expand All @@ -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<string, unknown>] - Declared global data.
* @callback LayoutFunction
* @param {LayoutFunctionParams<T, U, V, D>} params - The parameters for the layout.
* @param {LayoutFunctionParams<T, U, D>} params - The parameters for the layout.
* @returns {V | Promise<V>} The rendered content.
*/

Expand All @@ -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<string, unknown>] - Declared global data.
* @callback AsyncLayoutFunction
* @param {LayoutFunctionParams<T, U, V, D>} params - The parameters for the layout.
* @param {LayoutFunctionParams<T, U, D>} params - The parameters for the layout.
* @returns {Promise<V>} The rendered content.
*/

Expand Down
5 changes: 2 additions & 3 deletions lib/build-pages/outputs/page-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { writePageOutputs } from './page-output-writer.js'
* Common parameters for page functions.
*
* @template {Record<string, any>} 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<string, unknown>] - Declared global data.
* @typedef {object} PageFunctionParams
* @property {T} vars - All default, global, layout, page, and builder vars shallow merged.
Expand All @@ -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<string, unknown>] - Declared global data.
* @callback PageFunction
* @param {PageFunctionParams<T, U, D>} params - The parameters for the pageLayout.
* @param {PageFunctionParams<T, D>} params - The parameters for the pageLayout.
* @returns {U | Promise<U>} The rendered inner page thats compatible with its matched layout
*/

Expand All @@ -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<string, unknown>] - Declared global data.
* @callback AsyncPageFunction
* @param {PageFunctionParams<T, U, D>} params - The parameters for the pageLayout.
* @param {PageFunctionParams<T, D>} params - The parameters for the pageLayout.
* @returns {Promise<U>} The rendered inner page thats compatible with its matched layout
*/

Expand Down
3 changes: 1 addition & 2 deletions lib/domstack-manifest/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ export function getDomstackManifestSchemaId (version) {
*/

/**
* @template [Policy=Record<string, unknown>]
* @template [ManifestVars=Record<string, unknown>]
* @typedef {object} DomstackManifestPolicyTransformContext
* @property {DomstackManifestEntry<ManifestVars>[]} entries - Final public manifest entries after excludes, filters, and entry-level manifestVars are applied.
Expand All @@ -256,7 +255,7 @@ export function getDomstackManifestSchemaId (version) {
* @template [Policy=Record<string, unknown>]
* @template [ManifestVars=Record<string, unknown>]
* @callback DomstackManifestPolicyTransform
* @param {DomstackManifestPolicyTransformContext<Policy, ManifestVars>} context
* @param {DomstackManifestPolicyTransformContext<ManifestVars>} context
* @returns {Policy | undefined | Promise<Policy | undefined>}
*/

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [],
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test-cases/generated-pages/src/global.client.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
globalThis.generatedPagesGlobalClient = true
/** @type {typeof globalThis & { generatedPagesGlobalClient: boolean }} */ (globalThis).generatedPagesGlobalClient = true
2 changes: 1 addition & 1 deletion test-cases/generated-pages/src/root.layout.client.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
globalThis.generatedPagesRootLayoutClient = true
/** @type {typeof globalThis & { generatedPagesRootLayoutClient: boolean }} */ (globalThis).generatedPagesRootLayoutClient = true
6 changes: 3 additions & 3 deletions type-tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ test('PageData exposes typed, named layout variable layers', () => {
pageData.layoutVars = []
})

const layoutParams: LayoutFunctionParams<Record<string, any>, string, string> = {
const layoutParams: LayoutFunctionParams<Record<string, any>, string> = {
vars: { title: 'Hello' },
children: 'Body',
page: pageInfo,
data: {},
}

const pageParams: PageFunctionParams<Record<string, any>, string> = {
const pageParams: PageFunctionParams<Record<string, any>> = {
vars: { title: 'Hello' },
page: pageInfo,
data: {},
Expand Down Expand Up @@ -212,7 +212,7 @@ const domstackManifestTransformContext: DomstackManifestTransformContext<Example
entry: domstackManifestEntry,
}
const domstackManifestVarsTransform: DomstackManifestTransform<ExampleManifestVars, ExampleManifestVars, ExampleSourceVars> = ({ vars }) => ({ section: vars.section })
const domstackManifestPolicyTransformContext: DomstackManifestPolicyTransformContext<ExamplePolicy, ExampleManifestVars> = {
const domstackManifestPolicyTransformContext: DomstackManifestPolicyTransformContext<ExampleManifestVars> = {
entries: [domstackManifestEntry],
}
const domstackManifestPolicyTransform: DomstackManifestPolicyTransform<ExamplePolicy, ExampleManifestVars> = () => ({ cache: 'precache' })
Expand Down
Loading