- 
                Notifications
    You must be signed in to change notification settings 
- Fork 106
Add scripts that modify the package.json before publishing #275
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
Conversation
In order to get TS types working correctly for "Node16" and "NodeNext"
| 🦋 Changeset detectedLatest commit: 9017f71 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
 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 | 
| The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
 | 
| Lgtm. It was published as  ❯ pnpm typecheck
> [email protected] typecheck /home/projects/ladle-tk5xtu
> tsc --noEmit
src/controls.stories.tsx:1:28 - error TS1471: Module '@ladle/react' cannot
be imported using this construct. The specifier only resolves to an ES
module, which cannot be imported synchronously. Use dynamic import instead.
1 import type { Story } from '@ladle/react';Is this really expected? | 
| Ugh, ok, yeah, this is an annoying one. Since  This is a frustrating situation, and there are potentially several soloutions: 
 "exports": {
  ".": {
      "types": {
          "import": "./lib/app/exports.d.ts",
          "require": "./lib/app/exports.d.cts"
      },
      "default": "./lib/app/exports.ts"
  }
}(cross reference this issue in the TS repo for some similar discussions) I think that would work, but would need to test it to be sure. I did do something fairly similar in my own library and it works, but it's just different enough that I would want to test it first to be sure. Ugh | 
| Just tested out option 4 above and it looks like it would work. I can make another PR to update things if that's the direction you want to go. | 
| Appreciate your thoroughness! Yea, I think let's go with the option 4 if there's no other side-effect. | 
In order to get TS types working correctly for "Node16" and "NodeNext"
Closes #267
For normal npm versions:
release.shto runupdate-package-types.js, whichbackup-package.json, and thenpackage.json, and thenpackage.jsonfrombackup-package.jsonand deletes the backup-package.json.😓
For
nextnpm versions, it was a bit easier since there was already a NodeJS script modifying package.json, so I just hooked into it to make those changes and made sure the npm script was executed.I'm very open to changing any and all of this if you think there's something that needs to be changed. 👍