-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[babel 8] Publish .d.ts
files for every package
#16416
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9a7ee04
[babel 8] Publish .d.ts for every package
nicolo-ribaudo 7bbfebb
Export `File` from `@babel/parser` to use in `@babel/core`
nicolo-ribaudo 75a33c7
Update on top of new type checking infrastructure
nicolo-ribaudo cc180e6
Validate bundled .d.ts files
nicolo-ribaudo 124b483
Add some missing type deps
nicolo-ribaudo 3269404
Fix flag
nicolo-ribaudo 434948b
Remove old types from parser's exports
nicolo-ribaudo 7667d96
Export `Expression` type from `@babel/parser`
nicolo-ribaudo 816aa05
Use top-evel Babel deps to build `babel-helpers`
nicolo-ribaudo f7ca32a
Suppress TS error
nicolo-ribaudo db06fca
Update babel-parser/typings/babel-parser.d.ts
nicolo-ribaudo 35b99d8
Use ts-ignore
nicolo-ribaudo 9d71c9a
Improve comment
nicolo-ribaudo 1270dd2
Workaround rollup-plugin-dts bug
nicolo-ribaudo b322f40
Help tsc find babel-core/lib/index.d.ts
nicolo-ribaudo bdda2c5
Add minimal libdom for @babel/standalone
nicolo-ribaudo bda5b92
Mark options as optional in parser types
nicolo-ribaudo f617b85
Add `exports.types` in `package.json` (yarn constraint)
nicolo-ribaudo f1e02ea
yarn constraints --fix
nicolo-ribaudo 3e86c5e
Manually `exports.types` to:
nicolo-ribaudo 967b249
Add `@babel/types` as a devdep of parser (it should be dep)
nicolo-ribaudo 4b8cb4c
Export `Options` type from preset-env
nicolo-ribaudo d4aa7cb
Export `NodePath`, `Scope` and `Visitor` types from core
nicolo-ribaudo 7a8d156
Add some missing deps
nicolo-ribaudo d2fec6f
Update lockfile
nicolo-ribaudo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.yarn/patches/rollup-plugin-dts-npm-6.1.0-6d41e665a7.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/dist/rollup-plugin-dts.mjs b/dist/rollup-plugin-dts.mjs | ||
index 4a9412285c48c37d03340a086c771f8e61fd82ac..9e7c42c4ca12ddbee7e1bdbfe19e30b1d5555bc0 100644 | ||
--- a/dist/rollup-plugin-dts.mjs | ||
+++ b/dist/rollup-plugin-dts.mjs | ||
@@ -309,6 +309,19 @@ class NamespaceFixer { | ||
} | ||
const exports = []; | ||
for (const prop of obj.properties) { | ||
+ // Rollup generates an object of getters for re-exports sometimes | ||
+ if ( | ||
+ ts.isGetAccessor(prop) && | ||
+ ts.isIdentifier(prop.name) && | ||
+ ts.isReturnStatement(prop.body.statements[0]) && | ||
+ ts.isIdentifier(prop.body.statements[0].expression) | ||
+ ) { | ||
+ exports.push({ | ||
+ exportedName: prop.name.text, | ||
+ localName: prop.body.statements[0].expression.getText() | ||
+ }); | ||
+ continue; | ||
+ } | ||
if (!ts.isPropertyAssignment(prop) || | ||
!(ts.isIdentifier(prop.name) || ts.isStringLiteral(prop.name)) || | ||
(prop.name.text !== "__proto__" && !ts.isIdentifier(prop.initializer))) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Minimal version of lib.dom.d.ts. @babel/standalone needs these types | ||
// to be defined, but we don't want to load the full lib.dom.d.ts in | ||
// tscondif.dts-bundles.json because we don't want other .d.ts files to | ||
// accidenally rely on DOM features. | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
declare interface HTMLCollectionOf<T> {} | ||
declare interface HTMLScriptElement {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
rollup-plugin-dts
currently crashes on namespace objects generated by Rollup. I will open a PR upstream.