Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
71fca07
fix(page-outputs): preserve subscription error metadata
bcomnes Sep 17, 2026
6b958c1
fix(types): accept explicit undefined in optional build options
bcomnes Sep 17, 2026
dc66aad
refactor: replace make-array with native ignore normalization
bcomnes Sep 17, 2026
f1a0197
refactor(watch): isolate lifecycle, dependency routing, and output ow…
bcomnes Sep 17, 2026
6bd279f
refactor(build-pages): separate orchestration, data, generation, and …
bcomnes Sep 17, 2026
53f359e
perf(build-pages): reduce vars copying and unnecessary collection scans
bcomnes Sep 17, 2026
c1f8c01
docs: keep implementation guide focused on high-level behavior
bcomnes Sep 17, 2026
cf59229
refactor(build-pages): collect remaining subsystem boundaries
bcomnes Sep 17, 2026
68fc3a4
refactor(types): remove redundant internal aliases
bcomnes Sep 17, 2026
f1a876d
fix(types): type Markdown plugins without suppressions
bcomnes Sep 17, 2026
7ebf7d3
chore(types): explain expected errors and remove stale suppressions
bcomnes Sep 17, 2026
b4c2d4e
refactor(build-pages): isolate per-page data subscriptions
bcomnes Sep 17, 2026
35d7b5a
refactor(build-pages): isolate page vars caching
bcomnes Sep 17, 2026
beb0843
refactor(build-pages): extract lazy output hook collection
bcomnes Sep 17, 2026
6993b30
Simplify page preparation and output reporting
bcomnes Sep 17, 2026
d1e0f5d
Reuse prepared page renderers within each build
bcomnes Sep 17, 2026
c2bec1f
Separate example-site acceptance tests from subsystem regressions
bcomnes Sep 17, 2026
de63ce5
Document example-site and subsystem test boundaries
bcomnes Sep 17, 2026
8119151
Remove version-build verification test stage
bcomnes Sep 17, 2026
0a8fcd2
Fix typo in JSDoc for buildDrafts option
bcomnes Sep 17, 2026
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ test-results
*.d.ts.map
!types/**/*.d.ts
!types/**/*.d.ts.map
test-cases/generated-pages/.streaming
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ If for some reason that isn't working or a local release is preferred, follow th

Generation belongs in `version`, not `preversion` (which runs before the version update) or `postversion` (which runs after the commit and tag).
The release workflow's pre-version reset/clean is safe because the initial generated JavaScript is tracked and the version hook rebuilds it before staging.
Run `npm run test:version-build` to verify generation, staging, tagging, and cleanup in a disposable repository without versioning this checkout.
6 changes: 6 additions & 0 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
- After running a type build, clean up the generated build files and do not leave them sitting around.
- Use the cleanup scripts in `package.json` for generated type build files.
- The generated `lib/defaults/default.root.layout.js` is versioned runtime code, not temporary declaration output; regenerate it with `npm run build:defaults` after editing its TypeScript source and never remove it during cleanup.
- Keep `test-cases/` focused on checked-in example sites paired with acceptance tests that build through the public API and assert on outputs or expected build errors.
- Example sites should be understandable by browsing their source files, not reconstructed from JavaScript strings embedded in tests.
- Put detailed behavioral and regression tests beside the subsystem they exercise under `lib/`, even when they build temporary sites or run real watchers.
- Keep public facade tests at the repository root and public TypeScript contract tests in `type-tests/`.
- Behavioral tests may copy example sites into temporary directories, but must not mutate checked-in fixtures or depend on another test's output directory.
- Keep test-only files out of published packages and declaration builds; see `test-cases/README.md` for the test organization guidelines.
- For formatting-only ESLint failures, use `npx eslint <path> --fix` for a quick targeted fix before rerunning lint.
- When handling PR review comments, validate that each comment is correct before making changes; maintainer comments are almost always valid, but review bot comments may be wrong, and after addressing a comment, always reply with what was done.
7 changes: 7 additions & 0 deletions declaration.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
},
"exclude": [
"**/*.test.js",
"**/*.test.ts",
"**/*test-helpers.js",
"**/fixtures/**/*",
"lib/cli/tests/**/*",
"lib/watch/*-tests/**/*",
"type-tests/**/*",
"test-fixtures/**/*",
"test-cases/**/*",
"site/**/*",
]
Expand Down
2 changes: 1 addition & 1 deletion docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ Options are passed through to `DomStack`, including `copy` paths.

See these repository tests for complete usage:

- [`test-build-helper/index.test.js`](https://github.com/bcomnes/domstack/blob/master/test-cases/test-build-helper/index.test.js) tests temporary output, `readOutput()`, copied directories, and cleanup.
- [`test-build.test.js`](https://github.com/bcomnes/domstack/blob/master/test-build.test.js) tests temporary output, `readOutput()`, copied directories, and cleanup.
- [`default-layout/index.test.js`](https://github.com/bcomnes/domstack/blob/master/test-cases/default-layout/index.test.js) uses `testBuild()` for a focused output assertion.
- [`generated-pages/index.test.js`](https://github.com/bcomnes/domstack/blob/master/test-cases/generated-pages/index.test.js) uses it with generated pages, global data, and templates.
3 changes: 2 additions & 1 deletion docs/implementation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Layout subscriptions contribute to page invalidation, but each layout still rece
Page initialization uses a concurrency limit of `min(CPUs, 24)`.
The final page and template rendering queues run in parallel, splitting that concurrency budget between them.


Variable Resolution Layers, from lowest to highest precedence:
- **Domstack defaults** - Internal defaults such as the default `layout: 'root'`.
- **Global vars** - Site-wide variables from `global.vars.js` (resolved once).
Expand All @@ -193,7 +194,7 @@ Watch mode coordinates three independent watchers:

Chokidar events pass through a pure planner before any rebuild executes.
The planner reads an explicit snapshot of discovery, dependency maps, and the previous page-build outcome; it does not perform I/O or mutate that state.
`DomStack` owns the watch session, serializes events, executes plans, and releases its watchers, esbuild context, and server on shutdown.
DOMStack manages the watch session, queues changes, rebuilds affected outputs, and shuts down the watchers and server when stopped.

<pre class="mermaid" tabindex="0" role="region" aria-label="Watch planning diagram">
flowchart TD
Expand Down
5 changes: 5 additions & 0 deletions docs/pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Variables are available in all pages.
`ts` pages receive variables as part of the argument passed to them.
See the [Variables](../../docs/pages/#variables) section for more info.

DOMStack prepares each page's renderer once per build.
HTML and Markdown source content is captured when the page initializes; repeated renders reuse that content but still receive the current render inputs.
Watch rebuilds prepare fresh renderers, so an edit observed during a build is picked up by a subsequent build.
The `readMarkdownContent()` helper remains a fresh read of the source file rather than a read of the prepared content.

Pages can define a special variable called [`layout`](../layouts/#selecting-a-layout) that determines which layout the page is rendered into.

Because pages are just directories, they nest and structure naturally as a filesystem router.
Expand Down
2 changes: 1 addition & 1 deletion examples/tailwind/src/layouts/root.layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @import { LayoutFunction } from '@domstack/static'
*/
// @ts-ignore

import { html } from 'htm/preact'
import { render } from 'preact-render-to-string'

Expand Down
Loading