zotero-plugin-scaffold 0.9.1 → 0.9.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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { l as logger } from "./shared/scaffold-replace-Dn0wBA9W.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-DVeK7Az0.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-D5mM4ypK.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.9.1";
10
+ var version = "0.9.2";
11
11
  //#endregion
12
12
  //#region src/utils/gitignore.ts
13
13
  async function checkGitIgnore() {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as Release, n as Test, o as Build, r as Serve, s as defineConfig, t as Config } from "./shared/scaffold-src-DVeK7Az0.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-D5mM4ypK.mjs";
2
2
  export { Build, Config, Release, Serve, Test, defineConfig };
@@ -4190,7 +4190,7 @@ var raw_default = "<!-- Generated by zotero-plugin-scaffold -->\n<html lang=\"en
4190
4190
  var manifest_default = "{\n \"manifest_version\": 2,\n \"name\": \"Zotero Plugin Scaffold Test Runner\",\n \"version\": \"0.0.1\",\n \"description\": \"Test suite for the Zotero plugin. This is a runtime-generated plugin only for testing purposes.\",\n \"applications\": {\n \"zotero\": {\n \"id\": \"__TESTER_PLUGIN_ID__\",\n \"update_url\": \"https://example.com\",\n \"strict_max_version\": \"999.*.*\"\n }\n }\n}\n";
4191
4191
  //#endregion
4192
4192
  //#region src/core/tester/test-bundler-template/raw/mocha-setup.js?raw
