Skip to content

Commit 5fa7a2d

Browse files
committed
fix: do not add gecko to manifest.json
1 parent dc26768 commit 5fa7a2d

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

src/core/builder.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { replaceInFileSync } from "replace-in-file";
1212
import webext from "web-ext";
1313
import { generateHashSync } from "../utils/crypto.js";
1414
import { patchWebExtLogger } from "../utils/log.js";
15+
import { getValidatedManifest } from "../utils/manifest.js";
1516
import { dateFormat, toArray } from "../utils/string.js";
1617
import { Base } from "./base.js";
1718

@@ -119,11 +120,6 @@ export default class Build extends Base {
119120
id,
120121
update_url: updateURL,
121122
},
122-
gecko: {
123-
id,
124-
update_url: updateURL,
125-
strict_min_version: "102",
126-
},
127123
},
128124
};
129125

@@ -319,6 +315,8 @@ export default class Build extends Base {
319315
artifactsDir: dist,
320316
filename: `${xpiName}.xpi`,
321317
overwriteDest: true,
318+
}, {
319+
manifestData: getValidatedManifest(),
322320
});
323321
}
324322
}

src/core/server/runner-web-ext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { resolve } from "node:path";
44
import { env } from "node:process";
55
import webext from "web-ext";
66
import { patchWebExtLogger } from "../../utils/log.js";
7+
import { getValidatedManifest } from "../../utils/manifest.js";
78
import { ServeBase } from "./base.js";
89

910
export default class RunnerWebExt extends ServeBase {
@@ -41,6 +42,7 @@ export default class RunnerWebExt extends ServeBase {
4142
// You need to specify this one so that your NodeJS application
4243
// can continue running after web-ext is finished.
4344
shouldExitProgram: false,
45+
getValidatedManifest,
4446
},
4547
);
4648
this._runner = runner;

src/utils/manifest.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Patch web-ext's getValidatedManifest
3+
* @see https://github.com/mozilla/web-ext?tab=readme-ov-file#using-web-ext-in-nodejs-code
4+
* @see https://github.com/mozilla/web-ext/blob/master/src/util/manifest.js#L15
5+
*/
6+
export function getValidatedManifest(_sourceDir?: string) {
7+
return {
8+
manifest_version: 2,
9+
name: "zoterp-plugin-scaffold-fake-name",
10+
version: "0.0.0.0",
11+
};
12+
}

0 commit comments

Comments
 (0)