Skip to content

svelte-kit sync #4165

Closed
Closed
@Rich-Harris

Description

@Rich-Harris

Describe the problem

In #4120, we introduce generated types, which give you type safety when using params inside pages and endpoints. (In future, we want to extend that to props as well.)

One minor wrinkle is that the types aren't generated until you run svelte-kit dev or svelte-kit build, which means that if you were to (for example) typecheck in CI before building the app, it would fail.

Describe the proposed solution

It would be good to collate all the work that takes the filesystem as input (i.e. generating manifest.js, Root.svelte and now the route-level types) into a new function — let's call it sync — and expose it via the CLI as svelte-kit sync. (Open to alternative names but this one seems good enough to me.)

We could then add this to the default template as a postinstall script:

// package.json
"scripts": {
  // ...
  "postinstall": "svelte-kit sync"
}

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions