From 10d990c32cc7eaad6bf81dc6b32daf2d731c75c5 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Sat, 14 Mar 2020 14:26:07 -0700 Subject: [PATCH] Move plugins to "sonar/desktop/plugins" Summary: Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins". Fixed all the paths after moving. New "desktop" folder structure: - `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process. - `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process. - `plugins` - Flipper desktop JS plugins. - `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 desktop app. - `headless-tests` - Integration tests running agains Flipper headless version. Reviewed By: mweststrate Differential Revision: D20344186 fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0 --- .flowconfig | 14 ++++---- README.md | 6 ++-- desktop/.eslintignore | 2 +- desktop/package.json | 14 ++++---- desktop/pkg/src/transforms/fb-stubs.js | 10 ++++-- .../plugins/cpu/TemperatureTable.tsx | 0 desktop/{src => }/plugins/cpu/index.tsx | 0 desktop/{src => }/plugins/cpu/package.json | 0 desktop/{src => }/plugins/cpu/yarn.lock | 0 .../testCrashReporterPlugin.electron.js | 7 ++-- .../{src => }/plugins/crash_reporter/index.js | 2 +- .../plugins/crash_reporter/package.json | 0 .../plugins/crash_reporter/yarn.lock | 0 .../plugins/databases/ButtonNavigation.js | 0 .../plugins/databases/ClientProtocol.js | 0 desktop/{src => }/plugins/databases/index.js | 0 .../{src => }/plugins/databases/package.json | 0 desktop/{src => }/plugins/databases/yarn.lock | 0 desktop/{src => }/plugins/example/index.tsx | 0 .../{src => }/plugins/example/package.json | 0 desktop/{src => }/plugins/example/yarn.lock | 0 .../{src => }/plugins/fresco/ImagePool.tsx | 0 .../plugins/fresco/ImagesCacheOverview.tsx | 0 .../plugins/fresco/ImagesSidebar.tsx | 0 .../plugins/fresco/MultipleSelect.tsx | 0 .../__snapshots__/index.node.tsx.snap | 0 .../plugins/fresco/__tests__/index.node.tsx | 3 +- desktop/{src => }/plugins/fresco/api.tsx | 0 desktop/{src => }/plugins/fresco/index.tsx | 3 +- desktop/{src => }/plugins/fresco/package.json | 0 desktop/{src => }/plugins/fresco/yarn.lock | 0 .../plugins/kaios-allocations/index.tsx | 0 .../plugins/kaios-allocations/package.json | 0 .../patches/firefox-client+0.3.0.patch | 0 .../types/firefox-client.d.tsx | 0 .../plugins/kaios-allocations/yarn.lock | 0 desktop/{src => }/plugins/kaios-ram/index.tsx | 0 .../{src => }/plugins/kaios-ram/package.json | 0 desktop/{src => }/plugins/kaios-ram/yarn.lock | 0 .../{src => }/plugins/layout/Inspector.tsx | 0 .../plugins/layout/InspectorSidebar.tsx | 4 +-- .../plugins/layout/ProxyArchiveClient.tsx | 0 desktop/{src => }/plugins/layout/Search.tsx | 0 .../{src => }/plugins/layout/ToolbarIcon.tsx | 0 .../__tests__/ProxyArchiveClient.node.tsx | 0 desktop/{src => }/plugins/layout/index.tsx | 0 desktop/{src => }/plugins/layout/package.json | 0 desktop/{src => }/plugins/layout/yarn.lock | 0 .../{src => }/plugins/leak_canary/index.tsx | 0 .../plugins/leak_canary/package.json | 0 .../plugins/leak_canary/processLeakString.tsx | 0 .../{src => }/plugins/leak_canary/yarn.lock | 0 desktop/{src => }/plugins/logs/LogWatcher.tsx | 0 .../plugins/logs/__tests__/index.node.js | 0 desktop/{src => }/plugins/logs/index.tsx | 5 +-- desktop/{src => }/plugins/logs/package.json | 0 desktop/{src => }/plugins/logs/yarn.lock | 0 .../__tests__/testAutoCompleteSearch.node.tsx | 0 .../navigation/__tests__/testURI.node.tsx | 0 .../components/AutoCompleteSheet.tsx | 0 .../components/BookmarksSidebar.tsx | 0 .../navigation/components/FavoriteButton.tsx | 0 .../navigation/components/IconButton.tsx | 0 .../components/NavigationInfoBox.tsx | 0 .../components/RequiredParametersDialog.tsx | 0 .../components/SaveBookmarkDialog.tsx | 0 .../navigation/components/SearchBar.tsx | 0 .../navigation/components/Timeline.tsx | 0 .../plugins/navigation/components/index.tsx | 0 .../navigation/hooks/autoCompleteSheet.tsx | 0 .../navigation/hooks/requiredParameters.tsx | 0 .../{src => }/plugins/navigation/index.tsx | 0 .../{src => }/plugins/navigation/package.json | 0 .../{src => }/plugins/navigation/types.tsx | 0 .../navigation/util/appMatchPatterns.tsx | 0 .../navigation/util/autoCompleteProvider.tsx | 0 .../plugins/navigation/util/indexedDB.tsx | 0 .../{src => }/plugins/navigation/util/uri.tsx | 0 .../{src => }/plugins/navigation/yarn.lock | 0 .../plugins/network/RequestDetails.tsx | 0 .../__tests__/requestToCurlCommand.node.tsx | 0 desktop/{src => }/plugins/network/index.tsx | 0 .../{src => }/plugins/network/package.json | 0 desktop/{src => }/plugins/network/types.tsx | 0 desktop/{src => }/plugins/network/utils.tsx | 0 desktop/{src => }/plugins/network/yarn.lock | 0 .../plugins/reactdevtools/get-port.d.tsx | 0 .../{src => }/plugins/reactdevtools/index.tsx | 0 .../plugins/reactdevtools/package.json | 0 .../reactdevtools/react-devtools-core.d.tsx | 0 .../{src => }/plugins/reactdevtools/yarn.lock | 0 .../plugins/rn-tic-tac-toe/index.tsx | 0 .../plugins/rn-tic-tac-toe/package.json | 0 .../plugins/rn-tic-tac-toe/yarn.lock | 0 desktop/{src => }/plugins/sandbox/index.tsx | 0 .../{src => }/plugins/sandbox/package.json | 0 desktop/{src => }/plugins/sandbox/yarn.lock | 0 .../{src => }/plugins/seamammals/index.tsx | 0 .../{src => }/plugins/seamammals/package.json | 0 .../{src => }/plugins/seamammals/yarn.lock | 0 .../plugins/sections/DetailsPanel.js | 0 .../{src => }/plugins/sections/EventsTable.js | 0 desktop/{src => }/plugins/sections/Models.js | 0 .../{src => }/plugins/sections/StackTrace.js | 0 desktop/{src => }/plugins/sections/Tree.js | 0 desktop/{src => }/plugins/sections/d3/LICENSE | 0 desktop/{src => }/plugins/sections/d3/d3.js | 0 .../plugins/sections/d3/package.json | 0 desktop/{src => }/plugins/sections/index.js | 0 .../{src => }/plugins/sections/package.json | 0 desktop/{src => }/plugins/sections/yarn.lock | 0 .../plugins/shared_preferences/index.js | 0 .../plugins/shared_preferences/package.json | 0 .../plugins/shared_preferences/yarn.lock | 0 desktop/scripts/build-utils.ts | 4 +-- desktop/scripts/start-dev-server.ts | 7 +--- desktop/scripts/yarn-install.ts | 6 ++-- desktop/src/chrome/LocationsButton.tsx | 4 +-- desktop/src/index.tsx | 3 ++ desktop/src/utils/fbEmployee.tsx | 3 +- desktop/src/utils/js-client/serverUtils.tsx | 6 ++-- desktop/static/main.ts | 4 +-- desktop/static/package.json | 3 +- desktop/static/transforms/fb-stubs.js | 10 ++++-- desktop/static/yarn.lock | 5 +++ desktop/tsconfig.json | 2 +- desktop/types/metro.d.tsx | 10 ++++++ docs/extending/testing.md | 2 +- docs/tutorial/js-setup.md | 2 +- docs/tutorial/js-table.md | 2 +- docs/tutorial/react-native.md | 2 +- greenkeeper.json | 36 +++++++++---------- react-native/react-native-flipper/README.md | 2 +- 133 files changed, 106 insertions(+), 77 deletions(-) rename desktop/{src => }/plugins/cpu/TemperatureTable.tsx (100%) rename desktop/{src => }/plugins/cpu/index.tsx (100%) rename desktop/{src => }/plugins/cpu/package.json (100%) rename desktop/{src => }/plugins/cpu/yarn.lock (100%) rename desktop/{src => }/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js (99%) rename desktop/{src => }/plugins/crash_reporter/index.js (99%) rename desktop/{src => }/plugins/crash_reporter/package.json (100%) rename desktop/{src => }/plugins/crash_reporter/yarn.lock (100%) rename desktop/{src => }/plugins/databases/ButtonNavigation.js (100%) rename desktop/{src => }/plugins/databases/ClientProtocol.js (100%) rename desktop/{src => }/plugins/databases/index.js (100%) rename desktop/{src => }/plugins/databases/package.json (100%) rename desktop/{src => }/plugins/databases/yarn.lock (100%) rename desktop/{src => }/plugins/example/index.tsx (100%) rename desktop/{src => }/plugins/example/package.json (100%) rename desktop/{src => }/plugins/example/yarn.lock (100%) rename desktop/{src => }/plugins/fresco/ImagePool.tsx (100%) rename desktop/{src => }/plugins/fresco/ImagesCacheOverview.tsx (100%) rename desktop/{src => }/plugins/fresco/ImagesSidebar.tsx (100%) rename desktop/{src => }/plugins/fresco/MultipleSelect.tsx (100%) rename desktop/{src => }/plugins/fresco/__tests__/__snapshots__/index.node.tsx.snap (100%) rename desktop/{src => }/plugins/fresco/__tests__/index.node.tsx (99%) rename desktop/{src => }/plugins/fresco/api.tsx (100%) rename desktop/{src => }/plugins/fresco/index.tsx (99%) rename desktop/{src => }/plugins/fresco/package.json (100%) rename desktop/{src => }/plugins/fresco/yarn.lock (100%) rename desktop/{src => }/plugins/kaios-allocations/index.tsx (100%) rename desktop/{src => }/plugins/kaios-allocations/package.json (100%) rename desktop/{src => }/plugins/kaios-allocations/patches/firefox-client+0.3.0.patch (100%) rename desktop/{src => }/plugins/kaios-allocations/types/firefox-client.d.tsx (100%) rename desktop/{src => }/plugins/kaios-allocations/yarn.lock (100%) rename desktop/{src => }/plugins/kaios-ram/index.tsx (100%) rename desktop/{src => }/plugins/kaios-ram/package.json (100%) rename desktop/{src => }/plugins/kaios-ram/yarn.lock (100%) rename desktop/{src => }/plugins/layout/Inspector.tsx (100%) rename desktop/{src => }/plugins/layout/InspectorSidebar.tsx (98%) rename desktop/{src => }/plugins/layout/ProxyArchiveClient.tsx (100%) rename desktop/{src => }/plugins/layout/Search.tsx (100%) rename desktop/{src => }/plugins/layout/ToolbarIcon.tsx (100%) rename desktop/{src => }/plugins/layout/__tests__/ProxyArchiveClient.node.tsx (100%) rename desktop/{src => }/plugins/layout/index.tsx (100%) rename desktop/{src => }/plugins/layout/package.json (100%) rename desktop/{src => }/plugins/layout/yarn.lock (100%) rename desktop/{src => }/plugins/leak_canary/index.tsx (100%) rename desktop/{src => }/plugins/leak_canary/package.json (100%) rename desktop/{src => }/plugins/leak_canary/processLeakString.tsx (100%) rename desktop/{src => }/plugins/leak_canary/yarn.lock (100%) rename desktop/{src => }/plugins/logs/LogWatcher.tsx (100%) rename desktop/{src => }/plugins/logs/__tests__/index.node.js (100%) rename desktop/{src => }/plugins/logs/index.tsx (99%) rename desktop/{src => }/plugins/logs/package.json (100%) rename desktop/{src => }/plugins/logs/yarn.lock (100%) rename desktop/{src => }/plugins/navigation/__tests__/testAutoCompleteSearch.node.tsx (100%) rename desktop/{src => }/plugins/navigation/__tests__/testURI.node.tsx (100%) rename desktop/{src => }/plugins/navigation/components/AutoCompleteSheet.tsx (100%) rename desktop/{src => }/plugins/navigation/components/BookmarksSidebar.tsx (100%) rename desktop/{src => }/plugins/navigation/components/FavoriteButton.tsx (100%) rename desktop/{src => }/plugins/navigation/components/IconButton.tsx (100%) rename desktop/{src => }/plugins/navigation/components/NavigationInfoBox.tsx (100%) rename desktop/{src => }/plugins/navigation/components/RequiredParametersDialog.tsx (100%) rename desktop/{src => }/plugins/navigation/components/SaveBookmarkDialog.tsx (100%) rename desktop/{src => }/plugins/navigation/components/SearchBar.tsx (100%) rename desktop/{src => }/plugins/navigation/components/Timeline.tsx (100%) rename desktop/{src => }/plugins/navigation/components/index.tsx (100%) rename desktop/{src => }/plugins/navigation/hooks/autoCompleteSheet.tsx (100%) rename desktop/{src => }/plugins/navigation/hooks/requiredParameters.tsx (100%) rename desktop/{src => }/plugins/navigation/index.tsx (100%) rename desktop/{src => }/plugins/navigation/package.json (100%) rename desktop/{src => }/plugins/navigation/types.tsx (100%) rename desktop/{src => }/plugins/navigation/util/appMatchPatterns.tsx (100%) rename desktop/{src => }/plugins/navigation/util/autoCompleteProvider.tsx (100%) rename desktop/{src => }/plugins/navigation/util/indexedDB.tsx (100%) rename desktop/{src => }/plugins/navigation/util/uri.tsx (100%) rename desktop/{src => }/plugins/navigation/yarn.lock (100%) rename desktop/{src => }/plugins/network/RequestDetails.tsx (100%) rename desktop/{src => }/plugins/network/__tests__/requestToCurlCommand.node.tsx (100%) rename desktop/{src => }/plugins/network/index.tsx (100%) rename desktop/{src => }/plugins/network/package.json (100%) rename desktop/{src => }/plugins/network/types.tsx (100%) rename desktop/{src => }/plugins/network/utils.tsx (100%) rename desktop/{src => }/plugins/network/yarn.lock (100%) rename desktop/{src => }/plugins/reactdevtools/get-port.d.tsx (100%) rename desktop/{src => }/plugins/reactdevtools/index.tsx (100%) rename desktop/{src => }/plugins/reactdevtools/package.json (100%) rename desktop/{src => }/plugins/reactdevtools/react-devtools-core.d.tsx (100%) rename desktop/{src => }/plugins/reactdevtools/yarn.lock (100%) rename desktop/{src => }/plugins/rn-tic-tac-toe/index.tsx (100%) rename desktop/{src => }/plugins/rn-tic-tac-toe/package.json (100%) rename desktop/{src => }/plugins/rn-tic-tac-toe/yarn.lock (100%) rename desktop/{src => }/plugins/sandbox/index.tsx (100%) rename desktop/{src => }/plugins/sandbox/package.json (100%) rename desktop/{src => }/plugins/sandbox/yarn.lock (100%) rename desktop/{src => }/plugins/seamammals/index.tsx (100%) rename desktop/{src => }/plugins/seamammals/package.json (100%) rename desktop/{src => }/plugins/seamammals/yarn.lock (100%) rename desktop/{src => }/plugins/sections/DetailsPanel.js (100%) rename desktop/{src => }/plugins/sections/EventsTable.js (100%) rename desktop/{src => }/plugins/sections/Models.js (100%) rename desktop/{src => }/plugins/sections/StackTrace.js (100%) rename desktop/{src => }/plugins/sections/Tree.js (100%) rename desktop/{src => }/plugins/sections/d3/LICENSE (100%) rename desktop/{src => }/plugins/sections/d3/d3.js (100%) rename desktop/{src => }/plugins/sections/d3/package.json (100%) rename desktop/{src => }/plugins/sections/index.js (100%) rename desktop/{src => }/plugins/sections/package.json (100%) rename desktop/{src => }/plugins/sections/yarn.lock (100%) rename desktop/{src => }/plugins/shared_preferences/index.js (100%) rename desktop/{src => }/plugins/shared_preferences/package.json (100%) rename desktop/{src => }/plugins/shared_preferences/yarn.lock (100%) create mode 100644 desktop/types/metro.d.tsx diff --git a/.flowconfig b/.flowconfig index 712d40eb8..0b4d50cc5 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,16 +1,18 @@ [ignore] -.*/scripts/.* .*/coverage/.* .*/build/.* -.*/pkg/.* .*/dist/.* -.*/static/.* -/desktop/src/fb/plugins/relaydevtools/relay-devtools/DevtoolsUI.js$ -.*/website/.* -/desktop/src/plugins/sections/d3/d3.js$ .*\.tsx +.*\.ts .*/node_modules/.* +/scripts/.* +/desktop/scripts/.* +/desktop/static/.* +/desktop/pkg/.* /desktop/doctor/.* +/desktop/plugins/fb/relaydevtools/relay-devtools/DevtoolsUI.js$ +/website/.* +/desktop/plugins/sections/d3/d3.js$ /react-native/ReactNativeFlipperExample/.* [libs] diff --git a/README.md b/README.md index 78cbe8025..dfedf728f 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,9 @@ This repository includes all parts of Flipper. This includes: * native Flipper SDKs for Android (`/android`) * Plugins: * Logs (`/desktop/src/device-plugins/logs`) - * Layout inspector (`/desktop/src/plugins/layout`) - * Network inspector (`/desktop/src/plugins/network`) - * Shared Preferences/NSUserDefaults inspector (`/desktop/src/plugins/shared_preferences`) + * Layout inspector (`/desktop/plugins/layout`) + * Network inspector (`/desktop/plugins/network`) + * Shared Preferences/NSUserDefaults inspector (`/desktop/plugins/shared_preferences`) * website and documentation (`/website` / `/docs`) # Getting started diff --git a/desktop/.eslintignore b/desktop/.eslintignore index f42ab4448..7ab311a1c 100644 --- a/desktop/.eslintignore +++ b/desktop/.eslintignore @@ -1,5 +1,5 @@ *.bundle.js -src/fb/plugins/relaydevtools/relay-devtools/* +plugins/fb/relaydevtools/relay-devtools/* latest resources templates diff --git a/desktop/package.json b/desktop/package.json index 5a76753e4..8c5cdc82c 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -237,10 +237,10 @@ "scripts": { "preinstall": "node scripts/prepare-watchman-config.js && yarn config set ignore-engines", "postinstall": "cross-env TS_NODE_FILES=true node --require ts-node/register scripts/yarn-install.ts && patch-package", - "rm-dist": "rimraf dist", - "rm-modules": "rimraf node_modules static/node_modules", + "rm-dist": "rimraf ../dist", + "rm-modules": "rimraf plugins/**/node_modules pkg/node_modules doctor/node_modules static/node_modules node_modules", "rm-temp": "rimraf $TMPDIR/jest* $TMPDIR/react-native-packager*", - "rm-bundle": "rimraf static/main.bundle.*", + "rm-bundle": "rimraf static/main.bundle.* pkg/lib doctor/lib", "reset": "yarn rm-dist && yarn rm-temp && yarn cache clean && yarn rm-bundle && yarn rm-modules", "start": "cross-env NODE_ENV=development TS_NODE_FILES=true node --require ts-node/register scripts/start-dev-server.ts --inspect=9229", "start:break": "cross-env NODE_ENV=development TS_NODE_FILES=true node --require ts-node/register scripts/start-dev-server.ts --inspect-brk=9229", @@ -252,10 +252,10 @@ "test:debug": "node --inspect node_modules/.bin/jest --runInBand", "test-electron": "jest --testPathPattern=\"electron\\.(js|tsx)$\" --testEnvironment=@jest-runner/electron/environment --runner=@jest-runner/electron --no-cache", "test-with-device": "USE_ELECTRON_STUBS=1 jest --testPathPattern=\"device\\.(js|tsx)$\" --detectOpenHandles --no-cache", - "tsc": "tsc --noemit", - "eslint": "eslint . --ext .js,.ts,.tsx", - "flow": "flow check", - "lint": "yarn eslint && yarn flow && yarn tsc", + "lint:tsc": "tsc --noemit", + "lint:eslint": "eslint . --ext .js,.ts,.tsx", + "lint:flow": "flow check", + "lint": "yarn lint:eslint && yarn lint:flow && yarn lint:tsc", "everything": "yarn reset && yarn install && yarn lint && yarn test && yarn test-electron && yarn build --mac --win --linux && yarn build-headless --mac --linux && yarn start" }, "optionalDependencies": { diff --git a/desktop/pkg/src/transforms/fb-stubs.js b/desktop/pkg/src/transforms/fb-stubs.js index 3a01e19bc..6c3f74053 100644 --- a/desktop/pkg/src/transforms/fb-stubs.js +++ b/desktop/pkg/src/transforms/fb-stubs.js @@ -12,6 +12,7 @@ const path = require('path'); const replaceFBStubs = fs.existsSync( path.join(__dirname, '..', '..', 'src', 'fb'), ); +const isFBFile = filePath => filePath.includes(`${path.sep}fb${path.sep}`); const requireFromFolder = (folder, path) => new RegExp(folder + '/[A-Za-z0-9.-_]+(.js)?$', 'g').test(path); @@ -20,7 +21,7 @@ module.exports = function(babel) { return { name: 'replace-dynamic-requires', visitor: { - CallExpression(path) { + CallExpression(path, state) { if ( replaceFBStubs && path.node.type === 'CallExpression' && @@ -28,9 +29,12 @@ module.exports = function(babel) { path.node.callee.name === 'require' && path.node.arguments.length > 0 ) { - if (requireFromFolder('fb', path.node.arguments[0].value)) { + if ( + requireFromFolder('fb', path.node.arguments[0].value) && + !isFBFile(state.file.opts.filename) + ) { throw new Error( - 'Do not require directly from fb/, but rather from fb-stubs/ to not break flow-typing and make sure stubs are up-to-date.', + 'For files which are not under fb/ do not require directly from fb/, but rather from fb-stubs/ to not break flow-typing and make sure stubs are up-to-date.', ); } else if ( requireFromFolder('fb-stubs', path.node.arguments[0].value) diff --git a/desktop/src/plugins/cpu/TemperatureTable.tsx b/desktop/plugins/cpu/TemperatureTable.tsx similarity index 100% rename from desktop/src/plugins/cpu/TemperatureTable.tsx rename to desktop/plugins/cpu/TemperatureTable.tsx diff --git a/desktop/src/plugins/cpu/index.tsx b/desktop/plugins/cpu/index.tsx similarity index 100% rename from desktop/src/plugins/cpu/index.tsx rename to desktop/plugins/cpu/index.tsx diff --git a/desktop/src/plugins/cpu/package.json b/desktop/plugins/cpu/package.json similarity index 100% rename from desktop/src/plugins/cpu/package.json rename to desktop/plugins/cpu/package.json diff --git a/desktop/src/plugins/cpu/yarn.lock b/desktop/plugins/cpu/yarn.lock similarity index 100% rename from desktop/src/plugins/cpu/yarn.lock rename to desktop/plugins/cpu/yarn.lock diff --git a/desktop/src/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js b/desktop/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js similarity index 99% rename from desktop/src/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js rename to desktop/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js index 7d37fb433..1b9f3ddde 100644 --- a/desktop/src/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js +++ b/desktop/plugins/crash_reporter/__tests__/testCrashReporterPlugin.electron.js @@ -7,7 +7,7 @@ * @format */ -import BaseDevice from '../../../devices/BaseDevice.tsx'; +import BaseDevice from '../../../src/devices/BaseDevice.tsx'; import CrashReporterPlugin from '../../crash_reporter'; import type {PersistedState, Crash} from '../../crash_reporter'; import { @@ -16,7 +16,10 @@ import { parsePath, shouldShowCrashNotification, } from '../../crash_reporter'; -import {getPluginKey, getPersistedState} from '../../../utils/pluginUtils.tsx'; +import { + getPluginKey, + getPersistedState, +} from '../../../src/utils/pluginUtils.tsx'; function setDefaultPersistedState(defaultState: PersistedState) { CrashReporterPlugin.defaultPersistedState = defaultState; diff --git a/desktop/src/plugins/crash_reporter/index.js b/desktop/plugins/crash_reporter/index.js similarity index 99% rename from desktop/src/plugins/crash_reporter/index.js rename to desktop/plugins/crash_reporter/index.js index f91d2e8fb..e64314456 100644 --- a/desktop/src/plugins/crash_reporter/index.js +++ b/desktop/plugins/crash_reporter/index.js @@ -35,7 +35,7 @@ import os from 'os'; import util from 'util'; import path from 'path'; import {promisify} from 'util'; -import type {Notification} from '../../plugin.tsx'; +import type {Notification} from '../../src/plugin.tsx'; import type {Store, DeviceLogEntry, OS, Props} from 'flipper'; import {Component} from 'react'; diff --git a/desktop/src/plugins/crash_reporter/package.json b/desktop/plugins/crash_reporter/package.json similarity index 100% rename from desktop/src/plugins/crash_reporter/package.json rename to desktop/plugins/crash_reporter/package.json diff --git a/desktop/src/plugins/crash_reporter/yarn.lock b/desktop/plugins/crash_reporter/yarn.lock similarity index 100% rename from desktop/src/plugins/crash_reporter/yarn.lock rename to desktop/plugins/crash_reporter/yarn.lock diff --git a/desktop/src/plugins/databases/ButtonNavigation.js b/desktop/plugins/databases/ButtonNavigation.js similarity index 100% rename from desktop/src/plugins/databases/ButtonNavigation.js rename to desktop/plugins/databases/ButtonNavigation.js diff --git a/desktop/src/plugins/databases/ClientProtocol.js b/desktop/plugins/databases/ClientProtocol.js similarity index 100% rename from desktop/src/plugins/databases/ClientProtocol.js rename to desktop/plugins/databases/ClientProtocol.js diff --git a/desktop/src/plugins/databases/index.js b/desktop/plugins/databases/index.js similarity index 100% rename from desktop/src/plugins/databases/index.js rename to desktop/plugins/databases/index.js diff --git a/desktop/src/plugins/databases/package.json b/desktop/plugins/databases/package.json similarity index 100% rename from desktop/src/plugins/databases/package.json rename to desktop/plugins/databases/package.json diff --git a/desktop/src/plugins/databases/yarn.lock b/desktop/plugins/databases/yarn.lock similarity index 100% rename from desktop/src/plugins/databases/yarn.lock rename to desktop/plugins/databases/yarn.lock diff --git a/desktop/src/plugins/example/index.tsx b/desktop/plugins/example/index.tsx similarity index 100% rename from desktop/src/plugins/example/index.tsx rename to desktop/plugins/example/index.tsx diff --git a/desktop/src/plugins/example/package.json b/desktop/plugins/example/package.json similarity index 100% rename from desktop/src/plugins/example/package.json rename to desktop/plugins/example/package.json diff --git a/desktop/src/plugins/example/yarn.lock b/desktop/plugins/example/yarn.lock similarity index 100% rename from desktop/src/plugins/example/yarn.lock rename to desktop/plugins/example/yarn.lock diff --git a/desktop/src/plugins/fresco/ImagePool.tsx b/desktop/plugins/fresco/ImagePool.tsx similarity index 100% rename from desktop/src/plugins/fresco/ImagePool.tsx rename to desktop/plugins/fresco/ImagePool.tsx diff --git a/desktop/src/plugins/fresco/ImagesCacheOverview.tsx b/desktop/plugins/fresco/ImagesCacheOverview.tsx similarity index 100% rename from desktop/src/plugins/fresco/ImagesCacheOverview.tsx rename to desktop/plugins/fresco/ImagesCacheOverview.tsx diff --git a/desktop/src/plugins/fresco/ImagesSidebar.tsx b/desktop/plugins/fresco/ImagesSidebar.tsx similarity index 100% rename from desktop/src/plugins/fresco/ImagesSidebar.tsx rename to desktop/plugins/fresco/ImagesSidebar.tsx diff --git a/desktop/src/plugins/fresco/MultipleSelect.tsx b/desktop/plugins/fresco/MultipleSelect.tsx similarity index 100% rename from desktop/src/plugins/fresco/MultipleSelect.tsx rename to desktop/plugins/fresco/MultipleSelect.tsx diff --git a/desktop/src/plugins/fresco/__tests__/__snapshots__/index.node.tsx.snap b/desktop/plugins/fresco/__tests__/__snapshots__/index.node.tsx.snap similarity index 100% rename from desktop/src/plugins/fresco/__tests__/__snapshots__/index.node.tsx.snap rename to desktop/plugins/fresco/__tests__/__snapshots__/index.node.tsx.snap diff --git a/desktop/src/plugins/fresco/__tests__/index.node.tsx b/desktop/plugins/fresco/__tests__/index.node.tsx similarity index 99% rename from desktop/src/plugins/fresco/__tests__/index.node.tsx rename to desktop/plugins/fresco/__tests__/index.node.tsx index d6755ac3b..0b9de1c5f 100644 --- a/desktop/src/plugins/fresco/__tests__/index.node.tsx +++ b/desktop/plugins/fresco/__tests__/index.node.tsx @@ -10,8 +10,7 @@ import FrescoPlugin from '../index'; import {PersistedState, ImageEventWithId} from '../index'; import {AndroidCloseableReferenceLeakEvent} from '../api'; -import {MetricType} from 'flipper'; -import {Notification} from '../../../plugin'; +import {MetricType, Notification} from 'flipper'; import {ImagesMap} from '../ImagePool'; type ScanDisplayTime = {[scan_number: number]: number}; diff --git a/desktop/src/plugins/fresco/api.tsx b/desktop/plugins/fresco/api.tsx similarity index 100% rename from desktop/src/plugins/fresco/api.tsx rename to desktop/plugins/fresco/api.tsx diff --git a/desktop/src/plugins/fresco/index.tsx b/desktop/plugins/fresco/index.tsx similarity index 99% rename from desktop/src/plugins/fresco/index.tsx rename to desktop/plugins/fresco/index.tsx index 749242236..1e83c6e47 100644 --- a/desktop/src/plugins/fresco/index.tsx +++ b/desktop/plugins/fresco/index.tsx @@ -30,10 +30,11 @@ import { colors, styled, isProduction, + Notification, + BaseAction, } from 'flipper'; import ImagesSidebar from './ImagesSidebar'; import ImagePool from './ImagePool'; -import {Notification, BaseAction} from '../../plugin'; export type ImageEventWithId = ImageEvent & {eventId: number}; diff --git a/desktop/src/plugins/fresco/package.json b/desktop/plugins/fresco/package.json similarity index 100% rename from desktop/src/plugins/fresco/package.json rename to desktop/plugins/fresco/package.json diff --git a/desktop/src/plugins/fresco/yarn.lock b/desktop/plugins/fresco/yarn.lock similarity index 100% rename from desktop/src/plugins/fresco/yarn.lock rename to desktop/plugins/fresco/yarn.lock diff --git a/desktop/src/plugins/kaios-allocations/index.tsx b/desktop/plugins/kaios-allocations/index.tsx similarity index 100% rename from desktop/src/plugins/kaios-allocations/index.tsx rename to desktop/plugins/kaios-allocations/index.tsx diff --git a/desktop/src/plugins/kaios-allocations/package.json b/desktop/plugins/kaios-allocations/package.json similarity index 100% rename from desktop/src/plugins/kaios-allocations/package.json rename to desktop/plugins/kaios-allocations/package.json diff --git a/desktop/src/plugins/kaios-allocations/patches/firefox-client+0.3.0.patch b/desktop/plugins/kaios-allocations/patches/firefox-client+0.3.0.patch similarity index 100% rename from desktop/src/plugins/kaios-allocations/patches/firefox-client+0.3.0.patch rename to desktop/plugins/kaios-allocations/patches/firefox-client+0.3.0.patch diff --git a/desktop/src/plugins/kaios-allocations/types/firefox-client.d.tsx b/desktop/plugins/kaios-allocations/types/firefox-client.d.tsx similarity index 100% rename from desktop/src/plugins/kaios-allocations/types/firefox-client.d.tsx rename to desktop/plugins/kaios-allocations/types/firefox-client.d.tsx diff --git a/desktop/src/plugins/kaios-allocations/yarn.lock b/desktop/plugins/kaios-allocations/yarn.lock similarity index 100% rename from desktop/src/plugins/kaios-allocations/yarn.lock rename to desktop/plugins/kaios-allocations/yarn.lock diff --git a/desktop/src/plugins/kaios-ram/index.tsx b/desktop/plugins/kaios-ram/index.tsx similarity index 100% rename from desktop/src/plugins/kaios-ram/index.tsx rename to desktop/plugins/kaios-ram/index.tsx diff --git a/desktop/src/plugins/kaios-ram/package.json b/desktop/plugins/kaios-ram/package.json similarity index 100% rename from desktop/src/plugins/kaios-ram/package.json rename to desktop/plugins/kaios-ram/package.json diff --git a/desktop/src/plugins/kaios-ram/yarn.lock b/desktop/plugins/kaios-ram/yarn.lock similarity index 100% rename from desktop/src/plugins/kaios-ram/yarn.lock rename to desktop/plugins/kaios-ram/yarn.lock diff --git a/desktop/src/plugins/layout/Inspector.tsx b/desktop/plugins/layout/Inspector.tsx similarity index 100% rename from desktop/src/plugins/layout/Inspector.tsx rename to desktop/plugins/layout/Inspector.tsx diff --git a/desktop/src/plugins/layout/InspectorSidebar.tsx b/desktop/plugins/layout/InspectorSidebar.tsx similarity index 98% rename from desktop/src/plugins/layout/InspectorSidebar.tsx rename to desktop/plugins/layout/InspectorSidebar.tsx index 01197cf70..7026575f3 100644 --- a/desktop/src/plugins/layout/InspectorSidebar.tsx +++ b/desktop/plugins/layout/InspectorSidebar.tsx @@ -16,9 +16,9 @@ import { PluginClient, SidebarExtensions, Element, + Client, + Logger, } from 'flipper'; -import Client from '../../Client'; -import {Logger} from '../../fb-interfaces/Logger'; import {Component} from 'react'; import deepEqual from 'deep-equal'; import React from 'react'; diff --git a/desktop/src/plugins/layout/ProxyArchiveClient.tsx b/desktop/plugins/layout/ProxyArchiveClient.tsx similarity index 100% rename from desktop/src/plugins/layout/ProxyArchiveClient.tsx rename to desktop/plugins/layout/ProxyArchiveClient.tsx diff --git a/desktop/src/plugins/layout/Search.tsx b/desktop/plugins/layout/Search.tsx similarity index 100% rename from desktop/src/plugins/layout/Search.tsx rename to desktop/plugins/layout/Search.tsx diff --git a/desktop/src/plugins/layout/ToolbarIcon.tsx b/desktop/plugins/layout/ToolbarIcon.tsx similarity index 100% rename from desktop/src/plugins/layout/ToolbarIcon.tsx rename to desktop/plugins/layout/ToolbarIcon.tsx diff --git a/desktop/src/plugins/layout/__tests__/ProxyArchiveClient.node.tsx b/desktop/plugins/layout/__tests__/ProxyArchiveClient.node.tsx similarity index 100% rename from desktop/src/plugins/layout/__tests__/ProxyArchiveClient.node.tsx rename to desktop/plugins/layout/__tests__/ProxyArchiveClient.node.tsx diff --git a/desktop/src/plugins/layout/index.tsx b/desktop/plugins/layout/index.tsx similarity index 100% rename from desktop/src/plugins/layout/index.tsx rename to desktop/plugins/layout/index.tsx diff --git a/desktop/src/plugins/layout/package.json b/desktop/plugins/layout/package.json similarity index 100% rename from desktop/src/plugins/layout/package.json rename to desktop/plugins/layout/package.json diff --git a/desktop/src/plugins/layout/yarn.lock b/desktop/plugins/layout/yarn.lock similarity index 100% rename from desktop/src/plugins/layout/yarn.lock rename to desktop/plugins/layout/yarn.lock diff --git a/desktop/src/plugins/leak_canary/index.tsx b/desktop/plugins/leak_canary/index.tsx similarity index 100% rename from desktop/src/plugins/leak_canary/index.tsx rename to desktop/plugins/leak_canary/index.tsx diff --git a/desktop/src/plugins/leak_canary/package.json b/desktop/plugins/leak_canary/package.json similarity index 100% rename from desktop/src/plugins/leak_canary/package.json rename to desktop/plugins/leak_canary/package.json diff --git a/desktop/src/plugins/leak_canary/processLeakString.tsx b/desktop/plugins/leak_canary/processLeakString.tsx similarity index 100% rename from desktop/src/plugins/leak_canary/processLeakString.tsx rename to desktop/plugins/leak_canary/processLeakString.tsx diff --git a/desktop/src/plugins/leak_canary/yarn.lock b/desktop/plugins/leak_canary/yarn.lock similarity index 100% rename from desktop/src/plugins/leak_canary/yarn.lock rename to desktop/plugins/leak_canary/yarn.lock diff --git a/desktop/src/plugins/logs/LogWatcher.tsx b/desktop/plugins/logs/LogWatcher.tsx similarity index 100% rename from desktop/src/plugins/logs/LogWatcher.tsx rename to desktop/plugins/logs/LogWatcher.tsx diff --git a/desktop/src/plugins/logs/__tests__/index.node.js b/desktop/plugins/logs/__tests__/index.node.js similarity index 100% rename from desktop/src/plugins/logs/__tests__/index.node.js rename to desktop/plugins/logs/__tests__/index.node.js diff --git a/desktop/src/plugins/logs/index.tsx b/desktop/plugins/logs/index.tsx similarity index 99% rename from desktop/src/plugins/logs/index.tsx rename to desktop/plugins/logs/index.tsx index 1eb3965b1..0501d8c77 100644 --- a/desktop/src/plugins/logs/index.tsx +++ b/desktop/plugins/logs/index.tsx @@ -12,10 +12,11 @@ import { TableColumnOrder, TableColumnSizes, TableColumns, + Props as PluginProps, + BaseAction, + DeviceLogEntry, } from 'flipper'; import {Counter} from './LogWatcher'; -import {Props as PluginProps, BaseAction} from '../../plugin'; -import {DeviceLogEntry} from '../../devices/BaseDevice'; import { Text, diff --git a/desktop/src/plugins/logs/package.json b/desktop/plugins/logs/package.json similarity index 100% rename from desktop/src/plugins/logs/package.json rename to desktop/plugins/logs/package.json diff --git a/desktop/src/plugins/logs/yarn.lock b/desktop/plugins/logs/yarn.lock similarity index 100% rename from desktop/src/plugins/logs/yarn.lock rename to desktop/plugins/logs/yarn.lock diff --git a/desktop/src/plugins/navigation/__tests__/testAutoCompleteSearch.node.tsx b/desktop/plugins/navigation/__tests__/testAutoCompleteSearch.node.tsx similarity index 100% rename from desktop/src/plugins/navigation/__tests__/testAutoCompleteSearch.node.tsx rename to desktop/plugins/navigation/__tests__/testAutoCompleteSearch.node.tsx diff --git a/desktop/src/plugins/navigation/__tests__/testURI.node.tsx b/desktop/plugins/navigation/__tests__/testURI.node.tsx similarity index 100% rename from desktop/src/plugins/navigation/__tests__/testURI.node.tsx rename to desktop/plugins/navigation/__tests__/testURI.node.tsx diff --git a/desktop/src/plugins/navigation/components/AutoCompleteSheet.tsx b/desktop/plugins/navigation/components/AutoCompleteSheet.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/AutoCompleteSheet.tsx rename to desktop/plugins/navigation/components/AutoCompleteSheet.tsx diff --git a/desktop/src/plugins/navigation/components/BookmarksSidebar.tsx b/desktop/plugins/navigation/components/BookmarksSidebar.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/BookmarksSidebar.tsx rename to desktop/plugins/navigation/components/BookmarksSidebar.tsx diff --git a/desktop/src/plugins/navigation/components/FavoriteButton.tsx b/desktop/plugins/navigation/components/FavoriteButton.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/FavoriteButton.tsx rename to desktop/plugins/navigation/components/FavoriteButton.tsx diff --git a/desktop/src/plugins/navigation/components/IconButton.tsx b/desktop/plugins/navigation/components/IconButton.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/IconButton.tsx rename to desktop/plugins/navigation/components/IconButton.tsx diff --git a/desktop/src/plugins/navigation/components/NavigationInfoBox.tsx b/desktop/plugins/navigation/components/NavigationInfoBox.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/NavigationInfoBox.tsx rename to desktop/plugins/navigation/components/NavigationInfoBox.tsx diff --git a/desktop/src/plugins/navigation/components/RequiredParametersDialog.tsx b/desktop/plugins/navigation/components/RequiredParametersDialog.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/RequiredParametersDialog.tsx rename to desktop/plugins/navigation/components/RequiredParametersDialog.tsx diff --git a/desktop/src/plugins/navigation/components/SaveBookmarkDialog.tsx b/desktop/plugins/navigation/components/SaveBookmarkDialog.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/SaveBookmarkDialog.tsx rename to desktop/plugins/navigation/components/SaveBookmarkDialog.tsx diff --git a/desktop/src/plugins/navigation/components/SearchBar.tsx b/desktop/plugins/navigation/components/SearchBar.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/SearchBar.tsx rename to desktop/plugins/navigation/components/SearchBar.tsx diff --git a/desktop/src/plugins/navigation/components/Timeline.tsx b/desktop/plugins/navigation/components/Timeline.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/Timeline.tsx rename to desktop/plugins/navigation/components/Timeline.tsx diff --git a/desktop/src/plugins/navigation/components/index.tsx b/desktop/plugins/navigation/components/index.tsx similarity index 100% rename from desktop/src/plugins/navigation/components/index.tsx rename to desktop/plugins/navigation/components/index.tsx diff --git a/desktop/src/plugins/navigation/hooks/autoCompleteSheet.tsx b/desktop/plugins/navigation/hooks/autoCompleteSheet.tsx similarity index 100% rename from desktop/src/plugins/navigation/hooks/autoCompleteSheet.tsx rename to desktop/plugins/navigation/hooks/autoCompleteSheet.tsx diff --git a/desktop/src/plugins/navigation/hooks/requiredParameters.tsx b/desktop/plugins/navigation/hooks/requiredParameters.tsx similarity index 100% rename from desktop/src/plugins/navigation/hooks/requiredParameters.tsx rename to desktop/plugins/navigation/hooks/requiredParameters.tsx diff --git a/desktop/src/plugins/navigation/index.tsx b/desktop/plugins/navigation/index.tsx similarity index 100% rename from desktop/src/plugins/navigation/index.tsx rename to desktop/plugins/navigation/index.tsx diff --git a/desktop/src/plugins/navigation/package.json b/desktop/plugins/navigation/package.json similarity index 100% rename from desktop/src/plugins/navigation/package.json rename to desktop/plugins/navigation/package.json diff --git a/desktop/src/plugins/navigation/types.tsx b/desktop/plugins/navigation/types.tsx similarity index 100% rename from desktop/src/plugins/navigation/types.tsx rename to desktop/plugins/navigation/types.tsx diff --git a/desktop/src/plugins/navigation/util/appMatchPatterns.tsx b/desktop/plugins/navigation/util/appMatchPatterns.tsx similarity index 100% rename from desktop/src/plugins/navigation/util/appMatchPatterns.tsx rename to desktop/plugins/navigation/util/appMatchPatterns.tsx diff --git a/desktop/src/plugins/navigation/util/autoCompleteProvider.tsx b/desktop/plugins/navigation/util/autoCompleteProvider.tsx similarity index 100% rename from desktop/src/plugins/navigation/util/autoCompleteProvider.tsx rename to desktop/plugins/navigation/util/autoCompleteProvider.tsx diff --git a/desktop/src/plugins/navigation/util/indexedDB.tsx b/desktop/plugins/navigation/util/indexedDB.tsx similarity index 100% rename from desktop/src/plugins/navigation/util/indexedDB.tsx rename to desktop/plugins/navigation/util/indexedDB.tsx diff --git a/desktop/src/plugins/navigation/util/uri.tsx b/desktop/plugins/navigation/util/uri.tsx similarity index 100% rename from desktop/src/plugins/navigation/util/uri.tsx rename to desktop/plugins/navigation/util/uri.tsx diff --git a/desktop/src/plugins/navigation/yarn.lock b/desktop/plugins/navigation/yarn.lock similarity index 100% rename from desktop/src/plugins/navigation/yarn.lock rename to desktop/plugins/navigation/yarn.lock diff --git a/desktop/src/plugins/network/RequestDetails.tsx b/desktop/plugins/network/RequestDetails.tsx similarity index 100% rename from desktop/src/plugins/network/RequestDetails.tsx rename to desktop/plugins/network/RequestDetails.tsx diff --git a/desktop/src/plugins/network/__tests__/requestToCurlCommand.node.tsx b/desktop/plugins/network/__tests__/requestToCurlCommand.node.tsx similarity index 100% rename from desktop/src/plugins/network/__tests__/requestToCurlCommand.node.tsx rename to desktop/plugins/network/__tests__/requestToCurlCommand.node.tsx diff --git a/desktop/src/plugins/network/index.tsx b/desktop/plugins/network/index.tsx similarity index 100% rename from desktop/src/plugins/network/index.tsx rename to desktop/plugins/network/index.tsx diff --git a/desktop/src/plugins/network/package.json b/desktop/plugins/network/package.json similarity index 100% rename from desktop/src/plugins/network/package.json rename to desktop/plugins/network/package.json diff --git a/desktop/src/plugins/network/types.tsx b/desktop/plugins/network/types.tsx similarity index 100% rename from desktop/src/plugins/network/types.tsx rename to desktop/plugins/network/types.tsx diff --git a/desktop/src/plugins/network/utils.tsx b/desktop/plugins/network/utils.tsx similarity index 100% rename from desktop/src/plugins/network/utils.tsx rename to desktop/plugins/network/utils.tsx diff --git a/desktop/src/plugins/network/yarn.lock b/desktop/plugins/network/yarn.lock similarity index 100% rename from desktop/src/plugins/network/yarn.lock rename to desktop/plugins/network/yarn.lock diff --git a/desktop/src/plugins/reactdevtools/get-port.d.tsx b/desktop/plugins/reactdevtools/get-port.d.tsx similarity index 100% rename from desktop/src/plugins/reactdevtools/get-port.d.tsx rename to desktop/plugins/reactdevtools/get-port.d.tsx diff --git a/desktop/src/plugins/reactdevtools/index.tsx b/desktop/plugins/reactdevtools/index.tsx similarity index 100% rename from desktop/src/plugins/reactdevtools/index.tsx rename to desktop/plugins/reactdevtools/index.tsx diff --git a/desktop/src/plugins/reactdevtools/package.json b/desktop/plugins/reactdevtools/package.json similarity index 100% rename from desktop/src/plugins/reactdevtools/package.json rename to desktop/plugins/reactdevtools/package.json diff --git a/desktop/src/plugins/reactdevtools/react-devtools-core.d.tsx b/desktop/plugins/reactdevtools/react-devtools-core.d.tsx similarity index 100% rename from desktop/src/plugins/reactdevtools/react-devtools-core.d.tsx rename to desktop/plugins/reactdevtools/react-devtools-core.d.tsx diff --git a/desktop/src/plugins/reactdevtools/yarn.lock b/desktop/plugins/reactdevtools/yarn.lock similarity index 100% rename from desktop/src/plugins/reactdevtools/yarn.lock rename to desktop/plugins/reactdevtools/yarn.lock diff --git a/desktop/src/plugins/rn-tic-tac-toe/index.tsx b/desktop/plugins/rn-tic-tac-toe/index.tsx similarity index 100% rename from desktop/src/plugins/rn-tic-tac-toe/index.tsx rename to desktop/plugins/rn-tic-tac-toe/index.tsx diff --git a/desktop/src/plugins/rn-tic-tac-toe/package.json b/desktop/plugins/rn-tic-tac-toe/package.json similarity index 100% rename from desktop/src/plugins/rn-tic-tac-toe/package.json rename to desktop/plugins/rn-tic-tac-toe/package.json diff --git a/desktop/src/plugins/rn-tic-tac-toe/yarn.lock b/desktop/plugins/rn-tic-tac-toe/yarn.lock similarity index 100% rename from desktop/src/plugins/rn-tic-tac-toe/yarn.lock rename to desktop/plugins/rn-tic-tac-toe/yarn.lock diff --git a/desktop/src/plugins/sandbox/index.tsx b/desktop/plugins/sandbox/index.tsx similarity index 100% rename from desktop/src/plugins/sandbox/index.tsx rename to desktop/plugins/sandbox/index.tsx diff --git a/desktop/src/plugins/sandbox/package.json b/desktop/plugins/sandbox/package.json similarity index 100% rename from desktop/src/plugins/sandbox/package.json rename to desktop/plugins/sandbox/package.json diff --git a/desktop/src/plugins/sandbox/yarn.lock b/desktop/plugins/sandbox/yarn.lock similarity index 100% rename from desktop/src/plugins/sandbox/yarn.lock rename to desktop/plugins/sandbox/yarn.lock diff --git a/desktop/src/plugins/seamammals/index.tsx b/desktop/plugins/seamammals/index.tsx similarity index 100% rename from desktop/src/plugins/seamammals/index.tsx rename to desktop/plugins/seamammals/index.tsx diff --git a/desktop/src/plugins/seamammals/package.json b/desktop/plugins/seamammals/package.json similarity index 100% rename from desktop/src/plugins/seamammals/package.json rename to desktop/plugins/seamammals/package.json diff --git a/desktop/src/plugins/seamammals/yarn.lock b/desktop/plugins/seamammals/yarn.lock similarity index 100% rename from desktop/src/plugins/seamammals/yarn.lock rename to desktop/plugins/seamammals/yarn.lock diff --git a/desktop/src/plugins/sections/DetailsPanel.js b/desktop/plugins/sections/DetailsPanel.js similarity index 100% rename from desktop/src/plugins/sections/DetailsPanel.js rename to desktop/plugins/sections/DetailsPanel.js diff --git a/desktop/src/plugins/sections/EventsTable.js b/desktop/plugins/sections/EventsTable.js similarity index 100% rename from desktop/src/plugins/sections/EventsTable.js rename to desktop/plugins/sections/EventsTable.js diff --git a/desktop/src/plugins/sections/Models.js b/desktop/plugins/sections/Models.js similarity index 100% rename from desktop/src/plugins/sections/Models.js rename to desktop/plugins/sections/Models.js diff --git a/desktop/src/plugins/sections/StackTrace.js b/desktop/plugins/sections/StackTrace.js similarity index 100% rename from desktop/src/plugins/sections/StackTrace.js rename to desktop/plugins/sections/StackTrace.js diff --git a/desktop/src/plugins/sections/Tree.js b/desktop/plugins/sections/Tree.js similarity index 100% rename from desktop/src/plugins/sections/Tree.js rename to desktop/plugins/sections/Tree.js diff --git a/desktop/src/plugins/sections/d3/LICENSE b/desktop/plugins/sections/d3/LICENSE similarity index 100% rename from desktop/src/plugins/sections/d3/LICENSE rename to desktop/plugins/sections/d3/LICENSE diff --git a/desktop/src/plugins/sections/d3/d3.js b/desktop/plugins/sections/d3/d3.js similarity index 100% rename from desktop/src/plugins/sections/d3/d3.js rename to desktop/plugins/sections/d3/d3.js diff --git a/desktop/src/plugins/sections/d3/package.json b/desktop/plugins/sections/d3/package.json similarity index 100% rename from desktop/src/plugins/sections/d3/package.json rename to desktop/plugins/sections/d3/package.json diff --git a/desktop/src/plugins/sections/index.js b/desktop/plugins/sections/index.js similarity index 100% rename from desktop/src/plugins/sections/index.js rename to desktop/plugins/sections/index.js diff --git a/desktop/src/plugins/sections/package.json b/desktop/plugins/sections/package.json similarity index 100% rename from desktop/src/plugins/sections/package.json rename to desktop/plugins/sections/package.json diff --git a/desktop/src/plugins/sections/yarn.lock b/desktop/plugins/sections/yarn.lock similarity index 100% rename from desktop/src/plugins/sections/yarn.lock rename to desktop/plugins/sections/yarn.lock diff --git a/desktop/src/plugins/shared_preferences/index.js b/desktop/plugins/shared_preferences/index.js similarity index 100% rename from desktop/src/plugins/shared_preferences/index.js rename to desktop/plugins/shared_preferences/index.js diff --git a/desktop/src/plugins/shared_preferences/package.json b/desktop/plugins/shared_preferences/package.json similarity index 100% rename from desktop/src/plugins/shared_preferences/package.json rename to desktop/plugins/shared_preferences/package.json diff --git a/desktop/src/plugins/shared_preferences/yarn.lock b/desktop/plugins/shared_preferences/yarn.lock similarity index 100% rename from desktop/src/plugins/shared_preferences/yarn.lock rename to desktop/plugins/shared_preferences/yarn.lock diff --git a/desktop/scripts/build-utils.ts b/desktop/scripts/build-utils.ts index 1b1083b7e..0f48ae058 100644 --- a/desktop/scripts/build-utils.ts +++ b/desktop/scripts/build-utils.ts @@ -44,8 +44,8 @@ export function compileDefaultPlugins( skipAll ? [] : [ - path.join(__dirname, '..', 'src', 'plugins'), - path.join(__dirname, '..', 'src', 'fb', 'plugins'), + path.join(__dirname, '..', 'plugins'), + path.join(__dirname, '..', 'plugins', 'fb'), ], defaultPluginDir, {force: true, failSilently: false, recompileOnChanges: false}, diff --git a/desktop/scripts/start-dev-server.ts b/desktop/scripts/start-dev-server.ts index 7a2acd91c..4db6d99c7 100644 --- a/desktop/scripts/start-dev-server.ts +++ b/desktop/scripts/start-dev-server.ts @@ -182,12 +182,7 @@ async function addWebsocket(server: http.Server) { io.emit('refresh'); }, { - excludes: [ - '**/__tests__/**/*', - '**/node_modules/**/*', - '**/.*', - 'plugins/**/*', // plugin changes are tracked separately, so exlcuding them here to avoid double reloading. - ], + excludes: ['**/__tests__/**/*', '**/node_modules/**/*', '**/.*'], }, ); } catch (err) { diff --git a/desktop/scripts/yarn-install.ts b/desktop/scripts/yarn-install.ts index b0629a278..9047b6861 100644 --- a/desktop/scripts/yarn-install.ts +++ b/desktop/scripts/yarn-install.ts @@ -18,9 +18,9 @@ const PACKAGES = [ 'static', 'doctor', 'pkg', - 'src/plugins/*', - 'src/fb/plugins/*', - 'src/fb/plugins/layout/*', + 'plugins/*', + 'plugins/fb/*', + 'plugins/fb/layout/*', ]; const WINDOWS = /^win/.test(process.platform); const YARN_PATH = diff --git a/desktop/src/chrome/LocationsButton.tsx b/desktop/src/chrome/LocationsButton.tsx index f5c4c9c46..a895dc6d4 100644 --- a/desktop/src/chrome/LocationsButton.tsx +++ b/desktop/src/chrome/LocationsButton.tsx @@ -14,8 +14,8 @@ import {State as Store} from '../reducers'; import { readBookmarksFromDB, writeBookmarkToDB, -} from '../plugins/navigation/util/indexedDB'; -import {PersistedState as NavPluginState} from '../plugins/navigation/types'; +} from '../../plugins/navigation/util/indexedDB'; +import {PersistedState as NavPluginState} from '../../plugins/navigation/types'; import BaseDevice from '../devices/BaseDevice'; import {State as PluginState} from 'src/reducers/pluginStates'; import {platform} from 'os'; diff --git a/desktop/src/index.tsx b/desktop/src/index.tsx index 0e86583ee..018bdadfc 100644 --- a/desktop/src/index.tsx +++ b/desktop/src/index.tsx @@ -24,6 +24,7 @@ export { FlipperDevicePlugin, callClient, Notification, + BaseAction, } from './plugin'; export {PluginClient, Props} from './plugin'; export {default as Client} from './Client'; @@ -171,3 +172,5 @@ export {Console} from './ui/components/console'; export {default as Sheet} from './ui/components/Sheet'; export {KeyboardActions} from './MenuBar'; export {getFlipperMediaCDN} from './fb-stubs/user'; +export {Rect} from './utils/geometry'; +export {Logger} from './fb-interfaces/Logger'; diff --git a/desktop/src/utils/fbEmployee.tsx b/desktop/src/utils/fbEmployee.tsx index 419272f68..8dbc644b6 100644 --- a/desktop/src/utils/fbEmployee.tsx +++ b/desktop/src/utils/fbEmployee.tsx @@ -8,7 +8,8 @@ */ import util from 'util'; -const exec = util.promisify(require('child_process').exec); +import {exec as execImport} from 'child_process'; +const exec = util.promisify(execImport); const cmd = 'klist --json'; const endWith = '@THEFACEBOOK.COM'; diff --git a/desktop/src/utils/js-client/serverUtils.tsx b/desktop/src/utils/js-client/serverUtils.tsx index 17fe19f91..b9a29af86 100644 --- a/desktop/src/utils/js-client/serverUtils.tsx +++ b/desktop/src/utils/js-client/serverUtils.tsx @@ -11,12 +11,12 @@ import Client, {ClientQuery} from '../../Client'; import {FlipperClientConnection} from '../../Client'; import {ipcRenderer, remote, IpcRendererEvent} from 'electron'; import JSDevice from '../../devices/JSDevice'; -import {Store} from 'src/reducers'; -import {Logger} from 'src/fb-interfaces/Logger'; +import {Store} from '../../reducers'; +import {Logger} from '../../fb-interfaces/Logger'; import {Payload, ConnectionStatus, ISubscriber} from 'rsocket-types'; import {Flowable, Single} from 'rsocket-flowable'; -import Server from 'src/server'; +import Server from '../../server'; import {buildClientId} from '../clientUtils'; const connections: Map> = new Map(); diff --git a/desktop/static/main.ts b/desktop/static/main.ts index a32d9ee35..13b5977ad 100644 --- a/desktop/static/main.ts +++ b/desktop/static/main.ts @@ -92,8 +92,8 @@ const pluginPaths = (config.pluginPaths ?? []) ...(skipLoadingEmbeddedPlugins ? [] : [ - path.join(__dirname, '..', 'src', 'plugins'), - path.join(__dirname, '..', 'src', 'fb', 'plugins'), + path.join(__dirname, '..', 'plugins'), + path.join(__dirname, '..', 'plugins', 'fb'), ]), ]) .map(expandTilde) diff --git a/desktop/static/package.json b/desktop/static/package.json index f85646eb5..e8bc413b6 100644 --- a/desktop/static/package.json +++ b/desktop/static/package.json @@ -33,6 +33,7 @@ "ws": "7.2.0" }, "devDependencies": { - "@babel/preset-env": "^7.8.3" + "@babel/preset-env": "^7.8.3", + "@types/electron-devtools-installer": "^2.2.0" } } diff --git a/desktop/static/transforms/fb-stubs.js b/desktop/static/transforms/fb-stubs.js index 3a01e19bc..6c3f74053 100644 --- a/desktop/static/transforms/fb-stubs.js +++ b/desktop/static/transforms/fb-stubs.js @@ -12,6 +12,7 @@ const path = require('path'); const replaceFBStubs = fs.existsSync( path.join(__dirname, '..', '..', 'src', 'fb'), ); +const isFBFile = filePath => filePath.includes(`${path.sep}fb${path.sep}`); const requireFromFolder = (folder, path) => new RegExp(folder + '/[A-Za-z0-9.-_]+(.js)?$', 'g').test(path); @@ -20,7 +21,7 @@ module.exports = function(babel) { return { name: 'replace-dynamic-requires', visitor: { - CallExpression(path) { + CallExpression(path, state) { if ( replaceFBStubs && path.node.type === 'CallExpression' && @@ -28,9 +29,12 @@ module.exports = function(babel) { path.node.callee.name === 'require' && path.node.arguments.length > 0 ) { - if (requireFromFolder('fb', path.node.arguments[0].value)) { + if ( + requireFromFolder('fb', path.node.arguments[0].value) && + !isFBFile(state.file.opts.filename) + ) { throw new Error( - 'Do not require directly from fb/, but rather from fb-stubs/ to not break flow-typing and make sure stubs are up-to-date.', + 'For files which are not under fb/ do not require directly from fb/, but rather from fb-stubs/ to not break flow-typing and make sure stubs are up-to-date.', ); } else if ( requireFromFolder('fb-stubs', path.node.arguments[0].value) diff --git a/desktop/static/yarn.lock b/desktop/static/yarn.lock index cc1db056a..23d478be5 100644 --- a/desktop/static/yarn.lock +++ b/desktop/static/yarn.lock @@ -953,6 +953,11 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/electron-devtools-installer@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@types/electron-devtools-installer/-/electron-devtools-installer-2.2.0.tgz#32ee4ebbe99b3daf9847a6d2097dc00b5de94f10" + integrity sha512-HJNxpaOXuykCK4rQ6FOMxAA0NLFYsf7FiPFGmab0iQmtVBHSAfxzy3MRFpLTTDDWbV0yD2YsHOQvdu8yCqtCfw== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" diff --git a/desktop/tsconfig.json b/desktop/tsconfig.json index cb8fd0f76..75ffaa9d7 100644 --- a/desktop/tsconfig.json +++ b/desktop/tsconfig.json @@ -18,6 +18,6 @@ }, "strict": true }, - "include": ["src/**/*", "static/**/*", "scripts/**/*", "types/*", "headless/*"], + "include": ["src/**/*", "static/**/*", "scripts/**/*", "types/*", "headless/*", "plugins/**/*"], "exclude": ["node_modules", "**/*.spec.ts"] } diff --git a/desktop/types/metro.d.tsx b/desktop/types/metro.d.tsx new file mode 100644 index 000000000..19d6a54d7 --- /dev/null +++ b/desktop/types/metro.d.tsx @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +declare module 'metro'; diff --git a/docs/extending/testing.md b/docs/extending/testing.md index ee7fe3cb0..9bdc3851a 100644 --- a/docs/extending/testing.md +++ b/docs/extending/testing.md @@ -97,7 +97,7 @@ TEST(MyFlipperPluginTests, testDummy) { ## Testing the Flipper Desktop Plugin Tests should be put in the `__tests__` directory of your plugin sources, and be created using Jest. -An example test suite can be found [here](https://github.com/facebook/flipper/blob/master/desktop/src/plugins/layout/__tests__/ProxyArchiveClient.node.tsx). +An example test suite can be found [here](https://github.com/facebook/flipper/blob/master/desktop/plugins/layout/__tests__/ProxyArchiveClient.node.tsx). Flipper exposes an API to generate unit tests that can verify _regressions_ and real life scenarios. To generate a unit test: diff --git a/docs/tutorial/js-setup.md b/docs/tutorial/js-setup.md index c1ea0b922..fafea313c 100644 --- a/docs/tutorial/js-setup.md +++ b/docs/tutorial/js-setup.md @@ -59,6 +59,6 @@ you can also specify a title to show in the Flipper sidebar and an icon to displ } } ``` -*See [package.json](https://github.com/facebook/flipper/blob/master/desktop/src/plugins/seamammals/package.json)* +*See [package.json](https://github.com/facebook/flipper/blob/master/desktop/plugins/seamammals/package.json)* Now that our package has been set up, we are ready to build a UI for our plugin. Either by using a standardized table-based plugin, or by creating a custom UI. diff --git a/docs/tutorial/js-table.md b/docs/tutorial/js-table.md index 4502a1341..aea29f0eb 100644 --- a/docs/tutorial/js-table.md +++ b/docs/tutorial/js-table.md @@ -129,7 +129,7 @@ export default createTablePlugin({ buildRow, }); ``` -*See [index.tsx](https://github.com/facebook/flipper/blob/master/desktop/src/plugins/seamammals/index.tsx)* +*See [index.tsx](https://github.com/facebook/flipper/blob/master/desktop/plugins/seamammals/index.tsx)* The `method` we define here corresponds to the name of the function we call on the native side to inform diff --git a/docs/tutorial/react-native.md b/docs/tutorial/react-native.md index c8446686b..7dfccea09 100644 --- a/docs/tutorial/react-native.md +++ b/docs/tutorial/react-native.md @@ -49,4 +49,4 @@ The `connection` object can also be used to listen to messages coming from the D An example plugin to play a little Tic-Tac-Toe between the Flipper Desktop and a React Native app can be found inside this repository as well (run `yarn && yarn android` in `react-native/ReactNativeFlipperExample` to start the test project): * The React Native JavaScript based plugin implementation: [FlipperTicTacToe.js](https://github.com/facebook/flipper/tree/master/react-native/ReactNativeFlipperExample/FlipperTicTacToe.js) - * The Flipper Desktop plugin implementation: [rn-tic-tac-toe/index.tsx](https://github.com/facebook/flipper/blob/master/desktop/src/plugins/rn-tic-tac-toe/index.tsx) + * The Flipper Desktop plugin implementation: [rn-tic-tac-toe/index.tsx](https://github.com/facebook/flipper/blob/master/desktop/plugins/rn-tic-tac-toe/index.tsx) diff --git a/greenkeeper.json b/greenkeeper.json index 1a1754cb6..da95b76f1 100644 --- a/greenkeeper.json +++ b/greenkeeper.json @@ -23,24 +23,24 @@ }, "plugins": { "packages": [ - "desktop/src/plugins/cpu/package.json", - "desktop/src/plugins/crash_reporter/package.json", - "desktop/src/plugins/databases/package.json", - "desktop/src/plugins/example/package.json", - "desktop/src/plugins/fresco/package.json", - "desktop/src/plugins/kaios-allocations/package.json", - "desktop/src/plugins/kaios-ram/package.json", - "desktop/src/plugins/layout/package.json", - "desktop/src/plugins/leak_canary/package.json", - "desktop/src/plugins/logs/package.json", - "desktop/src/plugins/navigation/package.json", - "desktop/src/plugins/network/package.json", - "desktop/src/plugins/reactdevtools/package.json", - "desktop/src/plugins/sandbox/package.json", - "desktop/src/plugins/seamammals/package.json", - "desktop/src/plugins/sections/d3/package.json", - "desktop/src/plugins/sections/package.json", - "desktop/src/plugins/shared_preferences/package.json", + "desktop/plugins/cpu/package.json", + "desktop/plugins/crash_reporter/package.json", + "desktop/plugins/databases/package.json", + "desktop/plugins/example/package.json", + "desktop/plugins/fresco/package.json", + "desktop/plugins/kaios-allocations/package.json", + "desktop/plugins/kaios-ram/package.json", + "desktop/plugins/layout/package.json", + "desktop/plugins/leak_canary/package.json", + "desktop/plugins/logs/package.json", + "desktop/plugins/navigation/package.json", + "desktop/plugins/network/package.json", + "desktop/plugins/reactdevtools/package.json", + "desktop/plugins/sandbox/package.json", + "desktop/plugins/seamammals/package.json", + "desktop/plugins/sections/d3/package.json", + "desktop/plugins/sections/package.json", + "desktop/plugins/shared_preferences/package.json", "desktop/src/utils/js-client/package.json" ] }, diff --git a/react-native/react-native-flipper/README.md b/react-native/react-native-flipper/README.md index 2232796ac..fdc4f47aa 100644 --- a/react-native/react-native-flipper/README.md +++ b/react-native/react-native-flipper/README.md @@ -27,4 +27,4 @@ An example plugin can be found in [examples/FlipperTicTacToe.js](../sample/Flipp The corresponding Desktop plugin ships by default in Flipper, so importing the above file and dropping the `` component somewhere in your application should work out of the box. -The sources of the corresponding Desktop plugin can be found [here](../../desktop/src/plugins/rn-tic-tac-toe). +The sources of the corresponding Desktop plugin can be found [here](../../desktop/plugins/rn-tic-tac-toe).