mirror of
https://github.com/facebook/react-native.git
synced 2026-03-31 09:02:15 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49788 Release of 0.78 was successful but it failed to verify the package of NPM because of some error in the JS files. Preparing for 0.79, I discovered some other issues in the NPM checking scripts. This change should fix them. ## Changelog: [Internal] - Fix publishing scripts Reviewed By: fabriziocucci Differential Revision: D70489717 fbshipit-source-id: 02a37d9a86fe108c7f7d2d634b8c0727dabb153d
34 lines
704 B
JavaScript
34 lines
704 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const {execSync} = require('child_process');
|
|
|
|
const log = (...args) => console.log(...args);
|
|
|
|
async function getNpmPackageInfo(pkg, versionOrTag) {
|
|
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
|
|
resp.json(),
|
|
);
|
|
}
|
|
|
|
async function sleep(seconds) {
|
|
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
|
}
|
|
|
|
function run(cmd) {
|
|
return execSync(cmd, 'utf8').toString().trim();
|
|
}
|
|
|
|
module.exports = {
|
|
log,
|
|
getNpmPackageInfo,
|
|
sleep,
|
|
run,
|
|
};
|