Skip to content

Conversation

kizivat
Copy link

@kizivat kizivat commented Sep 8, 2025

This should resolve #689 .

  1. solves an issue where canceling the CLI while selecting add-ons, the project is still crated
  2. it adds --add variadic option to create enabling specifying add-ons during project creation

Point 1. is solved by separating the question prompting and applying add-ons in the add script. Both are reused in the create action handler.

I'm creating this as a draft PR to receive general direction before solving // TODO:s.

Copy link

changeset-bot bot commented Sep 8, 2025

⚠️ No Changeset found

Latest commit: ebe1d46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@jycouet jycouet left a 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);
Copy link
Contributor

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');
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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)

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.

create & add in one go
2 participants