Skip to content

Commit

Permalink
chore: build corejs3-shipped-proposals.json from core-js-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Dec 26, 2019
1 parent 30f3b07 commit c742cf3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/babel-preset-env/data/corejs3-shipped-proposals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"esnext.global-this",
"esnext.promise.all-settled",
"esnext.string.match-all"
]
2 changes: 1 addition & 1 deletion packages/babel-preset-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env",
"main": "lib/index.js",
"scripts": {
"build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js"
"build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js; node ./scripts/build-corejs-shipped-proposals.js"
},
"dependencies": {
"@babel/helper-module-imports": "^7.7.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const data = require("core-js-compat/data.json");
const fs = require("fs");
const path = require("path");

const shippedProposals = Object.keys(data).filter(feature => {
return feature.startsWith("esnext.") && Object.keys(data[feature]).length > 0;
});

const dataPath = path.join(__dirname, "../data/corejs3-shipped-proposals.json");

fs.writeFileSync(
dataPath,
JSON.stringify(shippedProposals, undefined, 2) + "\n"
);

This file was deleted.

0 comments on commit c742cf3

Please sign in to comment.