zotero-plugin-scaffold 0.9.3 → 0.9.4
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.d.ts +5 -7
- package/dist/cli.js +7 -11
- package/dist/index.d.ts +4 -16
- package/dist/index.js +1 -2
- package/dist/shared/{scaffold-base-D5fAvZGP.d.mts → scaffold-base-BzOO6CRI.d.mts} +1 -3
- package/dist/shared/{scaffold-index-DUirnfLl.d.mts → scaffold-index-D-5PZpaP.d.mts} +9 -14
- package/dist/shared/{scaffold-replace-Dn0wBA9W.mjs → scaffold-replace-CI5Lu8Fb.mjs} +3 -6
- package/dist/shared/{scaffold-src-Bv9sPw2S.mjs → scaffold-src-CZoKPRL3.mjs} +470 -636
- package/dist/vendor.d.ts +4 -6
- package/dist/vendor.js +1 -1
- package/package.json +21 -25
package/dist/cli.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
//#region src/cli.d.ts
|
|
1
|
+
import { t as Base } from "./shared/scaffold-base-BzOO6CRI.mjs";
|
|
2
|
+
import { n as OverrideConfig, t as Context } from "./shared/scaffold-index-D-5PZpaP.mjs";
|
|
4
3
|
type Constructor<T> = new (ctx: Context) => T;
|
|
5
|
-
declare function runCommand<T extends Base>(CommandClass: Constructor<T>, config: OverrideConfig): Promise<void>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { mainWithErrorHandler as default, runCommand };
|
|
4
|
+
export declare function runCommand<T extends Base>(CommandClass: Constructor<T>, config: OverrideConfig): Promise<void>;
|
|
5
|
+
export default function mainWithErrorHandler(): Promise<void>;
|
|
6
|
+
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as Release, i as ExitSignals, n as Test, o as Build, r as Serve, t as Config } from "./shared/scaffold-src-CZoKPRL3.mjs";
|
|
2
|
+
import { l as logger } from "./shared/scaffold-replace-CI5Lu8Fb.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
import { pathExists } from "fs-extra";
|
|
7
7
|
import tinyUpdateNotifier from "tiny-update-notifier";
|
|
8
|
-
|
|
8
|
+
// package.json
|
|
9
9
|
var name = "zotero-plugin-scaffold";
|
|
10
|
-
var version = "0.9.
|
|
11
|
-
|
|
12
|
-
//#region src/utils/gitignore.ts
|
|
10
|
+
var version = "0.9.4";
|
|
11
|
+
// src/utils/gitignore.ts
|
|
13
12
|
async function checkGitIgnore() {
|
|
14
13
|
if (!pathExists(".git")) return;
|
|
15
14
|
if (!pathExists(".gitignore")) {
|
|
@@ -24,8 +23,7 @@ async function checkGitIgnore() {
|
|
|
24
23
|
].filter((ignore) => !contents.match(ignore));
|
|
25
24
|
if (miss.length !== 0) logger.warn(`We recommend adding the following to your .gitignore file: ${miss.join(", ")}`);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
//#region src/utils/updater.ts
|
|
26
|
+
// src/utils/updater.ts
|
|
29
27
|
function updateNotifier(name, version) {
|
|
30
28
|
tinyUpdateNotifier({ pkg: {
|
|
31
29
|
name,
|
|
@@ -42,8 +40,7 @@ function updateNotifier(name, version) {
|
|
|
42
40
|
}
|
|
43
41
|
}).catch();
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
//#region src/cli.ts
|
|
43
|
+
// src/cli.ts
|
|
47
44
|
async function main() {
|
|
48
45
|
updateNotifier(name, version);
|
|
49
46
|
process.env.NODE_ENV ??= "development";
|
|
@@ -96,5 +93,4 @@ function onError(err) {
|
|
|
96
93
|
if (err.output) logger.log(err.output.stderr);
|
|
97
94
|
process.exit(1);
|
|
98
95
|
}
|
|
99
|
-
//#endregion
|
|
100
96
|
export { mainWithErrorHandler as default, runCommand };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { n as OverrideConfig, r as UserConfig, t as Context } from "./shared/scaffold-index-
|
|
2
|
-
import { t as Base } from "./shared/scaffold-base-
|
|
3
|
-
//#region src/config.d.ts
|
|
1
|
+
import { n as OverrideConfig, r as UserConfig, t as Context } from "./shared/scaffold-index-D-5PZpaP.mjs";
|
|
2
|
+
import { t as Base } from "./shared/scaffold-base-BzOO6CRI.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* Helper for user define configuration.
|
|
6
5
|
*/
|
|
7
|
-
declare function defineConfig(userConfig: UserConfig): UserConfig;
|
|
6
|
+
export declare function defineConfig(userConfig: UserConfig): UserConfig;
|
|
8
7
|
/**
|
|
9
8
|
* Loads config
|
|
10
9
|
* @param [overrides] Highest Priority Configuration.
|
|
11
10
|
* @returns Config with userDefined and defaultConfig merged.
|
|
12
11
|
*/
|
|
13
12
|
declare function loadConfig(overrides?: OverrideConfig): Promise<Context>;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/core/builder/index.d.ts
|
|
16
13
|
declare class Build extends Base {
|
|
17
14
|
private buildTime;
|
|
18
15
|
constructor(ctx: Context);
|
|
@@ -25,8 +22,6 @@ declare class Build extends Base {
|
|
|
25
22
|
buildInProduction(): Promise<void>;
|
|
26
23
|
exit(): void;
|
|
27
24
|
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/core/releaser/index.d.ts
|
|
30
25
|
declare class Release extends Base {
|
|
31
26
|
constructor(ctx: Context);
|
|
32
27
|
/**
|
|
@@ -42,8 +37,6 @@ declare class Release extends Base {
|
|
|
42
37
|
exit(): void;
|
|
43
38
|
get resolvedCommitMessage(): string;
|
|
44
39
|
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/core/server.d.ts
|
|
47
40
|
declare class Serve extends Base {
|
|
48
41
|
private builder;
|
|
49
42
|
private runner?;
|
|
@@ -61,8 +54,6 @@ declare class Serve extends Base {
|
|
|
61
54
|
get profilePath(): string | undefined;
|
|
62
55
|
get dataDir(): string | undefined;
|
|
63
56
|
}
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/core/tester/index.d.ts
|
|
66
57
|
declare class Test extends Base {
|
|
67
58
|
private builder;
|
|
68
59
|
private zotero?;
|
|
@@ -77,11 +68,8 @@ declare class Test extends Base {
|
|
|
77
68
|
private get zoteroBinPath();
|
|
78
69
|
private get prefs();
|
|
79
70
|
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/index.d.ts
|
|
82
71
|
declare const Config: {
|
|
83
72
|
defineConfig: typeof defineConfig;
|
|
84
73
|
loadConfig: typeof loadConfig;
|
|
85
74
|
};
|
|
86
|
-
|
|
87
|
-
export { Build, Config, Release, Serve, Test, defineConfig };
|
|
75
|
+
export { Build, Config, Release, Serve, Test };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Build, Config, Release, Serve, Test, defineConfig };
|
|
1
|
+
export { o as Build, t as Config, a as Release, r as Serve, n as Test, s as defineConfig } from "./shared/scaffold-src-CZoKPRL3.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { i as Logger, t as Context } from "./scaffold-index-
|
|
2
|
-
//#region src/core/base.d.ts
|
|
1
|
+
import { i as Logger, t as Context } from "./scaffold-index-D-5PZpaP.mjs";
|
|
3
2
|
declare abstract class Base {
|
|
4
3
|
ctx: Context;
|
|
5
4
|
constructor(ctx: Context);
|
|
@@ -7,5 +6,4 @@ declare abstract class Base {
|
|
|
7
6
|
abstract exit(): void;
|
|
8
7
|
get logger(): Logger;
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
9
|
export { Base as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Hookable } from "hookable";
|
|
2
2
|
import { BuildOptions } from "esbuild";
|
|
3
3
|
import { VersionBumpRelease } from "bumpp";
|
|
4
|
-
//#region src/utils/logger.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Log level enumeration
|
|
7
6
|
*/
|
|
@@ -49,8 +48,6 @@ declare class Logger {
|
|
|
49
48
|
clear(): void;
|
|
50
49
|
newLine(): void;
|
|
51
50
|
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region node_modules/.pnpm/changelogen@0.6.2/node_modules/changelogen/dist/index.d.mts
|
|
54
51
|
interface GitCommitAuthor {
|
|
55
52
|
name: string;
|
|
56
53
|
email: string;
|
|
@@ -73,8 +70,6 @@ interface GitCommit extends RawGitCommit {
|
|
|
73
70
|
authors: GitCommitAuthor[];
|
|
74
71
|
isBreaking: boolean;
|
|
75
72
|
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/types/manifest.d.ts
|
|
78
73
|
interface Manifest {
|
|
79
74
|
[key: string]: any;
|
|
80
75
|
manifest_version: number;
|
|
@@ -93,8 +88,6 @@ interface Manifest {
|
|
|
93
88
|
};
|
|
94
89
|
};
|
|
95
90
|
}
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/types/update-json.d.ts
|
|
98
91
|
/**
|
|
99
92
|
* Update json
|
|
100
93
|
* @see https://extensionworkshop.com/documentation/manage/updating-your-extension/
|
|
@@ -126,8 +119,6 @@ interface UpdateJSON {
|
|
|
126
119
|
};
|
|
127
120
|
};
|
|
128
121
|
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/types/config.d.ts
|
|
131
122
|
interface Config {
|
|
132
123
|
/**
|
|
133
124
|
* Source root directory or directories for the plugin.
|
|
@@ -749,10 +740,19 @@ interface ReleaseConfig {
|
|
|
749
740
|
*
|
|
750
741
|
* This is the tagName of the release when the value is a string.
|
|
751
742
|
*
|
|
743
|
+
* The assets of this release are replaced on every release, so it must stay
|
|
744
|
+
* mutable: if the repository enables immutable releases, create this release
|
|
745
|
+
* before enabling immutability, or set this option to `false` and host
|
|
746
|
+
* update.json yourself.
|
|
747
|
+
*
|
|
752
748
|
* 将 update.json 上传到指定的 GitHub release。
|
|
753
749
|
*
|
|
754
750
|
* 当值为字符串时,其为 release 的tagName。
|
|
755
751
|
*
|
|
752
|
+
* 该 release 的 asset 会在每次发布时被替换,因此它必须保持可变:如果仓库启用了
|
|
753
|
+
* 不可变 release,请在启用前创建该 release,或者将此项设为 `false` 并自行托管
|
|
754
|
+
* update.json。
|
|
755
|
+
*
|
|
756
756
|
* @default "release"
|
|
757
757
|
*/
|
|
758
758
|
updater: string | false;
|
|
@@ -875,11 +875,7 @@ interface TestHooks {
|
|
|
875
875
|
"test:exit": (ctx: Context) => void;
|
|
876
876
|
}
|
|
877
877
|
interface Hooks extends BuildHooks, ServeHooks, ReleaseHooks, TestHooks {}
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region src/types/utils.d.ts
|
|
880
878
|
type RecursivePartial<T> = { [P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> : T[P]; };
|
|
881
|
-
//#endregion
|
|
882
|
-
//#region src/types/index.d.ts
|
|
883
879
|
/**
|
|
884
880
|
* User config
|
|
885
881
|
*/
|
|
@@ -904,5 +900,4 @@ interface TemplateData {
|
|
|
904
900
|
xpiName: string;
|
|
905
901
|
buildTime: string;
|
|
906
902
|
}
|
|
907
|
-
//#endregion
|
|
908
903
|
export { Logger as i, OverrideConfig as n, UserConfig as r, Context as t };
|
|
@@ -5,7 +5,7 @@ import { styleText } from "node:util";
|
|
|
5
5
|
import { isDebug } from "std-env";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
7
|
import { readFile, writeFile } from "node:fs/promises";
|
|
8
|
-
|
|
8
|
+
// src/utils/logger.ts
|
|
9
9
|
/**
|
|
10
10
|
* Log level enumeration
|
|
11
11
|
*/
|
|
@@ -166,8 +166,7 @@ const logger = class Logger {
|
|
|
166
166
|
console.log();
|
|
167
167
|
}
|
|
168
168
|
}.getInstance();
|
|
169
|
-
|
|
170
|
-
//#region src/utils/string.ts
|
|
169
|
+
// src/utils/string.ts
|
|
171
170
|
function dateFormat(fmt, date) {
|
|
172
171
|
let ret;
|
|
173
172
|
const opt = {
|
|
@@ -211,8 +210,7 @@ function parseRepoUrl(url) {
|
|
|
211
210
|
repo
|
|
212
211
|
};
|
|
213
212
|
}
|
|
214
|
-
|
|
215
|
-
//#region src/core/builder/replace.ts
|
|
213
|
+
// src/core/builder/replace.ts
|
|
216
214
|
function replace(contents, from, to) {
|
|
217
215
|
const froms = Array.isArray(from) ? from : [from];
|
|
218
216
|
const tos = Array.isArray(to) ? to : Array.from({ length: froms.length }, () => to);
|
|
@@ -236,5 +234,4 @@ async function replaceDefine(dist, define) {
|
|
|
236
234
|
to: [...replaceMap.values()]
|
|
237
235
|
});
|
|
238
236
|
}
|
|
239
|
-
//#endregion
|
|
240
237
|
export { parseRepoUrl as a, LOG_LEVEL as c, dateFormat as i, logger as l, replaceDefine as n, template as o, replaceInFile as r, toArray as s, replace as t };
|