zotero-plugin-scaffold 0.0.15 → 0.0.17

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 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
@@ -2,19 +2,19 @@ import { Config, Build, Serve, Release } from './index.mjs';
2
2
  import { Command } from 'commander';
3
3
  import consola from 'consola';
4
4
  import updateNotifier from 'update-notifier';
5
+ import 'bumpp';
6
+ import 'chalk';
7
+ import 'std-env';
5
8
  import 'c12';
6
9
  import 'fs-extra';
7
10
  import 'hookable';
8
11
  import 'path';
9
12
  import 'radash';
10
13
  import 'crypto';
11
- import 'chalk';
12
- import 'std-env';
13
14
  import 'esbuild';
14
15
  import 'fast-glob';
15
16
  import 'replace-in-file';
16
17
  import 'web-ext';
17
- import 'bumpp';
18
18
  import 'conventional-changelog';
19
19
  import 'mime';
20
20
  import 'octokit';
@@ -23,7 +23,7 @@ import 'chokidar';
23
23
  import 'process';
24
24
 
25
25
  const name = "zotero-plugin-scaffold";
26
- const version = "0.0.15";
26
+ const version = "0.0.17";
27
27
  const description = "A scaffold for Zotero plugin development.";
28
28
  const scripts = {
29
29
  dev: "unbuild --stub",
package/dist/index.d.mts CHANGED
@@ -332,8 +332,6 @@ interface UserConfig extends RecursivePartial<Config$1> {
332
332
  name: string;
333
333
  id: string;
334
334
  namespace: string;
335
- xpiDownloadLink: string;
336
- updateURL: string;
337
335
  }
338
336
  interface Context extends Config$1 {
339
337
  pkgUser: any;
package/dist/index.d.ts CHANGED
@@ -332,8 +332,6 @@ interface UserConfig extends RecursivePartial<Config$1> {
332
332
  name: string;
333
333
  id: string;
334
334
  namespace: string;
335
- xpiDownloadLink: string;
336
- updateURL: string;
337
335
  }
338
336
  interface Context extends Config$1 {
339
337
  pkgUser: any;
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
+ import versionBump, { ProgressEvent } from 'bumpp';
2
+ import chalk from 'chalk';
3
+ import consola, { createConsola } from 'consola';
4
+ import { isCI, isWindows, isMacOS, isLinux } from 'std-env';
1
5
  import { loadConfig as loadConfig$1 } from 'c12';
2
6
  import fs from 'fs-extra';
3
7
  import { createHooks } from 'hookable';
4
8
  import path from 'path';
5
9
  import { dash, template, assign, debounce } from 'radash';
6
10
  import * as crypto from 'crypto';
7
- import chalk from 'chalk';
8
- import { isCI, isWindows, isMacOS, isLinux } from 'std-env';
9
- import consola, { createConsola } from 'consola';
10
11
  import { buildSync } from 'esbuild';
11
12
  import glob from 'fast-glob';
12
13
  import replaceInFile from 'replace-in-file';
13
14
  import webext from 'web-ext';
14
- import versionBump from 'bumpp';
15
15
  import conventionalChangelog from 'conventional-changelog';
16
16
  import mime from 'mime';
17
17
  import { Octokit } from 'octokit';
@@ -19,6 +19,42 @@ import { execSync, spawn } from 'child_process';
19
19
  import chokidar from 'chokidar';
20
20
  import { exit } from 'process';
21
21
 
22
+ const LogLevels = {
23
+ trace: 5,
24
+ debug: 4,
25
+ info: 3,
26
+ warn: 1,
27
+ error: 0
28
+ };
29
+ function bumppProgress({
30
+ event,
31
+ script,
32
+ updatedFiles,
33
+ skippedFiles,
34
+ newVersion
35
+ }) {
36
+ switch (event) {
37
+ case ProgressEvent.FileUpdated:
38
+ consola.success(`Updated ${updatedFiles.pop()} to ${newVersion}`);
39
+ break;
40
+ case ProgressEvent.FileSkipped:
41
+ consola.info(`${skippedFiles.pop()} did not need to be updated`);
42
+ break;
43
+ case ProgressEvent.GitCommit:
44
+ consola.success("Git commit");
45
+ break;
46
+ case ProgressEvent.GitTag:
47
+ consola.success("Git tag");
48
+ break;
49
+ case ProgressEvent.GitPush:
50
+ consola.success("Git push");
51
+ break;
52
+ case ProgressEvent.NpmScript:
53
+ consola.success(`Npm run ${script}`);
54
+ break;
55
+ }
56
+ }
57
+
22
58
  function dateFormat(fmt, date) {
23
59
  let ret;
24
60
  const opt = {
@@ -145,12 +181,14 @@ const defaultConfig = {
145
181
  release: {
146
182
  bumpp: {
147
183
  release: "prompt",
184
+ confirm: true,
148
185
  preid: "beta",
149
186
  // execute: "npm run build",
150
187
  all: false,
151
- commit: "Release v%s",
188
+ commit: "chore(publish): release v%s",
152
189
  tag: "v%s",
153
- push: true
190
+ push: true,
191
+ progress: bumppProgress
154
192
  }
155
193
  },
156
194
  logLevel: "info"
@@ -162,14 +200,6 @@ function generateHashSync(filePath, algorithm) {
162
200
  return `${algorithm}:${hash}`;
163
201
  }
164
202
 
165
- const LogLevels = {
166
- trace: 5,
167
- debug: 4,
168
- info: 3,
169
- warn: 1,
170
- error: 0
171
- };
172
-
173
203
  var __defProp$3 = Object.defineProperty;
174
204
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
175
205
  var __publicField$3 = (obj, key, value) => {
@@ -473,9 +503,7 @@ class Release extends Base {
473
503
  await this.bump();
474
504
  } else {
475
505
  if (glob.globSync(`${this.dist}/*.xpi`).length == 0) {
476
- this.logger.error(
477
- "No xpi file found, are you sure you have run the build?"
478
- );
506
+ throw new Error("No xpi file found, are you sure you have run build?");
479
507
  }
480
508
  await this.uploadXPI();
481
509
  await this.uploadUpdateJSON();
@@ -518,9 +546,6 @@ class Release extends Base {
518
546
  if (res.status == 200) {
519
547
  return res.data;
520
548
  }
521
- }).catch((err) => {
522
- this.logger.debug(err);
523
- return void 0;
524
549
  });
525
550
  }
526
551
  async creatRelease(options) {
@@ -528,9 +553,6 @@ class Release extends Base {
528
553
  if (res.status == 201) {
529
554
  return res.data;
530
555
  }
531
- }).catch((err) => {
532
- this.logger.debug(err);
533
- return void 0;
534
556
  });
535
557
  }
536
558
  async uploadAsset(releaseID, asset) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "A scaffold for Zotero plugin development.",
5
5
  "type": "module",
6
6
  "exports": {