Skip to content

fix: add @types/node to drizzle and storybook add-ons #541

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AdrianGonz97
Copy link
Member

@AdrianGonz97 AdrianGonz97 commented Apr 20, 2025

closes #509

This is an alternative to #536 and #539 where @types/node is added to devDependencies by the drizzle and storybook add-ons.

The version of @types/node is derived from the version of node from the current running process. Since @types/node only publishes types for lts versions of node, we'll need to install the nearest lts version for current releases. To do this, we'll just decrement the major number by one (and chop off the minor and patch numbers) to target the previous lts release version (note that we can detect whether a release is lts or current based on the if the major is an even or odd number, respectively)

For example: if the installed node version is 22.14.0 (lts), then ^22 will be added to the package.json. If the node version is 23.11.0 (current), then ^22 will be added instead.

Copy link

changeset-bot bot commented Apr 20, 2025

🦋 Changeset detected

Latest commit: fd2beb7

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

This PR includes changesets to release 1 package
Name Type
sv 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

Copy link

pkg-pr-new bot commented Apr 20, 2025

Open in StackBlitz

npx https://pkg.pr.new/sveltejs/cli/sv@541
npx https://pkg.pr.new/sveltejs/cli/svelte-migrate@541

commit: fd2beb7

@brettearle
Copy link

Nice work. I didn't think of the odd even check.

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.

add @types/node to npx sv create templates
2 participants