Commit Graph

91 Commits

Author SHA1 Message Date
John Knox
9871a6d155 Devserver: Only listen on localhost
Summary:
In response to https://github.com/facebook/flipper/issues/553

This server is just serving the local assets to the electron instance, when you are running flipper from source (`yarn start`). It's not used in production releases.

I don't think there's a need to encrypt this traffic - it's analogous to running a local web server while you are developing it, however I don't see a reason not to restrict it to localhost.

Reviewed By: danielbuechele

Differential Revision: D17500039

fbshipit-source-id: 5b9df3937d71dc542cfa900da8c9e7f285a0e6ac
2019-09-23 03:43:09 -07:00
Pascal Hartig
1ab47f9ca8 Set up Maven distribution for new plugins
Summary:
Setting up the necessary metadata to publish the separate plugins
to Maven/Bintray.

Reviewed By: danielbuechele

Differential Revision: D17480263

fbshipit-source-id: 1772cee5b3744ce52fc6e2510a27cb7f500e72bf
2019-09-20 06:07:42 -07:00
Pascal Hartig
fd8d28ca11 Remove fbjni from release script
Summary:
for_shame

Failing here: https://circleci.com/gh/facebook/flipper/1529

Reviewed By: danielbuechele

Differential Revision: D17375600

fbshipit-source-id: 9765b476f70f96a33e9ef6f4557fd062bedcfe61
2019-09-16 08:20:37 -07:00
Pascal Hartig
f41cbcd429 Add land-time eslint job
Summary: This will block us from landing eslint-failing tests.

Reviewed By: jknoxville

Differential Revision: D17342861

fbshipit-source-id: a42e3bc3fffe8f24420203f399fb702907069132
2019-09-12 10:10:49 -07:00
Pascal Hartig
4f181cc2ea Fix header
Summary: Getting a shipit violation for the missing header.

Reviewed By: danielbuechele

Differential Revision: D17184585

fbshipit-source-id: 1e88c1adec1f1500e16ddd8a461fb11bf1ea86e6
2019-09-04 10:48:22 -07:00
Daniel Büchele
631b743643 npm publish
Reviewed By: jknoxville

Differential Revision: D17161868

fbshipit-source-id: 65be618c6e231eec2d680906e80599889401ced7
2019-09-03 06:44:43 -07:00
John Knox
922019a8d0 Add script to run headless tests easily
Summary:
It's not obvious how to run the headless tests at the moment, and requires manual steps this adds a script to do it.
It still does not start an emulator or the sample app, but it's an improvement.

Reviewed By: passy

Differential Revision: D17155308

fbshipit-source-id: 846b87389823f422030470807aa4aabacce69179
2019-09-02 11:00:11 -07:00
Pascal Hartig
f6dd4c227f Add URL for more info
Summary: Added a wiki page with some more strict mode info.

Reviewed By: danielbuechele

Differential Revision: D17112391

fbshipit-source-id: 53b9e8d417eb9f41adecab42fbf912b999a0c9c3
2019-09-02 07:02:15 -07:00
Pascal Hartig
3cdc32c18b Update binary
Summary: allow-large-files

Reviewed By: danielbuechele

Differential Revision: D17112954

fbshipit-source-id: d0c53e3f5c5502d291212557ac808359e2a925b6
2019-08-30 03:32:47 -07:00
Pascal Hartig
31ce78b128 Add stack.yaml.lock
Summary: Stack has lock files now. Let's use them.

Reviewed By: danielbuechele

Differential Revision: D17112200

fbshipit-source-id: 898fff67ac74cbad918dbe1be6667523c4392b35
2019-08-29 09:23:57 -07:00
Pascal Hartig
f4f7245732 Add README
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D17111990

fbshipit-source-id: f5a14b7f0ce544cec324b70b74eeed8d6efb42b0
2019-08-29 09:19:01 -07:00
Pascal Hartig
bc4fc12ea4 Add prebuilt version of stricter
Summary:
Adds a binary we can run on Sandcastle.

allow-large-files

Reviewed By: danielbuechele

Differential Revision: D17093672

fbshipit-source-id: 3695739a65aea72bc8c8268404c9d3e025349e16
2019-08-28 14:31:33 -07:00
Pascal Hartig
a612792995 Add script to watch for TSC strict mode regressions
Summary:
This is a simple script that runs `tsc --strict` twice: on the current revision and the previous one, compares the number of errors and if there are more, prints them out and raises a failure exit code.

