-
-
Notifications
You must be signed in to change notification settings - Fork 56
feat(cli): Create & add one go #695
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
base: main
Are you sure you want to change the base?
Conversation
|
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.
Thank you for the initial work.
Let's speak over the different comments.
.addOption(installOption) | ||
.configureHelp(common.helpConfig) | ||
.action((projectPath, opts) => { | ||
console.log(opts); |
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.
As it's draft
it's OK, but be careful to remove it later (Maybe add a TODO David
so that you know ;) )
const templateOption = new Option('--template <type>', 'template to scaffold').choices( | ||
templateChoices | ||
); | ||
const noAddonsOption = new Option('--no-add-ons', 'do not prompt to add add-ons').conflicts('add'); |
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.
TIL conflicts
! That's nice.
So we get: error: option '--no-add-ons' cannot be used with option '--add <addon...>'
directly.
I'm wondering if the message could happen after Welcome to the Svelte CLI! (v0.9.4)
(just nice to have, if it exist, but not a MUST)
...selectedCommunityAddons.map((addon) => ({ type: 'community' as const, addon })) | ||
]; | ||
|
||
// TODO: run setup if we have access to workspace |
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.
I think I understand better your question, and #689 (comment) would be still valid :)
What matters is only unsupported(
I guess.
Thinking out loud...
setup
step is maybe a bit too wild: it's doing:runsAfter
,unsupported
,dependsOn
- in
create
we can probably assume stuff... eg: Lucia needs drizzle... So if you pick Lucia, you need to get dizzle as well... No need to check if you have drizzle deps as we are in create. - today create only creates kit projects (so all unsupported kit are out)
Maybe we can create a "virtual workspace", not with files, just "we know this, we know that". No ?!
And/Or not only have setup
, but also another level before: requirements
? That could built the virtual workspace?
I'm not sure what's the best way to do.
process.exit(1); | ||
} | ||
} | ||
// TODO: add verifications and inter-addon deps |
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.
Same as above, what do we do with workspace that is not here yet.
|
||
const official: AddonOption = {}; | ||
const community: AddonOption = {}; | ||
const answersOfficial: Record<string, OptionValues<any>> = selectedOfficialAddons |
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.
Didn't go too much into this, but renaming official
to answersOfficial
add some overhead in the diff. (maybe you can add a todo and keep official
at first)
This should resolve #689 .
--add
variadic option tocreate
enabling specifying add-ons during project creationPoint 1. is solved by separating the question prompting and applying add-ons in the
add
script. Both are reused in thecreate
action handler.I'm creating this as a draft PR to receive general direction before solving
// TODO:
s.