Commit Graph

12 Commits

Author SHA1 Message Date
Luke De Feo
1b02f105dc Add config for vscode-jest extension
Summary:
Provides a much nicer devx, shows test pass / failure in the editor and error messages in line

https://pxl.cl/25G0x

When the extension is installed with this config it will watch all test and run what is needed, automatically updating the editor with test status

It also supports debugging tests individually right in the editor

see https://github.com/jest-community/vscode-jest for full docs

Also Once VS code @ fb is updated to a newer base of vscode, we will get access to to the testing sidebar feature

https://pxl.cl/25G0R

Reviewed By: lblasa, aigoncharov

Differential Revision: D37009812

fbshipit-source-id: e1918a0817d4703089b6300840fcf9564b871682
2022-07-07 07:50:14 -07:00
Michel Weststrate
ee013e29fc Make sure public prettier plugin is recommended when developing on Flipper
Summary: On a fresh VS Code install, only the internal Prettier plugin is available, but not the open source version, which we need as the internal one doesn't work on Flipper (probably due to TypeScript?)

Reviewed By: lblasa

Differential Revision: D36275616

fbshipit-source-id: bccbbcd372f7a7ecca46eb83f5515543e611235c
2022-05-10 04:13:22 -07:00
Michel Weststrate
dcfeb4a4d5 Clean up packages and types
Summary:
This diff removes most deps from the root package.json, which now only contains electron and shared build / test infra structure: lint, prettier, jest, typescript.

This makes it possible to control much better which packages are used where, as all sub packages now have their deps explicitly in their package.json instead of incidentally shared. This allows for example to disable DOM types for all packages by default (flipper-plugin, ui(-core) and app still request it), and in the next diff I hope to add to this that nodeJS types are no longer shared either, so that UI oriented packages will generate compile errors when using Node built-ins

This diff removes most deps that were currently unused, and dedupes a bunch of other ones, so the build should probably be a bit smaller now as well:

{F686704253}

{F686704295}

Reviewed By: antonk52

Differential Revision: D33062859

fbshipit-source-id: 5afaa4f2103d055188382a3370c1fffa295a298a
2021-12-16 14:54:59 -08:00
Michel Weststrate
73c6e8ee05 Make flipper server debuggable
Summary: This diffs adds debugging support to flipper server, by adding VSCode config for it

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32982874

fbshipit-source-id: 8e187ad05a05566a598db04b97e8b08e3de7e835
2021-12-13 05:48:16 -08:00
Michel Weststrate
7e50c0466a Move app/src (mostly) to flipper-ui-core/src
Summary:
This diff moves all UI code from app/src to app/flipper-ui-core. That is now slightly too much (e.g. node deps are not removed yet), but from here it should be easier to move things out again, as I don't want this diff to be open for too long to avoid too much merge conflicts.

* But at least flipper-ui-core is Electron free :)
* Killed all cross module imports as well, as they where now even more in the way
* Some unit test needed some changes, most not too big (but emotion hashes got renumbered in the snapshots, feel free to ignore that)
* Found some files that were actually meaningless (tsconfig in plugins, WatchTools files, that start generating compile errors, removed those

Follow up work:
* make flipper-ui-core configurable, and wire up flipper-server-core in Electron instead of here
* remove node deps (aigoncharov)
* figure out correct place to load GKs, plugins, make intern requests etc., and move to the correct module
* clean up deps

Reviewed By: aigoncharov

Differential Revision: D32427722

fbshipit-source-id: 14fe92e1ceb15b9dcf7bece367c8ab92df927a70
2021-11-16 05:29:21 -08:00
Anton Nikolaev
f58e5ef7c9 Updated launch.json to pass TZ=Pacific/Pohnpei on debugging jest tests in VSCode
Summary: Running jests tests now requires TZ to be set, so updated launch.json to pass it when debugging is started in VSCode.

Reviewed By: mweststrate

Differential Revision: D29162031

fbshipit-source-id: 7e767563dd2545f79603ef6a203601056f47414f
2021-06-17 07:39:43 -07:00
Anton Nikolaev
c4f3978c36 Use typescript SDK from node_modules for VSCode
Summary: Force using typescript SDK from node_modules instead of VSCode embedded version when "desktop" root folder opened. Before that we had this setting only when the root folder opened in VSCode.

Reviewed By: mweststrate

Differential Revision: D22508520

fbshipit-source-id: 3663f432f905094613f4c44b0d0d6eac02e1336d
2020-07-14 02:37:37 -07:00
Michel Weststrate
5db7820820 Add support for Jest runner
Summary:
This diff adds compatibility with https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest and makes sure the `yarn jest` command works without further arguments by defaulting to the unit test setup.

This makes tests runnable from VSCode, highlights which tests passed, and show errors inline (and coverage as well if desired), and will report failing tests in the problems panel.

{F235815220}

The debugger can be started right from the code pane as well by clicking the tiny 'debug'

{F235815208}

Currently set up the defaults to not start tests after startup, as it can be CPU hogging, so simply run the command CMD+SHIFT+P 'start jest runner' instead.

Reviewed By: passy

Differential Revision: D21325241

fbshipit-source-id: 7b87297a710a18bbac394110dc2006218ccc7d86
2020-04-30 06:32:34 -07:00
Anton Nikolaev
f506d0eb61 Fix auto-format for js files
Summary: Auto-format for js files was broken on my machine. It seems that there is a conflict between eslint and prettier and the latter is trying to format files after eslint using different rules for that. Option to disable prettier formatting for already formatted files fixed this issue for me.

Reviewed By: jknoxville

Differential Revision: D20994053

fbshipit-source-id: 6e90be7f58f2891ce2143bca8c3d76118b9cfba3
2020-04-14 07:20:40 -07:00
Anton Nikolaev
d98bf10646 Force "\n" line endings in VSCode on Windows
Summary:
1) Forced consistend line endings in VSCode on all OSes
2) Copied VSCode settings to both root folder and "desktop" subfolder so both these folders can be opened as VSCode workspace

Reviewed By: passy

Differential Revision: D20724126

fbshipit-source-id: b9e35c6a055457e05cd1c2d6145a58820cc511f8
2020-03-30 01:58:30 -07:00
Anton Nikolaev
74d8da7c4b VSCode settings
Summary:
1) Add VSCode settings to the source control, so users won't need to configure them
2) Copy VSCode settings to both "sonar" and "sonar/desktop" folders so both folders can be opened for development

Reviewed By: passy

Differential Revision: D20594643

fbshipit-source-id: 4331659008e4dbf9dfcc44a3723ab0612a3bd333
2020-03-23 04:29:08 -07:00
Anton Nikolaev
85c13bb1f3 Move desktop-related code to "desktop" subfolder (#872)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
2020-03-14 14:35:17 -07:00