Repository navigation
chore: standardize configuration, environment, and tsconfig diagnostics - #17251
Merged
Merged
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/e6e9faeb7b8d8577f843fb117859d84ef827f8f2Open in |
🦋 Changeset detectedLatest commit: e6e9fae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
elliott-with-the-longest-name-on-github
added this pull request to stack #17254
September 28, 2026 22:17
elliott-with-the-longest-name-on-github
force-pushed
the
message-box/config-sync
branch
from
September 29, 2026 23:03
b7db300 to
3bda68d
Compare
Rich-Harris
force-pushed
the
message-box/config-sync
branch
from
September 30, 2026 14:15
3bda68d to
2238b75
Compare
Rich-Harris
approved these changes
Sep 30, 2026
…ild-warnings.js` are out of sync with their `.md` sources after the "backticks" commits, and the unit tests still assert the pre-backtick strings.
This commit fixes the issue reported at packages/kit/src/messages/build-errors.js:53
## The bug
The message catalog is authored in `packages/kit/messages/**/*.md` and compiled into `packages/kit/src/messages/{build-errors,build-warnings}.js` by `scripts/process-messages/index.js` (run via `pnpm generate:messages`, part of the required `prepublishOnly`). The generated files carry a `Do not edit!` banner and are committed.
Commits `0191cfb` and `c1f1c51` ("backticks") wrapped interpolated values in backticks in the `> ...` blockquote lines of the `.md` sources (e.g. `messages/build-errors/config.md` now has `` > `%keypath%` cannot start or end with `'/'` ``), but the generated `.js` files were **not** regenerated. So they still emitted the old strings, e.g.:
```js
// build-errors.js (stale)
throw_error('config_app_dir_slash', `${_values.keypath} cannot start or end with '/'`, ...)
```
### How this manifests
Running the repo's own required `pnpm -F @sveltejs/kit generate:messages` (invoked by `prepublishOnly`) regenerates the modules **with** backticks, producing a diff against the committed files. I reproduced this exactly: after installing `@sveltejs/message-box@1.1.3` and running the script, `git diff` showed 128 changed lines in `build-errors.js` and 12 in `build-warnings.js` — confirming the committed output was stale.
Worse, the unit tests assert the **pre-backtick** strings. Once the generated code is corrected, these tests fail. Confirmed failure sites include:
- `src/core/config/index.spec.js` — ~20 assertions such as `/^config.appDir cannot start or end with '/'$/`, `/^config.appDir should be a string, if specified$/`, prerender-entries, origin, csp, tracing, etc.
- `src/core/sync/write_tsconfig/index.spec.js:50,104` — `tsconfig.json should extend ...` / `Found issues while validating tsconfig.json:` (no backticks).
## The fix
1. **Regenerated** `build-errors.js` and `build-warnings.js` by actually running `node scripts/process-messages/index.js` (with `@sveltejs/message-box` installed), so the generated output now matches the `.md` sources byte-for-byte instead of being hand-edited.
2. **Updated the affected spec assertions** in `config/index.spec.js` and `write_tsconfig/index.spec.js` to include the new backticks, following each message's exact backtick placement from the `.md` diff (e.g. keypath is backticked in `config_expected_one_of` but the `%options%` list is not; in `config_extension_missing_dot` the keypath is *not* backticked but the `'.'`/extension are).
### Verification
- `npx vitest run src/core/config/index.spec.js` → **49/49 pass** (previously these assertions would break against regenerated code).
- `write_tsconfig/index.spec.js` has 3 failing tests, but these are **pre-existing environmental failures** (`warn` is called 0 times because TypeScript-based validation is skipped in this sandbox) that fail identically before and after this change — unrelated to the backtick sync.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: elliott-with-the-longest-name-on-github <hello+github@ell.iott.dev>
Rich-Harris
pushed a commit
that referenced
this pull request
Oct 1, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to version-3, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `version-3` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `version-3`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @sveltejs/kit@3.0.0-next.32 ### Patch Changes - fix: prevent non-redirect enhanced form results from navigating to another origin ([`91aae35`](91aae35)) - fix: escape cache-control headers in prerendered HTML ([`d9d55b5`](d9d55b5)) - fix: revert route metadata caching to regenerate missing root-route types during sync ([#17281](#17281)) - fix: print `builder.log.warn` messages to stderr, as documented ([#17253](#17253)) - fix: prevent path traversal when previewing prerendered pages and data on Windows ([`538edbf`](538edbf)) - chore: standardize remote-function and shared form diagnostics ([#17277](#17277)) - fix: prevent server-side self-fetch fallbacks from following redirects ([`b11bb87`](b11bb87)) - chore: standardize app template diagnostics ([#17250](#17250)) - chore: standardize Vite plugin, build, prerender and adapter diagnostics ([#17253](#17253)) - chore: standardize client navigation, preload, snapshot and enhancement diagnostics ([#17276](#17276)) - chore: standardize configuration, environment and tsconfig diagnostics ([#17251](#17251)) - chore: standardize public API, `$app/*` and deprecated module diagnostics ([#17265](#17265)) - chore: standardize route discovery, parameter and route export diagnostics ([#17252](#17252)) - chore: standardize server request, hook and page diagnostics ([#17275](#17275)) - fix: report tsconfig parse errors on Windows ([#17251](#17251)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Moves config validation, src/env, and tsconfig diagnostics to the
@sveltejs/message-box-generated catalog, creating:build-warningscategorybuild-errors, allowingcause,stackless, andlocationto be providedesm-envtrickery to remove the longer messages in some environmentsSmall bonus,
core/config/options.jsbecame a whole lot shorter because the prose is now in markdown.Stack created with GitHub Stacks CLI • Give Feedback 💬