-
-
Notifications
You must be signed in to change notification settings - Fork 73
feat: adds sveltekit-adapter add-on
#346
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
Conversation
🦋 Changeset detectedLatest commit: 6dfdaf0 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 |
commit: |
|
preview: https://svelte-dev-git-preview-cli-346-svelte.vercel.app/ this is an automated message |
manuel3108
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the command from the PR description fails npm sv add --sveltekit-adapter static:
Log
file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:4317
throw new ValiError(dataset.issues);
^
ValiError: Invalid type: Expected never but received Array
at parse (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:4317:11)
at Command.<anonymous> (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:11458:19)
at Command.listener [as _actionHandler] (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:1798:17)
at file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2758:14
at Command._chainOrCall (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2642:12)
at Command._parseCommand (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2757:27)
at file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2521:27
at Command._chainOrCall (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2642:12)
at Command._dispatchSubcommand (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2517:25)
at Command._parseCommand (file:///D:/dev/web/svelte-cli/packages/cli/dist/bin.js:2713:19) {
issues: [
{
kind: 'schema',
type: 'strict_object',
input: [ 'static' ],
expected: 'never',
received: 'Array',
message: 'Invalid type: Expected never but received Array',
requirement: undefined,
path: [
{
type: 'object',
origin: 'value',
input: {
cwd: 'D:\\dev\\web\\svelte-cli',
install: true,
preconditions: true,
sveltekitAdapter: [Array]
},
key: 'sveltekitAdapter',
value: [ 'static' ]
}
],
issues: undefined,
lang: undefined,
abortEarly: undefined,
abortPipeEarly: undefined
}
]
I was thinking that we might need to add it here, but was unable to make it work (also unsure if this will work while using the alias, we might need to initialize valibot dynamically):
cli/packages/cli/commands/add/index.ts
Lines 26 to 31 in 651c008
| const AddonOptionFlagsSchema = v.object({ | |
| tailwindcss: v.optional(v.array(v.string())), | |
| drizzle: v.optional(v.array(v.string())), | |
| lucia: v.optional(v.array(v.string())), | |
| paraglide: v.optional(v.array(v.string())) | |
| }); |
Also some we have the single vs. double quotes problem again, I think we already solved this somewhere else, but I don't remember where and how.

This still seems to be present, but looking at the code, no clue how this is happening and if this is fixable. For whatever reason the following command is installing the Also, it looks like there is an inconsistency with the aliases: pnpm sv add sveltekit-adapter --cwd ../svelte-cli-temp # works
pnpm sv add adapter --cwd ../svelte-cli-temp # works
pnpm sv add --sveltekit-adapter --cwd ../svelte-cli-temp # works
pnpm sv add --adapter --cwd ../svelte-cli-temp # error: unknown option '--adapter'The last one could be solved in a separate PR as this is assumably a broader issue |
That's the intended behavior. If you're specifying the adapter via the flag, then any unspecified add-on options will fallback to their defaults (which is
I don't think we ever discussed if aliases should also get their own option flags. At the moment, they're only useful when specifying add-ons as args (i.e. |
closes #248
sveltekit-adapterinstalls and replaces existing SvelteKit adapters.usage: