Conversation
|
Install the latest version of pnx https://pkg.svelte.dev/sv/c/b0bf634c2084b7aea2783128a3ad396422de0f7f 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: b0bf634 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. |
ref sveltejs#1341 - followed the same approach as `allowBuilds`
be05ed9 to
ad3bd63
Compare
| export function writeEngineStrict(): TransformFn { | ||
| return transforms.yaml(({ data }) => { | ||
| const existing = data.get('engineStrict'); | ||
| // if not set, set to true |
There was a problem hiding this comment.
| // if not set, set to true |
|
|
||
| /** | ||
| * Returns a TransformFn for `pnpm-workspace.yaml` that adds `engineStrict` config | ||
| * if not defined already | ||
| */ | ||
| export function engineStrict(): TransformFn { | ||
| return writeEngineStrict(); | ||
| } |
| packageManager: AgentName | null | undefined; | ||
| }): void { | ||
| const { cwd, packageManager } = options; | ||
| if (packageManager !== 'pnpm') return; |
There was a problem hiding this comment.
remove the config from .npmrc
There was a problem hiding this comment.
If I understand correctly, .npmrc files are present in templates and only contain engine-strict=true.
Maybe we can remove the .npmrc completely when the package manager is pnpm ? @see https://pnpm.io/blog/releases/11.0#npmrc-is-authregistry-only
There was a problem hiding this comment.
That is fine. Something along the lines of: remove prop, if file is empty, delete file. In case we add other props in the future.
Co-authored-by: Scott Wu <sw@scottwu.ca>
Closes #1341
Description
Following the
allowBuildsapproach, we add theengineStrictconfig to thepnpm-workspace.ymlif it is not already set.Checklist