zotero-plugin-scaffold 0.2.9 → 0.2.11

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.CBp9PBY_.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.Cogc0b_B.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,7 +31,7 @@ import 'node:http';
31
31
  import 'xvfb-ts';
32
32
 
33
33
  const name = "zotero-plugin-scaffold";
34
- const version = "0.2.9";
34
+ const version = "0.2.11";
35
35
  const pkg = {
36
36
  name: name,
37
37
  version: version};
package/dist/index.d.mts CHANGED
@@ -128,7 +128,7 @@ interface Config$1 {
128
128
  * 脚手架将在 `${dist}/addon` 存放构建后打包前的代码。
129
129
  * 在 `${dist}/${xpiName}.xpi` 存放打包结果。
130
130
  *
131
- * @default "build"
131
+ * @default ".scaffold/build"
132
132
  */
133
133
  dist: string;
134
134
  /**
@@ -356,8 +356,16 @@ interface BuildConfig {
356
356
  /**
357
357
  * Configurations of esbuild.
358
358
  *
359
+ * Paths should be relative to the root directory of the project.
360
+ * And if `outfile` and `outdir` not start with `dist`,
361
+ * `dist/` will be automatically added as a prefix.
362
+ *
359
363
  * esbuild 配置。
360
364
  *
365
+ * 路径应相对于项目根目录。
366
+ * 其中“outfile”和“outdir”若不以 `dist` 开头,
367
+ * 则会自动添加 `dist/` 前缀。
368
+ *
361
369
  * @default []
362
370
  *
363
371
  */
package/dist/index.d.ts CHANGED
@@ -128,7 +128,7 @@ interface Config$1 {
128
128
  * 脚手架将在 `${dist}/addon` 存放构建后打包前的代码。
129
129
  * 在 `${dist}/${xpiName}.xpi` 存放打包结果。
130
130
  *
131
- * @default "build"
131
+ * @default ".scaffold/build"
132
132
  */
133
133
  dist: string;
134
134
  /**
@@ -356,8 +356,16 @@ interface BuildConfig {
356
356
  /**
357
357
  * Configurations of esbuild.
358
358
  *
359
+ * Paths should be relative to the root directory of the project.
360
+ * And if `outfile` and `outdir` not start with `dist`,
361
+ * `dist/` will be automatically added as a prefix.
362
+ *
359
363
  * esbuild 配置。
360
364
  *
365
+ * 路径应相对于项目根目录。
366
+ * 其中“outfile”和“outdir”若不以 `dist` 开头,
367
+ * 则会自动添加 `dist/` 前缀。
368
+ *
361
369
  * @default []
362
370
  *
363
371
  */
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.CBp9PBY_.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.Cogc0b_B.mjs';
2
2
  import 'c12';
3
3
  import 'es-toolkit';
4
4
  import 'fs-extra/esm';
@@ -740,9 +740,20 @@ class Build extends Base {
740
740
  }
741
741
  }
742
742
  esbuild() {
743
- const { build: { esbuildOptions } } = this.ctx;
743
+ const { dist, build: { esbuildOptions } } = this.ctx;
744
744
  if (esbuildOptions.length === 0)
745
745
  return;
746
+ esbuildOptions.map((option, i) => {
747
+ if (option.outfile && !option.outfile.startsWith(dist)) {
748
+ this.logger.debug(`'outfile' of esbuildOptions[${i}] is not in dist folder, it will be overwritten.`);
749
+ option.outfile = `${dist}/${option.outfile}`;
750
+ }
751
+ if (option.outdir && !option.outdir.startsWith(dist)) {
752
+ this.logger.debug(`'outdir' of esbuildOptions[${i}] is not in dist folder, it will be overwritten.`);
753
+ option.outdir = `${dist}/${option.outdir}`;
754
+ }
755
+ return option;
756
+ });
746
757
  return Promise.all(
747
758
  esbuildOptions.map(
748
759
  (esbuildOption) => build(esbuildOption)
@@ -1234,9 +1245,40 @@ const prefsFirefox = {
1234
1245
  // (See #1114 for rationale)
1235
1246
  "datareporting.policy.firstRunURL": ""
1236
1247
  };
1248
+ const prefsZotero = {
1249
+ "extensions.experiments.enabled": true,
1250
+ "extensions.autoDisableScopes": 0,
1251
+ // Enable remote-debugging
1252
+ "devtools.debugger.remote-enabled": true,
1253
+ "devtools.debugger.remote-websocket": true,
1254
+ "devtools.debugger.prompt-connection": false,
1255
+ // Inherit the default test settings from Zotero
1256
+ // https://github.com/zotero/zotero/blob/8a06edab49f07b84d07056ccd594c87920ef2c5e/test/runtests.sh#L127-L147
1257
+ // "app.update.enabled": false,
1258
+ // "extensions.zotero.sync.server.compressData": false,
1259
+ // "extensions.zotero.automaticScraperUpdates": false,
1260
+ // "extensions.zotero.debug.log": 5,
1261
+ // "extensions.zotero.debug.level": 5,
1262
+ // "extensions.zotero.debug.time": 5,
1263
+ "extensions.zotero.firstRun.skipFirefoxProfileAccessCheck": true,
1264
+ "extensions.zotero.firstRunGuidance": false,
1265
+ "extensions.zotero.firstRun2": false,
1266
+ "extensions.zotero.reportTranslationFailure": false,
1267
+ "extensions.zotero.httpServer.enabled": true,
1268
+ "extensions.zotero.httpServer.port": 23124,
1269
+ // ascii "ZT"
1270
+ "extensions.zotero.httpServer.localAPI.enabled": true,
1271
+ // "extensions.zotero.backup.numBackups": 0,
1272
+ // "extensions.zotero.sync.autoSync": false,
1273
+ "extensions.zoteroMacWordIntegration.installed": true,
1274
+ "extensions.zoteroMacWordIntegration.skipInstallation": true,
1275
+ "extensions.zoteroWinWordIntegration.skipInstallation": true,
1276
+ "extensions.zoteroOpenOfficeIntegration.skipInstallation": true
1277
+ };
1237
1278
  const prefs = {
1238
1279
  ...prefsCommon,
1239
- ...prefsFirefox
1280
+ ...prefsFirefox,
1281
+ ...prefsZotero
1240
1282
  };
1241
1283
 
1242
1284
  const UNSOLICITED_EVENTS = /* @__PURE__ */ new Set([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
3
  "type": "module",
4
- "version": "0.2.9",
4
+ "version": "0.2.11",
5
5
  "description": "A scaffold for Zotero plugin development.",
6
6
  "author": "northword",
7
7
  "license": "AGPL-3.0-or-later",