mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix publish-updated-packages-test (#54017)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54017 Fix test: publish-updated-packages-test changelog: [internal] internal Reviewed By: christophpurrer Differential Revision: D83699726 fbshipit-source-id: 45f4713d18ed74a6b344f34ab9b3dd7760088fcc
This commit is contained in:
committed by
meta-codesync[bot]
parent
7dc26f58ee
commit
07fcdfebae
@@ -65,8 +65,8 @@ async function publishUpdatedPackages() {
|
||||
const packagesToUpdate = [];
|
||||
|
||||
await Promise.all(
|
||||
Object.values(packages).map(async package => {
|
||||
const version = package.packageJson.version;
|
||||
Object.values(packages).map(async pck => {
|
||||
const version = pck.packageJson.version;
|
||||
|
||||
if (!version.startsWith('0.')) {
|
||||
throw new Error(
|
||||
@@ -74,19 +74,17 @@ async function publishUpdatedPackages() {
|
||||
);
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
'https://registry.npmjs.org/' + package.name,
|
||||
);
|
||||
const response = await fetch('https://registry.npmjs.org/' + pck.name);
|
||||
const {versions: versionsInRegistry} = await response.json();
|
||||
|
||||
if (version in versionsInRegistry) {
|
||||
console.log(
|
||||
`- Skipping ${package.name} (${version} already present on npm)`,
|
||||
`- Skipping ${pck.name} (${version} already present on npm)`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
packagesToUpdate.push(package.name);
|
||||
packagesToUpdate.push(pck.name);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -97,19 +95,17 @@ async function publishUpdatedPackages() {
|
||||
const failedPackages = [];
|
||||
|
||||
for (const packageName of packagesToUpdate) {
|
||||
const package = packages[packageName];
|
||||
console.log(
|
||||
`- Publishing ${package.name} (${package.packageJson.version})`,
|
||||
);
|
||||
const pck = packages[packageName];
|
||||
console.log(`- Publishing ${pck.name} (${pck.packageJson.version})`);
|
||||
|
||||
try {
|
||||
runPublish(package.name, package.path, tags);
|
||||
runPublish(pck.name, pck.path, tags);
|
||||
} catch {
|
||||
console.log('--- Retrying once! ---');
|
||||
try {
|
||||
runPublish(package.name, package.path, tags);
|
||||
runPublish(pck.name, pck.path, tags);
|
||||
} catch (e) {
|
||||
failedPackages.push(package.name);
|
||||
failedPackages.push(pck.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user