Skip to content
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

add svelte-kit sync #4182

Merged
merged 7 commits into from
Mar 3, 2022
Merged

add svelte-kit sync #4182

merged 7 commits into from
Mar 3, 2022

Conversation

Rich-Harris
Copy link
Member

Closes #4165. This adds a sync module responsible for writing stuff to outDirgenerated/manifest.js, generated/root.svelte, runtime, types and tsconfig.json.

It also adds a svelte-kit sync command that runs when you first set up a new project, to ensure that types are set up and correct before you run typechecking.

I've been meaning to tidy up this corner of the codebase anyway, and this was a nice opportunity to do it.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2022

🦋 Changeset detected

Latest commit: 800476b

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

This PR includes changesets to release 2 packages
Name Type
create-svelte Patch
@sveltejs/kit 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

@benmccann
Copy link
Member

Is this command cheap enough that we can run it whenever we want to run pnpm check? Or would it be helpful to also have a svelte-kit tsconfig command that just generates that file? (#4190 (comment))

@Rich-Harris
Copy link
Member Author

For a large-ish app it takes about 100ms on my machine — it's basically free

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@Rich-Harris Rich-Harris merged commit 255e0d2 into master Mar 3, 2022
@Rich-Harris Rich-Harris deleted the gh-4165 branch March 3, 2022 20:27
@github-actions github-actions bot mentioned this pull request Mar 3, 2022
@Conduitry Conduitry mentioned this pull request Mar 4, 2022
5 tasks
indaco added a commit to sveltinio/sveltin that referenced this pull request Mar 7, 2022
With [#4182](sveltejs/kit#4182), SvelteKit added support for a new CLI command called `sync` wrapped as `prepare` script in `package.json` file
indaco added a commit to sveltinio/sveltin that referenced this pull request Mar 7, 2022
- it command wraps the new SvelteKit `sync` command, [#4182](sveltejs/kit#4182)
- package.json files updated to include the new "prepare" script
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.

svelte-kit sync
4 participants