generated from windingwind/zotero-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathzotero-plugin.config.ts
86 lines (82 loc) · 2.42 KB
/
zotero-plugin.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { copyFileSync } from "node:fs";
import { env } from "node:process";
import { defineConfig } from "zotero-plugin-scaffold";
import pkg from "./package.json";
export default defineConfig({
source: ["src", "addon"],
dist: "./.scaffold/build",
name: pkg.config.addonName,
id: pkg.config.addonID,
namespace: pkg.config.addonRef,
updateURL: `https://github.com/{{owner}}/{{repo}}/releases/download/releaser/{{updateJson}}`,
xpiDownloadLink: "https://github.com/{{owner}}/{{repo}}/releases/download/v{{version}}/{{xpiName}}.xpi",
build: {
assets: [
"addon/**/*.*",
"data/journal-abbr/journal-abbr.json",
"data/conference-abbr.json",
"data/university-list/university-place.json",
],
define: {
...pkg.config,
author: pkg.author,
description: pkg.description,
homepage: pkg.homepage,
buildVersion: pkg.version,
buildTime: "{{buildTime}}",
},
prefs: {
prefix: pkg.config.prefsPrefix,
},
esbuildOptions: [
{
entryPoints: ["src/index.ts"],
define: {
__env__: `"${env.NODE_ENV}"`,
},
bundle: true,
target: "firefox115",
outfile: `.scaffold/build/addon/content/scripts/${pkg.config.addonRef}.js`,
},
],
makeUpdateJson: {
hash: false,
updates: [
{
version: "0.4.5",
update_link: "https://github.com/northword/zotero-format-metadata/releases/download/0.4.4/zotero-format-metadata-0.4.5.xpi",
applications: {
gecko: {
strict_min_version: "60.0",
},
},
},
],
},
hooks: {
"build:makeUpdateJSON": () => {
copyFileSync(".scaffold/build/update.json", "update.json");
// copyFileSync("build/update-beta.json", "update-beta.json");
},
},
},
// TODO: switch to scaffold's releaser
release: {
bumpp: {
execute: "pnpm build",
all: true,
},
changelog: "conventional-changelog",
github: {
enable: "ci",
updater: "releaser",
releaseNote(ctx) {
let notes = `${ctx.release.changelog} \n\n`;
notes += ` \n\n`;
return notes;
},
},
},
// If you need to see a more detailed build log, uncomment the following line:
// logLevel: "trace",
});