zotero-plugin-scaffold 0.1.0 → 0.1.2
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
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { exit, env } from 'node:process';
|
|
2
|
+
import process, { exit, env } from 'node:process';
|
|
3
3
|
import { Command } from '@commander-js/extra-typings';
|
|
4
4
|
import updateNotifier from 'update-notifier';
|
|
5
|
-
import { L as Log, C as Config, B as Build, S as Serve, R as Release } from './shared/zotero-plugin-scaffold.
|
|
5
|
+
import { L as Log, C as Config, B as Build, S as Serve, R as Release } from './shared/zotero-plugin-scaffold.2dde82f3.mjs';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'c12';
|
|
8
8
|
import 'fs-extra';
|
|
@@ -25,12 +25,13 @@ import 'chokidar';
|
|
|
25
25
|
import 'node:fs';
|
|
26
26
|
|
|
27
27
|
const name = "zotero-plugin-scaffold";
|
|
28
|
-
const version = "0.1.
|
|
28
|
+
const version = "0.1.2";
|
|
29
29
|
|
|
30
30
|
const logger = new Log();
|
|
31
31
|
async function main() {
|
|
32
32
|
var _a;
|
|
33
33
|
updateNotifier({ pkg: { name, version } }).notify();
|
|
34
|
+
process.removeAllListeners("SIGINT");
|
|
34
35
|
(_a = env).NODE_ENV ?? (_a.NODE_ENV = "development");
|
|
35
36
|
const cli = new Command();
|
|
36
37
|
cli.version(version).usage("<command> [options]");
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as Build, C as Config, R as Release, S as Serve, d as defineConfig } from './shared/zotero-plugin-scaffold.
|
|
1
|
+
export { B as Build, C as Config, R as Release, S as Serve, d as defineConfig } from './shared/zotero-plugin-scaffold.2dde82f3.mjs';
|
|
2
2
|
import 'node:path';
|
|
3
3
|
import 'c12';
|
|
4
4
|
import 'fs-extra';
|
package/dist/shared/{zotero-plugin-scaffold.06668c10.mjs → zotero-plugin-scaffold.2dde82f3.mjs}
RENAMED
|
@@ -1253,13 +1253,19 @@ class Serve extends Base {
|
|
|
1253
1253
|
super(ctx);
|
|
1254
1254
|
__publicField(this, "builder");
|
|
1255
1255
|
__publicField(this, "runner");
|
|
1256
|
+
// Use arrow functions to keep `this`
|
|
1257
|
+
__publicField(this, "exit", () => {
|
|
1258
|
+
this.logger.info("Server shutdown by user request.");
|
|
1259
|
+
this.runner?.exit();
|
|
1260
|
+
killZotero();
|
|
1261
|
+
this.ctx.hooks.callHook("serve:exit", this.ctx);
|
|
1262
|
+
process.exit();
|
|
1263
|
+
});
|
|
1256
1264
|
(_a = process.env).NODE_ENV ?? (_a.NODE_ENV = "development");
|
|
1257
1265
|
this.builder = new Build(ctx);
|
|
1258
1266
|
}
|
|
1259
1267
|
async run() {
|
|
1260
|
-
process.on("SIGINT",
|
|
1261
|
-
this.exit();
|
|
1262
|
-
});
|
|
1268
|
+
process.on("SIGINT", this.exit);
|
|
1263
1269
|
await this.ctx.hooks.callHook("serve:init", this.ctx);
|
|
1264
1270
|
await this.builder.run();
|
|
1265
1271
|
await this.ctx.hooks.callHook("serve:prebuild", this.ctx);
|
|
@@ -1312,13 +1318,6 @@ class Serve extends Base {
|
|
|
1312
1318
|
await this.runner?.reload();
|
|
1313
1319
|
await this.ctx.hooks.callHook("serve:onReloaded", this.ctx);
|
|
1314
1320
|
}
|
|
1315
|
-
exit() {
|
|
1316
|
-
this.logger.info("Server shutdown by user request.");
|
|
1317
|
-
this.runner?.exit();
|
|
1318
|
-
killZotero();
|
|
1319
|
-
this.ctx.hooks.callHook("serve:exit", this.ctx);
|
|
1320
|
-
process.exit();
|
|
1321
|
-
}
|
|
1322
1321
|
}
|
|
1323
1322
|
|
|
1324
1323
|
const Config = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin-scaffold",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "A scaffold for Zotero plugin development.",
|
|
6
6
|
"author": "northword",
|
|
7
7
|
"license": "AGPL-3.0-or-later",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"web-ext": "^8.2.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@antfu/eslint-config": "^
|
|
75
|
+
"@antfu/eslint-config": "^3.0.0",
|
|
76
76
|
"@types/fs-extra": "^11.0.4",
|
|
77
77
|
"@types/node": "^20.16.1",
|
|
78
78
|
"@types/update-notifier": "^6.0.8",
|