Skip to content

chore: simplify runes option#1039

Merged
jycouet merged 3 commits intomainfrom
simplify-runes-option
Apr 4, 2026
Merged

chore: simplify runes option#1039
jycouet merged 3 commits intomainfrom
simplify-runes-option

Conversation

@Rich-Harris
Copy link
Copy Markdown
Member

Description

The current runes option feels very elaborate, and makes svelte.config.js unnecessarily intimidating. I don't think we need to care about making the path relative (if you're building your app inside node_modules, then a) you're an extreme edge case and b) all that will happen is runes becomes undefined, harmlessly) or making it lowercase (if someone has a NODE_MODULES folder then they will have far more severe self-inflicted wounds than this).

We can make it a simple one-liner instead

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

🦋 Changeset detected

Latest commit: 0dd5c54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

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

@Rich-Harris
Copy link
Copy Markdown
Member Author

Gah — lint is failing because of Prettier, but if I run Prettier then the tests fail. Seems there are conflicting configs somewhere?

@GrygrFlzr
Copy link
Copy Markdown
Member

Gah — lint is failing because of Prettier, but if I run Prettier then the tests fail. Seems there are conflicting configs somewhere?

After the prettier format, the failing test is just a snapshot whose difference is formatting:

Error: Snapshot `cli > should create a new project with name 'create-only' > file "svelte.config.js" does not match snapshot 1` mismatched

 - /packages/sv/src/cli/tests/cli.ts:116:5

- Expected
+ Received

@@ -2,11 +2,11 @@

  /** @type {import('@sveltejs/kit').Config} */
  const config = {
  	compilerOptions: {
  		// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
- 		runes: ({ filename }) => filename.split(/[/\\]/).includes('node_modules') ? undefined : true
+ 		runes: ({ filename }) => (filename.split(/[/\\]/).includes('node_modules') ? undefined : true)
  	},
  	kit: {
  		// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
  		// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
  		// See https://svelte.dev/docs/kit/adapters for more information about adapters.

Should just need a snapshot update after the prettier format run.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 4, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@1039
npx https://pkg.pr.new/sv@1039
npx https://pkg.pr.new/@sveltejs/sv-utils@1039

commit: 0dd5c54

@svelte-docs-bot
Copy link
Copy Markdown

@jycouet jycouet merged commit 1c83fdf into main Apr 4, 2026
8 checks passed
@jycouet jycouet deleted the simplify-runes-option branch April 4, 2026 21:25
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants