Repository navigation
build: make native Svelte checks fast and fail closed - #416
Merged
Merged
Conversation
Deploying podnotes with
|
| Latest commit: |
e634347
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cda1103a.podnotes.pages.dev |
| Branch Preview URL: | https://build-native-svelte-check.podnotes.pages.dev |
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.
Summary
Run Svelte checks through TypeScript 7's native API and reject compiler startup failures. Keep TypeScript 6 for the JavaScript APIs used by Svelte and lint tooling.
lint:tsconfigchecks both project configs for empty input sets before checking components.svelte-check 4.7.6 is still the latest release. A small Node installer backports the outer-catch exit-status fix from sveltejs/language-tools#3133. It recognizes the exact published and patched hashes, runs after install and at check entry, and fails on an unexpected version or file. This avoids adding a patching dependency. The checker is pinned with a temporary Dependabot ignore; AGENTS.md documents removing the patch and ignore when upstream ships the fix.
npm testruns application tests.npm run test:toolingseparately runs the checker regression suite, and the CI Test job runs both on every PR. AGENTS.md also usesnpm ci, matching CONTRIBUTING.md.Fixes #405.
Verification
npm cion Node 22.23.2 / npm 10.9.8 passed with the patch applied.--tsgofails the parser, missing-import and compiler-fault controls. A separate manual probe killed the real installed native compiler after observing its live PID and got exit 1.npm run test:e2epassed 68 tests across 11 files on Obsidian 1.13.7, Linux x64. This run preceded the merge of fix: make podcast name lookups exact and safe #413. It used the isolated worktree vault and the suite's local HTTP/WAV fixtures. The runner stopped the instance and removed its private profile afterward.Final checks after merging
origin/masterat6c6f40eall passed:npm run lintnpm run format:checknpm run typechecknpm run buildnpm run testnpm run test:toolingnpm run docs:buildnpm run sizecmpagainst a fresh build of6c6f40epassed. Bothmain.jsfiles have SHA-256674f5b401eed58847d28db38cd73e3a5cea5d79cc2fb5d55ae6ab1eb58532b5d. No Svelte preprocessing or production build settings changed.Local timings and review evidence
Seconds, median of five runs with min-max in parentheses, Node 22.23.2 on Linux x64. Baseline and combined-candidate runs alternated on the same
2cd9974source tree. Every run passed. The split-suite and serial/parallel trials followed on that same tree.check:a11ynpm test, tooling included in candidatenpm test, tooling separate (final layout)test:toolingalonebuildThis shared 12-CPU host was heavily loaded. The later split runs were not interleaved with combined runs, so their difference is not a controlled estimate of the split alone. Build inputs and outputs are identical; overlapping timing ranges do not establish a build regression. Separate CPU profiles put TS6 loading/checking at 2.41 of 3.72 seconds, versus 0.03 of 1.55 seconds on the API path, with native IPC and loader work accounting for most remaining time.
Five alternating full-gate trials (
lint,format:check,build,test,test:tooling) measured 49.26 seconds serially (32.38-73.31) and 24.91 seconds in parallel (22.79-27.02). That is a 24.35-second median difference on this host, not a prediction for GitHub runners. No task-runner dependency or CI parallelization was added; scheduling belongs to CI3.Independent Fable and Astra reviews approved the patch, fixtures, and final CI split with no blockers. Accepted follow-ups clarify removal of the lint/format paths with the patch and give tests more time than their subprocess timeout. The mutation harness now selects the separate tooling config.
CI also passed on
e634347. These are single successful runs on GitHub's Ubuntu runner, comparing the unchanged source base6c6f40ewith this PR:check:a11ylog intervalnpm teststeptest:toolingstepbuildstepThe checker interval runs from the npm script header to the second final diagnostic line; it includes both projects and, for the candidate, patch validation and preflights. Step/job timings use GitHub's second-resolution timestamps. The checker and local test path are faster; the full CI job is six seconds longer in these runs because it now also runs the failure regression suite. All five required checks passed. The PR remains unmerged.
Release impact
None. No plugin source, settings, storage, API, URI, or migration changes. The production bundle is byte-identical to the matching master base.
Note
Make
check:a11yuse native Svelte compiler checks and fail closedsvelte-checkto exactly 4.7.6 in package.json and adds apostinstallstep that patches it via patches/svelte-check.mjs to exit 1 on failed checks. The patch refuses to modify anything on an unrecognized version or entry-file hash.check:a11yto apply the patch, verify TypeScript project inputs with a newlint:tsconfigscript, and run native-API Svelte checks on both source and test projects.test:toolingVitest suite in svelteCheck.test.ts that runs the realnpm run check:a11yin temporary workspaces and covers diagnostics, empty projects, unavailable native compiler, and killed compiler processes. CI runs it as a new step in test.yml.svelte-checkflow, pin rationale, and tooling commands in AGENTS.md, and ignoressvelte-checkupdates in Dependabot.npm installnow patches the installedsvelte-checkfile in place;check:a11ynow fails on empty TypeScript projects (TS18003) and native compiler faults, where the old directsvelte-checkcalls did not.Macroscope summarized e634347.