-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: add create
and add
commands
#16
Conversation
commit: |
I'm still not convinced this is necessary. We already have the prompt that will ask you to override files if we detect some files (as a last resort). Accidentally creating a project in a wrong directory after specifying a path, shouldn't be a problem we should care about in my opinion.
valid point. Another option would As for the advanced mode, I see your point. I was thinking like this: If we have
Nope, it's not. Even if i'm outside of the mono-repo: Output
As far as i remember, the plan was to only really publish |
create
and add
commandscreate
and add
commands
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.
LGTM, there is just one minor bug i think.
pnpx https://pkg.pr.new/sveltejs/cli/sv@16 add --drizzle=postgresql,neon
Based on the PR description this should work, but I'm getting this output:
Invalid '--drizzle' option: 'postgresql neon'
Available options: postgresql, mysql, sqlite, postgres.js, neon, mysql2, planetscale, better-sqlite3, libsql, turso, docker, no-docker
Further we might be able to clarify the help screen:
--drizzle <options...> (choices: postgresql, mysql, sqlite, postgres.js, neon, mysql2, planetscale, better-sqlite3, libsql, turso, docker,
no-docker)
I would suggest something like this (rough idea):
--drizzle <options...> (choices:
database: postgresql, mysql, sqlite,
provider: postgres.js, neon, mysql2, planetscale, better-sqlite3, libsql, turso,
docker: docker, no-docker)
This will make it more clear which options can / should be combined together. Users might try adding postgresql,mysql,sqlite
at the same time otherwise.
From this point on, feel free to merge anytime.
something like this would be ideal, yeah. however it would require rethinking how the drizzle adder works with it's options given that the options are not sorted in this way. in its current state, we would have to apply special logic just for drizzle to achieve this |
You are right, did not think about that. Let's leave it like this for now, we can always explore this at a later stage, when we have merged all other relevant adders (lucia, supabase, etc) |
this PR is a chunky one that contains several necessary architectural changes to
core
due to how interwoven it was to the previous cliChanges
create
andadd
sv create [path]
sv add [adder...]
default
template (which is the sverdle demo template) todemo
core
such that only the bare essentials are left:cli
(cli parsing, prompting, etc), while any adder specific functionality, such as definitions, file processing and tooling, remain incore
postconditions
,installHooks
, anduninstallHooks
.cli
:prompts
wrapper since it didn't provide much value besides being another layer of abstractioncreate
andinstallAdders
)config
directly intoadders
since they are so closely related and to better ensure that imports and categories are updated simultaneously when new adders are createdTODOs before merging
we've settled on using the following format for now until we find a nicer syntax down the line:
here's how the choices will be printed:
here are a few adder flag options that we've discussed: