zotero-plugin-scaffold 0.0.15 → 0.0.16
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/dist/cli.mjs +2 -2
- package/dist/index.mjs +35 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
import 'c12';
|
|
6
7
|
import 'fs-extra';
|
|
7
8
|
import 'hookable';
|
|
@@ -14,7 +15,6 @@ 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.
|
|
26
|
+
const version = "0.0.16";
|
|
27
27
|
const description = "A scaffold for Zotero plugin development.";
|
|
28
28
|
const scripts = {
|
|
29
29
|
dev: "unbuild --stub",
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import versionBump, { ProgressEvent } from 'bumpp';
|
|
2
|
+
import consola, { createConsola } from 'consola';
|
|
1
3
|
import { loadConfig as loadConfig$1 } from 'c12';
|
|
2
4
|
import fs from 'fs-extra';
|
|
3
5
|
import { createHooks } from 'hookable';
|
|
@@ -6,12 +8,10 @@ import { dash, template, assign, debounce } from 'radash';
|
|
|
6
8
|
import * as crypto from 'crypto';
|
|
7
9
|
import chalk from 'chalk';
|
|
8
10
|
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,35 @@ import { execSync, spawn } from 'child_process';
|
|
|
19
19
|
import chokidar from 'chokidar';
|
|
20
20
|
import { exit } from 'process';
|
|
21
21
|
|
|
22
|
+
function progress({
|
|
23
|
+
event,
|
|
24
|
+
script,
|
|
25
|
+
updatedFiles,
|
|
26
|
+
skippedFiles,
|
|
27
|
+
newVersion
|
|
28
|
+
}) {
|
|
29
|
+
switch (event) {
|
|
30
|
+
case ProgressEvent.FileUpdated:
|
|
31
|
+
consola.success(`Updated ${updatedFiles.pop()} to ${newVersion}`);
|
|
32
|
+
break;
|
|
33
|
+
case ProgressEvent.FileSkipped:
|
|
34
|
+
consola.info(`${skippedFiles.pop()} did not need to be updated`);
|
|
35
|
+
break;
|
|
36
|
+
case ProgressEvent.GitCommit:
|
|
37
|
+
consola.success("Git commit");
|
|
38
|
+
break;
|
|
39
|
+
case ProgressEvent.GitTag:
|
|
40
|
+
consola.success("Git tag");
|
|
41
|
+
break;
|
|
42
|
+
case ProgressEvent.GitPush:
|
|
43
|
+
consola.success("Git push");
|
|
44
|
+
break;
|
|
45
|
+
case ProgressEvent.NpmScript:
|
|
46
|
+
consola.success(`Npm run ${script}`);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
22
51
|
function dateFormat(fmt, date) {
|
|
23
52
|
let ret;
|
|
24
53
|
const opt = {
|
|
@@ -145,12 +174,14 @@ const defaultConfig = {
|
|
|
145
174
|
release: {
|
|
146
175
|
bumpp: {
|
|
147
176
|
release: "prompt",
|
|
177
|
+
confirm: true,
|
|
148
178
|
preid: "beta",
|
|
149
179
|
// execute: "npm run build",
|
|
150
180
|
all: false,
|
|
151
|
-
commit: "
|
|
181
|
+
commit: "chore(publish): release v%s",
|
|
152
182
|
tag: "v%s",
|
|
153
|
-
push: true
|
|
183
|
+
push: true,
|
|
184
|
+
progress
|
|
154
185
|
}
|
|
155
186
|
},
|
|
156
187
|
logLevel: "info"
|