-
Notifications
You must be signed in to change notification settings - Fork 363
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
feat: Expands generateTypes flag to support TS entries #865
Conversation
🦋 Changeset detectedLatest commit: 2677748 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -2728,9 +2728,10 @@ ts-custom-declaration | |||
index.js.map | |||
index.umd.js | |||
index.umd.js.map | |||
node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix CI
node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicked "Commit suggestion" too fast there. What was not working w/ the CI? Seemed to be passing w/out any issues?
When rpt2 is used, it creates some cache files in node_modules
. As this test now uses a TS entry point, rpt2 will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just the one nit about node_modules
in the snapshot
d707d35
to
2677748
Compare
What kind of change does this PR introduce?
Feature, expands the
--generateTypes
flag to also support projects with TS entry points.Did you add tests for your changes?
Modified an existing test
Summary
Closes #863
The problem with the existing
--generateTypes
behavior is that it is only relevant when used with JS entry points.emitDeclaration
is derived fromoptions.generateTypes
and is only used in the following spot:microbundle/src/index.js
Line 510 in b1a6374
Which means that when
useTypescript
is truthy, that option holds no power whatsoever.useTypescript
would be truthy on any project that had TS entry points:microbundle/src/index.js
Line 387 in b1a6374
To allow projects with TS entry points to disable types from being output, we now simply disable TS's
declaration
compiler option ifoptions.generateTypes
is set to false.Does this PR introduce a breaking change?
No