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_ONE:s.

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2025

🦋 Changeset detected

Latest commit: e66e861

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

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

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.

@jycouet
Copy link
Contributor

jycouet commented Sep 24, 2025

Hello @kizivat do you want to puch forward this PR? or should I try to bring it to the finish line ? :)
Let me know 👍

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 3, 2025

Open in StackBlitz

npx https://pkg.pr.new/sveltejs/cli/sv@695
npx https://pkg.pr.new/sveltejs/cli/svelte-migrate@695

commit: e66e861

@jycouet
Copy link
Contributor

jycouet commented Oct 26, 2025

I'm not sure why svelte.dev is not having a preview. Any idea @manuel3108 ?

@jycouet jycouet marked this pull request as ready for review October 26, 2025 15:43
Copy link
Member

@manuel3108 manuel3108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too sure about the comments, feel free to correct me if i missed anything.

Also the --install pnpm flag does not seem to be working now, probably because it detects an empty directory or something. Don't manage to understand why it stopped working though

Comment on lines +370 to 372
// add verifications and inter-addon deps

// add inter-addon dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated comment


const setups = selectedAddons.map(({ addon }) => addon);
const setupResult = setupAddons(setups, workspace)[addon.id];
workspace = virtualWorkspace || (await createWorkspace({ ...workspace }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is the right call here. Previously we createWorkspace after every run, so that if tailwind and vitest run (after each other), the vitest run should already know via the workspace that tailwind is already installed.

Or am I missing something here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not sure why that works, but that seems to work

addonSetupResults?: Record<string, AddonSetupResult>;
virtualWorkspace?: Workspace<any>;
}): Promise<{ nextSteps: string[]; packageManager?: AgentName | null }> {
let workspace = virtualWorkspace || (await createWorkspace({ cwd: options.cwd }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above? in which case would virtualWorkspace even be undefined? Couldnt we just do this check once and make sure it's not undefined later on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are 100% right!
I will refactor this later 👍

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

3 participants