zotero-plugin 3.2.1 → 3.3.1

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/logger.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- export declare function format(...msg: any[]): string;
2
1
  export declare class Logger {
3
2
  #private;
4
3
  id: string;
5
4
  phase: string;
5
+ indent?: number;
6
6
  constructor(id: string);
7
7
  debug(...msg: any[]): void;
8
8
  info(...msg: any[]): void;
9
9
  error(...msg: any[]): void;
10
10
  dump(msg: string, error?: Error): void;
11
+ private to_s;
12
+ format(...msg: any[]): string;
11
13
  }
package/logger.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var _Logger_instances, _Logger_prefix;
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.Logger = void 0;
6
- exports.format = format;
7
6
  const tslib_1 = require("tslib");
8
7
  function stringifyXPCOM(obj) {
9
8
  if (!obj.QueryInterface)
@@ -51,14 +50,6 @@ function replacer() {
51
50
  return undefined;
52
51
  };
53
52
  }
54
- function to_s(obj) {
55
- if (typeof obj === 'string')
56
- return obj;
57
- return JSON.stringify(obj, replacer(), 2);
58
- }
59
- function format(...msg) {
60
- return msg.map(to_s).join(' ');
61
- }
62
53
  class Logger {
63
54
  constructor(id) {
64
55
  _Logger_instances.add(this);
@@ -66,22 +57,30 @@ class Logger {
66
57
  this.phase = '';
67
58
  }
68
59
  debug(...msg) {
69
- Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${format(...msg)}\n`);
60
+ Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${this.format(...msg)}\n`);
70
61
  }
71
62
  info(...msg) {
72
- Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${format(...msg)}\n`);
63
+ Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${this.format(...msg)}\n`);
73
64
  }
74
65
  error(...msg) {
75
- Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this, true)}${format(...msg)}\n`);
66
+ Zotero.debug(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this, true)}${this.format(...msg)}\n`);
76
67
  }
77
68
  dump(msg, error) {
78
69
  if (error) {
79
- dump(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this, error)}${format(msg, error)}\n`);
70
+ dump(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this, error)}${this.format(msg, error)}\n`);
80
71
  }
81
72
  else {
82
- dump(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${format(msg)}\n`);
73
+ dump(`${tslib_1.__classPrivateFieldGet(this, _Logger_instances, "m", _Logger_prefix).call(this)}${this.format(msg)}\n`);
83
74
  }
84
75
  }
76
+ to_s(obj) {
77
+ if (typeof obj === 'string')
78
+ return obj;
79
+ return JSON.stringify(obj, replacer(), this.indent);
80
+ }
81
+ format(...msg) {
82
+ return msg.map(m => this.to_s(m)).join(' ');
83
+ }
85
84
  }
86
85
  exports.Logger = Logger;
87
86
  _Logger_instances = new WeakSet(), _Logger_prefix = function _Logger_prefix(error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {
@@ -30,31 +30,30 @@
30
30
  "dependencies": {
31
31
  "@octokit/rest": "^21.0.2",
32
32
  "@rgrove/parse-xml": "^4.2.0",
33
- "@types/node": "^22.9.0",
34
- "@xmldom/xmldom": "^0.9.5",
33
+ "@types/node": "^22.10.2",
34
+ "@xmldom/xmldom": "^0.9.6",
35
35
  "ajv": "^8.17.1",
36
36
  "ajv-keywords": "^5.1.0",
37
37
  "archiver": "^7.0.1",
38
38
  "clp": "^4.0.12",
39
- "current-git-branch": "^1.1.0",
40
- "dotenv": "^16.4.5",
41
- "dprint": "^0.47.5",
39
+ "dotenv": "^16.4.7",
40
+ "dprint": "^0.48.0",
42
41
  "ejs": "^3.1.10",
43
42
  "fs-extra": "^11.2.0",
44
43
  "glob": "^11.0.0",
45
- "jsesc": "^3.0.2",
44
+ "jsesc": "^3.1.0",
46
45
  "lodash": "^4.17.21",
47
46
  "moment": "^2.30.1",
48
- "peggy": "^4.1.1",
47
+ "peggy": "^4.2.0",
49
48
  "properties-reader": "^2.3.0",
50
49
  "pug": "^3.0.3",
51
50
  "rimraf": "^6.0.1",
52
- "shell-quote": "^1.8.1",
51
+ "shell-quote": "^1.8.2",
53
52
  "shelljs": "^0.8.5",
54
53
  "string-to-arraybuffer": "^1.0.2",
55
54
  "ts-node": "^10.9.2",
56
55
  "tslib": "^2.8.1",
57
- "typescript": "^5.6.3",
56
+ "typescript": "^5.7.2",
58
57
  "uri-templates": "^0.2.0",
59
58
  "uzip": "^0.20201231.0",
60
59
  "xml-parser": "^1.2.1",
@@ -110,6 +109,6 @@
110
109
  "url": "https://github.com/retorquere/zotero-plugin/issues"
111
110
  },
112
111
  "devDependencies": {
113
- "esbuild": "^0.24.0"
112
+ "esbuild": "^0.24.2"
114
113
  }
115
114
  }