Skip to content

Commit 5fde28b

Browse files
authored
fix: Babel 8 types (#15109)
* test * fix babel8 types * ignore * fix constraints * order * fix
1 parent dafa8bd commit 5fde28b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

constraints.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ gen_enforced_field(WorkspaceCwd, 'exports', '{ ".": "./lib/index.js", "./package
8585
WorkspaceIdent \= '@babel/parser',
8686
WorkspaceIdent \= '@babel/plugin-transform-react-jsx', % TODO: Remove in Babel 8
8787
WorkspaceIdent \= '@babel/standalone',
88+
WorkspaceIdent \= '@babel/types', % @babel/types has types exports
8889
\+ atom_concat('@babel/eslint-', _, WorkspaceIdent),
8990
\+ atom_concat('@babel/runtime', _, WorkspaceIdent).
9091

packages/babel-parser/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"files": [
2828
"bin",
2929
"lib",
30-
"typings",
30+
"typings/babel-parser.d.ts",
3131
"index.cjs"
3232
],
3333
"engines": {
@@ -54,6 +54,7 @@
5454
"type": "module",
5555
"exports": {
5656
".": {
57+
"types": "./typings/babel-parser.d.ts",
5758
"require": "./lib/index.cjs",
5859
"default": "./lib/index.js"
5960
},
@@ -65,6 +66,7 @@
6566
},
6667
"exports": {
6768
".": {
69+
"types": "./typings/babel-parser.d.ts",
6870
"require": "./index.cjs",
6971
"default": "./lib/index.js"
7072
},

packages/babel-types/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@
5252
]
5353
},
5454
"exports": {
55-
".": "./lib/index.js",
55+
".": {
56+
"types@>=3.7": "./lib/index.d.ts",
57+
"types": "./lib/index-legacy.d.ts",
58+
"default": "./lib/index.js"
59+
},
5660
"./package.json": "./package.json"
5761
},
5862
"type": "commonjs"

scripts/integration-tests/e2e-prettier.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ startLocalRegistry "$root"/verdaccio-config.yml
3636
yarn install --no-immutable
3737
yarn info
3838

39+
# Test typings for @babel/parser
40+
yarn lint:typecheck
41+
3942
# https://github.com/babel/babel/pull/14892#issuecomment-1233180626
4043
echo "export default () => () => {}" > src/main/create-print-pre-check-function.js
4144

0 commit comments

Comments
 (0)