* chore: build corejs3-proposals.json from core-js-compat * fix: include finished proposals by default * update test fixtures * update test fixtures * chore: rename scripts * fix: add standarized entries for finished proposals * refactor: remove unused finished proposals json * revert test fixtures update * test against corejs 3.6 * fix: move corejs builtin definitions to babel/compat-data
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const data = require("core-js-compat/data.json");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const features = Object.keys(data);
|
|
|
|
const shippedProposals = features.filter(feature => {
|
|
return feature.startsWith("esnext.") && Object.keys(data[feature]).length > 0;
|
|
});
|
|
|
|
fs.writeFileSync(
|
|
path.join(__dirname, "../data/corejs3-shipped-proposals.json"),
|
|
JSON.stringify(shippedProposals, undefined, 2) + "\n"
|
|
);
|
|
|
|
const finishedProposals = shippedProposals.filter(feature => {
|
|
return features.includes(feature.replace("esnext.", "es."));
|
|
});
|
|
|
|
const builtInDefinitionsPath = path.join(
|
|
__dirname,
|
|
"../../babel-preset-env/src/polyfills/corejs3/built-in-definitions.js"
|
|
);
|
|
|
|
const builtInDefinitions = fs.readFileSync(builtInDefinitionsPath, "utf-8");
|
|
|
|
for (const feature of finishedProposals) {
|
|
const standarizedName = feature.replace("esnext.", "es.");
|
|
if (!builtInDefinitions.includes(standarizedName)) {
|
|
console.log(
|
|
`${feature} is now standarized as ${standarizedName}, please add "${standarizedName}" to "${builtInDefinitionsPath}"`
|
|
);
|
|
}
|
|
}
|