Skip to content

Improve DomStack programmatic build testing support#251

Merged
bcomnes merged 1 commit into
masterfrom
fix/copy-path-resolution
Jun 27, 2026
Merged

Improve DomStack programmatic build testing support#251
bcomnes merged 1 commit into
masterfrom
fix/copy-path-resolution

Conversation

@bcomnes

@bcomnes bcomnes commented Apr 18, 2026

Copy link
Copy Markdown
Owner

This PR completes the programmatic API testing improvements tracked in #234.

Completed

  • Resolves relative copy paths passed to the DomStack constructor to absolute paths from the current working directory, matching CLI --copy behavior.
  • Stores resolved copy paths in this.opts.copy so downstream build and watch copy steps receive consistent absolute paths.
  • Adds constructor copy-path tests for relative, absolute, and mixed copy paths.
  • Documents programmatic copy path behavior in README.md and the DomStackOpts JSDoc.
  • Improves worker page-build error reporting by restoring worker errors with page/template context in the error message, while preserving cause, stack, and attached metadata.
  • Adds a regression assertion that page build errors include the affected page path.
  • Adds a top-level testBuild(src, opts) helper for isolated programmatic test builds into temporary directories.
  • Documents testBuild() usage and adds fixture coverage for generated output reading, copy-option pass-through, and cleanup.

Validation

  • node --test --test-reporter spec test-cases/page-build-errors/index.test.js
  • node --test --test-reporter spec test-cases/test-build-helper/index.test.js
  • npm run test:tsc
  • npm run test:neostandard
  • npm run test:node-test
  • npm run test:installed-check

Closes #234

Copilot AI review requested due to automatic review settings April 18, 2026 18:44
@coveralls

coveralls commented Apr 18, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28271793017

Coverage decreased (-0.6%) to 91.837%

Details

  • Coverage decreased (-0.6%) from the base build.
  • Patch coverage: 7 uncovered changes across 1 file (88 of 95 lines covered, 92.63%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
lib/build-pages/index.js 50 43 86.0%
Total (3 files) 95 88 92.63%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4254
Covered Lines: 4027
Line Coverage: 94.66%
Relevant Branches: 830
Covered Branches: 642
Branch Coverage: 77.35%
Branches in Coverage %: Yes
Coverage Strength: 74.09 hits per line

💛 - Coveralls

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes programmatic DomStack usage so relative copy paths are normalized consistently (stored as absolute paths) based on the src location rather than the process working directory.

Changes:

  • Resolve opts.copy entries to absolute paths in the DomStack constructor.
  • Persist resolved copy paths back onto this.opts.copy so downstream copy steps/watchers consume consistent absolute paths.
  • Simplify dest-containment validation to operate on already-resolved copy paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread index.js Outdated
Comment thread index.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test-cases/constructor-copy-paths/index.test.js Outdated
Comment thread test-cases/constructor-copy-paths/index.test.js Outdated
@bcomnes

bcomnes commented Apr 20, 2026

Copy link
Copy Markdown
Owner Author

This is probably fine but only partially imements all suggestions in the parent issue.

@bcomnes

bcomnes commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

This only addresses the "The constructor does not resolve copy paths" issue. It also warrants a document README.md update and a jsdoc update for the public interface.

@bcomnes
bcomnes force-pushed the fix/copy-path-resolution branch from fce6532 to 095edd5 Compare June 26, 2026 21:48
@bcomnes bcomnes changed the title Resolve copy paths relative to src in DomStack constructor Improve DomStack programmatic build testing support Jun 26, 2026
Resolve programmatic copy paths, improve worker error context, add a testBuild helper, and migrate successful build fixtures to use isolated temporary destinations.

Closes #234
@bcomnes
bcomnes force-pushed the fix/copy-path-resolution branch from 4fe23ab to a8c5b94 Compare June 26, 2026 23:53
@bcomnes

bcomnes commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

All issues addressed.

@bcomnes
bcomnes merged commit 2b5a785 into master Jun 27, 2026
10 checks passed
@bcomnes
bcomnes deleted the fix/copy-path-resolution branch June 27, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Programmatic API needs better support for testing and dry-run builds

3 participants