zotero-plugin 1.2.2 → 1.4.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.
- package/README.md +47 -4
- package/bin/branches.js +2 -2
- package/bin/link.js +3 -3
- package/bin/release.js +5 -5
- package/bin/zipup.js +5 -5
- package/continuous-integration.js +1 -1
- package/copy-assets.js +4 -4
- package/debug-log.js +1 -1
- package/loader/peggy.js +1 -1
- package/loader/wrap.js +2 -2
- package/make-dirs.js +4 -4
- package/package.json +13 -13
- package/rdf.js +6 -6
- package/version.js +4 -4
package/README.md
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Utility scripts for releasing zotero plugins on github. See also https://github.com/retorquere/generator-zotero-plugin/
|
|
4
4
|
|
|
5
5
|
zotero-plugin-release will release your plugin as a github release.
|
|
6
|
-
When it is ran on master/main, and it detects a tagged build
|
|
6
|
+
When it is ran on master/main, and it detects a tagged build in a Github Action,
|
|
7
7
|
it will issue a new release. When it is ran on a branch named
|
|
8
8
|
`gh-<number>`, it will publish the plugin to a pre-release named
|
|
9
9
|
`builds`, and will announce the new build on issue number `<number>`
|
|
10
10
|
in your repo.
|
|
11
11
|
|
|
12
12
|
For this to work you must have a variable named `GITHUB_TOKEN` in
|
|
13
|
-
your
|
|
13
|
+
your GH Actions environment with a github token with `repo` rights. You
|
|
14
14
|
are allowed one bot account by github; I use this to do the
|
|
15
15
|
announcements, but you can use one from your own account if you
|
|
16
16
|
want.
|
|
@@ -26,7 +26,50 @@ commit message. If you want to announce on other issues in addition
|
|
|
26
26
|
to the current branch (or maybe your branch isn't named `gh-<number>`,
|
|
27
27
|
add `#<number>` to the commit message.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
## Releasing a new version
|
|
30
|
+
|
|
31
|
+
Add the folowing to your `scripts` section in `package.json`:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
"postversion": "git push --follow-tags",
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
and install this github actions workflow
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
name: release
|
|
41
|
+
|
|
42
|
+
on:
|
|
43
|
+
push:
|
|
44
|
+
|
|
45
|
+
jobs:
|
|
46
|
+
release:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v2
|
|
50
|
+
- name: install node
|
|
51
|
+
uses: actions/setup-node@v1
|
|
52
|
+
with:
|
|
53
|
+
node-version: 14.x
|
|
54
|
+
- name: Cache node dependencies
|
|
55
|
+
uses: actions/cache@v2
|
|
56
|
+
env:
|
|
57
|
+
cache-name: cache-dependencies
|
|
58
|
+
with:
|
|
59
|
+
path: |
|
|
60
|
+
~/.npm
|
|
61
|
+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
|
|
62
|
+
- name: install node dependencies
|
|
63
|
+
run: npm install
|
|
64
|
+
- name: build
|
|
65
|
+
run: npm run build
|
|
66
|
+
- name: release
|
|
67
|
+
run: npm run release
|
|
68
|
+
env:
|
|
69
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
You can now release new versions by issuing `npm version <major|minor|patch>`.
|
|
30
73
|
|
|
31
74
|
# Allowing your user to send debug information
|
|
32
75
|
|
|
@@ -45,7 +88,7 @@ The user will get an ID that looks like `C3WvhYgA8RDM-2XZGASLV`; the first part
|
|
|
45
88
|
|
|
46
89
|
# Starting Zotero with your plugin loaded
|
|
47
90
|
|
|
48
|
-
Note
|
|
91
|
+
Note it is *much* adviced to create a separate Zotero profile for testing!
|
|
49
92
|
|
|
50
93
|
You will need to have python3 installed to use this.
|
|
51
94
|
|
package/bin/branches.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
process.on('unhandledRejection', up => { throw up; });
|
|
7
7
|
require("dotenv/config");
|
|
8
|
-
const path =
|
|
8
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
9
|
const rest_1 = require("@octokit/rest");
|
|
10
10
|
const octokit = new rest_1.Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` });
|
|
11
|
-
const root_1 =
|
|
11
|
+
const root_1 = tslib_1.__importDefault(require("../root"));
|
|
12
12
|
const pkg = require(path.join(root_1.default, 'package.json'));
|
|
13
13
|
const [, owner, repo] = pkg.repository.url.match(/:\/\/github.com\/([^/]+)\/([^.]+)\.git$/);
|
|
14
14
|
async function main() {
|
package/bin/link.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-call */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const fs =
|
|
7
|
-
const path =
|
|
8
|
-
const root_1 =
|
|
6
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
8
|
+
const root_1 = tslib_1.__importDefault(require("../root"));
|
|
9
9
|
const pkg = Object.assign({}, require(path.join(root_1.default, 'package.json')));
|
|
10
10
|
if (!pkg.id)
|
|
11
11
|
pkg.id = `${pkg.name.replace(/^zotero-/, '')}@${pkg.author.email.replace(/.*@/, '')}`.toLowerCase();
|
package/bin/release.js
CHANGED
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
process.on('unhandledRejection', up => { throw up; });
|
|
7
7
|
require("dotenv/config");
|
|
8
|
-
const path =
|
|
9
|
-
const moment_1 =
|
|
10
|
-
const fs =
|
|
8
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
|
+
const moment_1 = tslib_1.__importDefault(require("moment"));
|
|
10
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
11
11
|
const rest_1 = require("@octokit/rest");
|
|
12
12
|
const octokit = new rest_1.Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` });
|
|
13
13
|
const continuous_integration_1 = require("../continuous-integration");
|
|
14
|
-
const root_1 =
|
|
14
|
+
const root_1 = tslib_1.__importDefault(require("../root"));
|
|
15
15
|
const pkg = require(path.join(root_1.default, 'package.json'));
|
|
16
16
|
const [, owner, repo] = pkg.repository.url.match(/:\/\/github.com\/([^/]+)\/([^.]+)\.git$/);
|
|
17
|
-
const version_1 =
|
|
17
|
+
const version_1 = tslib_1.__importDefault(require("../version"));
|
|
18
18
|
const xpi = `${pkg.name}-${version_1.default}.xpi`;
|
|
19
19
|
const PRERELEASE = false;
|
|
20
20
|
// eslint-disable-next-line no-magic-numbers
|
package/bin/zipup.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const fs =
|
|
7
|
-
const path =
|
|
8
|
-
const archiver =
|
|
9
|
-
const root_1 =
|
|
10
|
-
const version_1 =
|
|
6
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
8
|
+
const archiver = tslib_1.__importStar(require("archiver"));
|
|
9
|
+
const root_1 = tslib_1.__importDefault(require("../root"));
|
|
10
|
+
const version_1 = tslib_1.__importDefault(require("../version"));
|
|
11
11
|
const [, , source, target] = process.argv;
|
|
12
12
|
const xpi = path.join(root_1.default, 'xpi', `${target}-${version_1.default}.xpi`);
|
|
13
13
|
console.log(`creating ${xpi}`); // eslint-disable-line no-console
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContinuousIntegration = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const child_process =
|
|
5
|
+
const child_process = tslib_1.__importStar(require("child_process"));
|
|
6
6
|
class ContinuousIntegrationSingleton {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.service = '';
|
package/copy-assets.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* eslint-disable no-console, @typescript-eslint/no-unsafe-argument, @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 fs =
|
|
6
|
-
const glob =
|
|
7
|
-
const path =
|
|
8
|
-
const root_1 =
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const glob = tslib_1.__importStar(require("glob"));
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
8
|
+
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
9
9
|
function include(file, sources) {
|
|
10
10
|
if (fs.lstatSync(file).isDirectory())
|
|
11
11
|
return false;
|
package/debug-log.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebugLog = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const jszip_1 =
|
|
5
|
+
const jszip_1 = tslib_1.__importDefault(require("jszip"));
|
|
6
6
|
class DebugLogSender {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.enabled = false;
|
package/loader/peggy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable prefer-arrow/prefer-arrow-functions, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const peggy =
|
|
4
|
+
const peggy = tslib_1.__importStar(require("peggy"));
|
|
5
5
|
module.exports = function loader(source) {
|
|
6
6
|
return peggy.generate(source, {
|
|
7
7
|
output: 'source',
|
package/loader/wrap.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* 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
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const path =
|
|
5
|
-
const root_1 =
|
|
4
|
+
const path = tslib_1.__importStar(require("path"));
|
|
5
|
+
const root_1 = tslib_1.__importDefault(require("../root"));
|
|
6
6
|
const pkg = Object.assign({}, require(path.join(root_1.default, 'package.json')));
|
|
7
7
|
module.exports = function loader(source) {
|
|
8
8
|
// this.cacheable()
|
package/make-dirs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
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 =
|
|
6
|
-
const fs =
|
|
7
|
-
const path =
|
|
8
|
-
const root_1 =
|
|
5
|
+
const rimraf = tslib_1.__importStar(require("rimraf"));
|
|
6
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
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')]) {
|
|
11
11
|
rimraf.sync(dir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Zotero plugin builder",
|
|
5
5
|
"homepage": "https://github.com/retorquere/zotero-plugin/wiki",
|
|
6
6
|
"bin": {
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@octokit/rest": "^18.12.0",
|
|
31
31
|
"@rgrove/parse-xml": "^3.0.0",
|
|
32
|
-
"@types/node": "^17.0.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
34
|
-
"@typescript-eslint/parser": "^5.
|
|
35
|
-
"@xmldom/xmldom": "^0.8.
|
|
36
|
-
"ajv": "^8.
|
|
32
|
+
"@types/node": "^17.0.23",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.19.0",
|
|
35
|
+
"@xmldom/xmldom": "^0.8.2",
|
|
36
|
+
"ajv": "^8.11.0",
|
|
37
37
|
"ajv-keywords": "^5.1.0",
|
|
38
38
|
"archiver": "^5.3.0",
|
|
39
39
|
"clp": "^4.0.12",
|
|
40
40
|
"current-git-branch": "^1.1.0",
|
|
41
41
|
"dotenv": "^16.0.0",
|
|
42
42
|
"ejs": "^3.1.6",
|
|
43
|
-
"eslint": "^8.
|
|
44
|
-
"eslint-plugin-import": "^2.
|
|
43
|
+
"eslint": "^8.13.0",
|
|
44
|
+
"eslint-plugin-import": "^2.26.0",
|
|
45
45
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
46
|
-
"glob": "^
|
|
46
|
+
"glob": "^8.0.1",
|
|
47
47
|
"jsesc": "^3.0.2",
|
|
48
|
-
"jszip": "^3.
|
|
48
|
+
"jszip": "^3.9.1",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
|
-
"moment": "^2.29.
|
|
50
|
+
"moment": "^2.29.2",
|
|
51
51
|
"peggy": "^1.2.0",
|
|
52
52
|
"properties-reader": "^2.2.0",
|
|
53
53
|
"pug": "^3.0.2",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"shell-quote": "^1.7.3",
|
|
56
56
|
"shelljs": "^0.8.5",
|
|
57
57
|
"string-to-arraybuffer": "^1.0.2",
|
|
58
|
-
"ts-node": "^10.
|
|
58
|
+
"ts-node": "^10.7.0",
|
|
59
59
|
"tslib": "^2.3.1",
|
|
60
|
-
"typescript": "^4.
|
|
60
|
+
"typescript": "^4.6.3",
|
|
61
61
|
"uri-templates": "^0.2.0",
|
|
62
62
|
"xml-parser": "^1.2.1",
|
|
63
63
|
"xpath": "^0.0.32"
|
package/rdf.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/* 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 */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs =
|
|
6
|
-
const path =
|
|
7
|
-
const glob =
|
|
8
|
-
const pug =
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const glob = tslib_1.__importStar(require("glob"));
|
|
8
|
+
const pug = tslib_1.__importStar(require("pug"));
|
|
9
9
|
const PropertiesReader = require("properties-reader");
|
|
10
10
|
const uriTemplate = require("uri-templates");
|
|
11
|
-
const root_1 =
|
|
12
|
-
const version_1 =
|
|
11
|
+
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
12
|
+
const version_1 = tslib_1.__importDefault(require("./version"));
|
|
13
13
|
const pkg = Object.assign({}, require(path.join(root_1.default, 'package.json')));
|
|
14
14
|
if (!pkg.id)
|
|
15
15
|
pkg.id = `${pkg.name.replace(/^zotero-/, '')}@${pkg.author.email.replace(/.*@/, '')}`.toLowerCase();
|
package/version.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* eslint-disable no-console */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const path =
|
|
6
|
-
const os =
|
|
7
|
-
const fs =
|
|
8
|
-
const root_1 =
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
const os = tslib_1.__importStar(require("os"));
|
|
7
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
8
|
+
const root_1 = tslib_1.__importDefault(require("./root"));
|
|
9
9
|
const continuous_integration_1 = require("./continuous-integration");
|
|
10
10
|
let version = null;
|
|
11
11
|
const version_js = path.join(root_1.default, 'gen/version.js');
|