4193
- var mocha_setup_default = "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// Generated by zotero-plugin-scaffold\nmocha.setup({ \n ui: \"bdd\",\n reporter: Reporter,\n timeout: __TIMEOUT__ || 10000,\n bail: __ABORT_ON_FAIL__\n});\n\nwindow.expect = chai.expect;\nwindow.assert = chai.assert;\n\nasync function send(data) {\n const req = await Zotero.HTTP.request(\n \"POST\",\n \"http://localhost:__PORT__/update\",\n {\n body: JSON.stringify(data),\n }\n );\n\n if (req.status !== 200) {\n dump(\"Error sending data to server\" + req.responseText);\n return null;\n } else {\n const result = JSON.parse(req.responseText);\n return result;\n }\n}\n\nwindow.debug = function (data) {\n send({ type: \"debug\", data });\n};\n\nlet indents = 0,\n passed = 0,\n failed = 0,\n aborted = false;\n\n// Inherit the default test settings from Zotero\nfunction Reporter(runner) {\n function indent() {\n return \" \".repeat(indents);\n }\n\n function dump(str) {\n document.querySelector(\"#mocha\").innerText += str;\n }\n\n runner.on(\"start\", async function () {\n console.log(\"start\")\n await send({ type: \"start\", data: { indents } });\n });\n\n runner.on(\"suite\", async function (suite) {\n console.log(\"suite\", suite)\n indents++;\n const str = indent() + suite.title + \"\\n\";\n dump(str);\n await send({ type: \"suite\", data: { title: suite.title, root: suite.root, indents } });\n });\n\n runner.on(\"suite end\", async function (suite) {\n console.log(\"suite end\", suite)\n indents--;\n const str = indents === 1 ? \"\\n\" : \"\";\n dump(str);\n await send({ type: \"suite end\", data: { title: suite.title, root: suite.root, indents } });\n });\n\n runner.on(\"pending\", async function (test) {\n console.log(\"pending\", test)\n const str = indent() + \"pending -\" + test.title + \"\\n\";\n dump(str);\n await send({ type: \"pending\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, indents: indents + 1 } });\n });\n\n runner.on(\"pass\", async function (test) {\n console.log(\"pass\", test)\n passed++;\n let str = indent() + Mocha.reporters.Base.symbols.ok + \" \" + test.title;\n if (\"fast\" != test.speed) {\n str += \" (\" + Math.round(test.duration) + \" ms)\";\n }\n str += \"\\n\";\n dump(str);\n await send({ type: \"pass\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, indents: indents + 1 } });\n\n });\n\n runner.on(\"fail\", async function (test, error) {\n console.log(\"fail\", test, error)\n\n failed++;\n let indentStr = indent();\n const str =\n indentStr +\n Mocha.reporters.Base.symbols.err +\n (Zotero.automatedTest ? \"\" : \"\\x07\") +\n \" \" +\n test.title +\n \"\\n\" +\n indentStr +\n \" \" +\n error.message +\n \"\\n\\n\";\n dump(str);\n\n await send({ type: \"fail\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, error, indents: indents + 1 } });\n\n });\n\n runner.on(\"end\", async function () {\n console.log(\"end\")\n const str =\n passed +\n \"/\" +\n (passed + failed) +\n \" tests passed\" +\n (aborted ? \" -- aborting\" : \"\") +\n \"\\n\";\n dump(str);\n\n await send({\n type: \"end\",\n data: { passed: passed, failed: failed, aborted: aborted, str, indents },\n });\n\n // Must exit on Zotero side, otherwise the exit code will not be 0 and CI will fail\n if (__EXIT_ON_FINISH__) {\n Zotero.Utilities.Internal.quit(0);\n }\n });\n}\n";
4193
+ var mocha_setup_default = "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// Generated by zotero-plugin-scaffold\nmocha.setup({ \n ui: \"bdd\",\n reporter: Reporter,\n timeout: __TIMEOUT__ || 10000,\n bail: __ABORT_ON_FAIL__\n});\n\nwindow.expect = chai.expect;\nwindow.assert = chai.assert;\n\nasync function send(data) {\n const req = await Zotero.HTTP.request(\n \"POST\",\n \"http://localhost:__PORT__/update\",\n {\n body: JSON.stringify(data),\n }\n );\n\n if (req.status !== 200) {\n dump(\"Error sending data to server\" + req.responseText);\n return null;\n } else {\n const result = JSON.parse(req.responseText);\n return result;\n }\n}\n\nwindow.debug = function (data) {\n send({ type: \"debug\", data });\n};\n\nlet indents = 0,\n passed = 0,\n failed = 0,\n aborted = false;\n\n// Inherit the default test settings from Zotero\nfunction Reporter(runner) {\n function indent() {\n return \" \".repeat(indents);\n }\n\n function dump(str) {\n document.querySelector(\"#mocha\").innerText += str;\n }\n\n runner.on(\"start\", async function () {\n console.log(\"start\")\n await send({ type: \"start\", data: { indents } });\n });\n\n runner.on(\"suite\", async function (suite) {\n console.log(\"suite\", suite)\n indents++;\n const str = indent() + suite.title + \"\\n\";\n dump(str);\n await send({ type: \"suite\", data: { title: suite.title, root: suite.root, indents } });\n });\n\n runner.on(\"suite end\", async function (suite) {\n console.log(\"suite end\", suite)\n indents--;\n const str = indents === 1 ? \"\\n\" : \"\";\n dump(str);\n await send({ type: \"suite end\", data: { title: suite.title, root: suite.root, indents } });\n });\n\n runner.on(\"pending\", async function (test) {\n console.log(\"pending\", test)\n const str = indent() + \"pending -\" + test.title + \"\\n\";\n dump(str);\n await send({ type: \"pending\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, indents: indents + 1 } });\n });\n\n runner.on(\"pass\", async function (test) {\n console.log(\"pass\", test)\n passed++;\n let str = indent() + Mocha.reporters.Base.symbols.ok + \" \" + test.title;\n if (\"fast\" != test.speed) {\n str += \" (\" + Math.round(test.duration) + \" ms)\";\n }\n str += \"\\n\";\n dump(str);\n await send({ type: \"pass\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, indents: indents + 1 } });\n\n });\n\n runner.on(\"fail\", async function (test, error) {\n console.log(\"fail\", test, error)\n\n failed++;\n let indentStr = indent();\n const str =\n indentStr +\n Mocha.reporters.Base.symbols.err +\n (Zotero.automatedTest ? \"\" : \"\\x07\") +\n \" \" +\n test.title +\n \"\\n\" +\n indentStr +\n \" \" +\n error.message +\n \"\\n\\n\";\n dump(str);\n\n // Serialize the error explicitly: send() JSON-stringifies the payload,\n // and Error instances stringify to {} (message/stack are non-enumerable),\n // so thrown errors / timeouts / XPCOM exceptions reached the terminal as\n // \", undefined\". Chai AssertionErrors were unaffected (own-enumerable\n // props), which is why this went unnoticed in assertion-heavy suites.\n // NOTE: this file is inlined verbatim into index.xhtml, an XML document.\n // Never use raw ampersands or less-than signs here -- they break XML\n // parsing and with it the whole runner page. Optional chaining and\n // nullish coalescing are XML-safe.\n await send({ type: \"fail\", data: { title: test.title, fulltest: test.fullTitle(), duration: test.duration, error: { message: String(error?.message ?? error), stack: error?.stack, actual: error?.actual, expected: error?.expected, showDiff: error?.showDiff, operator: error?.operator }, indents: indents + 1 } });\n\n });\n\n runner.on(\"end\", async function () {\n console.log(\"end\")\n const str =\n passed +\n \"/\" +\n (passed + failed) +\n \" tests passed\" +\n (aborted ? \" -- aborting\" : \"\") +\n \"\\n\";\n dump(str);\n\n await send({\n type: \"end\",\n data: { passed: passed, failed: failed, aborted: aborted, str, indents },\n });\n\n // Must exit on Zotero side, otherwise the exit code will not be 0 and CI will fail\n if (__EXIT_ON_FINISH__) {\n Zotero.Utilities.Internal.quit(0);\n }\n });\n}\n";
4194
4194
  //#endregion
4195
4195
  //#region src/core/tester/test-bundler-template/index.ts
4196
4196
  function generateManifest() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
3
  "type": "module",
4
- "version": "0.9.1",
4
+ "version": "0.9.2",
5
5
  "description": "A scaffold for Zotero plugin development.",
6
6
  "author": "northword",
7
7
  "license": "AGPL-3.0-or-later",