zotero-plugin-scaffold 0.8.5 → 0.8.6

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { l as logger } from "./shared/scaffold-replace-BTU0g6CT.mjs";
2
- import { a as Release, i as ExitSignals, n as Test, o as Build, r as Serve, t as Config } from "./shared/scaffold-src-BF5nY3YC.mjs";
2
+ import { a as Release, i as ExitSignals, n as Test, o as Build, r as Serve, t as Config } from "./shared/scaffold-src-CQEdY9K7.mjs";
3
3
  import process from "node:process";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { Command } from "commander";
@@ -7,7 +7,7 @@ import { pathExists } from "fs-extra";
7
7
  import tinyUpdateNotifier from "tiny-update-notifier";
8
8
  //#region package.json
9
9
  var name = "zotero-plugin-scaffold";
10
- var version = "0.8.5";
10
+ var version = "0.8.6";
11
11
  //#endregion
12
12
  //#region src/utils/gitignore.ts
13
13
  async function checkGitIgnore() {
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
- import "./shared/scaffold-replace-BTU0g6CT.mjs";
2
- import { a as Release, n as Test, o as Build, r as Serve, s as defineConfig, t as Config } from "./shared/scaffold-src-BF5nY3YC.mjs";
1
+ import { a as Release, n as Test, o as Build, r as Serve, s as defineConfig, t as Config } from "./shared/scaffold-src-CQEdY9K7.mjs";
3
2
  export { Build, Config, Release, Serve, Test, defineConfig };
@@ -4024,6 +4024,10 @@ var TestHttpReporter = class {
4024
4024
  if (this.failed === 0) logger.success(`Test run completed - ${this.passed} passed`);
4025
4025
  else logger.fail(`Test run completed - ${this.passed} passed, ${this.failed} failed`);
4026
4026
  break;
4027
+ case "error":
4028
+ logger.error(body.data?.title);
4029
+ this.failed++;
4030
+ break;
4027
4031
  default:
4028
4032
  logger.log(data);
4029
4033
  break;
@@ -4040,7 +4044,7 @@ async function saveResource(url, path) {
4040
4044
  }
4041
4045
  //#endregion
4042
4046
  //#region src/core/tester/test-bundler-template/raw/bootstrap.js?raw
4043
- var bootstrap_default = "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// Code generated by the zotero-plugin-scaffold tester\nvar chromeHandle;\n\nfunction install(data, reason) {}\n\nasync function startup({ id, version, resourceURI, rootURI }, reason) {\n await Zotero.initializationPromise;\n const aomStartup = Components.classes[\n \"@mozilla.org/addons/addon-manager-startup;1\"\n ].getService(Components.interfaces.amIAddonManagerStartup);\n const manifestURI = Services.io.newURI(rootURI + \"manifest.json\");\n chromeHandle = aomStartup.registerChrome(manifestURI, [\n [\"content\", \"__TESTER_PLUGIN_REF__\", rootURI + \"content/\"],\n ]);\n\n launchTests().catch((error) => {\n Zotero.debug(error);\n Zotero.HTTP.request(\n \"POST\",\n \"http://localhost:__PORT__/update\",\n {\n body: JSON.stringify({\n type: \"fail\",\n data: {\n title: \"Internal: Plugin awaiting timeout\",\n stack: \"\",\n str: \"Plugin awaiting timeout\",\n },\n }),\n }\n );\n });\n}\n\nfunction onMainWindowLoad({ window: win }) {}\n\nfunction onMainWindowUnload({ window: win }) {}\n\nfunction shutdown({ id, version, resourceURI, rootURI }, reason) {\n if (reason === APP_SHUTDOWN) {\n return;\n }\n\n if (chromeHandle) {\n chromeHandle.destruct();\n chromeHandle = null;\n }\n}\n\nfunction uninstall(data, reason) {}\n\nasync function launchTests() {\n // Delay to allow plugin to fully load before opening the test page\n await Zotero.Promise.delay(__STARTUP_DELAY__);\n\n const waitForPlugin = \"__WAIT_FOR_PLUGIN__\";\n\n if (waitForPlugin) {\n // Wait for a plugin to be installed\n await waitUtilAsync(() => {\n try {\n return !!eval(waitForPlugin)();\n } catch (error) {\n return false;\n }\n }).catch(() => {\n throw new Error(\"Plugin awaiting timeout\");\n });\n }\n\n Services.ww.openWindow(\n null,\n \"chrome://__TESTER_PLUGIN_REF__/content/index.xhtml\",\n \"Zotero Plugin Scaffold Test Runnner\",\n \"chrome,centerscreen,resizable=yes\",\n {}\n );\n}\n\nfunction waitUtilAsync(condition, interval = 100, timeout = 1e4) {\n return new Promise((resolve, reject) => {\n const start = Date.now();\n const intervalId = setInterval(() => {\n if (condition()) {\n clearInterval(intervalId);\n resolve();\n } else if (Date.now() - start > timeout) {\n clearInterval(intervalId);\n reject();\n }\n }, interval);\n });\n}\n";
4047
+ var bootstrap_default = "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// Code generated by the zotero-plugin-scaffold tester\nvar chromeHandle;\n\nfunction install(data, reason) {}\n\nasync function startup({ id, version, resourceURI, rootURI }, reason) {\n await Zotero.initializationPromise;\n const aomStartup = Components.classes[\n \"@mozilla.org/addons/addon-manager-startup;1\"\n ].getService(Components.interfaces.amIAddonManagerStartup);\n const manifestURI = Services.io.newURI(rootURI + \"manifest.json\");\n chromeHandle = aomStartup.registerChrome(manifestURI, [\n [\"content\", \"__TESTER_PLUGIN_REF__\", rootURI + \"content/\"],\n ]);\n\n launchTests().catch((error) => {\n Zotero.debug(error);\n Zotero.HTTP.request(\n \"POST\",\n \"http://localhost:__PORT__/update\",\n {\n body: JSON.stringify({\n type: \"error\",\n data: {\n title: error.message,\n },\n }),\n }\n );\n // Although this is an exception, we still need to use the status code 0, \n // because status code 1 will cause Zotero to auto-restart.\n Zotero.Utilities.Internal.quit(0);\n });\n}\n\nfunction onMainWindowLoad({ window: win }) {}\n\nfunction onMainWindowUnload({ window: win }) {}\n\nfunction shutdown({ id, version, resourceURI, rootURI }, reason) {\n if (reason === APP_SHUTDOWN) {\n return;\n }\n\n if (chromeHandle) {\n chromeHandle.destruct();\n chromeHandle = null;\n }\n}\n\nfunction uninstall(data, reason) {}\n\nasync function launchTests() {\n // Delay to allow plugin to fully load before opening the test page\n if (__STARTUP_DELAY__) {\n await Zotero.Promise.delay(__STARTUP_DELAY__);\n }\n\n const waitForPlugin = \"__WAIT_FOR_PLUGIN__\";\n if (waitForPlugin) {\n // Wait for a plugin to be installed\n await waitUtilAsync(() => {\n try {\n return !!eval(waitForPlugin)();\n } catch (error) {\n return false;\n }\n }).catch(() => {\n throw new Error(\"Internal: Plugin awaiting timeout\");\n });\n }\n\n Services.ww.openWindow(\n null,\n \"chrome://__TESTER_PLUGIN_REF__/content/index.xhtml\",\n \"Zotero Plugin Scaffold Test Runnner\",\n \"chrome,centerscreen,resizable=yes\",\n {}\n );\n}\n\nfunction waitUtilAsync(condition, interval = 100, timeout = 1e4) {\n return new Promise((resolve, reject) => {\n const start = Date.now();\n const intervalId = setInterval(() => {\n if (condition()) {\n clearInterval(intervalId);\n resolve();\n } else if (Date.now() - start > timeout) {\n clearInterval(intervalId);\n reject();\n }\n }, interval);\n });\n}\n";
4044
4048
  //#endregion
4045
4049
  //#region src/core/tester/test-bundler-template/raw/index.html?raw
4046
4050
  var raw_default = "<!-- Generated by zotero-plugin-scaffold -->\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Zotero Plugin Test</title>\n <style>\n html {\n min-width: 400px;\n min-height: 600px;\n }\n body {\n font-family: Arial, sans-serif;\n }\n </style>\n </head>\n <body>\n <div id=\"mocha\"></div>\n\n <!-- Include Zotero Vars -->\n <script src=\"chrome://zotero/content/include.js\"><\/script>\n\n <!-- Mocha and Chai Libraries -->\n <script src=\"mocha.js\"><\/script>\n <script src=\"chai.js\"><\/script>\n\n <!-- Setup Mocha -->\n <script>\n __SETUP_CODE__;\n <\/script>\n\n <!-- Unit tests -->\n __TEST_FILES__\n\n <!-- Run Mocha -->\n <script class=\"mocha-exec\">\n mocha.run();\n <\/script>\n </body>\n</html>\n";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
3
  "type": "module",
4
- "version": "0.8.5",
4
+ "version": "0.8.6",
5
5
  "description": "A scaffold for Zotero plugin development.",
6
6
  "author": "northword",
7
7
  "license": "AGPL-3.0-or-later",
@@ -55,40 +55,39 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@fluent/syntax": "^0.19.0",
58
- "@swc/core": "^1.15.18",
59
- "adm-zip": "^0.5.16",
60
- "bumpp": "^10.4.1",
61
- "c12": "4.0.0-beta.3",
58
+ "@swc/core": "^1.15.24",
59
+ "adm-zip": "^0.5.17",
60
+ "bumpp": "^11.0.1",
61
+ "c12": "4.0.0-beta.4",
62
62
  "chokidar": "^5.0.0",
63
63
  "commander": "^14.0.3",
64
64
  "es-toolkit": "^1.45.1",
65
- "esbuild": "^0.27.4",
65
+ "esbuild": "^0.28.0",
66
66
  "fs-extra": "^11.3.4",
67
- "hookable": "^6.0.1",
67
+ "hookable": "^6.1.0",
68
68
  "octokit": "^5.0.5",
69
69
  "std-env": "^4.0.0",
70
70
  "tiny-update-notifier": "^2.0.2",
71
- "tinyglobby": "^0.2.15",
71
+ "tinyglobby": "^0.2.16",
72
72
  "xvfb-ts": "^1.1.1"
73
73
  },
74
74
  "devDependencies": {
75
- "@antfu/eslint-config": "^7.7.2",
75
+ "@antfu/eslint-config": "^7.7.3",
76
76
  "@commander-js/extra-typings": "^14.0.0",
77
- "@types/adm-zip": "^0.5.7",
77
+ "@types/adm-zip": "^0.5.8",
78
78
  "@types/fs-extra": "^11.0.4",
79
- "@types/node": "^25.5.0",
80
- "bumpp": "^10.4.1",
79
+ "@types/node": "^25.6.0",
80
+ "bumpp": "^11.0.1",
81
81
  "changelogen": "^0.6.2",
82
- "eslint": "^10.0.3",
82
+ "eslint": "^10.2.0",
83
83
  "eslint-plugin-format": "^2.0.1",
84
84
  "husky": "^9.1.7",
85
85
  "lint-staged": "^16.4.0",
86
- "tsdown": "^0.21.2",
86
+ "tsdown": "^0.21.7",
87
87
  "tsx": "^4.21.0",
88
88
  "typescript": "^5.9.3",
89
- "unbuild": "^3.6.1",
90
- "unplugin-raw": "^0.6.4",
91
- "vitest": "^4.1.0"
89
+ "unplugin-raw": "^0.7.0",
90
+ "vitest": "^4.1.4"
92
91
  },
93
92
  "workspaces": [
94
93
  "src",