zotero-plugin 2.0.32 → 3.1.0

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.
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import sys, os
4
+ import urllib.request
5
+ from zipfile import ZipFile
6
+
7
+ local, fio, remote = sys.argv[1].split('-')
8
+ url = 'https://file.io/' + remote
9
+ log = 'logs/' + local + '.zip'
10
+ logs = os.path.dirname(log)
11
+ if not os.path.exists(logs):
12
+ os.makedirs(logs)
13
+
14
+ urllib.request.urlretrieve(url, log)
15
+ with ZipFile(log) as f:
16
+ for name in f.namelist():
17
+ if not '/' in name: raise ValueError(name)
18
+ print(name)
19
+ f.extractall(path=logs)
20
+ os.remove(log)
21
+ print(log)
package/bin/release.js CHANGED
@@ -6563,9 +6563,9 @@ ${stderr}${stdout}`;
6563
6563
  })();
6564
6564
 
6565
6565
  // bin/release.ts
6566
- var path2 = __toESM(__require("path"));
6567
- var import_moment = __toESM(require_moment());
6568
6566
  var fs2 = __toESM(__require("fs"));
6567
+ var import_moment = __toESM(require_moment());
6568
+ var path2 = __toESM(__require("path"));
6569
6569
 
6570
6570
  // node_modules/@octokit/rest/node_modules/universal-user-agent/index.js
6571
6571
  function getUserAgent() {
@@ -9760,9 +9760,9 @@ ${stderr}${stdout}`;
9760
9760
  var root_default = process.cwd();
9761
9761
 
9762
9762
  // version.ts
9763
- var path = __toESM(__require("path"));
9764
- var os = __toESM(__require("os"));
9765
9763
  var fs = __toESM(__require("fs"));
9764
+ var os = __toESM(__require("os"));
9765
+ var path = __toESM(__require("path"));
9766
9766
  var version = null;
9767
9767
  var version_js = path.join(root_default, "gen/version.js");
9768
9768
  if (fs.existsSync(version_js)) {
package/bin/zipup.js CHANGED
@@ -26056,17 +26056,17 @@
26056
26056
  });
26057
26057
 
26058
26058
  // bin/zipup.ts
26059
+ var archiver = __toESM(require_archiver());
26059
26060
  var fs2 = __toESM(__require("fs"));
26060
26061
  var path2 = __toESM(__require("path"));
26061
- var archiver = __toESM(require_archiver());
26062
26062
 
26063
26063
  // root.ts
26064
26064
  var root_default = process.cwd();
26065
26065
 
26066
26066
  // version.ts
26067
- var path = __toESM(__require("path"));
26068
- var os = __toESM(__require("os"));
26069
26067
  var fs = __toESM(__require("fs"));
26068
+ var os = __toESM(__require("os"));
26069
+ var path = __toESM(__require("path"));
26070
26070
 
26071
26071
  // continuous-integration.ts
26072
26072
  var child_process = __toESM(__require("child_process"));
@@ -60,4 +60,4 @@ class ContinuousIntegrationSingleton {
60
60
  return int;
61
61
  }
62
62
  }
