zotero-plugin-scaffold 0.7.2 → 0.8.1
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 +6 -6
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/shared/{zotero-plugin-scaffold.CTJf9uCe.mjs → zotero-plugin-scaffold.5VjiPpN8.mjs} +42 -28
- package/dist/shared/{zotero-plugin-scaffold.CIruZpuO.d.mts → zotero-plugin-scaffold.fkuivpCE.d.mts} +18 -4
- package/dist/shared/{zotero-plugin-scaffold.CzBjWbS8.mjs → zotero-plugin-scaffold.qsx_2VJx.mjs} +23 -17
- package/dist/vendor/index.mjs +1 -1
- package/package.json +24 -24
package/README.md
CHANGED
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/zotero-plugin-scaffold)
|
|
4
4
|
[](https://www.npmjs.com/package/zotero-plugin-scaffold)
|
|
5
5
|

|
|
6
|
-

|
|
7
7
|
[](https://github.com/antfu/eslint-config)
|
|
8
8
|
|
|
9
9
|
This is an npm package designed to assist in the development of Zotero plugins. It provides features such as compiling plugins, starting Zotero and installing plugins from source code, reloading plugins when the source code changes, and releasing plugins, and so on.
|
|
10
10
|
|
|
11
11
|
Initially, the code of this package was part of the [zotero-plugin-template](https://github.com/windingwind/zotero-plugin-template) repository. To allow downstream developers to easily stay up-to-date, we have abstracted these scripts into a standalone npm package.
|
|
12
12
|
|
|
13
|
-
This project is under active development, and some APIs may change. However, it is ready for production and has been [used in several projects](https://github.com/
|
|
13
|
+
This project is under active development, and some APIs may change. However, it is ready for production and has been [used in several projects](https://github.com/zotero-plugin-dev/zotero-plugin-scaffold/network/dependents).
|
|
14
14
|
|
|
15
15
|
For best practices regarding this package, please refer to [zotero-plugin-template](https://github.com/windingwind/zotero-plugin-template).
|
|
16
16
|
|
|
17
17
|
## Documentation
|
|
18
18
|
|
|
19
|
-
[Read the Docs to Learn More](https://
|
|
19
|
+
[Read the Docs to Learn More](https://zotero-plugin-dev.github.io/zotero-plugin-scaffold).
|
|
20
20
|
|
|
21
21
|
## Contributing
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
# Git Clone
|
|
25
|
-
git clone https://github.com/
|
|
25
|
+
git clone https://github.com/zotero-plugin-dev/zotero-plugin-scaffold.git
|
|
26
26
|
cd zotero-plugin-scaffold/
|
|
27
27
|
|
|
28
28
|
# Install deps
|
|
@@ -36,7 +36,7 @@ pnpm run dev
|
|
|
36
36
|
|
|
37
37
|
# link local scaffold to your plugin
|
|
38
38
|
cd your-plugin-work-dir/
|
|
39
|
-
pnpm link ../zotero-plugin-scaffold/
|
|
39
|
+
pnpm link ../zotero-plugin-scaffold/
|
|
40
40
|
cd zotero-plugin-scaffold/
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -60,4 +60,4 @@ GNU Affero General Public License Version 3.
|
|
|
60
60
|
|
|
61
61
|
This project references the design and code of the [Zotero Plugin Template](https://github.com/windingwind/zotero-plugin-template).
|
|
62
62
|
|
|
63
|
-
This project would not be possible without the support of the [open source community](https://github.com/
|
|
63
|
+
This project would not be possible without the support of the [open source community](https://github.com/zotero-plugin-dev/zotero-plugin-scaffold/network/dependencies).
|
package/dist/cli.d.mts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { E as ExitSignals, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.
|
|
3
|
+
import { E as ExitSignals, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.5VjiPpN8.mjs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { pathExists } from 'fs-extra';
|
|
6
|
-
import { l as logger } from './shared/zotero-plugin-scaffold.
|
|
6
|
+
import { l as logger } from './shared/zotero-plugin-scaffold.qsx_2VJx.mjs';
|
|
7
7
|
import tinyUpdateNotifier from 'tiny-update-notifier';
|
|
8
8
|
import 'c12';
|
|
9
9
|
import 'es-toolkit';
|
|
@@ -36,7 +36,7 @@ import 'node:http';
|
|
|
36
36
|
import 'node:readline';
|
|
37
37
|
|
|
38
38
|
const name = "zotero-plugin-scaffold";
|
|
39
|
-
const version = "0.
|
|
39
|
+
const version = "0.8.1";
|
|
40
40
|
const pkg = {
|
|
41
41
|
name: name,
|
|
42
42
|
version: version};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UserConfig, O as OverrideConfig, C as Context, B as Base } from './shared/zotero-plugin-scaffold.
|
|
1
|
+
import { U as UserConfig, O as OverrideConfig, C as Context, B as Base } from './shared/zotero-plugin-scaffold.fkuivpCE.mjs';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import 'esbuild';
|
|
4
4
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.
|
|
1
|
+
export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.5VjiPpN8.mjs';
|
|
2
2
|
import 'c12';
|
|
3
3
|
import 'es-toolkit';
|
|
4
4
|
import 'fs-extra/esm';
|
|
5
5
|
import 'hookable';
|
|
6
|
-
import './shared/zotero-plugin-scaffold.
|
|
6
|
+
import './shared/zotero-plugin-scaffold.qsx_2VJx.mjs';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'tinyglobby';
|
|
9
9
|
import 'node:process';
|
package/dist/shared/{zotero-plugin-scaffold.CTJf9uCe.mjs → zotero-plugin-scaffold.5VjiPpN8.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { loadConfig as loadConfig$1, setupDotenv } from 'c12';
|
|
|
2
2
|
import { kebabCase, mapValues, toMerged, escapeRegExp, debounce, delay } from 'es-toolkit';
|
|
3
3
|
import { readJsonSync, copy, move, outputFile, readJSON, outputJSON, writeJson, emptyDir, pathExists, ensureDir, remove } from 'fs-extra/esm';
|
|
4
4
|
import { createHooks } from 'hookable';
|
|
5
|
-
import { l as logger, p as parseRepoUrl, d as dateFormat, t as template, b as toArray, s as
|
|
5
|
+
import { l as logger, p as parseRepoUrl, d as dateFormat, t as template, b as toArray, s as stdout, c as replaceDefine, L as LOG_LEVEL } from './zotero-plugin-scaffold.qsx_2VJx.mjs';
|
|
6
6
|
import process$1 from 'node:process';
|
|
7
7
|
import { glob, globSync } from 'tinyglobby';
|
|
8
8
|
import path, { resolve as resolve$1, dirname, basename, join as join$1, isAbsolute as isAbsolute$1, extname as extname$1 } from 'node:path';
|
|
@@ -87,6 +87,7 @@ function resolveConfig$1(config) {
|
|
|
87
87
|
}
|
|
88
88
|
const defaultConfig = {
|
|
89
89
|
source: "src",
|
|
90
|
+
watchIgnore: [],
|
|
90
91
|
dist: ".scaffold/build",
|
|
91
92
|
name: "",
|
|
92
93
|
id: "",
|
|
@@ -373,7 +374,7 @@ class MessageManager {
|
|
|
373
374
|
return;
|
|
374
375
|
const missingLocales = [...this.ftlMessages.entries()].filter(([_, messages]) => !messages.has(msg)).map(([locale]) => locale);
|
|
375
376
|
if (missingLocales.length > 0)
|
|
376
|
-
logger.warn(`I10N id ${
|
|
377
|
+
logger.warn(`I10N id ${stdout.blue(msg)} missing in locale: ${missingLocales.join(", ")}`);
|
|
377
378
|
});
|
|
378
379
|
}
|
|
379
380
|
getFTLMessages() {
|
|
@@ -396,11 +397,11 @@ function processHTMLFile(content, namespace, allMessages, ignores, filePath) {
|
|
|
396
397
|
const processed = content.replace(L10N_PATTERN, (match, attr, id) => {
|
|
397
398
|
foundMessages.add(id);
|
|
398
399
|
if (ignores.includes(id)) {
|
|
399
|
-
logger.debug(`Skipped ignored ID: ${
|
|
400
|
+
logger.debug(`Skipped ignored ID: ${stdout.blue(id)} in ${stdout.gray(filePath)}`);
|
|
400
401
|
return match;
|
|
401
402
|
}
|
|
402
403
|
if (!allMessages.has(id)) {
|
|
403
|
-
logger.warn(`I10N id ${
|
|
404
|
+
logger.warn(`I10N id ${stdout.blue(id)} in path ${stdout.gray(filePath)} does not exist in any locale, skip renaming it.`);
|
|
404
405
|
return match;
|
|
405
406
|
}
|
|
406
407
|
return `${attr}="${namespace}-${id}"`;
|
|
@@ -682,7 +683,7 @@ async function buildPrefs(dist, options) {
|
|
|
682
683
|
Object.entries(prefs).forEach(([key, value]) => {
|
|
683
684
|
if (typeof value === "number") {
|
|
684
685
|
if (!is32BitNumber(value)) {
|
|
685
|
-
logger.warn(`Pref key '${
|
|
686
|
+
logger.warn(`Pref key '${stdout.blue(key)}' is a number, but is more than 4 bytes, which can be problematic on some OS.`);
|
|
686
687
|
}
|
|
687
688
|
}
|
|
688
689
|
});
|
|
@@ -704,17 +705,17 @@ async function buildPrefs(dist, options) {
|
|
|
704
705
|
for (const match of matchs) {
|
|
705
706
|
const [matched, key] = match;
|
|
706
707
|
if (key.startsWith(prefix)) {
|
|
707
|
-
logger.debug(`Pref key '${
|
|
708
|
+
logger.debug(`Pref key '${stdout.blue(key)}' is already starts with '${prefix}', skip prefixing it.`);
|
|
708
709
|
continue;
|
|
709
710
|
} else if (key.startsWith("extensions.")) {
|
|
710
|
-
logger.warn(`Pref key '${
|
|
711
|
+
logger.warn(`Pref key '${stdout.blue(key)}' in ${stdout.gray(path)} starts with 'extensions.' but not '${stdout.blue(prefix)}', skip prefixing it.`);
|
|
711
712
|
continue;
|
|
712
713
|
} else if (!(key in prefsWithPrefix) && !(key in prefsWithoutPrefix)) {
|
|
713
|
-
logger.warn(`Pref key '${
|
|
714
|
+
logger.warn(`Pref key '${stdout.blue(key)}' in ${stdout.gray(path)} is not found in prefs.js, skip prefixing it.`);
|
|
714
715
|
continue;
|
|
715
716
|
} else {
|
|
716
717
|
const prefixed = `${prefix}.${key}`;
|
|
717
|
-
logger.debug(`Pref key '${
|
|
718
|
+
logger.debug(`Pref key '${stdout.blue(key)}' in ${stdout.gray(path)} is prefixed to ${stdout.blue(prefixed)}.`);
|
|
718
719
|
content = content.replace(matched, `preference="${prefixed}"`);
|
|
719
720
|
}
|
|
720
721
|
}
|
|
@@ -815,7 +816,7 @@ class Build extends Base {
|
|
|
815
816
|
const { dist, version } = this.ctx;
|
|
816
817
|
const t = /* @__PURE__ */ new Date();
|
|
817
818
|
this.buildTime = dateFormat("YYYY-mm-dd HH:MM:SS", t);
|
|
818
|
-
this.logger.info(`Building version ${
|
|
819
|
+
this.logger.info(`Building version ${stdout.blue(version)} to ${stdout.blue(dist)} at ${stdout.blue(this.buildTime)} in ${stdout.blue(process$1.env.NODE_ENV)} mode.`);
|
|
819
820
|
await this.ctx.hooks.callHook("build:init", this.ctx);
|
|
820
821
|
this.logger.tip("Preparing static assets", { space: 1 });
|
|
821
822
|
await this.prepareAssets();
|
|
@@ -2454,18 +2455,19 @@ function resolveModuleURL(input, options) {
|
|
|
2454
2455
|
}
|
|
2455
2456
|
}
|
|
2456
2457
|
const conditionsSet = options?.conditions ? new Set(options.conditions) : DEFAULT_CONDITIONS_SET;
|
|
2458
|
+
const target = specifier || url.href;
|
|
2457
2459
|
const bases = _normalizeBases(options?.from);
|
|
2458
2460
|
const suffixes = options?.suffixes || [""];
|
|
2459
2461
|
const extensions = options?.extensions ? ["", ...options.extensions] : [""];
|
|
2460
2462
|
let resolved;
|
|
2461
2463
|
for (const base of bases) {
|
|
2462
2464
|
for (const suffix of suffixes) {
|
|
2465
|
+
let name = _join(target, suffix);
|
|
2466
|
+
if (name === ".") {
|
|
2467
|
+
name += "/.";
|
|
2468
|
+
}
|
|
2463
2469
|
for (const extension of extensions) {
|
|
2464
|
-
resolved = _tryModuleResolve(
|
|
2465
|
-
_join(specifier || url.href, suffix) + extension,
|
|
2466
|
-
base,
|
|
2467
|
-
conditionsSet
|
|
2468
|
-
);
|
|
2470
|
+
resolved = _tryModuleResolve(name + extension, base, conditionsSet);
|
|
2469
2471
|
if (resolved) {
|
|
2470
2472
|
break;
|
|
2471
2473
|
}
|
|
@@ -2529,7 +2531,7 @@ function _normalizeBase(input) {
|
|
|
2529
2531
|
if (!input) {
|
|
2530
2532
|
return [];
|
|
2531
2533
|
}
|
|
2532
|
-
if (input
|
|
2534
|
+
if (_isURL(input)) {
|
|
2533
2535
|
return [input];
|
|
2534
2536
|
}
|
|
2535
2537
|
if (typeof input !== "string") {
|
|
@@ -2572,6 +2574,9 @@ function _join(a, b) {
|
|
|
2572
2574
|
function _normalizeWinPath(path) {
|
|
2573
2575
|
return path.replace(/\\/g, "/").replace(/^[a-z]:\//, (r) => r.toUpperCase());
|
|
2574
2576
|
}
|
|
2577
|
+
function _isURL(input) {
|
|
2578
|
+
return input instanceof URL || input?.constructor?.name === "URL";
|
|
2579
|
+
}
|
|
2575
2580
|
function _parseInput(input) {
|
|
2576
2581
|
if (typeof input === "string") {
|
|
2577
2582
|
if (input.startsWith("file:")) {
|
|
@@ -2589,7 +2594,7 @@ function _parseInput(input) {
|
|
|
2589
2594
|
}
|
|
2590
2595
|
return { specifier: input };
|
|
2591
2596
|
}
|
|
2592
|
-
if (input
|
|
2597
|
+
if (_isURL(input)) {
|
|
2593
2598
|
if (input.protocol === "file:") {
|
|
2594
2599
|
return { url: input, absolutePath: fileURLToPath(input) };
|
|
2595
2600
|
}
|
|
@@ -2929,9 +2934,9 @@ async function generateMarkDown(commits, config) {
|
|
|
2929
2934
|
const _email = [...i.email].find(
|
|
2930
2935
|
(e) => !e.includes("noreply.github.com")
|
|
2931
2936
|
);
|
|
2932
|
-
const email = config.hideAuthorEmail !== true && _email ?
|
|
2933
|
-
const github = i.github ? `([@${i.github}](https://github.com/${i.github}))` : "";
|
|
2934
|
-
return `- ${i.name}
|
|
2937
|
+
const email = config.hideAuthorEmail !== true && _email ? ` <${_email}>` : "";
|
|
2938
|
+
const github = i.github ? ` ([@${i.github}](https://github.com/${i.github}))` : "";
|
|
2939
|
+
return `- ${i.name}${github || email || ""}`;
|
|
2935
2940
|
})
|
|
2936
2941
|
);
|
|
2937
2942
|
}
|
|
@@ -3318,10 +3323,17 @@ ${changelog}
|
|
|
3318
3323
|
}
|
|
3319
3324
|
}
|
|
3320
3325
|
|
|
3321
|
-
function watch(source, event) {
|
|
3326
|
+
function watch(source, ignore, event) {
|
|
3322
3327
|
const watcher = chokidar.watch(source, {
|
|
3323
|
-
ignored:
|
|
3324
|
-
|
|
3328
|
+
ignored: [
|
|
3329
|
+
/(^|[/\\])\../,
|
|
3330
|
+
// ignore dotfiles
|
|
3331
|
+
/[\\/]\.git[\\/]/,
|
|
3332
|
+
/[\\/]node_modules[\\/]/,
|
|
3333
|
+
...toArray(ignore)
|
|
3334
|
+
],
|
|
3335
|
+
ignoreInitial: true,
|
|
3336
|
+
ignorePermissionErrors: true,
|
|
3325
3337
|
persistent: true
|
|
3326
3338
|
});
|
|
3327
3339
|
const onChangeDebounced = safeDebounce(event.onChange);
|
|
@@ -4148,9 +4160,10 @@ class Serve extends Base {
|
|
|
4148
4160
|
* watch source dir and build when file changed
|
|
4149
4161
|
*/
|
|
4150
4162
|
async watch() {
|
|
4151
|
-
const { source } = this.ctx;
|
|
4163
|
+
const { source, watchIgnore } = this.ctx;
|
|
4152
4164
|
watch(
|
|
4153
4165
|
source,
|
|
4166
|
+
watchIgnore,
|
|
4154
4167
|
{
|
|
4155
4168
|
onReady: async () => {
|
|
4156
4169
|
await this.ctx.hooks.callHook("serve:ready", this.ctx);
|
|
@@ -4341,7 +4354,7 @@ class TestHttpReporter {
|
|
|
4341
4354
|
logger.tip(data.title, logger_option);
|
|
4342
4355
|
break;
|
|
4343
4356
|
case "pass":
|
|
4344
|
-
logger.success(`${data.title} ${
|
|
4357
|
+
logger.success(`${data.title} ${stdout.gray(`${data.duration}ms`)}`, logger_option);
|
|
4345
4358
|
break;
|
|
4346
4359
|
case "fail": {
|
|
4347
4360
|
let formatOutput = function(obj, indent) {
|
|
@@ -4352,15 +4365,15 @@ class TestHttpReporter {
|
|
|
4352
4365
|
return `${firstLine}
|
|
4353
4366
|
${restLines}`;
|
|
4354
4367
|
};
|
|
4355
|
-
logger.fail(
|
|
4368
|
+
logger.fail(stdout.red(`${data.title}, ${data?.error?.message}`), logger_option);
|
|
4356
4369
|
let expected = data.error.expected;
|
|
4357
4370
|
let received = data.error.actual;
|
|
4358
4371
|
if (expected && typeof expected === "object")
|
|
4359
4372
|
expected = formatOutput(expected, data.indents + 1);
|
|
4360
4373
|
if (received && typeof received === "object")
|
|
4361
4374
|
received = formatOutput(received, data.indents + 1);
|
|
4362
|
-
logger.log(`Expected: ${
|
|
4363
|
-
logger.log(`Received: ${
|
|
4375
|
+
logger.log(`Expected: ${stdout.green(String(expected))}`, { space: data.indents + 0.5 });
|
|
4376
|
+
logger.log(`Received: ${stdout.red(String(received))}`, { space: data.indents + 0.5 });
|
|
4364
4377
|
break;
|
|
4365
4378
|
}
|
|
4366
4379
|
case "pending":
|
|
@@ -4846,6 +4859,7 @@ class Test extends Base {
|
|
|
4846
4859
|
}
|
|
4847
4860
|
watch(
|
|
4848
4861
|
[this.ctx.source, this.ctx.test.entries].flat(),
|
|
4862
|
+
this.ctx.watchIgnore,
|
|
4849
4863
|
{
|
|
4850
4864
|
onChange: async (path) => {
|
|
4851
4865
|
if (isSource(path)) {
|
package/dist/shared/{zotero-plugin-scaffold.CIruZpuO.d.mts → zotero-plugin-scaffold.fkuivpCE.d.mts}
RENAMED
|
@@ -125,17 +125,31 @@ interface UpdateJSON {
|
|
|
125
125
|
|
|
126
126
|
interface Config {
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* Source root directory or directories for the plugin.
|
|
129
129
|
*
|
|
130
|
-
*
|
|
130
|
+
* These paths are:
|
|
131
|
+
* - Watched during development to trigger rebuilds on changes.
|
|
132
|
+
* - Used to remove the top-level asset directory (e.g. `assets/`) during build,
|
|
133
|
+
* so that only its contents are copied directly to the output root.
|
|
131
134
|
*
|
|
132
|
-
*
|
|
135
|
+
* 插件的源码根目录(可为字符串或字符串数组)。
|
|
133
136
|
*
|
|
134
|
-
*
|
|
137
|
+
* 用于以下两个目的:
|
|
138
|
+
* - 在开发模式下监听这些目录,以便在文件变更时触发重建;
|
|
139
|
+
* - 在构建阶段中,用于识别 assets 所在的顶层目录,以移除该目录本身,仅将其内容复制到输出目录的根部。
|
|
135
140
|
*
|
|
141
|
+
* @example ["src", "addon"]
|
|
136
142
|
* @default "src"
|
|
137
143
|
*/
|
|
138
144
|
source: string | string[];
|
|
145
|
+
/**
|
|
146
|
+
* The files to ignore when watching.
|
|
147
|
+
*
|
|
148
|
+
* 忽略的监听文件。
|
|
149
|
+
*
|
|
150
|
+
* @default []
|
|
151
|
+
*/
|
|
152
|
+
watchIgnore: string | string[] | RegExp | RegExp[];
|
|
139
153
|
/**
|
|
140
154
|
* The build directories.
|
|
141
155
|
*
|
package/dist/shared/{zotero-plugin-scaffold.CzBjWbS8.mjs → zotero-plugin-scaffold.qsx_2VJx.mjs}
RENAMED
|
@@ -3,16 +3,22 @@ import { glob } from 'tinyglobby';
|
|
|
3
3
|
import process from 'node:process';
|
|
4
4
|
import readline from 'node:readline';
|
|
5
5
|
import { isPlainObject } from 'es-toolkit';
|
|
6
|
-
import
|
|
6
|
+
import { styleText } from 'node:util';
|
|
7
7
|
import { isDebug } from 'std-env';
|
|
8
8
|
|
|
9
|
-
const factory = (...formats) =>
|
|
10
|
-
new Proxy(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const factory = (styleText, options, ...formats) =>
|
|
10
|
+
new Proxy(
|
|
11
|
+
(raw, ...substitutions) =>
|
|
12
|
+
styleText(
|
|
13
|
+
formats,
|
|
14
|
+
raw.raw ? String.raw({raw}, ...substitutions) : raw,
|
|
15
|
+
options,
|
|
16
|
+
),
|
|
17
|
+
{get: (_, format) => factory(styleText, options, ...formats, format)},
|
|
18
|
+
);
|
|
14
19
|
|
|
15
|
-
const
|
|
20
|
+
const stdout = factory(styleText, {stream: process.stdout});
|
|
21
|
+
factory(styleText, {stream: process.stderr});
|
|
16
22
|
|
|
17
23
|
var LOG_LEVEL = /* @__PURE__ */ ((LOG_LEVEL2) => {
|
|
18
24
|
LOG_LEVEL2[LOG_LEVEL2["TRACE"] = 0] = "TRACE";
|
|
@@ -23,13 +29,13 @@ var LOG_LEVEL = /* @__PURE__ */ ((LOG_LEVEL2) => {
|
|
|
23
29
|
return LOG_LEVEL2;
|
|
24
30
|
})(LOG_LEVEL || {});
|
|
25
31
|
const SYMBOLS = {
|
|
26
|
-
SUCCESS:
|
|
27
|
-
INFO:
|
|
28
|
-
FAIL:
|
|
29
|
-
TIP:
|
|
30
|
-
ERROR:
|
|
31
|
-
WARN:
|
|
32
|
-
DEBUG:
|
|
32
|
+
SUCCESS: stdout.green("\u2714"),
|
|
33
|
+
INFO: stdout.blue("\u2139"),
|
|
34
|
+
FAIL: stdout.red("\u2716"),
|
|
35
|
+
TIP: stdout.blue("\u2192"),
|
|
36
|
+
ERROR: stdout.bgRed(" ERROR "),
|
|
37
|
+
WARN: stdout.bgYellow(" WARN "),
|
|
38
|
+
DEBUG: stdout.grey("\u2699"),
|
|
33
39
|
NONE: ""
|
|
34
40
|
};
|
|
35
41
|
const DEFAULT_OPTIONS = {
|
|
@@ -112,7 +118,7 @@ class Logger {
|
|
|
112
118
|
return String(content);
|
|
113
119
|
}
|
|
114
120
|
formatError(error) {
|
|
115
|
-
return `${
|
|
121
|
+
return `${stdout.red(error.name)}: ${stdout.red(error.message)}
|
|
116
122
|
${error.stack}`;
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
@@ -157,7 +163,7 @@ ${error.stack}`;
|
|
|
157
163
|
this.logInternal(content, LOG_METHODS_CONFIG.fail, options);
|
|
158
164
|
}
|
|
159
165
|
ready(content) {
|
|
160
|
-
this.logInternal(
|
|
166
|
+
this.logInternal(stdout.green(content), LOG_METHODS_CONFIG.success);
|
|
161
167
|
}
|
|
162
168
|
log(content, options) {
|
|
163
169
|
this.logInternal(content, LOG_METHODS_CONFIG.log, options);
|
|
@@ -254,4 +260,4 @@ async function replaceDefine(dist, define) {
|
|
|
254
260
|
});
|
|
255
261
|
}
|
|
256
262
|
|
|
257
|
-
export { LOG_LEVEL as L, replaceInFile as a, toArray as b, replaceDefine as c, dateFormat as d, logger as l, parseRepoUrl as p, replace as r,
|
|
263
|
+
export { LOG_LEVEL as L, replaceInFile as a, toArray as b, replaceDefine as c, dateFormat as d, logger as l, parseRepoUrl as p, replace as r, stdout as s, template as t };
|
package/dist/vendor/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as replace, a as replaceInFile } from '../shared/zotero-plugin-scaffold.
|
|
1
|
+
export { r as replace, a as replaceInFile } from '../shared/zotero-plugin-scaffold.qsx_2VJx.mjs';
|
|
2
2
|
import * as esToolkit from 'es-toolkit';
|
|
3
3
|
export { esToolkit };
|
|
4
4
|
import * as esm from 'fs-extra/esm';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin-scaffold",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"description": "A scaffold for Zotero plugin development.",
|
|
6
6
|
"author": "northword",
|
|
7
7
|
"license": "AGPL-3.0-or-later",
|
|
@@ -55,39 +55,39 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@fluent/syntax": "^0.19.0",
|
|
58
|
-
"@swc/core": "^1.
|
|
58
|
+
"@swc/core": "^1.15.0",
|
|
59
59
|
"adm-zip": "^0.5.16",
|
|
60
|
-
"bumpp": "^10.
|
|
61
|
-
"c12": "^3.
|
|
60
|
+
"bumpp": "^10.3.1",
|
|
61
|
+
"c12": "^3.3.1",
|
|
62
62
|
"chokidar": "^4.0.3",
|
|
63
|
-
"commander": "^14.0.
|
|
64
|
-
"es-toolkit": "^1.
|
|
65
|
-
"esbuild": "^0.25.
|
|
66
|
-
"fs-extra": "^11.3.
|
|
63
|
+
"commander": "^14.0.2",
|
|
64
|
+
"es-toolkit": "^1.41.0",
|
|
65
|
+
"esbuild": "^0.25.12",
|
|
66
|
+
"fs-extra": "^11.3.2",
|
|
67
67
|
"hookable": "^5.5.3",
|
|
68
|
-
"octokit": "^5.0.
|
|
69
|
-
"std-env": "^3.
|
|
68
|
+
"octokit": "^5.0.5",
|
|
69
|
+
"std-env": "^3.10.0",
|
|
70
70
|
"tiny-update-notifier": "^2.0.2",
|
|
71
|
-
"tinyglobby": "^0.2.
|
|
72
|
-
"xvfb-ts": "^1.1.
|
|
71
|
+
"tinyglobby": "^0.2.15",
|
|
72
|
+
"xvfb-ts": "^1.1.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@antfu/eslint-config": "^
|
|
75
|
+
"@antfu/eslint-config": "^6.2.0",
|
|
76
76
|
"@commander-js/extra-typings": "^14.0.0",
|
|
77
77
|
"@types/adm-zip": "^0.5.7",
|
|
78
78
|
"@types/fs-extra": "^11.0.4",
|
|
79
|
-
"@types/node": "^
|
|
80
|
-
"bumpp": "^10.
|
|
81
|
-
"changelogen": "^0.6.
|
|
82
|
-
"eslint": "^9.
|
|
83
|
-
"eslint-plugin-format": "^1.0.
|
|
79
|
+
"@types/node": "^24.10.0",
|
|
80
|
+
"bumpp": "^10.3.1",
|
|
81
|
+
"changelogen": "^0.6.2",
|
|
82
|
+
"eslint": "^9.39.1",
|
|
83
|
+
"eslint-plugin-format": "^1.0.2",
|
|
84
84
|
"husky": "^9.1.7",
|
|
85
|
-
"lint-staged": "^16.
|
|
86
|
-
"node-style-text": "^
|
|
87
|
-
"tsx": "^4.20.
|
|
88
|
-
"typescript": "^5.
|
|
89
|
-
"unbuild": "^3.
|
|
90
|
-
"vitest": "^
|
|
85
|
+
"lint-staged": "^16.2.6",
|
|
86
|
+
"node-style-text": "^2.1.2",
|
|
87
|
+
"tsx": "^4.20.6",
|
|
88
|
+
"typescript": "^5.9.3",
|
|
89
|
+
"unbuild": "^3.6.1",
|
|
90
|
+
"vitest": "^4.0.7"
|
|
91
91
|
},
|
|
92
92
|
"workspaces": [
|
|
93
93
|
"src",
|