This should help us ensure that while we clean up the 500-odd errors we don't land more in the process.

Reviewed By: danielbuechele

Differential Revision: D17093671

fbshipit-source-id: 6c5d1424c729d15d66a32ae17f15b17c3b76fc68
2019-08-28 14:31:33 -07:00
Daniel Büchele
f69bfab0f4 npm
Summary:
Publishing flipper to npm via Sandcastle.
- NPM token added to secrets tool
- removing private flag from package JSON
- adding publish script

Reviewed By: passy

Differential Revision: D16984934

fbshipit-source-id: 334991381d4035928af9a9d98d3905280938736a
2019-08-23 09:33:56 -07:00
Daniel Büchele
853d80f182 headless
Summary: _typescript_

Reviewed By: passy

Differential Revision: D16962733

fbshipit-source-id: 6583c5a4471b12f91895f6449ed9c510265a63e2
2019-08-23 09:33:56 -07:00
Pritesh Nandgaonkar
d850f1ff43 Update the bump version script
Summary: Updates the bump_version script to update the flipperkit version in Tutorial's Podfile.

Reviewed By: passy

Differential Revision: D16916433

fbshipit-source-id: dd5cf24fbbe4e9ca322178632613caebe178cc17
2019-08-20 08:41:30 -07:00
Daniel Büchele
d0da0d66a5 main folder
Summary: _typescript_

Reviewed By: passy

Differential Revision: D16762117

fbshipit-source-id: b6ee32e0bb3fc686fc69cfccab703e2ef4989571
2019-08-15 03:33:06 -07:00
Daniel Büchele
16e913a819 local icons
Summary:
Currently icons were always fetched remotely. We used a service worker to prefetch and cache some icons, that were critical to the UI.

In this diff, we are bundling icons at build time, with the app. In utils/icons.js we still specfify the list of icons which should be bundled. These are downloaded as part of the build step and bundled with the app. We are downloading the icons in 1x and 2x (the two most common pixel densities).

Reviewed By: jknoxville

Differential Revision: D16620764

fbshipit-source-id: 965a7793ad1f08aebb292606add00218429cdaf4
2019-08-02 09:00:00 -07:00
John Knox
df55ac263d Make android file pulling script public
Summary: This could be useful for OSS users, e.g. https://github.com/facebook/flipper/issues/498

Reviewed By: passy

Differential Revision: D16457362

fbshipit-source-id: 73fad6a30383f622e49cecc3a20d7fbbec2b318b
2019-07-24 06:25:40 -07:00
John Knox
5d99817555 Add --no-plugins arg to speed up headless development
Summary:
Compiling headless flipper takes a long time. This is because it individually compiles and bundles every plugin.

When debugging core headless, you don't need to compile any plugins, so this adds a build flag `--no-plugins` to skip that and vastly speed up iteration speed.

Reduces build time from 3 minutes to 20s

Reviewed By: priteshrnandgaonkar

Differential Revision: D16131322

fbshipit-source-id: 2b38ee37183a1257b3993f392cf623b2631fd7da
2019-07-05 08:09:18 -07:00
Pascal Hartig
4aafc49aaf Remove unneeded pod instructions from release script
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D15964257

fbshipit-source-id: 7f5888cff480df3a598d703b0f2c58bc9fa0ab89
2019-06-24 06:24:01 -07:00
Andres Suarez
198841d1d7 Rename uses of install-node-modules.sh in fbsource
Differential Revision: D15848788

fbshipit-source-id: b98626083ed7aee108f27d6e8c5c7b637e1b2327
2019-06-17 06:07:19 -07:00
Pascal Hartig
b8f3729752 Update Mac binary
Summary: Checking in a new binary pre-compiled for MacOS.

Reviewed By: jknoxville

Differential Revision: D15374540

fbshipit-source-id: a69e6f497a8c8b9f08144e1482450ff43b85f5da
2019-05-17 02:36:18 -07:00
Pascal Hartig
704634768f Update bump binary for Linux
Summary: This is the one used on sandcastle, built statically.

Reviewed By: jknoxville

Differential Revision: D15374415

