zotero-plugin-scaffold 0.2.8 → 0.2.10

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,6 +1,6 @@
1
1
  import process from 'node:process';
2
2
  import { Command } from 'commander';
3
- import { E as ExitSignals, l as logger, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.BfbnPYjV.mjs';
3
+ import { E as ExitSignals, l as logger, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.CpbQ9PJO.mjs';
4
4
  import { readFile, writeFile } from 'node:fs/promises';
5
5
  import { pathExists, ensureFile } from 'fs-extra';
6
6
  import tinyUpdateNotifier from 'tiny-update-notifier';
@@ -31,124 +31,10 @@ import 'node:http';
31
31
  import 'xvfb-ts';
32
32
 
33
33
  const name = "zotero-plugin-scaffold";
34
- const type = "module";
35
- const version = "0.2.8";
36
- const packageManager = "pnpm@10.2.0";
37
- const description = "A scaffold for Zotero plugin development.";
38
- const author = "northword";
39
- const license = "AGPL-3.0-or-later";
40
- const homepage = "https://github.com/northword/zotero-plugin-scaffold#readme";
41
- const repository = {
42
- type: "git",
43
- url: "https://github.com/northword/zotero-plugin-scaffold.git",
44
- directory: "packages/scaffold"
45
- };
46
- const bugs = {
47
- url: "https://github.com/northword/zotero-plugin-scaffold/issues"
48
- };
49
- const keywords = [
50
- "zotero",
51
- "plugin",
52
- "developer",
53
- "scaffold",
54
- "web-ext"
55
- ];
56
- const exports = {
57
- ".": {
58
- types: "./dist/index.d.ts",
59
- "import": "./dist/index.mjs"
60
- },
61
- "./cli": {
62
- "import": "./dist/cli.mjs"
63
- },
64
- "./vendor": {
65
- types: "./dist/vendor/index.d.ts",
66
- "import": "./dist/vendor/index.mjs"
67
- }
68
- };
69
- const main$1 = "./dist/index.mjs";
70
- const module = "./dist/index.mjs";
71
- const types = "./dist/index.d.ts";
72
- const bin = {
73
- "zotero-plugin": "./bin/zotero-plugin.mjs"
74
- };
75
- const files = [
76
- "bin",
77
- "dist"
78
- ];
79
- const engines = {
80
- node: ">=18"
81
- };
82
- const scripts = {
83
- dev: "unbuild --stub",
84
- build: "tsc --noEmit && unbuild",
85
- test: "echo \"Error: no test specified\" && exit 1"
86
- };
87
- const publishConfig = {
88
- access: "public",
89
- registry: "https://registry.npmjs.org"
90
- };
91
- const directories = {
92
- lib: "dist"
93
- };
94
- const peerDependencies = {
95
- "conventional-changelog": "^6.0.0"
96
- };
97
- const peerDependenciesMeta = {
98
- "conventional-changelog": {
99
- optional: true
100
- }
101
- };
102
- const dependencies = {
103
- "@swc/core": "^1.10.14",
104
- "adm-zip": "^0.5.16",
105
- bumpp: "^10.0.1",
106
- c12: "^2.0.1",
107
- chalk: "^5.4.1",
108
- chokidar: "^4.0.3",
109
- commander: "^13.1.0",
110
- "es-toolkit": "^1.32.0",
111
- esbuild: "^0.24.2",
112
- "fs-extra": "^11.3.0",
113
- hookable: "^5.5.3",
114
- octokit: "^4.1.0",
115
- "std-env": "^3.8.0",
116
- "tiny-update-notifier": "^2.0.0",
117
- tinyglobby: "^0.2.10",
118
- "xvfb-ts": "^1.1.0"
119
- };
120
- const devDependencies = {
121
- "@commander-js/extra-typings": "^13.1.0",
122
- "@types/adm-zip": "^0.5.7",
123
- "@types/fs-extra": "^11.0.4"
124
- };
34
+ const version = "0.2.10";
125
35
  const pkg = {
126
36
  name: name,
127
- type: type,
128
- version: version,
129
- packageManager: packageManager,
130
- description: description,
131
- author: author,
132
- license: license,
133
- homepage: homepage,
134
- repository: repository,
135
- bugs: bugs,
136
- keywords: keywords,
137
- exports: exports,
138
- main: main$1,
139
- module: module,
140
- types: types,
141
- bin: bin,
142
- files: files,
143
- engines: engines,
144
- scripts: scripts,
145
- publishConfig: publishConfig,
146
- directories: directories,
147
- peerDependencies: peerDependencies,
148
- peerDependenciesMeta: peerDependenciesMeta,
149
- dependencies: dependencies,
150
- devDependencies: devDependencies
151
- };
37
+ version: version};
152
38
 
153
39
  async function checkGitIgnore() {
154
40
  if (!pathExists(".git"))
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.BfbnPYjV.mjs';
1
+ export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.CpbQ9PJO.mjs';
2
2
  import 'c12';
3
3
  import 'es-toolkit';
4
4
  import 'fs-extra/esm';
@@ -41,13 +41,9 @@ const SYMBOLS = {
41
41
  TIP: chalk.blue("\u2192"),
42
42
  ERROR: chalk.bgRed(" ERROR "),
43
43
  WARN: chalk.bgYellow(" WARN "),
44
- DEBUG: chalk.grey("\u2699"),
45
- NONE: ""
46
- };
44
+ DEBUG: chalk.grey("\u2699")};
47
45
  const DEFAULT_OPTIONS = {
48
46
  SPACE: 0,
49
- LEVEL: 2 /* INFO */,
50
- SYMBOL: "",
51
47
  NEW_LINE: false
52
48
  };
53
49
  const LOG_METHODS_CONFIG = {
@@ -77,11 +73,6 @@ const LOG_METHODS_CONFIG = {
77
73
  level: 2 /* INFO */,
78
74
  symbol: SYMBOLS.SUCCESS
79
75
  },
80
- ready: {
81
- level: 2 /* INFO */,
82
- symbol: SYMBOLS.SUCCESS,
83
- wrapNewLine: true
84
- },
85
76
  fail: {
86
77
  level: 4 /* ERROR */,
87
78
  symbol: SYMBOLS.FAIL
@@ -464,7 +455,7 @@ class PrefsManager {
464
455
  logger.debug("The prefs.js has been modified.");
465
456
  }
466
457
  setPref(key, value) {
467
- if (value === null || value === undefined) {
458
+ if (value === null || value === void 0) {
468
459
  if (key in this.prefs)
469
460
  delete this.prefs[key];
470
461
  return;
@@ -477,7 +468,7 @@ class PrefsManager {
477
468
  });
478
469
  }
479
470
  getPref(key) {
480
- return this.prefs[key] ?? undefined;
471
+ return this.prefs[key] ?? void 0;
481
472
  }
482
473
  getPrefs() {
483
474
  return this.prefs;
@@ -873,7 +864,7 @@ function getMimeTypeByFileName(filename) {
873
864
  if (ext === `.${type}`)
874
865
  return mimeTypes[type];
875
866
  }
876
- return undefined;
867
+ return void 0;
877
868
  }
878
869
 
879
870
  class ReleaseBase extends Base {
@@ -928,7 +919,7 @@ class GitHub extends ReleaseBase {
928
919
  tag
929
920
  }).catch((e) => {
930
921
  this.logger.debug(`Release with tag ${tag} not found. ${e}`);
931
- return undefined;
922
+ return void 0;
932
923
  }).then((res) => {
933
924
  if (res && res.status === 200) {
934
925
  this.logger.debug(`Found release with tag "${tag}", id=${res.data.id}.`);
@@ -1243,9 +1234,40 @@ const prefsFirefox = {
1243
1234
  // (See #1114 for rationale)
1244
1235
  "datareporting.policy.firstRunURL": ""
1245
1236
  };
1237
+ const zoteroPrefs = {
1238
+ "extensions.experiments.enabled": true,
1239
+ "extensions.autoDisableScopes": 0,
1240
+ // Enable remote-debugging
1241
+ "devtools.debugger.remote-enabled": true,
1242
+ "devtools.debugger.remote-websocket": true,
1243
+ "devtools.debugger.prompt-connection": false,
1244
+ // Inherit the default test settings from Zotero
1245
+ // https://github.com/zotero/zotero/blob/8a06edab49f07b84d07056ccd594c87920ef2c5e/test/runtests.sh#L127-L147
1246
+ // "app.update.enabled": false,
1247
+ "extensions.zotero.sync.server.compressData": false,
1248
+ "extensions.zotero.automaticScraperUpdates": false,
1249
+ "extensions.zotero.debug.log": 5,
1250
+ "extensions.zotero.debug.level": 5,
1251
+ "extensions.zotero.debug.time": 5,
1252
+ "extensions.zotero.firstRun.skipFirefoxProfileAccessCheck": true,
1253
+ "extensions.zotero.firstRunGuidance": false,
1254
+ "extensions.zotero.firstRun2": false,
1255
+ "extensions.zotero.reportTranslationFailure": false,
1256
+ "extensions.zotero.httpServer.enabled": true,
1257
+ "extensions.zotero.httpServer.port": 23124,
1258
+ // ascii "ZT"
1259
+ "extensions.zotero.httpServer.localAPI.enabled": true,
1260
+ "extensions.zotero.backup.numBackups": 0,
1261
+ // "extensions.zotero.sync.autoSync": false,
1262
+ "extensions.zoteroMacWordIntegration.installed": true,
1263
+ "extensions.zoteroMacWordIntegration.skipInstallation": true,
1264
+ "extensions.zoteroWinWordIntegration.skipInstallation": true,
1265
+ "extensions.zoteroOpenOfficeIntegration.skipInstallation": true
1266
+ };
1246
1267
  const prefs = {
1247
1268
  ...prefsCommon,
1248
- ...prefsFirefox
1269
+ ...prefsFirefox,
1270
+ ...zoteroPrefs
1249
1271
  };
1250
1272
 
1251
1273
  const UNSOLICITED_EVENTS = /* @__PURE__ */ new Set([
@@ -1798,7 +1820,7 @@ class ZoteroRunner {
1798
1820
  reloadError: error
1799
1821
  };
1800
1822
  }
1801
- return { sourceDir, reloadError: undefined };
1823
+ return { sourceDir, reloadError: void 0 };
1802
1824
  }
1803
1825
  async reloadAllTemporaryPlugins() {
1804
1826
  for (const { sourceDir } of this.options.plugins.list) {
@@ -2241,14 +2263,14 @@ class Test extends Base {
2241
2263
  for (const dir of testDirs) {
2242
2264
  let tsconfigPath = resolve(`${dir}/tsconfig.json`);
2243
2265
  if (!await pathExists(tsconfigPath)) {
2244
- tsconfigPath = undefined;
2266
+ tsconfigPath = void 0;
2245
2267
  }
2246
2268
  await build({
2247
2269
  entryPoints: await glob(`${dir}/**/*.spec.{js,ts}`),
2248
2270
  outdir: `${this.testPluginDir}/content/units`,
2249
2271
  bundle: true,
2250
2272
  target: "firefox115",
2251
- tsconfig: tsconfigPath || undefined
2273
+ tsconfig: tsconfigPath || void 0
2252
2274
  });
2253
2275
  }
2254
2276
  const testFiles = (await glob(`**/*.spec.js`, { cwd: `${this.testPluginDir}/content` })).sort();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
3
  "type": "module",
4
- "version": "0.2.8",
4
+ "version": "0.2.10",
5
5
  "description": "A scaffold for Zotero plugin development.",
6
6
  "author": "northword",
7
7
  "license": "AGPL-3.0-or-later",
@@ -45,7 +45,7 @@
45
45
  "dist"
46
46
  ],
47
47
  "engines": {
48
- "node": ">=18"
48
+ "node": ">=18.20.7"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",
@@ -63,21 +63,21 @@
63
63
  }
64
64
  },
65
65
  "dependencies": {
66
- "@swc/core": "^1.10.14",
66
+ "@swc/core": "^1.11.5",
67
67
  "adm-zip": "^0.5.16",
68
- "bumpp": "^10.0.1",
69
- "c12": "^2.0.1",
68
+ "bumpp": "^10.0.3",
69
+ "c12": "^3.0.2",
70
70
  "chalk": "^5.4.1",
71
71
  "chokidar": "^4.0.3",
72
72
  "commander": "^13.1.0",
73
73
  "es-toolkit": "^1.32.0",
74
- "esbuild": "^0.24.2",
74
+ "esbuild": "^0.25.0",
75
75
  "fs-extra": "^11.3.0",
76
76
  "hookable": "^5.5.3",
77
- "octokit": "^4.1.0",
77
+ "octokit": "^4.1.2",
78
78
  "std-env": "^3.8.0",
79
79
  "tiny-update-notifier": "^2.0.0",
80
- "tinyglobby": "^0.2.10",
80
+ "tinyglobby": "^0.2.12",
81
81
  "xvfb-ts": "^1.1.0"
82
82
  },
83
83
  "devDependencies": {