Publish flipper-server to NPM (#3224)

Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3224

Automatically publish to https://www.npmjs.com/package/flipper-server

Changelog: [experimental] It is now possible to run a full fledged Flipper as node + browser appication by using `npx flipper-server`

Pull Request resolved: https://github.com/facebook/flipper/pull/3224

Test Plan:
https://github.com/facebook/flipper/runs/4659854128?check_suite_focus=true

Checked that the build is non-fb, has no fb plugins etc, and runs from npm

{F690008124}

{F690008123}

{F690008122}

Reviewed By: nikoant

Differential Revision: D33297125

Pulled By: mweststrate

fbshipit-source-id: b5fe6fcb81c665036273db814cb61855aaceff85
This commit is contained in:
Michel Weststrate
2022-01-04 04:11:47 -08:00
committed by Facebook GitHub Bot
parent 25e585b819
commit 582ea64011
2 changed files with 45 additions and 1 deletions

View File

@@ -209,6 +209,7 @@ async function modifyPackageManifest(
const manifest = require('../flipper-server/package.json');
manifest.version = versionNumber;
manifest.private = false; // make this package npm-publishable
if (hgRevision != null) {
manifest.revision = hgRevision;
}
@@ -262,6 +263,7 @@ async function modifyPackageManifest(
if (argv.npx) {
// This is a hack, as npx cached very aggressively if package.version
// didn't change
console.log(`⚙️ Installing flipper-server.tgz using npx`);
await fs.remove(path.join(homedir(), '.npm', '_npx'));
await spawn('npx', [archive, argv.open ? '--open' : '--no-open'], {