Repository navigation
Conversation
|
Install the latest version of pnx https://pkg.svelte.dev/sv/c/cdf5b97d30801144fcec6b82ad3c2a94416e00f0 createOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: cdf5b97 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 |
|
Hi, this is my first attempt to contribute to the project. I followed what was done for I miss some things though: for instance I could not run the branch locally to see if the generated project output was correct. I also do not know if I should regenerate the snapshots or the changeset. Any guidance is welcome! Cheers! |
|
As an aside, I didn't want to fix it cause the whole create logic should be rewritten which would make this a no brainer fix. |
Thanks for helping out!
What exactly was not working? Im pretty sure we are just missing something Snapshots should indeed be regenerated. Also a changeset is required here, since this is a public facing change, otherwise no new release will be triggered. |
## Build and run
To build the project and all packages. Run the 'build' script:
```sh
# from root of project
pnpm build
```
This outputs into /packages/PACKAGE/dist/.
Run the 'cli' package:
```sh
pnpm sv
pnpm sv create
pnpm sv add
pnpm sv migrate
pnpm sv check
pnpm sv help
```So I thought I should buid the project locally and run [ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL] Command "sv" not found |
|
Also, when I try to regenerate the snapshots, using this (taken from the pnpm build && pnpm test --project cli --update allI receive this output and it runs forever: $ vitest run --silent --project cli --update all
RUN v4.1.8 /home/calou/dev/@sveltejs/cli
│
■ The --tasks values all and prerequisite cannot be combined with other tasks.
│
└ Operation failed.
│
■ The --tasks values all and prerequisite cannot be combined with other tasks.
│
└ Operation failed.
│
■ Unknown migration task: missing
│ Available tasks: svelte-config, env-vars
│
└ Operation failed.
✓ cli tests/migrate.ts (13 tests) 19ms
❯ cli tests/cli.ts 2/5
Test Files 1 passed (2)
Tests 15 passed (18)
Start at 14:55:24
Duration 138.01s |
|
That's a visual bug. I fixed it in the other PR. |
This should work. What version of pnpm are you on and what folder did you run it in. Should be pnpm 11 and root respectively. |
|
run at the root of the project: pnpm --versiongives (I removed the warning about But anywhere else on my machine: pnpm --versionyields 12.4.2 |
|
TBH, I never use Maybe we should tweak this in the readme? WDYT? |
|
I think pnpm 11 works a lot better so I rather triage the problem. |
Hi Scott, Do you mean in this case everything should happen in I tried to follow the approach for As I stated in my comment, I would rather have the |
Yes, keep it private.
You can write to the same file multiple times. We do it all the time in this codebase. |
be05ed9 to
ad3bd63
Compare
b0bf634 to
1832a9e
Compare
|
I wanted to add one test for { projectName: 'create-pnpm', args: ['--no-add-ons', '--install pnpm'] }as my understanding is that we set the package manager throught the Is there another way to set the package manager for a create command without installing dependencies ? If not, that would be nice to be able to select a package manager on its own and still be able not to install dependencies. |
|
I'd like that too, im not sure how to current behaviour works. Can you look around and test it out. At the very least, we can document this. |
|
I'll have a look. In the meantime, maybe we could try to hijack the install step while in testing, running dry runs to avoid actually installing dependencies on disk. Not sure if viable and/or wanted and/or feasible. |
|
I looked into the testing process for the cli and I do not think that covering this PR is possible as it is unfortunately. |
|
Ok, just summarize your findings and remove the draft status. |
ref sveltejs#1341 - followed the same approach as `allowBuilds`
Co-authored-by: Scott Wu <sw@scottwu.ca>
e058ed6 to
8cf1fdd
Compare
find.up() can walk past the project and edit e.g. ~/.npmrc or a parent workspace. A fresh scaffold owns its root, so path.join(cwd, ...) is enough.
A function that returns a transform and is called right away adds a layer without adding meaning. `transforms.x(fn)(content)` reads top to bottom.
upsert already skips `key=` when present. The includes() check was redundant and would also match a commented-out line.
addEngineStrict already branches on the package manager, so the helpers don't need to re-check it. Only the entry point is used outside this file.
The same 3 lines appeared in every helper. One place to get it right, and each helper now only says *which* file and *what* change.
The JSDoc restated the function names. The one useful fact is why pnpm gets a different file, so that's the comment that stays.
Users care about the result (which file gets the setting), not that .npmrc is now written by code instead of copied from the template.
Code inprovements in general and making the approach centralized and better organized.
|
|
|
Yes, and it was removed here |
Closes #1341
Description
Following the
allowBuildsapproach, we add theengineStrictconfig to thepnpm-workspace.ymlif it is not already set.Checklist