zotero-plugin-scaffold 0.5.0 → 0.6.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { l as logger, 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 { l as logger, E as ExitSignals, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.C-SXQX4J.mjs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { pathExists } from 'fs-extra';
|
|
6
6
|
import tinyUpdateNotifier from 'tiny-update-notifier';
|
|
@@ -32,7 +32,7 @@ import 'xvfb-ts';
|
|
|
32
32
|
import 'node:http';
|
|
33
33
|
|
|
34
34
|
const name = "zotero-plugin-scaffold";
|
|
35
|
-
const version = "0.
|
|
35
|
+
const version = "0.6.0";
|
|
36
36
|
const pkg = {
|
|
37
37
|
name: name,
|
|
38
38
|
version: version};
|
package/dist/index.d.mts
CHANGED
|
@@ -315,6 +315,20 @@ interface BuildConfig {
|
|
|
315
315
|
* @default []
|
|
316
316
|
*/
|
|
317
317
|
ignore: string[];
|
|
318
|
+
/**
|
|
319
|
+
* Generate i10n.d.ts form fluent messages.
|
|
320
|
+
*
|
|
321
|
+
* - false: disable
|
|
322
|
+
* - string: path of dts file
|
|
323
|
+
*
|
|
324
|
+
* 为 Fluent messages 生成类型声明文件。
|
|
325
|
+
*
|
|
326
|
+
* - false: 禁用
|
|
327
|
+
* - string:dts 文件路径
|
|
328
|
+
*
|
|
329
|
+
* @default 'typings/i10n.d.ts'
|
|
330
|
+
*/
|
|
331
|
+
dts: string | false;
|
|
318
332
|
};
|
|
319
333
|
prefs: {
|
|
320
334
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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.C-SXQX4J.mjs';
|
|
2
2
|
import 'c12';
|
|
3
3
|
import 'es-toolkit';
|
|
4
4
|
import 'fs-extra/esm';
|
package/dist/shared/{zotero-plugin-scaffold.BhyPDymw.mjs → zotero-plugin-scaffold.C-SXQX4J.mjs}
RENAMED
|
@@ -265,7 +265,8 @@ const defaultConfig = {
|
|
|
265
265
|
fluent: {
|
|
266
266
|
prefixFluentMessages: true,
|
|
267
267
|
prefixLocaleFiles: true,
|
|
268
|
-
ignore: []
|
|
268
|
+
ignore: [],
|
|
269
|
+
dts: "typings/i10n.d.ts"
|
|
269
270
|
},
|
|
270
271
|
prefs: {
|
|
271
272
|
prefix: "",
|
|
@@ -407,6 +408,10 @@ async function buildLocale(dist, namespace, options) {
|
|
|
407
408
|
}
|
|
408
409
|
}));
|
|
409
410
|
messageManager.validateMessages();
|
|
411
|
+
if (options.dts) {
|
|
412
|
+
const dtsContent = generateFluentDts([...messageManager.getFTLMessages()]);
|
|
413
|
+
await outputFile(options.dts, dtsContent, "utf-8");
|
|
414
|
+
}
|
|
410
415
|
}
|
|
411
416
|
async function getLocales(dist) {
|
|
412
417
|
const localePaths = await glob(`${dist}/addon/locale/*`, { onlyDirectories: true });
|
|
@@ -541,6 +546,15 @@ function processHTMLFile(content, namespace, allMessages, ignores, filePath) {
|
|
|
541
546
|
});
|
|
542
547
|
return { processedContent: processed, foundMessages: [...foundMessages] };
|
|
543
548
|
}
|
|
549
|
+
function generateFluentDts(messages) {
|
|
550
|
+
return `// Generated by zotero-plugin-scaffold
|
|
551
|
+
/* prettier-ignore */
|
|
552
|
+
/* eslint-disable */
|
|
553
|
+
// @ts-nocheck
|
|
554
|
+
export type FluentMessageId =
|
|
555
|
+
${Array.from(messages).sort().map((id) => ` | '${id}'`).join("\n")};
|
|
556
|
+
`;
|
|
557
|
+
}
|
|
544
558
|
|
|
545
559
|
function is32BitNumber(n) {
|
|
546
560
|
return Number.isInteger(n) && n >= -2147483648 && n <= 2147483647;
|
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.6.0",
|
|
5
5
|
"description": "A scaffold for Zotero plugin development.",
|
|
6
6
|
"author": "northword",
|
|
7
7
|
"license": "AGPL-3.0-or-later",
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@fluent/syntax": "^0.19.0",
|
|
67
|
-
"@swc/core": "^1.11.
|
|
67
|
+
"@swc/core": "^1.11.24",
|
|
68
68
|
"adm-zip": "^0.5.16",
|
|
69
69
|
"bumpp": "^10.1.0",
|
|
70
70
|
"c12": "^3.0.3",
|
|
71
71
|
"chokidar": "^4.0.3",
|
|
72
72
|
"commander": "^13.1.0",
|
|
73
|
-
"es-toolkit": "^1.
|
|
74
|
-
"esbuild": "^0.25.
|
|
73
|
+
"es-toolkit": "^1.36.0",
|
|
74
|
+
"esbuild": "^0.25.3",
|
|
75
75
|
"fs-extra": "^11.3.0",
|
|
76
76
|
"hookable": "^5.5.3",
|
|
77
|
-
"octokit": "^4.1.
|
|
77
|
+
"octokit": "^4.1.3",
|
|
78
78
|
"std-env": "^3.9.0",
|
|
79
79
|
"tiny-update-notifier": "^2.0.0",
|
|
80
|
-
"tinyglobby": "^0.2.
|
|
80
|
+
"tinyglobby": "^0.2.13",
|
|
81
81
|
"xvfb-ts": "^1.1.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|