63
- exports.ContinuousIntegration = new ContinuousIntegrationSingleton; // eslint-disable-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match
63
+ exports.ContinuousIntegration = new ContinuousIntegrationSingleton(); // eslint-disable-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match
package/debug-log.js CHANGED
@@ -106,7 +106,7 @@ class DebugLogSender {
106
106
  async sendAsync(plugin, preferences) {
107
107
  await this.zotero.Schema.schemaUpdatePromise;
108
108
  const files = {};
109
- const enc = new TextEncoder;
109
+ const enc = new TextEncoder();
110
110
  const key = this.zotero.Utilities.generateObjectKey();
111
111
  const log = [
112
112
  await this.info(preferences),
@@ -125,7 +125,7 @@ class DebugLogSender {
125
125
  const zip = new Uint8Array(UZip.encode(files));
126
126
  const blob = new Blob([zip], { type: 'application/zip' });
127
127
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
128
- const formData = new FormData;
128
+ const formData = new FormData();
129
129
  formData.append('file', blob, `${key}.zip`);
130
130
  const response = await this.post('https://file.io', formData);
131
131
  this.alert(`Debug log ID for ${plugin}`, `${key}-fio-${response.key}`);
@@ -181,7 +181,7 @@ class DebugLogSender {
181
181
  if (items.length === 0)
182
182
  return resolve('');
183
183
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
184
- const translation = new this.zotero.Translate.Export;
184
+ const translation = new this.zotero.Translate.Export();
185
185
  translation.setItems(items);
186
186
  translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9'); // rdf
187
187
  translation.setHandler('done', (obj, success) => {
@@ -196,4 +196,4 @@ class DebugLogSender {
196
196
  });
197
197
  }
198
198
  }
199
- exports.DebugLog = new DebugLogSender;
199
+ exports.DebugLog = new DebugLogSender();
package/make-dirs.js CHANGED
@@ -2,9 +2,9 @@
2
2
  /* eslint-disable no-console, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
- const rimraf_1 = require("rimraf");
6
5
  const fs = tslib_1.__importStar(require("fs"));
7
6
  const path = tslib_1.__importStar(require("path"));
7
+ const rimraf_1 = require("rimraf");
8
8
  const root_1 = tslib_1.__importDefault(require("./root"));
9
9
  console.log('make build dirs');
10
10
  for (const dir of [path.join(root_1.default, 'build'), path.join(root_1.default, 'gen'), path.join(root_1.default, 'xpi')]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "2.0.32",
3
+ "version": "3.1.0",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  "zotero-plugin-zipup": "bin/zipup.js",
9
9
  "zotero-plugin-link": "bin/link.js",
10
10
  "issue-branches": "bin/branches.js",
11
- "zotero-start": "bin/start.py"
11
+ "zotero-start": "bin/start.py",
12
+ "fetch-zotero-log": "bin/fetch-zotero-log.py"
12
13
  },
13
14
  "author": {
14
15
  "name": "Emiliano Heyns",
@@ -17,7 +18,7 @@
17
18
  "scripts": {
18
19
  "preversion": "npm test",
19
20
  "postversion": "git push --follow-tags",
20
- "test": "eslint . --ext .ts && npm run build",
21
+ "test": "dprint fmt *.ts */*.ts && dprint check *.ts */*.ts && npm run build",
21
22
  "build": "tsc && ./bundle.mjs && chmod +x bin/*.js",
22
23
  "pack": "npm test && npm pack",
23
24
  "prepublishOnly": "npm install && npm run build",
@@ -28,28 +29,23 @@
28
29
  },
29
30
  "dependencies": {
30
31
  "@octokit/rest": "^21.0.2",
31
- "@rgrove/parse-xml": "^4.1.0",
32
- "@stylistic/eslint-plugin": "^2.7.1",
33
- "@types/node": "^22.5.1",
34
- "@typescript-eslint/eslint-plugin": "^8.3.0",
35
- "@typescript-eslint/parser": "^8.3.0",
36
- "@xmldom/xmldom": "^0.9.0",
32
+ "@rgrove/parse-xml": "^4.2.0",
33
+ "@types/node": "^22.9.0",
34
+ "@xmldom/xmldom": "^0.9.5",
37
35
  "ajv": "^8.17.1",
38
36
  "ajv-keywords": "^5.1.0",
39
37
  "archiver": "^7.0.1",
40
38
  "clp": "^4.0.12",
41
39
  "current-git-branch": "^1.1.0",
42
40
  "dotenv": "^16.4.5",
41
+ "dprint": "^0.47.5",
43
42
  "ejs": "^3.1.10",
44
- "eslint": "^8.56.0",
45
- "eslint-plugin-import": "^2.29.1",
46
- "eslint-plugin-prefer-arrow": "^1.2.3",
47
43
  "fs-extra": "^11.2.0",
48
44
  "glob": "^11.0.0",
49
45
  "jsesc": "^3.0.2",
50
46
  "lodash": "^4.17.21",
51
47
  "moment": "^2.30.1",
52
- "peggy": "^4.0.3",
48
+ "peggy": "^4.1.1",
53
49
  "properties-reader": "^2.3.0",
54
50
  "pug": "^3.0.3",
55
51
  "rimraf": "^6.0.1",
@@ -57,8 +53,8 @@
57
53
  "shelljs": "^0.8.5",
58
54
  "string-to-arraybuffer": "^1.0.2",
59
55
  "ts-node": "^10.9.2",
60
- "tslib": "^2.7.0",
61
- "typescript": "^5.5.4",
56
+ "tslib": "^2.8.1",
57
+ "typescript": "^5.6.3",
62
58
  "uri-templates": "^0.2.0",
63
59
  "uzip": "^0.20201231.0",
64
60
  "xml-parser": "^1.2.1",
@@ -79,6 +75,7 @@
79
75
  "bin/zipup.d.ts",
80
76
  "bin/zipup.js",
81
77
  "bin/start.py",
78
+ "bin/fetch-zotero-log.py",
82
79
  "continuous-integration.d.ts",
83
80
  "continuous-integration.js",
84
81
  "copy-assets.d.ts",
@@ -99,8 +96,6 @@
99
96
  "rdf.js",
100
97
  "root.d.ts",
101
98
  "root.js",
102
- ".eslintrc.js",
103
- ".ncurc.js",
104
99
  "update.rdf.pug",
105
100
  "version.d.ts",
106
101
  "version.js",
@@ -111,6 +106,6 @@
111
106
  "url": "https://github.com/retorquere/zotero-plugin/issues"
112
107
  },
113
108
  "devDependencies": {
114
- "esbuild": "^0.23.1"
109
+ "esbuild": "^0.24.0"
115
110
  }
116
111
  }
package/rdf.js CHANGED
@@ -4,8 +4,8 @@ var _a, _b;
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const tslib_1 = require("tslib");
6
6
  const fs = tslib_1.__importStar(require("fs"));
7
- const path = tslib_1.__importStar(require("path"));
8
7
  const glob_1 = require("glob");
8
+ const path = tslib_1.__importStar(require("path"));
9
9
  const pug = tslib_1.__importStar(require("pug"));
10
10
  const properties_reader_1 = tslib_1.__importDefault(require("properties-reader"));
11
11
  const uri_templates_1 = tslib_1.__importDefault(require("uri-templates"));
package/version.js CHANGED
@@ -2,11 +2,11 @@
2
2
  /* eslint-disable no-console */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
6
- const os = tslib_1.__importStar(require("os"));
7
5
  const fs = tslib_1.__importStar(require("fs"));
8
- const root_1 = tslib_1.__importDefault(require("./root"));
6
+ const os = tslib_1.__importStar(require("os"));
7
+ const path = tslib_1.__importStar(require("path"));
9
8
  const continuous_integration_1 = require("./continuous-integration");
9
+ const root_1 = tslib_1.__importDefault(require("./root"));
10
10
  let version = null;
11
11
  const version_js = path.join(root_1.default, 'gen/version.js');
12
12
  if (fs.existsSync(version_js)) {
package/.eslintrc.js DELETED
@@ -1,229 +0,0 @@
1
- const stylistic = require('@stylistic/eslint-plugin').configs.customize({
2
- indent: 2,
3
- quotes: 'single',
4
- })
5
-
6
- module.exports = {
7
- "root": true,
8
- "env": {
9
- "browser": true,
10
- "es6": true,
11
- "node": true
12
- },
13
- "extends": [
14
- 'eslint:recommended',
15
- "plugin:@typescript-eslint/recommended",
16
- "plugin:@typescript-eslint/eslint-recommended",
17
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
18
- ],
19
- "parser": "@typescript-eslint/parser",
20
- "parserOptions": {
21
- "project": "tsconfig.json",
22
- "sourceType": "module"
23
- },
24
- "plugins": [
25
- '@stylistic',
26
- "eslint-plugin-import",
27
- "eslint-plugin-prefer-arrow",
28
- "@typescript-eslint",
29
- "@typescript-eslint/eslint-plugin",
30
- ],
31
- "rules": {
32
- ...stylistic.rules,
33
- '@stylistic/semi': [ 'error', 'never' ],
34
- '@stylistic/member-delimiter-style': [ 'error', {
35
- multiline: { delimiter: 'none', requireLast: false },
36
- singleline: { delimiter: 'semi', requireLast: false }
37
- }],
38
- '@stylistic/array-bracket-spacing': ['error', 'always', { singleValue: false }],
39
- '@stylistic/object-curly-spacing': ['error', 'always', { arraysInObjects: false, objectsInObjects: false }],
40
- '@stylistic/new-parens': ['error', 'never'],
41
- '@stylistic/quote-props': [ 'error', 'as-needed' ],
42
- '@stylistic/arrow-parens': [ 'error', 'as-needed' ],
43
- '@stylistic/max-statements-per-line': 'off',
44
-
45
- '@typescript-eslint/no-require-imports': 'off',
46
- "@typescript-eslint/adjacent-overload-signatures": "error",
47
- "@typescript-eslint/array-type": [
48
- "error",
49
- {
50
- "default": "array"
51
- }
52
- ],
53
- "@typescript-eslint/await-thenable": "error",
54
- "@typescript-eslint/ban-ts-comment": "error",
55
- "@typescript-eslint/consistent-type-assertions": "error",
56
- "@typescript-eslint/dot-notation": "error",
57
- "@typescript-eslint/explicit-module-boundary-types": "warn",
58
- "@typescript-eslint/member-ordering": "off",
59
- "@typescript-eslint/naming-convention": "off",
60
- "@typescript-eslint/no-array-constructor": "error",
61
- "@typescript-eslint/no-empty-function": "error",
62
- "@typescript-eslint/no-empty-interface": "error",
63
- "@typescript-eslint/no-explicit-any": "off",
64
- "@typescript-eslint/no-extra-non-null-assertion": "error",
65
- "@typescript-eslint/no-floating-promises": "error",
66
- "@typescript-eslint/no-for-in-array": "error",
67
- "@typescript-eslint/no-implied-eval": "error",
68
- "@typescript-eslint/no-inferrable-types": "error",
69
- "@typescript-eslint/no-misused-new": "error",
70
- "@typescript-eslint/no-misused-promises": "error",
71
- "@typescript-eslint/no-namespace": "error",
72
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
73
- "@typescript-eslint/no-non-null-assertion": "warn",
74
- "@typescript-eslint/no-parameter-properties": "off",
75
- "@typescript-eslint/no-shadow": [
76
- "error",
77
- {
78
- "hoist": "all"
79
- }
80
- ],
81
- "@typescript-eslint/no-this-alias": "error",
82
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
83
- "@typescript-eslint/no-unsafe-assignment": "error",
84
- "@typescript-eslint/no-unsafe-call": "error",
85
- "@typescript-eslint/no-unsafe-member-access": "error",
86
- "@typescript-eslint/no-unsafe-return": "error",
87
- "@typescript-eslint/no-unused-expressions": "error",
88
- "@typescript-eslint/no-unused-vars": "warn",
89
- "@typescript-eslint/no-use-before-define": "off",
90
- "@typescript-eslint/no-var-requires": "off",
91
- "@typescript-eslint/prefer-as-const": "error",
92
- "@typescript-eslint/prefer-for-of": "error",
93
- "@typescript-eslint/prefer-function-type": "error",
94
- "@typescript-eslint/prefer-namespace-keyword": "error",
95
- "@typescript-eslint/prefer-regexp-exec": "warn",
96
- "@typescript-eslint/require-await": "error",
97
- "@typescript-eslint/restrict-plus-operands": "error",
98
- "@typescript-eslint/restrict-template-expressions": "error",
99
- "@typescript-eslint/triple-slash-reference": [
100
- "error",
101
- {
102
- "path": "always",
103
- "types": "prefer-import",
104
- "lib": "always"
105
- }
106
- ],
107
- "@typescript-eslint/unbound-method": "error",
108
- "@typescript-eslint/unified-signatures": "error",
109
- "arrow-body-style": "error",
110
- "brace-style": [ "error", "stroustrup", { "allowSingleLine": true } ],
111
- "comma-dangle": [
112
- "error",
113
- {
114
- "objects": "always-multiline",
115
- "arrays": "always-multiline",
116
- "functions": "never"
117
- }
118
- ],
119
- "complexity": "off",
120
- "constructor-super": "error",
121
- "curly": [
122
- "error",
123
- "multi-line"
124
- ],
125
- "eol-last": "error",
126
- "eqeqeq": [
127
- "error",
128
- "smart"
129
- ],
130
- "guard-for-in": "error",
131
- "id-blacklist": [
132
- "error",
133
- "any",
134
- "Number",
135
- "number",
136
- "String",
137
- "string",
138
- "Boolean",
139
- "boolean",
140
- "Undefined",
141
- "undefined"
142
- ],
143
- "id-match": "error",
144
- "import/order": "off",
145
- "linebreak-style": [
146
- "error",
147
- "unix"
148
- ],
149
- "max-classes-per-file": [
150
- "error",
151
- 4
152
- ],
153
- "max-len": [
154
- "warn",
155
- {
156
- "code": 240
157
- }
158
- ],
159
- "new-parens": "off",
160
- "no-array-constructor": "off",
161
- "no-bitwise": "error",
162
- "no-caller": "error",
163
- "no-cond-assign": "off",
164
- "no-console": "error",
165
- "no-debugger": "error",
166
- "no-empty": [
167
- "error",
168
- {
169
- "allowEmptyCatch": true
170
- }
171
- ],
172
- "no-empty-function": "off",
173
- "no-eval": "error",
174
- "no-extra-semi": "off",
175
- "no-fallthrough": "off",
176
- "no-implied-eval": "off",
177
- "no-invalid-this": "off",
178
- "no-irregular-whitespace": "error",
179
- "no-magic-numbers": [
180
- "error",
181
- {
182
- "ignore": [
183
- -1,
184
- 0,
185
- 1,
186
- 2
187
- ]
188
- }
189
- ],
190
- "no-new-wrappers": "error",
191
- "no-redeclare": "error",
192
- "no-trailing-spaces": "error",
193
- "no-undef-init": "error",
194
- "no-underscore-dangle": "error",
195
- "no-unsafe-finally": "error",
196
- "no-unused-labels": "error",
197
- "no-unused-vars": "off",
198
- "no-var": "error",
199
- "object-shorthand": "error",
200
- "one-var": [ "off", "never" ],
201
- 'prefer-arrow/prefer-arrow-functions': 'off',
202
- "prefer-const": [ "error", { "destructuring": "all" } ],
203
- "prefer-object-spread": "error",
204
- "prefer-template": "error",
205
- "radix": "off",
206
- "require-await": "off",
207
- "@stylistic/space-before-function-paren": [
208
- "error",
209
- {
210
- "anonymous": "never",
211
- "named": "never",
212
- "asyncArrow": "always"
213
- }
214
- ],
215
- "spaced-comment": [
216
- "error",
217
- "always",
218
- {
219
- "markers": [
220
- "/"
221
- ]
222
- }
223
- ],
224
- "use-isnan": "error",
225
- "valid-typeof": "off",
226
- "yoda": "error",
227
- "@typescript-eslint/prefer-regexp-exec": "off"
228
- }
229
- };
package/.ncurc.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- reject: ['eslint']
3
- }