Skip to content

create-svelte: add svelte-check for TS#1556

Merged
dummdidumm merged 3 commits intomasterfrom
add-svelte-check-to-ts-starter
May 28, 2021
Merged

create-svelte: add svelte-check for TS#1556
dummdidumm merged 3 commits intomasterfrom
add-svelte-check-to-ts-starter

Conversation

@dummdidumm
Copy link
Copy Markdown
Member

This add svelte-check along with two validate scripts to the package.json if the user selects TS. This uncovered missing type definitions for the cookie package in the default template, which are now added as well if the user selects TS.

Closes #1536 , if noone has objections to doing it this way. Alternatives:

  • add this to svelte-kit. This would add needless dependencies for those who don't want to use it, and does not bring any benefit to me as it only hides the invocation and cannot add any deeper integration
  • adjust the TS templates so that svelte-check is always invoked prior to svelte-kit. I'm slightly in favor of this, but it slows down the build a little obviously

This add svelte-check along with two validate scripts to the package.json if the user selects TS. This uncovered missing type definitions for the cookie package in the default template, which are now added as well if the user selects TS.
Comment thread packages/create-svelte/shared/+typescript/package.json Outdated
Comment thread packages/create-svelte/shared/+typescript/package.json
Copy link
Copy Markdown
Member

@ignatiusmb ignatiusmb left a comment

Choose a reason for hiding this comment

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

Really nice addition, especially for TS users

Copy link
Copy Markdown
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

lgtm. only reason I'm not merging is in case you wanted more opinions on how to setup the package.json commands first. but if you're happy with how it is then I'd say go ahead and hit the green button

@dummdidumm
Copy link
Copy Markdown
Member Author

I'll wait a little more, also because there's likely a new major version of svelte-check very soon which I'd use here then.

@dummdidumm dummdidumm merged commit 1739443 into master May 28, 2021
@dummdidumm dummdidumm deleted the add-svelte-check-to-ts-starter branch May 28, 2021 10:44
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request May 29, 2021
* 'master' of https://github.com/sveltejs/kit:
  Version Packages (next) (sveltejs#1543)
  type fixes for adapter-node and adapter-static (sveltejs#1578)
  Upgrade to Vite 2.3.3 (sveltejs#1580)
  fix: improve getRawBody parsing & handle error(s) (sveltejs#1528)
  create-svelte: add svelte-check for TS (sveltejs#1556)
  pass validated svelte config to adapters (sveltejs#1559)
  types: group related and reduce potential inconsistencies (sveltejs#1539)
  Use sveltekit tag on StackOverflow (sveltejs#1558)
  Fix create-svelte build-template script (sveltejs#1555)
  Remove err param from Polka .listen() callback (sveltejs#1550)
  bump: polka and sirv versions (sveltejs#1548)
  svelte-kit package (sveltejs#1499)
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 build swallows typescript errors

3 participants