Commit Graph

12 Commits

Author SHA1 Message Date
Michel Weststrate
bc606dc073 fix public release build failing for flipper-server
Summary: Fixed failing release build, see https://github.com/facebook/flipper/runs/4790065925?check_suite_focus=true.

Reviewed By: passy

Differential Revision: D33550553

fbshipit-source-id: ecbcfa77a29e1afb7815453bc53b66a46da9aa9f
2022-01-13 03:51:59 -08:00
Michel Weststrate
b05219d09c Fix release build
Summary:
This diff fixes the issue where flipper-server didn't properly build when creating a release build, due to plugins being resolved from both source `desktop/plugins` and `desktop/static/defaultPlugins` folders.

The `desktop/plugins` folder should not be included in the build, but wasn't sure why not, as it isn't a problem for desktop release either?

Anyway solved it for now to unblock releasing by using bundled-plugins, which might actually be better anyway for a bunch of use cases of flipper-server (e.g. when installed to an OD). So I think this is fine for now.

It does increase the build to ~40 MB, which is still halve of our unbundled electron build.

Reviewed By: aigoncharov

Differential Revision: D33427938

fbshipit-source-id: c931c2d1bea1e04c7b1603a488dcb76a41488740
2022-01-10 08:58:02 -08:00
Michel Weststrate
d92c403dd2 Run server build as part of normal SandCastle build
Summary: Build flipper-server as normal build job. Note that `--no-rebuild-plugins` is used to save a lot of time, and

Reviewed By: passy

Differential Revision: D33361569

fbshipit-source-id: 55e97f81dbcfa98901ddc21e2f35f4d1134c74ef
2022-01-04 09:06:15 -08:00
Michel Weststrate
582ea64011 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
2022-01-04 04:13:10 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Michel Weststrate
521ef9e243 Check plugin entry points before bundling them stripped
Summary: When packaging plugins into flipper-server package, we assume an idiomatic plugin structure, warn and skip if a plugin doesn't conform to it.

Reviewed By: antonk52

Differential Revision: D33308367

fbshipit-source-id: fd6d1dbc66739b0867034930579429e97d9e2bfa
2021-12-24 07:18:11 -08:00
Michel Weststrate
bc98a77cf7 Improved build-release open args
Summary:
Improved `flipper:build-release` command with several options as suggested in earlier reviews. Flags added:

* `--npx` install using npx and start
* `--start` run directly from the build folder
* `--open` icmw previous two, spawn a browser

This should generally benefit developing from for example an on-demand server (although current socket access is currently only open to local host, so a port forward or remote entry point needs to be set up)

Reviewed By: antonk52

Differential Revision: D33308198

fbshipit-source-id: fb905647c8d9fbda9d3efc2bfdcbd4d03be84938
2021-12-24 07:18:11 -08:00
Michel Weststrate
cbda298b9d Add support to build flipper-server from SandCastle
Summary:
This refactors the flipper-server release script in such a way that it works the same as the normal release script, which solves two problems:

1) the official release script modifies versioned files, as it touches the package.json
2) it was slightly confusing that `flipper-server/static` was filled for release builds only, but not used in dev builds
3) running test:npx without running a release build before it, would fail with hard to comprehend errors. this has been solved now by removing that script and make it an arg of `build:flipper-server`

Also some further minor changes to prepare running a corresponding build / release job from SandCastle (later in this stack)

Reviewed By: nikoant

Differential Revision: D33297214

fbshipit-source-id: f6299aa982c3e59d1cc6479a93c56cbe4b57f85c
2021-12-24 07:18:11 -08:00
Michel Weststrate
54dacb7e5d Make sure icons are bundled
Summary: Make sure icons are prefetched for flipper-server prod builds, like we do for electron, so that the user doesn't need an internet connection to see icons

Reviewed By: nikoant

Differential Revision: D33296389

fbshipit-source-id: bfa92d78d8d77030238e5cca10d7aa6dcfb88e8b
2021-12-24 02:16:48 -08:00
Michel Weststrate
72fa481d27 Fix generation of bundled.json, make source maps work in prod builds
Summary:
This diff fixes several issues around loading plugin, such as:

* make suresource maps work in the flipper-server production build
* make sure default plugins are no symlinked, which wouldn't work anywhere else but on the the system where it was build
* support release channel param for flipper-server

Bundled flipper-server is now 42MB (with icons (see later diffs) and plugins
```
ll flipper-server-v0.0.0.tgz
-rw-r--r--  1 mweststrate  staff    42M 23 Dec 15:29 flipper-server-v0.0.0.tgz
```

Reviewed By: nikoant

Differential Revision: D33294677

fbshipit-source-id: 63538dc8127f883fee6a3608673ad11ce239b350
2021-12-24 02:16:48 -08:00
Michel Weststrate
b1d960e4c4 Make sure plugin loading works in NPX builds
Summary: Make sure non-bundled plugins load correctly . Note that sourcemaps don't load yet

Reviewed By: nikoant

Differential Revision: D33278639

fbshipit-source-id: 9951286ec6df65f33149e4687261a43e6c072c31
2021-12-24 02:16:48 -08:00
Michel Weststrate
6ff4abbc67 Make flipper-server stand-alone servable
Summary:
This diff makes flipper-server stand-alone servable as a single package.

It basically works as follows:

- (default) plugins are build as usually into static folder
- static folder is copied into flipper-server/static (as far as relevant)
- `flipper-server/src/index.tsx` is bundled into `flipper-server/dist/index.js`
- `flipper-ui-browser/src/index.tsx` is bundled into `flipper-server/static/bundle.js`

If flipper-server is started without the `--bundler` config, the `bundle.js` will be served statically, rather than starting up the Metro bundler with all the typical transforms (in a distributed version of the package those all wouldn't resolve)

Things to be done in next diffs:

* make sure plugins actually load in the non bundled setup
* make sure flipper-server gets published properly
* make sure build is created as part of CI

At the end of this stack, running `npx flipper-server` on any machine should basically be a viable approach to get flipper up and running locally :)

Reviewed By: nikoant

Differential Revision: D33171107

fbshipit-source-id: 4af8ac2699467a0b55283fe084640482700744c2
2021-12-24 02:16:48 -08:00