zotero-plugin 2.0.21 → 2.0.22
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/bin/branches.js +3581 -23
- package/bin/link.js +53 -23
- package/bin/release.js +9910 -161
- package/bin/zipup.js +26231 -20
- package/continuous-integration.js +2 -6
- package/copy-assets.js +2 -5
- package/debug-log.js +2 -6
- package/loader/json.d.ts +1 -2
- package/loader/json.js +3 -4
- package/loader/peggy.d.ts +1 -2
- package/loader/peggy.js +3 -5
- package/loader/wrap.d.ts +1 -2
- package/loader/wrap.js +5 -7
- package/make-dirs.js +6 -9
- package/package.json +5 -2
- package/rdf.js +18 -21
- package/root.js +1 -3
- package/version.js +12 -15
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContinuousIntegration = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const child_process = tslib_1.__importStar(require("child_process"));
|
|
1
|
+
import * as child_process from 'child_process';
|
|
6
2
|
class ContinuousIntegrationSingleton {
|
|
7
3
|
constructor() {
|
|
8
4
|
var _a;
|
|
@@ -60,4 +56,4 @@ class ContinuousIntegrationSingleton {
|
|
|
60
56
|
return int;
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
|
-
|
|
59
|
+
export const ContinuousIntegration = new ContinuousIntegrationSingleton; // eslint-disable-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match
|
package/copy-assets.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
2
|
+
import * as fs from 'fs-extra';
|
|
3
|
+
import * as path from 'path';
|
|
7
4
|
function allow(file) {
|
|
8
5
|
switch (path.basename(file)) {
|
|
9
6
|
case '.DS_Store':
|
package/debug-log.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-magic-numbers */
|
|
3
|
-
|
|
4
|
-
exports.DebugLog = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const UZip = tslib_1.__importStar(require("uzip"));
|
|
2
|
+
import * as UZip from 'uzip';
|
|
7
3
|
class DebugLogSender {
|
|
8
4
|
constructor() {
|
|
9
5
|
this.id = {
|
|
@@ -165,4 +161,4 @@ class DebugLogSender {
|
|
|
165
161
|
});
|
|
166
162
|
}
|
|
167
163
|
}
|
|
168
|
-
|
|
164
|
+
export const DebugLog = new DebugLogSender;
|
package/loader/json.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export = _default;
|
|
1
|
+
export default function loader(source: string): string;
|
package/loader/json.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
3
|
-
|
|
2
|
+
import jsesc from 'jsesc';
|
|
4
3
|
function normalize(obj) {
|
|
5
4
|
if (Array.isArray(obj)) {
|
|
6
5
|
return obj.map(normalize); // eslint-disable-line @typescript-eslint/no-unsafe-return
|
|
@@ -16,11 +15,11 @@ function normalize(obj) {
|
|
|
16
15
|
}
|
|
17
16
|
return obj; // eslint-disable-line @typescript-eslint/no-unsafe-return
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
export default function loader(source) {
|
|
20
19
|
if (this.cacheable)
|
|
21
20
|
this.cacheable();
|
|
22
21
|
const value = typeof source === 'string' ? JSON.parse(source) : source;
|
|
23
22
|
// const jsesc_options = { compact: false, indent: ' ' }
|
|
24
23
|
const jsesc_options = { compact: true };
|
|
25
24
|
return `module.exports = ${jsesc(normalize(value), jsesc_options)};`; // eslint-disable-line @typescript-eslint/restrict-template-expressions
|
|
26
|
-
}
|
|
25
|
+
}
|
package/loader/peggy.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export = _default;
|
|
1
|
+
export default function loader(source: string): string;
|
package/loader/peggy.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable prefer-arrow/prefer-arrow-functions, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = function loader(source) {
|
|
2
|
+
import * as peggy from 'peggy';
|
|
3
|
+
export default function loader(source) {
|
|
6
4
|
return peggy.generate(source, {
|
|
7
5
|
output: 'source',
|
|
8
6
|
format: 'commonjs',
|
|
9
7
|
});
|
|
10
|
-
}
|
|
8
|
+
}
|
package/loader/wrap.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export = _default;
|
|
1
|
+
export default function loader(source: string): string;
|
package/loader/wrap.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console, prefer-template, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/restrict-template-expressions */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
module.exports = function loader(source) {
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import root from '../root';
|
|
4
|
+
const pkg = Object.assign({}, require(path.join(root, 'package.json')));
|
|
5
|
+
export default function loader(source) {
|
|
8
6
|
// this.cacheable()
|
|
9
7
|
const src = this.resourcePath.substring(process.cwd().length + 1);
|
|
10
8
|
const loading = `
|
|
@@ -30,4 +28,4 @@ module.exports = function loader(source) {
|
|
|
30
28
|
default:
|
|
31
29
|
throw new Error(`Unexpected extension on ${src}`);
|
|
32
30
|
}
|
|
33
|
-
}
|
|
31
|
+
}
|
package/make-dirs.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const path = tslib_1.__importStar(require("path"));
|
|
8
|
-
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
2
|
+
import { rimrafSync } from 'rimraf';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import root from './root';
|
|
9
6
|
console.log('make build dirs');
|
|
10
|
-
for (const dir of [path.join(
|
|
11
|
-
|
|
7
|
+
for (const dir of [path.join(root, 'build'), path.join(root, 'gen'), path.join(root, 'xpi')]) {
|
|
8
|
+
rimrafSync(dir);
|
|
12
9
|
fs.mkdirSync(dir);
|
|
13
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Zotero plugin builder",
|
|
5
5
|
"homepage": "https://github.com/retorquere/zotero-plugin/wiki",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"preversion": "npm test",
|
|
19
19
|
"postversion": "git push --follow-tags",
|
|
20
20
|
"test": "eslint . --ext .ts && npm run build",
|
|
21
|
-
"build": "tsc && chmod +x bin/*.js",
|
|
21
|
+
"build": "tsc && ./bundle.mjs && chmod +x bin/*.js",
|
|
22
22
|
"pack": "npm test && npm pack",
|
|
23
23
|
"prepublishOnly": "npm install && npm run build",
|
|
24
24
|
"ncu": "ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu"
|
|
@@ -109,5 +109,8 @@
|
|
|
109
109
|
],
|
|
110
110
|
"bugs": {
|
|
111
111
|
"url": "https://github.com/retorquere/zotero-plugin/issues"
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"esbuild": "^0.23.0"
|
|
112
115
|
}
|
|
113
116
|
}
|
package/rdf.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/restrict-template-expressions, no-magic-numbers */
|
|
3
2
|
var _a, _b;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const version_1 = tslib_1.__importDefault(require("./version"));
|
|
14
|
-
const pkg = Object.assign({}, require(path.join(root_1.default, 'package.json')));
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { globSync as glob } from 'glob';
|
|
6
|
+
import * as pug from 'pug';
|
|
7
|
+
import PropertiesReader from 'properties-reader';
|
|
8
|
+
import uriTemplate from 'uri-templates';
|
|
9
|
+
import root from './root';
|
|
10
|
+
import version from './version';
|
|
11
|
+
const pkg = Object.assign({}, require(path.join(root, 'package.json')));
|
|
15
12
|
if (!pkg.id)
|
|
16
13
|
pkg.id = `${pkg.name.replace(/^zotero-/, '')}@${pkg.author.email.replace(/.*@/, '')}`.toLowerCase();
|
|
17
14
|
if (pkg.xpi)
|
|
18
15
|
Object.assign(pkg, pkg.xpi);
|
|
19
|
-
pkg.version =
|
|
16
|
+
pkg.version = version;
|
|
20
17
|
if (pkg.updateLink)
|
|
21
18
|
pkg.updateLink = uriTemplate(pkg.updateLink).fill({ version: pkg.version });
|
|
22
19
|
pkg.updateURL = `${pkg.xpi.releaseURL}update.rdf`;
|
|
23
|
-
const translations = (
|
|
20
|
+
const translations = glob(path.join(root, 'locale/*/*.properties'));
|
|
24
21
|
for (const translation of translations) {
|
|
25
22
|
const locale = path.basename(path.dirname(translation));
|
|
26
23
|
const properties = PropertiesReader(translation);
|
|
@@ -37,7 +34,7 @@ for (const translation of translations) {
|
|
|
37
34
|
}
|
|
38
35
|
const options_and_vars = Object.assign(Object.assign({}, pkg), { pretty: true });
|
|
39
36
|
try {
|
|
40
|
-
Object.assign(options_and_vars, JSON.parse(fs.readFileSync(path.join(
|
|
37
|
+
Object.assign(options_and_vars, JSON.parse(fs.readFileSync(path.join(root, 'schema', 'supported.json'), 'utf8')));
|
|
41
38
|
}
|
|
42
39
|
catch (err) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
43
40
|
// ignore
|
|
@@ -46,13 +43,13 @@ let template;
|
|
|
46
43
|
console.log('generating install.rdf');
|
|
47
44
|
template = fs.readFileSync(path.join(__dirname, 'install.rdf.pug'), 'utf8');
|
|
48
45
|
template = pug.render(template, options_and_vars);
|
|
49
|
-
fs.writeFileSync(path.join(
|
|
46
|
+
fs.writeFileSync(path.join(root, 'build/install.rdf'), template, { encoding: 'utf8' });
|
|
50
47
|
console.log('generating update.rdf');
|
|
51
48
|
template = fs.readFileSync(path.join(__dirname, 'update.rdf.pug'), 'utf8');
|
|
52
49
|
template = pug.render(template, options_and_vars);
|
|
53
|
-
fs.writeFileSync(path.join(
|
|
50
|
+
fs.writeFileSync(path.join(root, 'gen/update.rdf'), template, { encoding: 'utf8' });
|
|
54
51
|
console.log('generating updates.json');
|
|
55
|
-
fs.writeFileSync(path.join(
|
|
52
|
+
fs.writeFileSync(path.join(root, 'gen/updates.json'), JSON.stringify({
|
|
56
53
|
addons: {
|
|
57
54
|
[pkg.id]: {
|
|
58
55
|
updates: [
|
|
@@ -88,15 +85,15 @@ for (const i of [...icons]) {
|
|
|
88
85
|
i[96] = i[48].replace(/([.][^.]+)$/, '@2x$1');
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
|
-
const icon = icons.find(i => fs.existsSync(path.join(
|
|
88
|
+
const icon = icons.find(i => fs.existsSync(path.join(root, ...i[48].split('/'))));
|
|
92
89
|
if (icon) {
|
|
93
90
|
options_and_vars.icons = {
|
|
94
91
|
48: icon[48],
|
|
95
|
-
96: fs.existsSync(path.join(
|
|
92
|
+
96: fs.existsSync(path.join(root, ...icon[96].split('/'))) ? icon[96] : icon[48],
|
|
96
93
|
};
|
|
97
94
|
}
|
|
98
95
|
console.log('generating manifest.json');
|
|
99
|
-
fs.writeFileSync(path.join(
|
|
96
|
+
fs.writeFileSync(path.join(root, 'build/manifest.json'), JSON.stringify({
|
|
100
97
|
manifest_version: 2,
|
|
101
98
|
name: options_and_vars.name,
|
|
102
99
|
version: options_and_vars.version,
|
package/root.js
CHANGED
package/version.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable no-console */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
9
|
-
const continuous_integration_1 = require("./continuous-integration");
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import root from './root';
|
|
6
|
+
import { ContinuousIntegration as CI } from './continuous-integration';
|
|
10
7
|
let version = null;
|
|
11
|
-
const version_js = path.join(
|
|
8
|
+
const version_js = path.join(root, 'gen/version.js');
|
|
12
9
|
if (fs.existsSync(version_js)) {
|
|
13
10
|
version = require(version_js); // eslint-disable-line @typescript-eslint/no-require-imports
|
|
14
11
|
}
|
|
15
12
|
else {
|
|
16
13
|
console.log('writing version');
|
|
17
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
18
|
-
version = require(path.join(
|
|
19
|
-
if (
|
|
20
|
-
const issue =
|
|
21
|
-
version = `${version}${issue}.${
|
|
15
|
+
version = require(path.join(root, 'package.json')).version; // eslint-disable-line @typescript-eslint/no-require-imports
|
|
16
|
+
if (CI.service && !CI.tag) {
|
|
17
|
+
const issue = CI.issue ? `.${CI.issue}` : '';
|
|
18
|
+
version = `${version}${issue}.${CI.build_number}`;
|
|
22
19
|
}
|
|
23
|
-
else if (!
|
|
20
|
+
else if (!CI.service) {
|
|
24
21
|
version = `${version}.${os.userInfo().username}.${os.hostname()}`;
|
|
25
22
|
}
|
|
26
23
|
if (!fs.existsSync(path.dirname(version_js)))
|
|
27
24
|
fs.mkdirSync(path.dirname(version_js));
|
|
28
25
|
fs.writeFileSync(version_js, `module.exports = ${JSON.stringify(version)};\n`, 'utf8');
|
|
29
26
|
}
|
|
30
|
-
|
|
27
|
+
export default version;
|