forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare-stable.js
More file actions
executable file
·44 lines (35 loc) · 1.65 KB
/
prepare-stable.js
File metadata and controls
executable file
·44 lines (35 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
'use strict';
const {join} = require('path');
const {getPublicPackages, handleError} = require('./utils');
const checkOutPackages = require('./prepare-stable-commands/check-out-packages');
const confirmStableVersionNumbers = require('./prepare-stable-commands/confirm-stable-version-numbers');
const guessStableVersionNumbers = require('./prepare-stable-commands/guess-stable-version-numbers');
const parseParams = require('./prepare-stable-commands/parse-params');
const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
const testPackagingFixture = require('./shared-commands/test-packaging-fixture');
const testSchedulerFixture = require('./shared-commands/test-scheduler-fixture');
const updateStableVersionNumbers = require('./prepare-stable-commands/update-stable-version-numbers');
const run = async () => {
try {
const params = parseParams();
params.cwd = join(__dirname, '..', '..');
params.packages = await getPublicPackages();
// Map of package name to upcoming stable version.
// This Map is initially populated with guesses based on local versions.
// The developer running the release later confirms or overrides each version.
const versionsMap = new Map();
await checkOutPackages(params);
await guessStableVersionNumbers(params, versionsMap);
await confirmStableVersionNumbers(params, versionsMap);
await updateStableVersionNumbers(params, versionsMap);
if (!params.skipTests) {
await testPackagingFixture(params);
await testSchedulerFixture(params);
}
await printPrereleaseSummary(params);
} catch (error) {
handleError(error);
}
};
run();