Repository navigation
test: let the unbuilt schema fail in tsc instead of a pre-check - #466
Merged
Merged
Conversation
Contributor
File size check0 over a hard cap (fails), 34 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused rollback consistently removes the redundant pre-check without affecting built-schema behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Removes the redundant schema pre-check so TypeScript reports missing build output directly.
Changes:
- Removes schema import detection and its dedicated test.
- Simplifies schema error construction.
| File | Description |
|---|---|
test/docs/library-examples.test.ts |
Lets tsc report a missing built schema. |
test/settings-schema.ts |
Removes the shared schema error helper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vivswan
force-pushed
the
test/drop-schema-precheck
branch
from
October 5, 2026 06:57
2cf5045 to
1c2c5be
Compare
The library-examples test gained, in #456, an existsSync check before tsc ran: when a fence imported the package's settings.schema.json subpath and lib/settings.schema.json was absent, compileExamples rejected with a line naming bun run build:schema, through a textual import scan (importsModule) and a shared mint (schemaNotBuilt) in test/settings-schema.ts. The owner's rule: do not write a check or guard for something that fails on its own. A missing build output, a missing package, a wrong toolchain surface as failures when they happen and are fixed then; a pre-check that restates a failure the tool already produces is deleted. tsc's own TS2307 against the page line is that failure, so both files return to their content before #456. The refusal-messages registry rows and planted row from #456 stay. The same rule removes two more pre-checks of the same class: readSettingsSchema's own existsSync check and not-built message (readFileSync's ENOENT names the path) and refusalSources' existsSync check and census message (read() raises the same ENOENT, and the gone-source control asserts it). Every other existsSync under test/ and .github/scripts/ chooses a path, skips an optional input, or is the test's own assertion, and stays.
Vivswan
force-pushed
the
test/drop-schema-precheck
branch
from
October 5, 2026 07:07
1c2c5be to
c87025f
Compare
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.
Before
Clean checkout,
lib/absent, after #456:Three
existsSyncpre-checks fired before the tool ran.After
Same checkout:
The tools' own failures, fixed by
bun run build:schemawhen they happen. Withlib/built: 79 pass across the four touched test files.How
compileExamplesback to tsc alone,importsModuleandschemaNotBuilt()gone.readSettingsSchema()andrefusalSources()lose theirexistsSyncchecks;readFileSyncraises ENOENT naming the path. The gone-source control asserts it.existsSyncundertest/and.github/scripts/does real work and stays. Census below.Proof
tsc -p .,biome check,knip: clean.mv lib lib.bak, run, restore. Output above.Technical details
Line accounting (
git diff --numstat origin/main...HEAD): +12 / -86schemaNotBuilt()mint and theexistsSynccheck removedrefusalSources()existsSynccheck removed, control asserts ENOENT, unused import droppedDeleted (each restated the failure the next call produces on its own):
compileExamples(#456)TS2307: Cannot find module .../lib/settings.schema.jsonat the page linereadSettingsSchema()readFileSyncENOENT ... open '.../lib/settings.schema.json'refusalSources()readFileSyncinread()ENOENT ... open '.../src/sections/<dir>/index.ts'Kept (
git grep -n existsSync test .github/scripts), with the reason:.ts,index.ts); the throw after the loop names importer, specifier, and candidatesgit add -f; an absent one is the carry check's finding by designpushes.logmeans no push attempted: optional input, returns[]index.ts), then names the importer and specifier of a broken one; the later read in another iteration could notexportsSymbol()(diagrams.test.ts:27) orslugsOf()(guides.test.ts:402) would abort at the first ENOENTexpect(existsSync(...))Files: test/docs/library-examples.test.ts, test/settings-schema.ts, test/sections/refusal-messages.test.ts