-
-
Notifications
You must be signed in to change notification settings - Fork 105
fix(experimental): create manages #lib and the rest of the SvelteKit 3 shape
#1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f735bde
feat(sv-utils): add SvelteKit 3 helpers
jycouet 62f311d
fix(core): make `runsAfter` actually order add-ons
jycouet f5398b6
fix(experimental): create manages `#lib` and the rest of the SvelteKi…
jycouet 99c8e6b
test(cli): cover `kit@next` with a real install, build and check
jycouet dfda94d
Update packages/sv/src/addons/drizzle.ts
jycouet 585dd42
Update packages/sv-utils/src/kit3.ts
jycouet 5db6d87
test(cli): cover better-auth on `kit@next`, finish the `KIT3_TSCONFIG…
jycouet 896505a
test(cli): pin the `kit@next` prereleases the experimental cases run …
jycouet 61a9754
test(cli): drop the better-auth `kit@next` case
jycouet 8c3d8c9
chore: fix indentation
jycouet f643e41
test(cli): let the generated project install a fresh prerelease
jycouet 92b6943
test(cli): track the `next` tag instead of a pinned prerelease
jycouet c7fa72b
chore: trim the changesets to one line each
jycouet 99332a5
chore: changeset wording
jycouet fdf6531
Merge remote-tracking branch 'origin/main' into fix/experimental-kit3…
jycouet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'sv': patch | ||
| --- | ||
|
|
||
| fix(experimental): `@sveltejs/kit@next` projects now install, build and type-check - `#lib` imports instead of `$lib`, a `tsconfig` extending `$app/tsconfig`, and no options kit 3 removed |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@sveltejs/sv-utils': patch | ||
| --- | ||
|
|
||
| feat: add SvelteKit 3 helpers - `isKit3`, `resolveLibPrefix`, `libSubpathImports` |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { coerceVersion } from './semver.ts'; | ||
|
|
||
| /** Whether a `@sveltejs/kit` range resolves to v3+, including the `next` dist-tag. */ | ||
| export function isKit3(kitRange: string | undefined): boolean { | ||
| if (!kitRange) return false; | ||
| if (kitRange === 'next') return true; | ||
| const { major } = coerceVersion(kitRange); | ||
| return major !== undefined && major >= 3; | ||
| } | ||
|
|
||
| /** The prefix for `src/lib` imports. Kit 3 dropped the built-in `$lib` alias for `#lib` subpath imports. */ | ||
| export function resolveLibPrefix(kitRange: string | undefined): '#lib' | '$lib' { | ||
|
jycouet marked this conversation as resolved.
|
||
| return isKit3(kitRange) ? '#lib' : '$lib'; | ||
| } | ||
|
|
||
| /** The `package.json#imports` entries backing `#lib`. `libDir` is workspace-relative, e.g. `src/lib`. */ | ||
| export function libSubpathImports(libDir: string): Record<string, string> { | ||
| return { '#lib': `./${libDir}/index.js`, '#lib/*': `./${libDir}/*` }; | ||
| } | ||
|
|
||
| /** The config kit 3 generates into `node_modules`, replacing `.svelte-kit/tsconfig.json`. */ | ||
| export const KIT3_TSCONFIG = '$app/tsconfig'; | ||
|
|
||
| /** | ||
| * Options `$app/tsconfig` already sets. A local copy of the same value is noise, but a different | ||
| * value is a deliberate override and must stay - so only drop keys whose value matches. | ||
| */ | ||
| export const KIT3_TSCONFIG_DEFAULT: Record<string, unknown> = { | ||
| allowImportingTsExtensions: true, | ||
| allowJs: true, | ||
| checkJs: true, | ||
| esModuleInterop: true, | ||
| forceConsistentCasingInFileNames: true, | ||
| isolatedModules: true, | ||
| module: 'esnext', | ||
| moduleDetection: 'force', | ||
| moduleResolution: 'bundler', | ||
| noEmit: true, | ||
| resolveJsonModule: true, | ||
| skipLibCheck: true, | ||
| target: 'esnext', | ||
| verbatimModuleSyntax: true | ||
| }; | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.