Skip to content

Commit 58933e0

Browse files
committed
fix: do not strip "bugs" field from main package.json
Close #2606
1 parent ba2957e commit 58933e0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/electron-builder-lib/src/fileTransformer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function createElectronCompilerHost(projectDir: string, cacheDir: string)
5656
return require(path.join(electronCompilePath, "config-parser")).createCompilerHostFromProjectRoot(projectDir, cacheDir)
5757
}
5858

59-
const ignoredPackageMetadataProperties = new Set(["dist", "gitHead", "keywords", "build", "jspm", "ava", "xo", "nyc", "eslintConfig", "contributors", "bundleDependencies", "bugs", "tags"])
59+
const ignoredPackageMetadataProperties = new Set(["dist", "gitHead", "keywords", "build", "jspm", "ava", "xo", "nyc", "eslintConfig", "contributors", "bundleDependencies", "tags"])
6060

6161
interface CleanupPackageFileOptions {
6262
readonly isRemovePackageScripts: boolean
@@ -74,7 +74,9 @@ function cleanupPackageJson(data: any, options: CleanupPackageFileOptions): any
7474
if (prop[0] === "_" ||
7575
ignoredPackageMetadataProperties.has(prop) ||
7676
(options.isRemovePackageScripts && prop === "scripts") ||
77-
(options.isMain && prop === "devDependencies") || (isRemoveBabel && prop === "babel")) {
77+
(options.isMain && prop === "devDependencies") ||
78+
(!options.isMain && prop === "bugs") ||
79+
(isRemoveBabel && prop === "babel")) {
7880
delete data[prop]
7981
changed = true
8082
}

test/out/windows/__snapshots__/webInstallerTest.js.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ Object {
1515
"packages": Object {
1616
"ia32": Object {
1717
"blockMapSize": "@blockMapSize",
18+
"file": "TestApp-1.1.0-ia32.nsis.7z",
1819
"path": "TestApp-1.1.0-ia32.nsis.7z",
1920
"sha512": "@sha512",
2021
"size": "@size",
2122
},
2223
"x64": Object {
2324
"blockMapSize": "@blockMapSize",
25+
"file": "TestApp-1.1.0-x64.nsis.7z",
2426
"path": "TestApp-1.1.0-x64.nsis.7z",
2527
"sha512": "@sha512",
2628
"size": "@size",
@@ -40,12 +42,14 @@ Object {
4042
"packages": Object {
4143
"ia32": Object {
4244
"blockMapSize": "@blockMapSize",
45+
"file": "TestApp-1.1.0-ia32.nsis.7z",
4346
"path": "TestApp-1.1.0-ia32.nsis.7z",
4447
"sha512": "@sha512",
4548
"size": "@size",
4649
},
4750
"x64": Object {
4851
"blockMapSize": "@blockMapSize",
52+
"file": "TestApp-1.1.0-x64.nsis.7z",
4953
"path": "TestApp-1.1.0-x64.nsis.7z",
5054
"sha512": "@sha512",
5155
"size": "@size",
@@ -80,6 +84,7 @@ Object {
8084
"packages": Object {
8185
"x64": Object {
8286
"blockMapSize": "@blockMapSize",
87+
"file": "TestApp-1.1.0-x64.nsis.7z",
8388
"path": "TestApp-1.1.0-x64.nsis.7z",
8489
"sha512": "@sha512",
8590
"size": "@size",
@@ -100,6 +105,7 @@ Object {
100105
"packages": Object {
101106
"x64": Object {
102107
"blockMapSize": "@blockMapSize",
108+
"file": "TestApp-1.1.0-x64.nsis.7z",
103109
"path": "TestApp-1.1.0-x64.nsis.7z",
104110
"sha512": "@sha512",
105111
"size": "@size",
@@ -130,6 +136,7 @@ Object {
130136
"packages": Object {
131137
"x64": Object {
132138
"blockMapSize": "@blockMapSize",
139+
"file": "TestApp-1.1.0-x64.nsis.7z",
133140
"path": "TestApp-1.1.0-x64.nsis.7z",
134141
"sha512": "@sha512",
135142
"size": "@size",
@@ -154,6 +161,7 @@ Object {
154161
"packages": Object {
155162
"x64": Object {
156163
"blockMapSize": "@blockMapSize",
164+
"file": "TestApp-1.1.0-x64.nsis.7z",
157165
"path": "TestApp-1.1.0-x64.nsis.7z",
158166
"sha512": "@sha512",
159167
"size": "@size",

0 commit comments

Comments
 (0)