Files
flipper/desktop/package.json
Anton Nikolaev a4eb2a56d6 Option for "yarn start" and "yarn build" scripts to pre-install default plugin packages instead of bundling them
Summary:
Sorry for long diff! I can try to split it if necessary, but many changes here are 1-1 replacements / renames.

**Preambule**
Currently we bundle default plugins into the Flipper main bundle. This helps us to reduce bundle size, because of plugin dependencies re-use. E.g. if multiple plugins use "lodash" when they are bundled together, only one copy of "lodash" added. When they are bundled separately, the same dependency might be added to each of them. However as we're not going to include most of plugins into Flipper distributive anymore and going to rely on Marketplace instead, this bundling doesn't provide significant size benefits anymore. In addition to that, bundling makes it impossible to differentiate whether thrown errors are originated from Flipper core or one of its plugins.

Why don't we remove plugin bundling at all? Because for "dev mode" it actually quite useful. It makes dev build start much faster and also enables using of Fast Refresh for plugin development (fast refresh won't work for plugins loaded from disk).

**Changes**
This diff introduces new option "no-bundled-plugins" for "yarn start" and "yarn build" commands. For now, by default, we will continue bundling default plugins into the Flipper main bundle, but if this option provided then we will build each default plugin separately and include their packages into the Flipper distributive as "pre-installed" to be able to load them from disk even without access to Marketplace.

For "yarn start", we're adding symlinks to plugin folders in "static/defaultPlugins" and then they are loaded by Flipper. For "yarn build" we are dereferencing these symlinks to include physical files of plugins into folder "defaultPlugins" of the produced distributive. Folder "defaultPlugins" is excluded from asar, because loading of plugins from asar archive might introduce some unexpected issues depending on their implementation.

Reviewed By: mweststrate

Differential Revision: D28431838

fbshipit-source-id: f7757e9f5ba9183ed918d70252de3ce0e823177d
2021-05-18 08:08:30 -07:00

280 lines
9.5 KiB
JSON

