zotero-plugin-scaffold 0.0.34 → 0.1.0-beta.2
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 +22 -152
- package/dist/index.d.mts +186 -314
- package/dist/index.d.ts +186 -314
- package/dist/index.mjs +22 -973
- package/dist/shared/zotero-plugin-scaffold.125bc4ce.mjs +1320 -0
- package/dist/vendor/index.d.mts +6 -0
- package/dist/vendor/index.d.ts +6 -0
- package/dist/vendor/index.mjs +6 -0
- package/package.json +7 -8
- package/dist/tools/index.d.mts +0 -2
- package/dist/tools/index.d.ts +0 -2
- package/dist/tools/index.mjs +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,165 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import { exit, env } from 'node:process';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
-
import consola from 'consola';
|
|
5
4
|
import updateNotifier from 'update-notifier';
|
|
6
|
-
import { Config, Build, Serve, Release } from './
|
|
5
|
+
import { L as Log, C as Config, B as Build, S as Serve, R as Release } from './shared/zotero-plugin-scaffold.125bc4ce.mjs';
|
|
7
6
|
import 'node:path';
|
|
8
7
|
import 'c12';
|
|
9
8
|
import 'fs-extra';
|
|
10
9
|
import 'hookable';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
10
|
+
import 'es-toolkit';
|
|
11
|
+
import 'node:readline';
|
|
13
12
|
import 'chalk';
|
|
14
13
|
import 'std-env';
|
|
15
14
|
import 'esbuild';
|
|
16
|
-
import '
|
|
15
|
+
import 'globby';
|
|
17
16
|
import 'replace-in-file';
|
|
18
17
|
import 'web-ext';
|
|
19
18
|
import 'node:crypto';
|
|
19
|
+
import 'node:child_process';
|
|
20
20
|
import 'conventional-changelog';
|
|
21
|
+
import 'bumpp';
|
|
21
22
|
import 'mime';
|
|
22
23
|
import 'octokit';
|
|
23
|
-
import 'node:child_process';
|
|
24
24
|
import 'chokidar';
|
|
25
|
+
import 'node:fs';
|
|
25
26
|
|
|
26
27
|
const name = "zotero-plugin-scaffold";
|
|
27
|
-
const
|
|
28
|
-
const version = "0.0.34";
|
|
29
|
-
const packageManager = "pnpm@9.6.0";
|
|
30
|
-
const description = "A scaffold for Zotero plugin development.";
|
|
31
|
-
const author = "northword";
|
|
32
|
-
const license = "AGPL-3.0-or-later";
|
|
33
|
-
const homepage = "https://github.com/northword/zotero-plugin-scaffold#readme";
|
|
34
|
-
const repository = {
|
|
35
|
-
type: "git",
|
|
36
|
-
url: "https://github.com/northword/zotero-plugin-scaffold.git"
|
|
37
|
-
};
|
|
38
|
-
const bugs = {
|
|
39
|
-
url: "https://github.com/northword/zotero-plugin-scaffold/issues"
|
|
40
|
-
};
|
|
41
|
-
const keywords = [
|
|
42
|
-
"zotero",
|
|
43
|
-
"plugin",
|
|
44
|
-
"developer",
|
|
45
|
-
"scaffold",
|
|
46
|
-
"web-ext"
|
|
47
|
-
];
|
|
48
|
-
const exports = {
|
|
49
|
-
".": {
|
|
50
|
-
types: "./dist/index.d.ts",
|
|
51
|
-
"import": "./dist/index.mjs"
|
|
52
|
-
},
|
|
53
|
-
"./tools": {
|
|
54
|
-
types: "./dist/tools/index.d.ts",
|
|
55
|
-
"import": "./dist/tools/index.mjs"
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const main$1 = "./dist/index.mjs";
|
|
59
|
-
const module = "./dist/index.mjs";
|
|
60
|
-
const types = "./dist/index.d.ts";
|
|
61
|
-
const bin = {
|
|
62
|
-
"zotero-plugin": "./dist/cli.mjs"
|
|
63
|
-
};
|
|
64
|
-
const files = [
|
|
65
|
-
"dist"
|
|
66
|
-
];
|
|
67
|
-
const engines = {
|
|
68
|
-
node: ">=18"
|
|
69
|
-
};
|
|
70
|
-
const scripts = {
|
|
71
|
-
dev: "unbuild --stub",
|
|
72
|
-
build: "tsc --noEmit && unbuild",
|
|
73
|
-
lint: "eslint .",
|
|
74
|
-
"lint:fix": "eslint . --fix",
|
|
75
|
-
release: "bumpp --commit \"chore(release): publish v%s\"",
|
|
76
|
-
"update:deps": "pnpx taze minor -w -f -l",
|
|
77
|
-
test: "echo \"Error: no test specified\" && exit 1"
|
|
78
|
-
};
|
|
79
|
-
const publishConfig = {
|
|
80
|
-
access: "public",
|
|
81
|
-
registry: "https://registry.npmjs.org"
|
|
82
|
-
};
|
|
83
|
-
const directories = {
|
|
84
|
-
lib: "dist",
|
|
85
|
-
doc: "docs"
|
|
86
|
-
};
|
|
87
|
-
const dependencies = {
|
|
88
|
-
"@inquirer/prompts": "5.3.6",
|
|
89
|
-
bumpp: "9.4.1",
|
|
90
|
-
c12: "1.11.1",
|
|
91
|
-
chalk: "5.3.0",
|
|
92
|
-
chokidar: "3.6.0",
|
|
93
|
-
commander: "12.1.0",
|
|
94
|
-
consola: "3.2.3",
|
|
95
|
-
"conventional-changelog": "6.0.0",
|
|
96
|
-
esbuild: "0.23.0",
|
|
97
|
-
"fast-glob": "3.3.2",
|
|
98
|
-
"fs-extra": "11.2.0",
|
|
99
|
-
hookable: "5.5.3",
|
|
100
|
-
mime: "4.0.4",
|
|
101
|
-
octokit: "4.0.2",
|
|
102
|
-
radash: "12.1.0",
|
|
103
|
-
"replace-in-file": "8.1.0",
|
|
104
|
-
"std-env": "3.7.0",
|
|
105
|
-
"update-notifier": "7.2.0",
|
|
106
|
-
"web-ext": "8.2.0"
|
|
107
|
-
};
|
|
108
|
-
const devDependencies = {
|
|
109
|
-
"@antfu/eslint-config": "^2.23.0",
|
|
110
|
-
"@types/fs-extra": "11.0.4",
|
|
111
|
-
"@types/node": "20.14.13",
|
|
112
|
-
"@types/update-notifier": "6.0.8",
|
|
113
|
-
eslint: "9.8.0",
|
|
114
|
-
"eslint-plugin-format": "^0.1.2",
|
|
115
|
-
typescript: "5.5.4",
|
|
116
|
-
unbuild: "2.0.0"
|
|
117
|
-
};
|
|
118
|
-
const pnpm = {
|
|
119
|
-
peerDependencyRules: {
|
|
120
|
-
allowAny: [
|
|
121
|
-
"node-fetch"
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const pkg = {
|
|
126
|
-
name: name,
|
|
127
|
-
type: type,
|
|
128
|
-
version: version,
|
|
129
|
-
packageManager: packageManager,
|
|
130
|
-
description: description,
|
|
131
|
-
author: author,
|
|
132
|
-
license: license,
|
|
133
|
-
homepage: homepage,
|
|
134
|
-
repository: repository,
|
|
135
|
-
bugs: bugs,
|
|
136
|
-
keywords: keywords,
|
|
137
|
-
exports: exports,
|
|
138
|
-
main: main$1,
|
|
139
|
-
module: module,
|
|
140
|
-
types: types,
|
|
141
|
-
bin: bin,
|
|
142
|
-
files: files,
|
|
143
|
-
engines: engines,
|
|
144
|
-
scripts: scripts,
|
|
145
|
-
publishConfig: publishConfig,
|
|
146
|
-
directories: directories,
|
|
147
|
-
dependencies: dependencies,
|
|
148
|
-
devDependencies: devDependencies,
|
|
149
|
-
pnpm: pnpm
|
|
150
|
-
};
|
|
28
|
+
const version = "0.1.0-beta.2";
|
|
151
29
|
|
|
30
|
+
const logger = new Log();
|
|
152
31
|
async function main() {
|
|
153
32
|
var _a;
|
|
154
|
-
updateNotifier({ pkg }).notify();
|
|
155
|
-
(_a =
|
|
33
|
+
updateNotifier({ pkg: { name, version } }).notify();
|
|
34
|
+
(_a = env).NODE_ENV ?? (_a.NODE_ENV = "development");
|
|
156
35
|
const cli = new Command();
|
|
157
|
-
cli.version(
|
|
158
|
-
cli.command("build").description("Build the plugin.").option("--dev", "Builds the plugin in dev mode.").option(
|
|
159
|
-
"
|
|
160
|
-
"the full path for the new output directory, relative to the current workspace (default: build)"
|
|
161
|
-
).action(async (options) => {
|
|
162
|
-
process.env.NODE_ENV = options.dev ? "development" : "production";
|
|
36
|
+
cli.version(version).usage("<command> [options]");
|
|
37
|
+
cli.command("build").description("Build the plugin.").option("--dev", "Builds the plugin in dev mode.").option("--dist <dir>", "The relative path for the new output directory (default: build)").action(async (options) => {
|
|
38
|
+
env.NODE_ENV = options.dev ? "development" : "production";
|
|
163
39
|
const config = await Config.loadConfig({
|
|
164
40
|
dist: options.dist
|
|
165
41
|
});
|
|
@@ -170,30 +46,24 @@ async function main() {
|
|
|
170
46
|
new Serve(config).run();
|
|
171
47
|
});
|
|
172
48
|
cli.command("create").description("Create the plugin template.").action((_options) => {
|
|
173
|
-
|
|
49
|
+
logger.error("The create not yet implemented");
|
|
174
50
|
});
|
|
175
51
|
cli.command("release").description("Release.").action(async (_options) => {
|
|
176
|
-
|
|
52
|
+
env.NODE_ENV = "production";
|
|
177
53
|
const config = await Config.loadConfig({});
|
|
178
54
|
new Release(config).run();
|
|
179
55
|
});
|
|
180
56
|
cli.arguments("<command>").action((cmd) => {
|
|
181
57
|
cli.outputHelp();
|
|
182
|
-
|
|
58
|
+
logger.error(`Unknown command name=${cmd}.`);
|
|
183
59
|
});
|
|
184
60
|
cli.parse();
|
|
185
61
|
}
|
|
186
62
|
main().catch((err) => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
});
|
|
192
|
-
process.on("unhandledRejection", (err) => {
|
|
193
|
-
console.log("");
|
|
194
|
-
consola.error(err);
|
|
195
|
-
console.log("");
|
|
196
|
-
process.exit(1);
|
|
63
|
+
logger.newLine();
|
|
64
|
+
logger.error(err);
|
|
65
|
+
logger.newLine();
|
|
66
|
+
exit(1);
|
|
197
67
|
});
|
|
198
68
|
|
|
199
69
|
export { main as default };
|