Repository navigation
test(node): prebuilt Core and the docs modules load natively in the node project - #8752
Merged
Merged
Conversation
resolve-theme.test.mjs's "loads a real built local default with an icon registry" timed out at its 30 s budget in loaded full runs and passed alone in about 10.6 s. Its theme build imports Core's root entry, all of Core and React, as the CLI does: 0.9 s in Node, 4.5 s in the test, because the workspace link resolves Core's dist outside node_modules and Vitest inlined every file of it through its transform. The node project now leaves Core's dist to Node, so the case runs in about 7.4 s alone. Before, with the case's budget cut to 8.5 s, it timed out; after, it passes in that budget. Mocks of @astryxdesign/core/theme in the theme build suites still apply from their inlined callers (build.test.mjs 54, build.adaptation-core-compat.test.mjs 18 pass).
doctor.test.mjs's first case, "returns a doctor envelope with checks + summary", timed out at 30 s in a loaded full run. It runs doctor over the repository, whose docs catalog imports the .doc.mjs documentation modules by the hundred; Vitest inlined each one through its transform: the case took about 4.7 s alone against 0.7 s for the same call in Node. The node project now leaves .doc.mjs files to Node as well, and the case takes about 2.2 s; the whole doctor file drops from about 64 s to 15 s, search from 36 s to 23 s and docs-homes from 44 s to 16 s. Before, with the case's budget cut to 3.5 s, it timed out; after, it passes in that budget.
vjeux
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
October 27, 2026 21:50
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
Contributor
There was a problem hiding this comment.
This is ready to approve: letting Node load Core's prebuilt dist/ and the .doc.mjs modules in the node project keeps the affected suites passing and cuts the doctor and docs-homes suites to roughly a third of their time. No changes are needed, and scoped CI runs still select the tests of a changed .doc.mjs, so no coverage is lost. Worth knowing for future tests: a vi.mock of a Core subpath no longer reaches Core's own re-exports, such as @astryxdesign/core re-exporting ./theme, so a test that needs the root entry mocked should mock @astryxdesign/core directly.
[Automated review]
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review only this PR's change: vjeux/astryx@3ffb646...c20d7ca
Maintainer impact
Two node-project cases time out at their 30 s budget in loaded full runs and pass alone, for one reason: Vitest inlines, through its transform, modules that Node loads as they are.
resolve-theme.test.mjs› "loads a real built local default with an icon registry" (about 10.6 s alone): its theme build imports Core's root entry, all of Core and React. Node loads it in 0.9 s; the test took 4.5 s, because the workspace link resolves Core'sdist/outsidenode_modules, so every file of the bundle went through the transform.doctor.test.mjs› "returns adoctorenvelope with checks + summary": doctor over the repository imports the.doc.mjsdocumentation modules by the hundred, each inlined: about 4.7 s alone against 0.7 s for the same call in Node.Both costs grow several times over on a loaded machine.
Intended invariant
A test's time goes to what it checks; prebuilt and plain-data modules load as they do for the CLI.
Change
The node project leaves
packages/core/dist/and.doc.mjsfiles to Node (server.deps.external). The theme case runs in about 7.4 s alone and doctor's in about 2.2 s; the whole doctor file drops from about 64 s to 15 s, search from 36 s to 23 s, and docs-homes from 44 s to 16 s.Evidence
@astryxdesign/core/themein the theme build suites still apply from their inlined callers:build.test.mjs(54) andbuild.adaptation-core-compat.test.mjs(18) pass.Scope
Testing
mainthere; 18 of the 21 files that time out or fail onmainunder the same run now pass.resolve-theme.test.mjs(30),doctor.test.mjs(86),search.test.mjs(77) anddocs-homes.test.mjs(3) pass.