-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use postinstall hook to run sync instead of prepare #5651
Conversation
🦋 Changeset detectedLatest commit: 2a5c4fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Looks like we'll need to do some more setup work for our own CI. If we move this to postinstall, do we still need to keep |
That's a great idea, not going through the cli script for postinstall could make this easier. Unfortunately I think we need to keep the sync command in a cli for cases where postinstall isnt run. |
Do we though? The only reason we included |
|
const cliPath = is_workspace | ||
? fileURLToPath(new URL('./src/cli.js', import.meta.url)) | ||
: '@sveltejs/kit/dist/cli.js'; | ||
await import(cliPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should work, no?
const cliPath = is_workspace | |
? fileURLToPath(new URL('./src/cli.js', import.meta.url)) | |
: '@sveltejs/kit/dist/cli.js'; | |
await import(cliPath); | |
await import( | |
fileURLToPath(new URL(`./${is_workspace ? 'src' : 'dist'}/cli.js`, import.meta.url)) | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(otherwise it complains about ./dist/cli.js
not being in pkg.exports
)
I'll be honest, I don't understand what any of the new stuff in |
merged #5760 so will close this |
fixes #4585 and possibly a few others where people had issues with missing aliases
caveat:
this currently does not invoke sync for workspace projects depending on
"@sveltejs/kit":"workspace:*"
when runningpnpm install
in kit monorepo.We could think about keeping prepare in those, but i'm uneasy doing it do avoid it masking issues with postinstall.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0