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

docs: update requirements for generated types #12071

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

homostellaris
Copy link

@homostellaris homostellaris commented Apr 2, 2024

Clarifies that Typescript is required as a dependency for generated types to be created. When the dependency is missing they are silently omitted. This requirement may not be obvious to those who are running a vanilla JavaScript project and have not used the scaffolding script (e.g. because they migrated from an earlier version of SvelteKit).

I came across this issue because I migrated from an alpha version and spent a while scratching my head before realising why the new generated types were not working for me.


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 pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

changeset-bot bot commented Apr 2, 2024

⚠️ No Changeset found

Latest commit: 7b5bff5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@homostellaris homostellaris force-pushed the patch-1 branch 2 times, most recently from 51c80dc to b56a75c Compare April 2, 2024 19:55
@homostellaris homostellaris changed the title Update requirements for generated types docs: update requirements for generated types Apr 2, 2024
@benmccann benmccann added the documentation Improvements or additions to documentation label Apr 3, 2024
@@ -96,7 +96,7 @@ export async function load({ params, fetch }) {
}
```

> For this to work, your own `tsconfig.json` or `jsconfig.json` should extend from the generated `.svelte-kit/tsconfig.json` (where `.svelte-kit` is your [`outDir`](configuration#outdir)):
> For this to work, your own `tsconfig.json` or `jsconfig.json` should extend from the generated `.svelte-kit/tsconfig.json` (where `.svelte-kit` is your [`outDir`](configuration#outdir)) and typescript should be installed as a dependency:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> For this to work, your own `tsconfig.json` or `jsconfig.json` should extend from the generated `.svelte-kit/tsconfig.json` (where `.svelte-kit` is your [`outDir`](configuration#outdir)) and typescript should be installed as a dependency:
> For this to work, your own `tsconfig.json` or `jsconfig.json` should extend from the generated `.svelte-kit/tsconfig.json` (where `.svelte-kit` is your [`outDir`](configuration#outdir)) and TypeScript should be installed as a dependency:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

Clarifies that Typescript is required as a
dependency for generated types to be created.
When the dependency is missing they are silently
omitted. This requirement may not be obvious to
those who are running a vanilla JavaScript project
and have not used the scaffolding script (e.g.
because they migrated from an earlier version of
SvelteKit).
@homostellaris
Copy link
Author

Is this good to go now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants