Skip to content

Commit 13f7208

Browse files
committed
build /stage/ entries
1 parent 1722365 commit 13f7208

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

scripts/build-entries/index.mjs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ import { modules as AllModules } from '@core-js/compat/src/data.mjs';
66
const { mkdir, writeFile } = fs;
77
const { dirname } = path;
88

9+
function modulesToStage(x) {
10+
return sort([
11+
...StableModules,
12+
...Object.values(proposals).flatMap(({ stage, modules }) => stage >= x ? modules : []),
13+
]);
14+
}
15+
916
const ESModules = AllModules.filter(it => it.startsWith('es.'));
17+
const ESWithProposalsModules = AllModules.filter(it => it.startsWith('es'));
1018
const StableModules = AllModules.filter(it => it.match(/^(?:es|web)\./));
11-
const Stage3Modules = unique(Object.values(proposals).flatMap(({ stage, modules }) => stage === 3 ? modules : []));
12-
const ActualModules = sort([...StableModules, ...Stage3Modules]);
19+
const ActualModules = modulesToStage(3);
1320

1421
const ESSet = new Set(ESModules);
22+
const ESWithProposalsSet = new Set(ESWithProposalsModules);
1523
const StableSet = new Set(StableModules);
1624
const ActualSet = new Set(ActualModules);
1725

@@ -45,4 +53,10 @@ await buildEntry('stable/index', $path, StableModules, StableSet);
4553
await buildEntry('actual/index', $path, ActualModules);
4654
await buildEntry('full/index', $path, AllModules);
4755
await buildEntry('index', $path, ActualModules);
56+
57+
await buildEntry('stage/3', $path, ActualModules, ESWithProposalsSet);
58+
await buildEntry('stage/2', $path, modulesToStage(2), ESWithProposalsSet);
59+
await buildEntry('stage/1', $path, modulesToStage(1), ESWithProposalsSet);
60+
await buildEntry('stage/0', $path, AllModules, ESWithProposalsSet);
61+
4862
echo(chalk.green(`built ${ chalk.cyan(built) } entries`));

0 commit comments

Comments
 (0)