GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Prepare semver (`@latest`) releases in CI (#21615) · react/react@8f37942

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts/rollup
    • build-all-release-channels.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/rollup/build-all-release-channels.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/build-all-release-channels.js
+31-5Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,29 @@ function processStable(buildDir) {
9898
updatePackageVersions(
9999
buildDir + '/node_modules',
100100
versionsMap,
101-
defaultVersionIfNotFound
101+
defaultVersionIfNotFound,
102+
true
102103
);
103104
fs.renameSync(buildDir + '/node_modules', buildDir + '/oss-stable');
105+
106+
// Identical to `oss-stable` but with real, semver versions. This is what
107+
// will get published to @latest.
108+
spawnSync('cp', [
109+
'-r',
110+
buildDir + '/oss-stable',
111+
buildDir + '/oss-stable-semver',
112+
]);
113+
const semverVersionsMap = new Map();
114+
for (const moduleName in stablePackages) {
115+
const version = stablePackages[moduleName];
116+
semverVersionsMap.set(moduleName, version);
117+
}
118+
updatePackageVersions(
119+
buildDir + '/oss-stable-semver',
120+
semverVersionsMap,
121+
defaultVersionIfNotFound,
122+
false
123+
);
104124
}
105125

106126
if (fs.existsSync(buildDir + '/facebook-www')) {
@@ -131,7 +151,8 @@ function processExperimental(buildDir, version) {
131151
updatePackageVersions(
132152
buildDir + '/node_modules',
133153
versionsMap,
134-
defaultVersionIfNotFound
154+
defaultVersionIfNotFound,
155+
true
135156
);
136157
fs.renameSync(buildDir + '/node_modules', buildDir + '/oss-experimental');
137158
}
@@ -179,7 +200,8 @@ function crossDeviceRenameSync(source, destination) {
179200
function updatePackageVersions(
180201
modulesDir,
181202
versionsMap,
182-
defaultVersionIfNotFound
203+
defaultVersionIfNotFound,
204+
pinToExactVersion
183205
) {
184206
for (const moduleName of fs.readdirSync(modulesDir)) {
185207
let version = versionsMap.get(moduleName);
@@ -199,14 +221,18 @@ function updatePackageVersions(
199221
if (packageInfo.dependencies) {
200222
for (const dep of Object.keys(packageInfo.dependencies)) {
201223
if (versionsMap.has(dep)) {
202-
packageInfo.dependencies[dep] = version;
224+
packageInfo.dependencies[dep] = pinToExactVersion
225+
? version
226+
: '^' + version;
203227
}
204228
}
205229
}
206230
if (packageInfo.peerDependencies) {
207231
for (const dep of Object.keys(packageInfo.peerDependencies)) {
208232
if (versionsMap.has(dep)) {
209-
packageInfo.peerDependencies[dep] = version;
233+
packageInfo.peerDependencies[dep] = pinToExactVersion
234+
? version
235+
: '^' + version;
210236
}
211237
}
212238
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.