You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package-layout: test:dist runs only the CJS entry test, name it test:cjs #442
area: testsTouches test files, fixtures, or test infrastructurepriority: mediumShould be addressed in the normal course of developmentstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: documentationRelates to docs, README updates, guides, or inline code comments
docs/conventions/package-layout.md names the script that runs tests/cjs/entry.test.cjs after a build test:dist. That test only checks the CommonJS entry on the build (dist/index.cjs re-exports dist/index.mjs, the require(esm) guard, plus a bin smoke test in some repos). It doesn't run anything else against dist/, so test:cjs is the accurate name. Most of the fleet already calls it that.
test:dist should mean the whole suite run against the build without the <pkg>-dev condition. Nothing does that today, because tests import ../src/… by relative path, so dropping the condition changes nothing.
Repos that named the CJS check test:dist, to rename back to test:cjs: sizeofvar, envm, llm-translator, jsonv-prettier-plugin-jsonv, jsonv-eslint-plugin-jsonv, slothlet-vine.
package-layout.md: test:cjs for the entry check (script example, the slothlet section, the Tests section).
Decide how a real test:dist runs the suite against dist/ (tests import the package by name instead of ../src, so the condition picks src/ or dist/), then document it.
test:cjs runs the tests that check CommonJS only, in repos that have any.
test:dist runs the repo's full test suite against dist/ instead of src/.
Both should be documented as standard scripts. llm-translator is getting a real test:dist now. Its build mirrors src/ file by file (tsup bundle: false), so the vitest config redirects src/ imports to dist/ in a dist mode rather than changing every test's imports. That's one way to do it for unbundled builds. Bundled builds would still need tests to import by package name.
Landed on next in #443 (d9ded9a). test:cjs is the CommonJS entry check plus any CommonJS-only tests; test:dist is the full suite against dist/, by package name or, for unbundled builds, by redirecting src/ to dist/. Set status: implemented by hand, the PR body lost its closing keyword when the branch was refreshed.
area: testsTouches test files, fixtures, or test infrastructurepriority: mediumShould be addressed in the normal course of developmentstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: documentationRelates to docs, README updates, guides, or inline code comments
Activity
Shinrai commentedon Nov 8, 2026
To pin down the two names for package-layout.md:
test:cjsruns the tests that check CommonJS only, in repos that have any.test:distruns the repo's full test suite againstdist/instead ofsrc/.Both should be documented as standard scripts. llm-translator is getting a real
test:distnow. Its build mirrorssrc/file by file (tsupbundle: false), so the vitest config redirectssrc/imports todist/in a dist mode rather than changing every test's imports. That's one way to do it for unbundled builds. Bundled builds would still need tests to import by package name.Shinrai commentedon Nov 8, 2026
One addition:
test:cjsalso covers the CJS entry point (dist/index.cjsloadingdist/index.mjs), not just CJS-specific tests.docs: test:cjs covers CommonJS-only tests; unbundled redirect for tes…
chore: rename the CJS entry test script to test:cjs
Shinrai commentedon Nov 8, 2026
Landed on
nextin #443 (d9ded9a).test:cjsis the CommonJS entry check plus any CommonJS-only tests;test:distis the full suite againstdist/, by package name or, for unbundled builds, by redirectingsrc/todist/. Setstatus: implementedby hand, the PR body lost its closing keyword when the branch was refreshed.