zotero-plugin-scaffold 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +3 -16
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +9 -8
- package/package.json +2 -15
package/dist/cli.mjs
CHANGED
|
@@ -23,14 +23,14 @@ import 'chokidar';
|
|
|
23
23
|
import 'process';
|
|
24
24
|
|
|
25
25
|
const name = "zotero-plugin-scaffold";
|
|
26
|
-
const version = "0.0.
|
|
26
|
+
const version = "0.0.14";
|
|
27
27
|
const description = "A scaffold for Zotero plugin development.";
|
|
28
28
|
const scripts = {
|
|
29
29
|
dev: "unbuild --stub",
|
|
30
30
|
build: "tsc --noEmit && unbuild",
|
|
31
31
|
lint: "eslint --max-warnings=0 . && prettier --check .",
|
|
32
32
|
"lint:fix": "eslint --fix . && prettier --write .",
|
|
33
|
-
release: "
|
|
33
|
+
release: "bumpp --commit \"chore(release): publish v%s\"",
|
|
34
34
|
test: "echo \"Error: no test specified\" && exit 1"
|
|
35
35
|
};
|
|
36
36
|
const type = "module";
|
|
@@ -110,7 +110,6 @@ const devDependencies = {
|
|
|
110
110
|
eslint: "8.57.0",
|
|
111
111
|
"eslint-config-prettier": "9.1.0",
|
|
112
112
|
prettier: "3.2.5",
|
|
113
|
-
"release-it": "17.1.1",
|
|
114
113
|
typescript: "5.4.3",
|
|
115
114
|
unbuild: "2.0.0"
|
|
116
115
|
};
|
|
@@ -145,19 +144,7 @@ const pkg = {
|
|
|
145
144
|
packageManager: packageManager,
|
|
146
145
|
dependencies: dependencies,
|
|
147
146
|
devDependencies: devDependencies,
|
|
148
|
-
pnpm: pnpm
|
|
149
|
-
"release-it": {
|
|
150
|
-
git: {
|
|
151
|
-
commitMessage: "chore(publish): release v${version}",
|
|
152
|
-
tagName: "v${version}"
|
|
153
|
-
},
|
|
154
|
-
npm: {
|
|
155
|
-
publish: false
|
|
156
|
-
},
|
|
157
|
-
github: {
|
|
158
|
-
release: false
|
|
159
|
-
}
|
|
160
|
-
}
|
|
147
|
+
pnpm: pnpm
|
|
161
148
|
};
|
|
162
149
|
|
|
163
150
|
async function main() {
|
package/dist/index.d.mts
CHANGED
|
@@ -341,6 +341,7 @@ interface UserConfig extends RecursivePartial<Config$1> {
|
|
|
341
341
|
}
|
|
342
342
|
interface Context extends Config$1 {
|
|
343
343
|
pkgUser: any;
|
|
344
|
+
xpiName: string;
|
|
344
345
|
version: string;
|
|
345
346
|
hooks: Hookable<Hooks>;
|
|
346
347
|
templateDate: {
|
|
@@ -375,7 +376,7 @@ declare abstract class Base {
|
|
|
375
376
|
get namespace(): string;
|
|
376
377
|
get updateLink(): string;
|
|
377
378
|
get updateURL(): string;
|
|
378
|
-
get xpiName():
|
|
379
|
+
get xpiName(): string;
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
declare class Build extends Base {
|
|
@@ -418,7 +419,7 @@ declare class Release extends Base {
|
|
|
418
419
|
*
|
|
419
420
|
* release: bump version, run build, git add, git commit, git tag, git push
|
|
420
421
|
*/
|
|
421
|
-
bump(): void
|
|
422
|
+
bump(): Promise<void>;
|
|
422
423
|
/**
|
|
423
424
|
* Create new release and upload XPI to asset
|
|
424
425
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -341,6 +341,7 @@ interface UserConfig extends RecursivePartial<Config$1> {
|
|
|
341
341
|
}
|
|
342
342
|
interface Context extends Config$1 {
|
|
343
343
|
pkgUser: any;
|
|
344
|
+
xpiName: string;
|
|
344
345
|
version: string;
|
|
345
346
|
hooks: Hookable<Hooks>;
|
|
346
347
|
templateDate: {
|
|
@@ -375,7 +376,7 @@ declare abstract class Base {
|
|
|
375
376
|
get namespace(): string;
|
|
376
377
|
get updateLink(): string;
|
|
377
378
|
get updateURL(): string;
|
|
378
|
-
get xpiName():
|
|
379
|
+
get xpiName(): string;
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
declare class Build extends Base {
|
|
@@ -418,7 +419,7 @@ declare class Release extends Base {
|
|
|
418
419
|
*
|
|
419
420
|
* release: bump version, run build, git add, git commit, git tag, git push
|
|
420
421
|
*/
|
|
421
|
-
bump(): void
|
|
422
|
+
bump(): Promise<void>;
|
|
422
423
|
/**
|
|
423
424
|
* Create new release and upload XPI to asset
|
|
424
425
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -71,6 +71,7 @@ function resolveConfig(config) {
|
|
|
71
71
|
const ctx = {
|
|
72
72
|
...config,
|
|
73
73
|
pkgUser: pkg,
|
|
74
|
+
xpiName: dash(config.name),
|
|
74
75
|
version: pkg.version,
|
|
75
76
|
hooks: createHooks(),
|
|
76
77
|
templateDate: data
|
|
@@ -212,7 +213,7 @@ class Base {
|
|
|
212
213
|
return this.ctx.updateURL;
|
|
213
214
|
}
|
|
214
215
|
get xpiName() {
|
|
215
|
-
return this.ctx.
|
|
216
|
+
return this.ctx.xpiName;
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
@@ -399,7 +400,7 @@ class Build extends Base {
|
|
|
399
400
|
`${this.dist}/addon/manifest.json`
|
|
400
401
|
), min = manifest.applications?.zotero?.strict_min_version, max = manifest.applications?.zotero?.strict_max_version;
|
|
401
402
|
const updateHash = generateHashSync(
|
|
402
|
-
path.join(this.dist, `${this.
|
|
403
|
+
path.join(this.dist, `${this.xpiName}.xpi`),
|
|
403
404
|
"sha512"
|
|
404
405
|
);
|
|
405
406
|
const data = {
|
|
@@ -434,7 +435,7 @@ class Build extends Base {
|
|
|
434
435
|
await webext.cmd.build({
|
|
435
436
|
sourceDir: `${this.dist}/addon`,
|
|
436
437
|
artifactsDir: this.dist,
|
|
437
|
-
filename: `${this.
|
|
438
|
+
filename: `${this.xpiName}.xpi`,
|
|
438
439
|
overwriteDest: true
|
|
439
440
|
});
|
|
440
441
|
}
|
|
@@ -464,15 +465,15 @@ class Release extends Base {
|
|
|
464
465
|
async run() {
|
|
465
466
|
const t = /* @__PURE__ */ new Date();
|
|
466
467
|
if (!this.isCI) {
|
|
467
|
-
this.bump();
|
|
468
|
+
await this.bump();
|
|
468
469
|
} else {
|
|
469
470
|
if (glob.globSync(`${this.dist}/*.xpi`).length == 0) {
|
|
470
471
|
this.logger.error(
|
|
471
472
|
"No xpi file found, are you sure you have run the build?"
|
|
472
473
|
);
|
|
473
474
|
}
|
|
474
|
-
this.uploadXPI();
|
|
475
|
-
this.uploadUpdateJSON();
|
|
475
|
+
await this.uploadXPI();
|
|
476
|
+
await this.uploadUpdateJSON();
|
|
476
477
|
}
|
|
477
478
|
this.logger.success(
|
|
478
479
|
`Done in ${(( new Date()).getTime() - t.getTime()) / 1e3} s.`
|
|
@@ -483,8 +484,8 @@ class Release extends Base {
|
|
|
483
484
|
*
|
|
484
485
|
* release: bump version, run build, git add, git commit, git tag, git push
|
|
485
486
|
*/
|
|
486
|
-
bump() {
|
|
487
|
-
versionBump(this.ctx.release.bumpp);
|
|
487
|
+
async bump() {
|
|
488
|
+
await versionBump(this.ctx.release.bumpp);
|
|
488
489
|
}
|
|
489
490
|
/**
|
|
490
491
|
* Create new release and upload XPI to asset
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin-scaffold",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "A scaffold for Zotero plugin development.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -79,28 +79,15 @@
|
|
|
79
79
|
"eslint": "8.57.0",
|
|
80
80
|
"eslint-config-prettier": "9.1.0",
|
|
81
81
|
"prettier": "3.2.5",
|
|
82
|
-
"release-it": "17.1.1",
|
|
83
82
|
"typescript": "5.4.3",
|
|
84
83
|
"unbuild": "2.0.0"
|
|
85
84
|
},
|
|
86
|
-
"release-it": {
|
|
87
|
-
"git": {
|
|
88
|
-
"commitMessage": "chore(publish): release v${version}",
|
|
89
|
-
"tagName": "v${version}"
|
|
90
|
-
},
|
|
91
|
-
"npm": {
|
|
92
|
-
"publish": false
|
|
93
|
-
},
|
|
94
|
-
"github": {
|
|
95
|
-
"release": false
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
85
|
"scripts": {
|
|
99
86
|
"dev": "unbuild --stub",
|
|
100
87
|
"build": "tsc --noEmit && unbuild",
|
|
101
88
|
"lint": "eslint --max-warnings=0 . && prettier --check .",
|
|
102
89
|
"lint:fix": "eslint --fix . && prettier --write .",
|
|
103
|
-
"release": "
|
|
90
|
+
"release": "bumpp --commit \"chore(release): publish v%s\"",
|
|
104
91
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
105
92
|
}
|
|
106
93
|
}
|