Commit Graph

18 Commits

Author SHA1 Message Date
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
a3500c453b Fix linter / prettier not working when using sonar as VS Code workspace
Summary: Per title

Reviewed By: antonk52

Differential Revision: D33308303

fbshipit-source-id: b4786fe8070b12ae211b68aafdc32814ea53381e
2021-12-24 07:18:11 -08:00
Michel Weststrate
8b2d8498e6 Upgrade to TypeScript 3.9
Summary:
Upgrading to TypeScript 3.9 so that we can use `// ts-expect-error`, that allows us to basically write unit tests for typings.

Fixed the typescript path in `settings.json`, because otherwise VSCode kept picking the built-in version (3.8.3 atm) of ts when opening the `sonar` folder as workspace.

Reviewed By: passy

Differential Revision: D22255818

fbshipit-source-id: ae54aedb237445f32f1797b4290656dbfb0e528f
2020-07-01 09:12:36 -07:00
Michel Weststrate
7b69b96190 Fix code formatting
Summary:
Had some horrible dev experience caused by  VSCode and Jest not agreeing what snapshots should look like, every time saving a test in VSCode, it would break the jest snapshots. After investigating eslint and prettier, turned out VSCode itself was the culprit. Caused by a global user setting, but this makes sure nobody else runs into it :)

Also made sure Jest uses the correct prettier settings (it didn't before).

Reviewed By: passy

Differential Revision: D22114656

fbshipit-source-id: aef6c278a668bce049c96aba95c7a5101ca840ad
2020-06-19 03:54:49 -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
c21ccedf14 Dev mode: fixed loading plugins located outside of the Flipper source root folder
Summary: Dev mode: fixed loading of plugins located outside of the Flipper source root folder, e.g. in ~/flipper-plugins as suggested in tutorial docs.

Reviewed By: passy

Differential Revision: D21306639

fbshipit-source-id: bb9044b25324065f0c12169b95fbe663da8d4305
2020-04-30 04:29:41 -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
Anton Nikolaev
3ddd1c14f2 Bundle operation implementation
Summary: Plugin bundling operation implemented in flipper-pkg

Reviewed By: passy

Differential Revision: D20191845

fbshipit-source-id: 6a7156debf96668c323dcb740b33542f129f0689
2020-03-02 10:29:09 -08:00
Anton Nikolaev
ab0078a13f Typescriptify the main process code (14/N)
Summary: Converted scripts/yarn-install.js to typescript

Reviewed By: passy

Differential Revision: D20098071

fbshipit-source-id: be56a95a11089cd857efb00e62866213a88b739c
2020-02-27 05:45:24 -08:00
Anton Nikolaev
18c259dc22 Typescriptify the main process code (1/N)
Summary:
As a first step I've configured bundling for the main process code using Metro. For now I haven't converted anything to ts, just made that possible.

The bundle is just produced into the "static" directory. To avoid too many changes I kept the "static" folder as it is, but probably non-static code should be moved from there.

Also installed modules from "node_modules" for the main process are not bundled to avoid potential issues with node native modules.

Reviewed By: mweststrate

Differential Revision: D19960982

fbshipit-source-id: efbd426254e2b37c913c5f5f75f042c50ccee2f3
2020-02-24 05:23:45 -08:00
Anton Nikolaev
29258c3168 VSCode task to attach to both Main and Renderer processes simultaneously
Summary: The task for attaching to both Main and Renderer processes makes debugging in certain scenarios easier.

Reviewed By: passy

Differential Revision: D19813764

fbshipit-source-id: d81e07e5fb135b5bb904a3f6532347eca1a9bbb1
2020-02-10 06:26:51 -08:00
Anton Nikolaev
99d4d44957 VSCode debug task for debugging main process
Summary: Just a small task to make debugging of the main process easier

Reviewed By: jknoxville

Differential Revision: D19792592

fbshipit-source-id: 9d1060dbb58a01615230bff2361144cfc88e41b7
2020-02-10 03:44:55 -08:00
Anton Nikolaev
68510b53bf Debugging in VSCode
Summary:
This diff enables debugging in VSCode. Debugging works for both Flipper core and plugin code. To start debugging:
1. yarn start
2. Go to "Debug and Run" tab in VSCode, select task "Attach to Running Renderer" and launch it (or just press F5).
{F227135377}
3. Debugger will be attached and all the breakpoints set in VSCode will be hit.

Reviewed By: passy

Differential Revision: D19578566

fbshipit-source-id: 609766471ad196a2ee8d4086ddb84b7af4ef05ef
2020-01-27 06:14:46 -08:00
Anton Nikolaev
c0f902f81a Upgrade to emotion v10
Summary: React 16 is not compatible with react-emotion 9 (it prints warnings, see also https://github.com/emotion-js/emotion/issues/644). So we should upgrade to 10.

Reviewed By: mweststrate

Differential Revision: D18905889

fbshipit-source-id: c00d2dbbadb1c08544632cb9bfcd63f2b1818a25
2019-12-11 09:43:24 -08:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00