forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract targets parser and compat data from preset-env (babel#10899)
* Extract targets parser and compat data from preset-env * Review by Jùnliàng * isItemRequired -> targetsSupported * Export isRequired
- Loading branch information
1 parent
5f807ae
commit 04354d1
Showing
59 changed files
with
936 additions
and
707 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package.json | ||
packages/babel-preset-env/data | ||
packages/babel-compat-data/data | ||
packages/babel-compat-data/scripts/data/overlapping-plugins.js | ||
packages/*/test/fixtures/**/input.* | ||
packages/*/test/fixtures/**/exec.* | ||
packages/*/test/fixtures/**/output.* |
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,4 @@ | ||
scripts | ||
src | ||
test | ||
*.log |
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,4 @@ | ||
// Node < 13.3 doesn't support export maps in package.json. | ||
// Use this proxy file as a fallback. | ||
|
||
module.exports = require("./data/corejs2-built-ins.json"); |
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,12 @@ | ||
{ | ||
"es6.module": { | ||
"edge": "16", | ||
"firefox": "60", | ||
"chrome": "61", | ||
"safari": "10.1", | ||
"opera": "48", | ||
"ios_saf": "10.3", | ||
"and_chr": "74", | ||
"and_ff": "66" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
{ | ||
"transform-regenerator": [] | ||
} |
File renamed without changes.
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,4 @@ | ||
// Node < 13.3 doesn't support export maps in package.json. | ||
// Use this proxy file as a fallback. | ||
|
||
module.exports = require("./data/native-modules.json"); |
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,4 @@ | ||
// Node < 13.3 doesn't support export maps in package.json. | ||
// Use this proxy file as a fallback. | ||
|
||
module.exports = require("./data/overlapping-plugins.json"); |
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,36 @@ | ||
{ | ||
"name": "@babel/compat-data", | ||
"version": "0.0.0", | ||
"author": "The Babel Team (https://babeljs.io/team)", | ||
"license": "MIT", | ||
"description": "", | ||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-compat-data", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"exports": { | ||
"./plugins": "./data/plugins.json", | ||
"./native-modules": "./data/native-modules.json", | ||
"./corejs2-built-ins": "./data/corejs2-built-ins.json", | ||
"./overlapping-plugins": "./data/overlapping-plugins.json" | ||
}, | ||
"scripts": { | ||
"build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js; node ./scripts/build-overlapping-plugins.js" | ||
}, | ||
"keywords": [ | ||
"babel", | ||
"compat-table", | ||
"compat-data" | ||
], | ||
"dependencies": { | ||
"browserslist": "^4.8.2", | ||
"invariant": "^2.2.4", | ||
"semver": "^7.1.1" | ||
}, | ||
"devDependencies": { | ||
"caniuse-db": "1.0.30000969", | ||
"electron-to-chromium": "1.3.113", | ||
"lodash": "^4.17.15", | ||
"@babel/helper-compilation-targets": "^0.0.0" | ||
} | ||
} |
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,4 @@ | ||
// Node < 13.3 doesn't support export maps in package.json. | ||
// Use this proxy file as a fallback. | ||
|
||
module.exports = require("./data/plugins.json"); |
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
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
packages/babel-compat-data/scripts/build-overlapping-plugins.js
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,15 @@ | ||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
const overlappingPlugins = require("./data/overlapping-plugins"); | ||
|
||
fs.writeFileSync( | ||
__dirname + "/../data/overlapping-plugins.json", | ||
JSON.stringify(overlappingPlugins, replacer, 2) | ||
); | ||
|
||
function replacer(key, val) { | ||
if (val instanceof Set) return Array.from(val); | ||
if (val instanceof Map) return Object.fromEntries(val); | ||
return val; | ||
} |
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
File renamed without changes.
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,3 @@ | ||
src | ||
test | ||
*.log |
Oops, something went wrong.