{
"author": {
"email": "n/a",
"name": "Facebook Inc",
"url": "https://github.com/facebook"
},
"build": {
"appId": "flipper",
"artifactName": "Flipper-${os}.${ext}",
"asar": true,
"asarUnpack": [
"PortForwardingMacApp.app/**/*",
"defaultPlugins/**/*"
],
"dmg": {
"background": "dmgBackground.png",
"contents": [
{
"x": 123,
"y": 172
},
{
"path": "/Applications",
"type": "link",
"x": 539,
"y": 168
}
],
"icon": "icon.icns",
"iconSize": 155,
"window": {
"height": 400,
"width": 660
}
},
"fileAssociations": [
{
"ext": [
".flipper"
],
"icon": "document-icons/document.icns",
"name": "Flipper Data",
"role": "Viewer"
}
],
"linux": {
"category": "Development"
},
"mac": {
"category": "public.app-category.developer-tools",
"extendInfo": {
"NSUserNotificationAlertStyle": "alert"
}
},
"productName": "Flipper",
"protocols": {
"name": "flipper",
"schemes": [
"flipper"
]
},
"win": {
"publisherName": "Facebook, Inc.",
"sign": null
}
},
"category": "facebook-intern",
"description": "Mobile development tool",
"devDependencies": {
"@adobe/node-fetch-retry": "^1.1.1",
"@babel/code-frame": "^7.12.13",
"@babel/eslint-parser": "^7.13.14",
"@jest-runner/electron": "^3.0.1",
"@testing-library/dom": "^7.31.0",
"@testing-library/react": "^11.2.6",
"@types/adobe__node-fetch-retry": "^1.0.0",
"@types/algoliasearch": "^4.0.0",
"@types/babel__code-frame": "^7.0.2",
"@types/babel__core": "^7.1.14",
"@types/babel__generator": "^7.6.2",
"@types/babel__traverse": "^7.11.1",
"@types/decompress": "4.2.3",
"@types/deep-equal": "^1.0.1",
"@types/detect-port": "^1.1.0",
"@types/electron-devtools-installer": "^2.2.0",
"@types/expand-tilde": "^2.0.0",
"@types/express": "^4.17.11",
"@types/fb-watchman": "^2.0.0",
"@types/form-data": "^2.2.1",
"@types/fs-extra": "^9.0.11",
"@types/glob": "^7.1.1",
"@types/invariant": "^2.2.31",
"@types/jest": "^26.0.23",
"@types/lodash": "^4.14.169",
"@types/lodash.debounce": "^4.0.6",
"@types/mkdirp": "^1.0.0",
"@types/mock-fs": "^4.13.0",
"@types/node": "^15.0.2",
"@types/npm-packlist": "^1.1.1",
"@types/promise-retry": "^1.1.3",
"@types/react": "^17.0.5",
"@types/react-color": "^3.0.1",
"@types/react-dom": "^17.0.4",
"@types/react-redux": "^7.1.16",
"@types/react-test-renderer": "^17.0.1",
"@types/react-transition-group": "^4.4.1",
"@types/react-virtualized": "^9.21.11",
"@types/react-virtualized-auto-sizer": "^1.0.0",
"@types/react-window": "^1.8.3",
"@types/recharts": "^1.8.19",
"@types/recursive-readdir": "^2.2.0",
"@types/redux-devtools-extension": "^2.13.2",
"@types/redux-mock-store": "^1.0.1",
"@types/redux-persist": "^4.3.1",
"@types/requestidlecallback": "^0.3.1",
"@types/resize-observer-browser": "^0.1.5",
"@types/rsocket-core": "^0.0.6",
"@types/rsocket-tcp-server": "^0.0.2",
"@types/socket.io": "^2.1.13",
"@types/testing-library__react": "^10.2.0",
"@types/tmp": "^0.2.0",
"@types/uuid": "^8.0.0",
"@types/which": "^2.0.0",
"@types/ws": "^7.4.2",
"@types/yargs": "^16.0.1",
"@types/yazl": "^2.4.2",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.0",
"ansi-to-html": "^0.6.3",
"app-builder-lib": "22.11.1",
"babel-eslint": "^10.1.0",
"chalk": "^4.1.1",
"cross-env": "^7.0.3",
"detect-port": "^1.1.1",
"dotenv": "^8.2.0",
"electron": "11.2.3",
"electron-builder": "22.11.1",
"eslint": "^7.25.0",
"eslint-config-fbjs": "^3.1.1",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-flipper": "0.0.0",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"expand-tilde": "^2.0.2",
"express": "^4.15.2",
"fb-watchman": "^2.0.1",
"flipper-babel-transformer": "0.0.0",
"flipper-pkg-lib": "0.0.0",
"flipper-plugin-lib": "0.0.0",
"fs-extra": "^9.0.0",
"glob": "^7.1.7",
"ignore": "^5.1.4",
"invariant": "^2.2.4",
"jest": "^26.6.3",
"jest-environment-jsdom-sixteen": "^2.0.0",
"jest-fetch-mock": "^3.0.3",
"less": "^4.1.1",
"line-replace": "^2.0.1",
"metro": "^0.66.0",
"metro-minify-terser": "^0.66.0",
"metro-resolver": "^0.66.0",
"node-fetch": "^2.6.1",
"p-filter": "^2.1.0",
"p-map": "^4.0.0",
"patch-package": "^6.4.7",
"prettier": "^2.3.0",
"pretty-format": "^26.1.0",
"promisify-child-process": "^4.1.0",
"react-async": "^10.0.0",
"react-refresh": "^0.10.0",
"recursive-readdir": "^2.2.2",
"redux": "^4.0.0",
"rimraf": "^3.0.2",
"socket.io": "^4.1.1",
"tmp": "^0.2.1",
"ts-jest": "^26.5.6",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"uuid": "^8.3.2",
"yargs": "^17.0.1",
"yazl": "^2.5.1"
},
"homepage": "https://fbflipper.com/",
"icon": "icon.png",
"name": "flipper-project",
"optionalDependencies": {
"7zip-bin-mac": "^1.0.1"
},
"private": true,
"privileged": true,
"productName": "Flipper",
"resolutions": {
"**/metro/**/temp": "0.9.0",
"**/metro/**/ws": "1.1.5",
"@jest-runner/electron/electron": "11.2.3",
"@types/react": "17.0.5",
"acorn": "7.1.1",
"adbkit-logcat": "2.0.1",
"bl": "4.0.3",
"csstype": "^3.0.5",
"jsdom": "16.4.0",
"kind-of": "6.0.3",
"minimist": "1.2.3",
"node-fetch": "^2.6.1",
"node-forge": "^0.10.0",
"node-notifier": "^8.0.1",
"ws": "7.3.0",
"xmldom": "0.5.0"
},
"scripts": {
"build": "cross-env NODE_ENV=production ./ts-node scripts/build-release.ts $@",
"build-plugin": "./ts-node scripts/build-plugin.ts",
"build:dev": "cross-env NODE_ENV=development ./ts-node scripts/build-release.ts $@",
"build:eslint": "cd eslint-plugin-flipper && yarn build",
"build:themes": "lessc --js themes/light.less static/themes/light.css && lessc --js themes/dark.less static/themes/dark.css",
"build:tsc": "tsc -b tsc-root/tsconfig.json && ./ts-node ./scripts/compute-package-checksum.ts -d ./babel-transformer -o ./lib/checksum.txt",
"bump-versions": "./ts-node scripts/bump-versions.ts",
"bundle-all-plugins": "./ts-node scripts/bundle-all-plugins.ts",
"dev-server": "cross-env NODE_ENV=development ./ts-node scripts/start-dev-server.ts",
"everything": "yarn reset && yarn install && yarn lint && yarn test && yarn test-electron && yarn build --mac --mac-dmg --win --linux --linux-deb && yarn start",
"fix": "eslint . --fix --ext .js,.ts,.tsx",
"lint": "yarn lint:eslint && yarn lint:tsc && yarn tsc-plugins",
"lint:eslint": "eslint . --ext .js,.ts,.tsx",
"lint:tsc": "tsc --noemit",
"list-plugins": "./ts-node scripts/list-plugins.ts",
"open-dist": "open ../dist/mac/Flipper.app --args --launcher=false --inspect=9229",
"postinstall": "patch-package && ./ts-node scripts/gen-type-index.ts && yarn --cwd plugins install --mutex network:30331 && yarn build:tsc && ./ts-node scripts/generate-plugin-entry-points.ts && yarn build:themes",
"prebuild": "yarn build:tsc && yarn rm-dist && yarn build:themes",
"predev-server": "yarn build:tsc",
"preinstall": "node scripts/prepare-watchman-config.js && yarn config set ignore-engines",
"prelint:eslint": "yarn build:eslint",
"pretest": "yarn build:tsc",
"publish-packages": "./ts-node scripts/publish-packages.ts",
"reset": "yarn rm-dist && yarn rm-temp && yarn rm-metro-cache && yarn cache clean && yarn rm-bundle && yarn rm-modules",
"resolve-plugin-dir": "./ts-node scripts/resolve-plugin-dir.ts",
"rm-bundle": "rimraf static/main.bundle.* **/dist/bundle.* **/lib **/*.tsbuildinfo",
"rm-dist": "rimraf ../dist",
"rm-metro-cache": "rimraf $TMPDIR/metro-cache*",
"rm-modules": "rimraf **/*/node_modules node_modules",
"rm-temp": "rimraf $TMPDIR/jest* $TMPDIR/react-native-packager*",
"rm-watches": "watchman watch-del-all",
"start": "yarn dev-server --inspect=9229",
"start:break": "yarn dev-server --inspect-brk=9229",
"start:no-embedded-plugins": "yarn start --no-embedded-plugins",
"test": "jest",
"test-e2e": "cd e2e && yarn test",
"test-electron": "yarn build:tsc && jest --testMatch=\"**/**.electron\\.(js|jsx|ts|tsx)\" --testEnvironment=@jest-runner/electron/environment --runner=@jest-runner/electron",
"test-with-device": "yarn build:tsc && USE_ELECTRON_STUBS=1 jest --testMatch=\"**/**.device\\.(js|jsx|ts|tsx)\" --detectOpenHandles",
"test:debug": "yarn build:tsc && node --inspect node_modules/.bin/jest --runInBand",
"tsc-plugins": "./ts-node scripts/tsc-plugins.ts",
"watch": "node --expose-gc --stack-trace-limit=40 ./node_modules/.bin/jest --watch"
},
"version": "0.90.2",
"workspaces": {
"packages": [
"app",
"app/src/fb/*",
"babel-transformer",
"doctor",
"pkg",
"pkg-lib",
"flipper-plugin",
"static",
"e2e",
"plugin-lib",
"test-utils",
"eslint-plugin-flipper",
"types"
]
}
}