Skip to content

Commit

Permalink
fix: Babel 8 types (#15109)
Browse files Browse the repository at this point in the history
* test

* fix babel8 types

* ignore

* fix constraints

* order

* fix
  • Loading branch information
liuxingbaoyu committed Nov 11, 2022
1 parent dafa8bd commit 5fde28b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
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",
"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

0 comments on commit 5fde28b

Please sign in to comment.