Skip to content

Commit ba24f5f

Browse files
motiz88facebook-github-bot
authored andcommitted
Demote electron to devDependency (#53438)
Summary: Pull Request resolved: #53438 Changelog: [Internal] Makes `flavor: 'prebuilt'` the default mode of launching the RNDT standalone shell, and the *only* mode supported in the published version of the package. See D78351931 for more context. With this, we can demote `electron` from `dependencies` to `devDependencies`. This makes it possible to make `debugger-shell` a dependency of `dev-middleware` (and thus of all major frameworks) without significantly impacting `npm install` times. We'll add this dependency on `debugger-shell` in an upcoming diff (D78351937). We also stop publishing the `dist/electron` subdirectory (and `src/electron` for good measure) since the corresponding code will always be bundled into the prebuilt binary instead. Reviewed By: huntie Differential Revision: D78351934 fbshipit-source-id: 2a4b03e852c4d0330250567c41dca09d1c4f3abd
1 parent b5dfb32 commit ba24f5f

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/debugger-shell/__tests__/electron-dependency-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Electron dependency', () => {
2222
// $FlowFixMe[untyped-import] - package.json is not typed
2323
const ourPackageJson = require('../package.json');
2424

25-
const declaredElectronVersion = ourPackageJson.dependencies.electron;
25+
const declaredElectronVersion = ourPackageJson.devDependencies.electron;
2626
expect(declaredElectronVersion).toBeTruthy();
2727

2828
// $FlowFixMe[untyped-import] - package.json is not typed

packages/debugger-shell/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@
3030
},
3131
"dependencies": {
3232
"cross-spawn": "^7.0.6",
33-
"electron": "37.2.6",
3433
"fb-dotslash": "0.5.8"
3534
},
3635
"devDependencies": {
36+
"electron": "37.2.6",
3737
"semver": "^7.1.3"
38-
}
38+
},
39+
"files": [
40+
"!**/__tests__/**",
41+
"bin",
42+
"dist",
43+
"!src/electron"
44+
]
3945
}

packages/debugger-shell/src/node/index.flow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function unstable_spawnDebuggerShellWithArgs(
2929
args: string[],
3030
{
3131
mode = 'detached',
32-
flavor = 'dev',
32+
flavor = 'prebuilt',
3333
}: $ReadOnly<{
3434
// In 'syncAndExit' mode, the current process will block until the spawned process exits, and then it will exit
3535
// with the same exit code as the spawned process.

0 commit comments

Comments
 (0)