Skip to content
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

fix: Babel 8 types #15109

Merged
merged 6 commits into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions constraints.pro
Expand Up @@ -85,6 +85,7 @@ gen_enforced_field(WorkspaceCwd, 'exports', '{ ".": "./lib/index.js", "./package
WorkspaceIdent \= '@babel/parser',
WorkspaceIdent \= '@babel/plugin-transform-react-jsx', % TODO: Remove in Babel 8
WorkspaceIdent \= '@babel/standalone',
WorkspaceIdent \= '@babel/types', % @babel/types has types exports
\+ atom_concat('@babel/eslint-', _, WorkspaceIdent),
\+ atom_concat('@babel/runtime', _, WorkspaceIdent).

Expand Down
4 changes: 3 additions & 1 deletion packages/babel-parser/package.json
Expand Up @@ -27,7 +27,7 @@
"files": [
"bin",
"lib",
"typings",
"typings/babel-parser.d.ts",
"index.cjs"
],
"engines": {
Expand All @@ -54,6 +54,7 @@
"type": "module",
"exports": {
".": {
"types": "./typings/babel-parser.d.ts",
"require": "./lib/index.cjs",
"default": "./lib/index.js"
},
Expand All @@ -65,6 +66,7 @@
},
"exports": {
".": {
"types": "./typings/babel-parser.d.ts",
"require": "./index.cjs",
"default": "./lib/index.js"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-types/package.json
Expand Up @@ -52,7 +52,11 @@
]
},
"exports": {
".": "./lib/index.js",
".": {
"types@>=3.7": "./lib/index.d.ts",
Copy link
Member Author

Choose a reason for hiding this comment

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

"types": "./lib/index-legacy.d.ts",
"default": "./lib/index.js"
},
"./package.json": "./package.json"
},
"type": "commonjs"
Expand Down
3 changes: 3 additions & 0 deletions scripts/integration-tests/e2e-prettier.sh
Expand Up @@ -36,6 +36,9 @@ startLocalRegistry "$root"/verdaccio-config.yml
yarn install --no-immutable
yarn info

# Test typings for @babel/parser
yarn lint:typecheck

# https://github.com/babel/babel/pull/14892#issuecomment-1233180626
echo "export default () => () => {}" > src/main/create-print-pre-check-function.js

Expand Down