Skip to content

fix: build the root package before workspaces - #474

Merged
robgruen merged 5 commits into
microsoft:mainfrom
mikemikimike:fix/typechat-464
Nov 2, 2026
Merged

robgruen merged 5 commits into
microsoft:mainfrom
mikemikimike:fix/typechat-464

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

prepare runs build-all, but the script only compiled workspaces. npm excludes the root package from workspace runs, so the TypeScript validator's published dist could remain stale and fail at runtime with the declared TypeScript 7 peer.

Build the root package before workspaces. Add an integration test that builds from a source copy with no generated output, packs it, and verifies successful and rejected values in a clean TypeScript 7 consumer.

Validation:

  • npm ci --no-audit --no-fund
  • npm run build-all
  • npm test (178 tests passed)

Fixes #464

Issue: #464

Copilot AI balanced review requested due to automatic review settings October 31, 2026 00:10

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.

🟡 Changes recommended

The package test mishandles paths containing spaces on Windows and requires fresh registry downloads on every run, causing failures before validation in affected or offline environments.

2 open issues
What changed in this PR

This PR addresses #464 by building TypeChat’s root TypeScript package before its workspaces, preventing stale validator output from being packaged.

Changes:

  • Update build-all to compile the root package first.
  • Add a default-suite integration test that builds without generated output, packs the package, and checks accepted and rejected values in a clean TypeScript 7 consumer.
File Description
typescript/​tests/​package.test.mjs Adds packaged-validator verification in an isolated consumer.
typescript/​package.json Fixes build order and includes the packaging test in npm test.

Review effort: Balanced

Comment thread typescript/tests/package.test.mjs Resolved
Comment thread typescript/tests/package.test.mjs Resolved
Copilot AI balanced review requested due to automatic review settings October 31, 2026 00:30

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.

🟡 Changes recommended

The npm CLI path resolves incorrectly on standard Unix Node installations, causing MODULE_NOT_FOUND on the first runNpm call and breaking npm test.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread typescript/tests/package.test.mjs Resolved
@mikemikimike

Copy link
Copy Markdown
Contributor Author

Validation note: npm test passed with 198 tests, including the packaged TypeScript 7 consumer regression test. The root package build completed successfully. The remaining npm run build-all workspace builds hit pre-existing environment failures in downstream examples: one workspace could not resolve @types/node, and several could not find tsc on PATH. These failures occurred outside the changed test and were not introduced by this patch.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 04:17

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.

🟢 Approval recommended

No active review issues are recorded for the build-order fix and its packaging regression coverage.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 00:21

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.

🟢 Approval recommended

No active review issues were identified for the build-order fix and packaging regression coverage.

No open issues 🎉

Review effort: Balanced

@robgruen robgruen 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.

Tidy fix, thank you!

@robgruen
robgruen merged commit 81a9b90 into microsoft:main Nov 2, 2026
8 checks passed
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.

TypeChat 0.1.4: TypeScript validator fails with declared TypeScript 7 peer

3 participants