fix(build): keep tests/*.mjs out of tsc input; cover *.mjs in lint/format - #2472
Open
RibatTRW wants to merge 1 commit into
Open
fix(build): keep tests/*.mjs out of tsc input; cover *.mjs in lint/format#2472RibatTRW wants to merge 1 commit into
RibatTRW wants to merge 1 commit into
Conversation
…rmat - tsconfig.json, tsconfig.production.json: exclude ./tests/** (allowJs with no rootDir made the inferred rootDir the repo root once tests/ existed, emitting nested .js/plugins/plugins/<lang>/ and an empty manifest, Total 0 (0)) - eslint.config.js: add mjs,mjsx to the project-rules files glob - package.json: format/format:check and lint-staged globs cover mjs Verified at e1dcd06: manifest builds Total 117 (68) with tests in-tree AND out-of-tree; eslint on tests/regression-2453.mjs clean; prettier clean on all touched files except pre-existing tsconfig.json style debt (left untouched).
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.
What
With a plain-node regression script present under
tests/, building withproduces an EMPTY plugin manifest:
.dist/plugins.jsonreports| Total | 0 (0) |, so any downstream "plugin X absent" assertion passes vacuously.Why / how
tsconfig.production.jsonsetsallowJs: true, defines norootDir, and itsexcludearray lists neithertests/**nor any.mjspattern.tests/regression-*.mjsfile therefore enters the tsc program; the inferred rootDir becomes the repo root; emit lands nested at.js/plugins/plugins/<lang>/<file>.jsplus.js/plugins/tests/regression-N.mjs.scripts/build-plugin-manifest.jsscans./.js/plugins/<lang>/, finds nothing, and writes[].Fix (4 files, +6/-4):
tsconfig.jsonandtsconfig.production.json: insert"./tests/**"intoexclude, right after the existing"scripts/**"entry (same convention: tooling that plain node runs, tsc ignores).eslint.config.js: extend the project-rules files glob from{ts,tsx,mts,cts,js,cjs}to{ts,tsx,mts,cts,js,cjs,mjs,mjsx}; that config object already registers node globals, which the.mjsscripts need.package.json: addmjsto theformat/format:checkglobs and to lint-staged.No rootDir change, no emit-layout reshaping, no manifest-script edit.
Tests
Executed locally on 2026-08-25 at base
e1dcd06(RED baseline) and at this branch head (GREEN); tsc 5.9.3, node v26.5.1..js/plugins/plugins/{arabic..vietnamese}and.js/plugins/tests/regression-2453.mjs; manifest| Total | 0 (0) |(RED).js/plugins/plugins, no.js/tests; manifest| Total | 117 (68) |tests/moved out of tree, fresh rebuild| Total | 117 (68) |(tsc input scope no longer depends on test placement)tests/**/*.mjs+eslint.config.jsno-undeferrors onregression-2453.mjs(consolex2,process)package.json,eslint.config.js,tsconfig.production.json,tests/*.mjstsconfig.jsonkeeps pre-existing upstream style debt, deliberately untouched)Context for the totals (2026-08-25): #2468 (RanobeHub retirement) is OPEN, so
117 (68)is correct against current master; once it merges, the expected total becomes116 (67). #2466 (Riwyat) is OPEN too; if it lands first, its eslint config object and this glob extension are separate hunks that compose cleanly.Gates
e1dcd06: exactly 4 files changed, +6/-4, nothing else; no lockfile churn; no CI workflow edits..github/workflows/publish-plugins.ymluntouched.Closes: none (repo-level build defect, no upstream issue).
Automated contribution via Hermes Agent.