fbshipit-source-id: 7b200e8630ce0a3a336cc46df26df367ed712fa1
2019-05-17 02:36:18 -07:00
Pascal Hartig
85f06c53eb Bump noop versions
Summary:
When running bump, also update the docs references to the noop package.

Will update binaries in subsequent diffs.

Reviewed By: jknoxville

Differential Revision: D15374370

fbshipit-source-id: 5558d33a91dc5e690f5754891b2e5aa29385646a
2019-05-17 02:36:17 -07:00
Pritesh Nandgaonkar
31542ca790 Update the open source release script
Summary: We no longer require to host the pods on our repository, thus I updated the release script to get rid off the copying part.

Reviewed By: passy

Differential Revision: D15166526

fbshipit-source-id: 1989eff335f83c191b16a78d9562470d7819bc17
2019-05-02 04:58:38 -07:00
Pascal Hartig
cfb4f52359 Automatically release noop packages
Summary: This is used by the public Circle CI release task.

Reviewed By: jknoxville

Differential Revision: D15149586

fbshipit-source-id: de631f930649fdbe582d525874ac6a6bf1fd4bad
2019-05-01 08:38:23 -07:00
Pascal Hartig
1831a672b5 More copyright headers for misc stuff
Summary: Scripts and Portforwarding things.

Reviewed By: jknoxville

Differential Revision: D15164852

fbshipit-source-id: a9dcdcb5e6c19dc51d1aa0158fceafe21ab7615f
2019-05-01 08:14:55 -07:00
Pascal Hartig
939cc531e2 Fix revision bundling
Summary:
This fixes headless not terminating due to the `package.json` not being readable.
I instead write this to the `global` object in the same way that the version is
set.

Reviewed By: jknoxville

Differential Revision: D14579316

fbshipit-source-id: 238afe912366c423552305e120088f4abac4c20b
2019-03-22 10:41:01 -07:00
Pascal Hartig
c2b6df7c3b Use prefixed temp folder
Summary:
I'm accumulating a lot of those in my tmpfs and
it would be great to immediately identify the
ones coming from Flipper.

Reviewed By: danielbuechele

Differential Revision: D14406809

fbshipit-source-id: 6b74e8260a841d5db76ac34643ee0226abba735a
2019-03-13 03:40:06 -07:00
Pascal Hartig
1b1d349dba Add revision to build manifest
Summary:
Package up the current repository's revision when building
a release.

This will then be used to write it into exported traces
so we can find a compatible version when opening it up
again.

Reviewed By: danielbuechele

Differential Revision: D14406684

fbshipit-source-id: 761a51e69adbcab1d541c2daa78c9827ea299e79
2019-03-13 03:40:06 -07:00
Pascal Hartig
31c240ba00 Blacklist dist/ from devserver
Summary:
Having previously run `yarn build` can otherwise
cause your devserver to stop working.

Caveat: If you have a Flipper checkout and it's called neither `sonar` nor `flipper`, you're still screwed.

Reviewed By: danielbuechele

Differential Revision: D14364984

fbshipit-source-id: 1652c94a95b1dcb6d34bb9040a9cd4cd70c6df55
2019-03-07 05:47:32 -08:00
Pascal Hartig
f0722287be Fix Mac ZIP building
Summary:
The current Mac zip creation in electron-builder is broken and creates corrupt zip builder. Other platforms are still fine. This just zips stuff up manually and ensures that symlinks are preserved.

Thanks a lot to Daniel Büchele for helping me wrap my head around untyped promises.

Reviewed By: jknoxville

Differential Revision: D14243002

fbshipit-source-id: 908d176275e5d22173e587c0eb4d7c4b2b7c2e0f
2019-02-27 15:07:46 -08:00
Daniel Büchele
520ffec7c9 removing entry, rootDir from defaultPlugins
Summary:
When bundling default plugins, we create a JSON-file containing information about the plugin and where to require it from. This information contained two filed: `entry` and `rootDir`, which were written while bundling the plugins. Because the plugins are bundled on Sandcastle, this was a path on the Sandcastle machine.

This also happened for the OSS version, see the screenshot from a GitHub issue.
Entry and rootDir are only used during the build process and not needed afterwards, so it is save to remove them from the JSON.

https://pxl.cl/qQSx

Reviewed By: passy

Differential Revision: D14165679

