feat(create): make the npm org optional for the addon template - #1279
feat(create): make the npm org optional for the addon template#1279jycouet wants to merge 1 commit into
addon template#1279Conversation
Publishing under an org stays the recommendation, since naming the package `sv` within it enables the `sv add @my-org` shorthand, but it is no longer required. Corrects the docs, which marked `sv add my-lib` as invalid even though unscoped specifiers have always resolved. Closes #1101
|
Install the latest version of pnx https://pkg.svelte.dev/sv/c/ab075c4123cccc36fe1cb494518c0a04dc39a22d createOpen in |
🦋 Changeset detectedLatest commit: ab075c4 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 |
|
is it intentional that running ...where the org is its own directory. if not, then I wonder what we should do instead? perhaps it should just create the |
|
I'm glad that you bring this up, because I also don't know the best answer (but I remember that this topic it not that trivial) I think that we should be able to distinguish 2 things: directory & package name. But Maybe if it's starting with just thinking loud, I'm not sure |
|
We can also distinguish between an empty |
Closes #1101.
The org prompt in
sv create --template addonnow accepts an empty answer and scaffolds an unscoped package. Publishing under an org stays the recommendation, since naming the packagesvwithin it is what enables thesv add @my-orgshorthand.Also corrects the
### Package namesdocs. They markednpx sv add my-libas invalid, butsv addhas parsed unscoped specifiers since the feature shipped and has never had a scope check. Two add-ons published today under thesv-addkeyword are unscoped (sveltekit-temporal,svforge) and install fine.For context on how the docs drifted: the requirement was only ever enforced in
create(added in 618f1ad, relaxed to a prompt by #1031), while the docs stated it globally. A later docs refactor (#1161) then turned the hedged "unscoped packages are not supported yet" note into a hard✗ BAD npx sv add my-libexample, pointing at the one command that never enforced it.Note that the prompt still blocks in non-interactive runs; that is pre-existing and left alone here.