Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1cabf6

Browse files
[babel 8] Add "exports" to every package (#14013)
1 parent 2c68d03 commit d1cabf6

File tree

145 files changed

+1717
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+1717
-125
lines changed

.yarn/plugins/@yarnpkg/plugin-conditions.cjs

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,17 @@
2929
"engines": {
3030
"node": ">=6.9.0"
3131
},
32-
"author": "The Babel Team (https://babel.dev/team)"
32+
"author": "The Babel Team (https://babel.dev/team)",
33+
"conditions": {
34+
"BABEL_8_BREAKING": [
35+
null,
36+
{
37+
"exports": null
38+
}
39+
]
40+
},
41+
"exports": {
42+
".": "./lib/index.js",
43+
"./package.json": "./package.json"
44+
}
3345
}

codemods/babel-plugin-codemod-optional-catch-binding/package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,17 @@
2929
"engines": {
3030
"node": ">=6.9.0"
3131
},
32-
"author": "The Babel Team (https://babel.dev/team)"
32+
"author": "The Babel Team (https://babel.dev/team)",
33+
"conditions": {
34+
"BABEL_8_BREAKING": [
35+
null,
36+
{
37+
"exports": null
38+
}
39+
]
40+
},
41+
"exports": {
42+
".": "./lib/index.js",
43+
"./package.json": "./package.json"
44+
}
3345
}

constraints.pro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,15 @@ gen_enforced_field(WorkspaceCwd, FieldName, ExpectedValue) :-
7474
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, null, 'devDependencies') :-
7575
workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'devDependencies'),
7676
workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'dependencies').
77+
78+
% Enforces `exports` to be consistent
79+
gen_enforced_field(WorkspaceCwd, 'exports', '{ ".": "./lib/index.js", "./package.json": "./package.json" }') :-
80+
\+ workspace_field(WorkspaceCwd, 'private', true),
81+
% Exclude packages with more complex `exports`
82+
workspace_ident(WorkspaceCwd, WorkspaceIdent),
83+
WorkspaceIdent \= '@babel/eslint-parser',
84+
WorkspaceIdent \= '@babel/compat-data',
85+
WorkspaceIdent \= '@babel/plugin-transform-react-jsx', % TODO: Remove in Babel 8
86+
WorkspaceIdent \= '@babel/helper-plugin-test-runner', % TODO: Remove in Babel 8
87+
WorkspaceIdent \= '@babel/standalone',
88+
\+ atom_concat('@babel/runtime', _, WorkspaceIdent).

packages/babel-cli/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,17 @@
5050
},
5151
"engines": {
5252
"node": ">=6.9.0"
53+
},
54+
"conditions": {
55+
"BABEL_8_BREAKING": [
56+
null,
57+
{
58+
"exports": null
59+
}
60+
]
61+
},
62+
"exports": {
63+
".": "./lib/index.js",
64+
"./package.json": "./package.json"
5365
}
5466
}

packages/babel-code-frame/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,17 @@
2525
},
2626
"engines": {
2727
"node": ">=6.9.0"
28+
},
29+
"conditions": {
30+
"BABEL_8_BREAKING": [
31+
null,
32+
{
33+
"exports": null
34+
}
35+
]
36+
},
37+
"exports": {
38+
".": "./lib/index.js",
39+
"./package.json": "./package.json"
2840
}
2941
}

packages/babel-core/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,17 @@
7272
"@types/resolve": "^1.3.2",
7373
"@types/semver": "^5.4.0",
7474
"@types/source-map": "^0.5.0"
75+
},
76+
"conditions": {
77+
"BABEL_8_BREAKING": [
78+
null,
79+
{
80+
"exports": null
81+
}
82+
]
83+
},
84+
"exports": {
85+
".": "./lib/index.js",
86+
"./package.json": "./package.json"
7587
}
7688
}

packages/babel-generator/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,17 @@
3232
},
3333
"engines": {
3434
"node": ">=6.9.0"
35+
},
36+
"conditions": {
37+
"BABEL_8_BREAKING": [
38+
null,
39+
{
40+
"exports": null
41+
}
42+
]
43+
},
44+
"exports": {
45+
".": "./lib/index.js",
46+
"./package.json": "./package.json"
3547
}
3648
}

packages/babel-helper-annotate-as-pure/package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,17 @@
1919
"engines": {
2020
"node": ">=6.9.0"
2121
},
22-
"author": "The Babel Team (https://babel.dev/team)"
22+
"author": "The Babel Team (https://babel.dev/team)",
23+
"conditions": {
24+
"BABEL_8_BREAKING": [
25+
null,
26+
{
27+
"exports": null
28+
}
29+
]
30+
},
31+
"exports": {
32+
".": "./lib/index.js",
33+
"./package.json": "./package.json"
34+
}
2335
}

packages/babel-helper-builder-binary-assignment-operator-visitor/package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,17 @@
2020
"engines": {
2121
"node": ">=6.9.0"
2222
},
23-
"author": "The Babel Team (https://babel.dev/team)"
23+
"author": "The Babel Team (https://babel.dev/team)",
24+
"conditions": {
25+
"BABEL_8_BREAKING": [
26+
null,
27+
{
28+
"exports": null
29+
}
30+
]
31+
},
32+
"exports": {
33+
".": "./lib/index.js",
34+
"./package.json": "./package.json"
35+
}
2436
}

0 commit comments

Comments
 (0)