fbshipit-source-id: 4e7c5ac25652758ccfc3a459f4dd197254c6f897
2019-02-21 09:39:54 -08:00
Daniel Büchele
13f7444013 electron update
Summary:
Started with upgrading electron from 3.0.0 to 4.0.5. This required a bunch of subsequent updates:
* upgrading `electron-builder` to latest version, because the old version couldn't build electron 4 apps.
  * `appDir` is deprecated in builder config, `projectDir` is used instead, which we already had set, so its fine to just remove this ([see GitHub commit](a5e457163e)).
* upgrading `jest-runner/electron` because the old version couldn't run electron 4 tests.
  * upgrading our custom dependency resolution to use electron 4.0.5, because the test runner still resolves to 2.0.8 ([see GitHub issue](https://github.com/facebook-atom/jest-electron-runner/issues/31)).
* updating `sandcastle.sh` to use the new cache files from D14131344.
* removing `package-lock.json` as is was causing warnings. We use `yarn` and `yarn.lock` anyways. This file must have been committed by accident.
* updating our check to only run one version of Flipper at a time to use the new electron API `app.requestSingleInstanceLock` as the old one was removed in electron 4.
* updating the snapshot test that checks App rendering, which changed a little due to the electron upgrade.
* upgrading flow-type definitions to `electron-v4.0.5.js` generated by [electron-flowtype-definitions](https://github.com/danielbuechele/electron-flowtype-definitions).

**PS: Best new feature in Electron 4: Copy&paste working in dev tools**

Reviewed By: jknoxville

Differential Revision: D14131360

fbshipit-source-id: d7ed9643875629a1fa1860bb61b11dd0c64112ab
2019-02-21 02:46:12 -08:00
Daniel Büchele
6ada04bc38 ignore flipper-public/dist folder in build
Summary:
Builds in flipper-public are failing, because duplicate imports: https://our.intern.facebook.com/intern/sandcastle/job/22517998213713260

That's most likely because the `flipper-public` is not blacklisted in metro, so let's add it!

Reviewed By: passy

Differential Revision: D14134423

fbshipit-source-id: 52f87196957c8578b8ac7f578efa74e3c13fe1bb
2019-02-20 06:58:54 -08:00
Daniel Büchele
825bfffd21 create one headless file for all platforms
Summary: We are distributing a single package via fbpkg containing the headless version linux and macOS. This changes the build process to only create a single zip-file containing these binaries.

Reviewed By: passy

Differential Revision: D14042031

fbshipit-source-id: 88992f17501353a70bc21799c6bd2957576268a3
2019-02-12 06:18:56 -08:00
Daniel Büchele
e78bd57514 build headless
Summary:
- create a zip-file when building the headless version of Flipper
- restore pkg cache in Sandcastle from pantri
- run build script in sandcastle.

Changes need to go together with D13942919

Reviewed By: passy

Differential Revision: D13942701

fbshipit-source-id: caac7d6cda99fec2a6836c652957ff609a0bf8bb
2019-02-05 11:35:52 -08:00
Daniel Büchele
22f9401e05 move version number to build-utils
Summary:
* The generation of the version number is moved to build-utils so it can be used from the headless build process as well.
* The prelude script for the headless version exposes the version number on `global.__VERSION__`
* While at this file, moving some functions in the build process to use the Sync version. Doesn't matter for the build process anyways and the syntax is much nicer.

Reviewed By: passy

Differential Revision: D13843678

fbshipit-source-id: 7df8364044ab6ebc83a4060aab2e3a42ae48a934
2019-02-04 07:29:13 -08:00
Daniel Büchele
5b68c59b5c package bundle
Summary:
For the electron build, plugins are bundled with the app and loaded from there at launch. The headless version can't require from its binary, so plugins need to be required from another path.

This diff makes the path where bundled plugins are loaded from adjustable via an environment variable: `BUNDLED_PLUGIN_PATH`. If it's set, the plugins are loaded from this path, otherwise we default to the old behaviour of including them from `./defaultPlugins`.

For the headless version we expect the plugins to be in a folder called `plugins` next to the executable. This should later be configurable via an argument passed to the CLI.

Reviewed By: passy

Differential Revision: D13843676

fbshipit-source-id: 04237ae6631b4f2ba56887fe992a56f860724edc
2019-02-04 07:29:13 -08:00
Daniel Büchele
d512c97cab package bundle
Summary:
Building binaries for the headless version of Flipper. These binaries include node, so they can be run independent on any system.

allow-large-files

Reviewed By: passy

Differential Revision: D13843677

fbshipit-source-id: c053177328ddfcba11f9a293951ebe4db4d84034
2019-02-04 07:29:13 -08:00
Pascal Hartig
14b1583eb0 Adjust verify-bintrya-upload script for Flipper
Summary:
Umm, this is embarrassing. I thouhgt I did this when I put
up the first diff? Apparently I didn't. Well, I just ran
this for `0.14.2` and now it actually does what it
says on the tin.

Reviewed By: danielbuechele

Differential Revision: D13861574

fbshipit-source-id: dd7ae30a97e6da036d3a30b43de941e82088062c
2019-01-30 10:38:45 -08:00
Daniel Büchele
7ac6a09af1 build headless version
Summary:
* Adds `build-headless.js` to bundle the app using metro
* the build script replaces the prelude code added by metro with our own to make it work in node. Metro will add an API to add custom prelude code in the next version.
* Pins down metro's dependency of `temp` to `v0.9.0` (instead of `0.8.3`) to be compatible with node 10. (This will be fixed in a metro upgrade)

Reviewed By: passy

Differential Revision: D13786574

fbshipit-source-id: bddb3542c370c068d90a90c4b59337f995e4fa3f
2019-01-25 12:19:07 -08:00
Daniel Büchele
78cd40e890 split build process
Summary: Moving a couple of build function from `build-release` to `build-utils` so they can be shared between the desktop build process and the headless build process.

Reviewed By: passy

Differential Revision: D13786575

fbshipit-source-id: df0a0da6d9a643e3e1c65470e1e96254e8966dd9
2019-01-25 12:19:07 -08:00
Pascal Hartig
2fd9bac31c Automatically create snapshot release
Summary: This adds some frankly disgusting magic to the bump script to determine the next viable snapshot version and creates a second commit.

Reviewed By: jknoxville

Differential Revision: D13801765

fbshipit-source-id: 40728afe9dfde3da7a4fced645a89ed293109878
2019-01-25 03:27:32 -08:00
Pascal Hartig
685be44187 Small fixes to bump-version.sh
Summary: Indentation, abort jq installation on non-Darwin, spelling.

Reviewed By: jknoxville

Differential Revision: D13801766

fbshipit-source-id: 2e2e45806b43ff78d6c6d2e5a4ab166dd8d043b1
2019-01-24 11:27:43 -08:00
Pascal Hartig
383cabe212 Update bump binaries
Summary:
Compiled statically for darwin and Linux (x86_64). Also
changed some flags to make this reproducible.

Reviewed By: danielbuechele

Differential Revision: D13801305

fbshipit-source-id: d98701afca3c4787922d377bc6b674b59421f5b8
2019-01-24 04:43:15 -08:00
Pascal Hartig
7e911ed5e8 Move bump to project folder
Summary: Makes building a bit easier and I can have my own README in there.

Reviewed By: jknoxville

Differential Revision: D13784725

fbshipit-source-id: b694c1ce812d4e383ad44faeacd8e0094a96b432
2019-01-24 03:42:12 -08:00
Pascal Hartig
64d3f34fe5 Improve version bumping logic
Summary:
Currently, when bumping the version, the script will override "-SNAPSHOT" mentions in both the docs and the properties. This requires some manual fixup after every release. With this change, you can pass "-s" or "--snapshot" to change the version number to a snapshot release and it will only affect the places where that change is necessary.

Did some overall cleanup, too, like getting rid of the macro magic to determine the current location which messes with tooling.

This does *not* include the updated binaries yet. I'll put them up as a separate diff.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13782177

fbshipit-source-id: 87ad0ab20a5f544ddb6aa3e2d30949bbabbabfc4
2019-01-23 08:03:32 -08:00
Pascal Hartig
82f4d4ad95 Add --no-updater flag
Summary: Provide a `--no-updater` option that disables the in-app auto updater when passed.

Reviewed By: jknoxville

Differential Revision: D13713919

fbshipit-source-id: 49a647105fea1efa23f653e4a6ed452b3489879b
2019-01-18 08:01:05 -08:00