zotero-plugin-scaffold 0.0.16 → 0.0.18
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 +1 -4
- package/dist/cli.mjs +4 -3
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.mjs +12 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,9 +64,6 @@ export default defineConfig({
|
|
|
64
64
|
name: pkg.config.addonName,
|
|
65
65
|
id: pkg.config.addonID,
|
|
66
66
|
namespace: pkg.config.addonRef,
|
|
67
|
-
updateURL: `https://raw.githubusercontent.com/{{owner}}/{{repo}}/main/update.json`,
|
|
68
|
-
xpiDownloadLink:
|
|
69
|
-
"https://github.com/{{owner}}/{{repo}}/releases/download/v{{version}}/{{xpiName}}.xpi",
|
|
70
67
|
build: {
|
|
71
68
|
esbuildOptions: [
|
|
72
69
|
{
|
|
@@ -159,7 +156,7 @@ pnpm run lint:fix
|
|
|
159
156
|
|
|
160
157
|
## License
|
|
161
158
|
|
|
162
|
-
GNU Affero General Public License Version 3
|
|
159
|
+
GNU Affero General Public License Version 3.
|
|
163
160
|
|
|
164
161
|
## Acknowledgements
|
|
165
162
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { Config, Build, Serve, Release } from './index.mjs';
|
|
2
3
|
import { Command } from 'commander';
|
|
3
4
|
import consola from 'consola';
|
|
4
5
|
import updateNotifier from 'update-notifier';
|
|
5
6
|
import 'bumpp';
|
|
7
|
+
import 'chalk';
|
|
8
|
+
import 'std-env';
|
|
6
9
|
import 'c12';
|
|
7
10
|
import 'fs-extra';
|
|
8
11
|
import 'hookable';
|
|
9
12
|
import 'path';
|
|
10
13
|
import 'radash';
|
|
11
14
|
import 'crypto';
|
|
12
|
-
import 'chalk';
|
|
13
|
-
import 'std-env';
|
|
14
15
|
import 'esbuild';
|
|
15
16
|
import 'fast-glob';
|
|
16
17
|
import 'replace-in-file';
|
|
@@ -23,7 +24,7 @@ import 'chokidar';
|
|
|
23
24
|
import 'process';
|
|
24
25
|
|
|
25
26
|
const name = "zotero-plugin-scaffold";
|
|
26
|
-
const version = "0.0.
|
|
27
|
+
const version = "0.0.18";
|
|
27
28
|
const description = "A scaffold for Zotero plugin development.";
|
|
28
29
|
const scripts = {
|
|
29
30
|
dev: "unbuild --stub",
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import versionBump, { ProgressEvent } from 'bumpp';
|
|
2
|
+
import chalk from 'chalk';
|
|
2
3
|
import consola, { createConsola } from 'consola';
|
|
4
|
+
import { isCI, isWindows, isMacOS, isLinux } from 'std-env';
|
|
3
5
|
import { loadConfig as loadConfig$1 } from 'c12';
|
|
4
6
|
import fs from 'fs-extra';
|
|
5
7
|
import { createHooks } from 'hookable';
|
|
6
8
|
import path from 'path';
|
|
7
9
|
import { dash, template, assign, debounce } from 'radash';
|
|
8
10
|
import * as crypto from 'crypto';
|
|
9
|
-
import chalk from 'chalk';
|
|
10
|
-
import { isCI, isWindows, isMacOS, isLinux } from 'std-env';
|
|
11
11
|
import { buildSync } from 'esbuild';
|
|
12
12
|
import glob from 'fast-glob';
|
|
13
13
|
import replaceInFile from 'replace-in-file';
|
|
@@ -19,7 +19,14 @@ import { execSync, spawn } from 'child_process';
|
|
|
19
19
|
import chokidar from 'chokidar';
|
|
20
20
|
import { exit } from 'process';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const LogLevels = {
|
|
23
|
+
trace: 5,
|
|
24
|
+
debug: 4,
|
|
25
|
+
info: 3,
|
|
26
|
+
warn: 1,
|
|
27
|
+
error: 0
|
|
28
|
+
};
|
|
29
|
+
function bumppProgress({
|
|
23
30
|
event,
|
|
24
31
|
script,
|
|
25
32
|
updatedFiles,
|
|
@@ -181,7 +188,7 @@ const defaultConfig = {
|
|
|
181
188
|
commit: "chore(publish): release v%s",
|
|
182
189
|
tag: "v%s",
|
|
183
190
|
push: true,
|
|
184
|
-
progress
|
|
191
|
+
progress: bumppProgress
|
|
185
192
|
}
|
|
186
193
|
},
|
|
187
194
|
logLevel: "info"
|
|
@@ -193,14 +200,6 @@ function generateHashSync(filePath, algorithm) {
|
|
|
193
200
|
return `${algorithm}:${hash}`;
|
|
194
201
|
}
|
|
195
202
|
|
|
196
|
-
const LogLevels = {
|
|
197
|
-
trace: 5,
|
|
198
|
-
debug: 4,
|
|
199
|
-
info: 3,
|
|
200
|
-
warn: 1,
|
|
201
|
-
error: 0
|
|
202
|
-
};
|
|
203
|
-
|
|
204
203
|
var __defProp$3 = Object.defineProperty;
|
|
205
204
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
206
205
|
var __publicField$3 = (obj, key, value) => {
|
|
@@ -504,9 +503,7 @@ class Release extends Base {
|
|
|
504
503
|
await this.bump();
|
|
505
504
|
} else {
|
|
506
505
|
if (glob.globSync(`${this.dist}/*.xpi`).length == 0) {
|
|
507
|
-
|
|
508
|
-
"No xpi file found, are you sure you have run the build?"
|
|
509
|
-
);
|
|
506
|
+
throw new Error("No xpi file found, are you sure you have run build?");
|
|
510
507
|
}
|
|
511
508
|
await this.uploadXPI();
|
|
512
509
|
await this.uploadUpdateJSON();
|
|
@@ -549,9 +546,6 @@ class Release extends Base {
|
|
|
549
546
|
if (res.status == 200) {
|
|
550
547
|
return res.data;
|
|
551
548
|
}
|
|
552
|
-
}).catch((err) => {
|
|
553
|
-
this.logger.debug(err);
|
|
554
|
-
return void 0;
|
|
555
549
|
});
|
|
556
550
|
}
|
|
557
551
|
async creatRelease(options) {
|
|
@@ -559,9 +553,6 @@ class Release extends Base {
|
|
|
559
553
|
if (res.status == 201) {
|
|
560
554
|
return res.data;
|
|
561
555
|
}
|
|
562
|
-
}).catch((err) => {
|
|
563
|
-
this.logger.debug(err);
|
|
564
|
-
return void 0;
|
|
565
556
|
});
|
|
566
557
|
}
|
|
567
558
|
async uploadAsset(releaseID, asset) {
|