@sfmc-bds/cli 0.2.0-beta.7 → 0.2.0-beta.8
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/argv-parse.d.ts +0 -2
- package/dist/argv-parse.d.ts.map +1 -1
- package/dist/argv-parse.js +1 -5
- package/dist/argv-parse.js.map +2 -2
- package/dist/cli-gate.d.ts.map +1 -1
- package/dist/cli-gate.js +0 -2
- package/dist/cli-gate.js.map +2 -2
- package/dist/command-surface.d.ts +2 -12
- package/dist/command-surface.d.ts.map +1 -1
- package/dist/command-surface.js +2 -32
- package/dist/command-surface.js.map +2 -2
- package/dist/i18n/locales/en.d.ts +3 -25
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +3 -27
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +3 -27
- package/dist/i18n/locales/zh-CN.js.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +2 -2
- package/dist/main.js +3 -6
- package/dist/main.js.map +2 -2
- package/dist/module-commands.d.ts +5 -18
- package/dist/module-commands.d.ts.map +1 -1
- package/dist/module-commands.js +89 -87
- package/dist/module-commands.js.map +2 -2
- package/dist/module-pack-build.d.ts.map +1 -1
- package/dist/module-pack-build.js +4 -0
- package/dist/module-pack-build.js.map +2 -2
- package/dist/module-toggle.d.ts +33 -0
- package/dist/module-toggle.d.ts.map +1 -0
- package/dist/module-toggle.js +28 -0
- package/dist/module-toggle.js.map +7 -0
- package/dist/pack-lifecycle.d.ts.map +1 -1
- package/dist/pack-lifecycle.js +4 -0
- package/dist/pack-lifecycle.js.map +2 -2
- package/dist/remote-agent.js +5 -5
- package/dist/remote-agent.js.map +2 -2
- package/dist/repl.d.ts +0 -2
- package/dist/repl.d.ts.map +1 -1
- package/dist/repl.js +0 -9
- package/dist/repl.js.map +2 -2
- package/dist/runtime.d.ts +4 -13
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +15 -27
- package/dist/runtime.js.map +2 -2
- package/dist/services.d.ts +0 -2
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +0 -4
- package/dist/services.js.map +2 -2
- package/package.json +6 -6
- package/dist/module-publish.d.ts +0 -69
- package/dist/module-publish.d.ts.map +0 -1
- package/dist/module-publish.js +0 -478
- package/dist/module-publish.js.map +0 -7
- package/dist/module-watch.d.ts +0 -32
- package/dist/module-watch.d.ts.map +0 -1
- package/dist/module-watch.js +0 -171
- package/dist/module-watch.js.map +0 -7
package/dist/module-watch.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import process from "node:process";
|
|
4
|
-
import { c } from "./theme.js";
|
|
5
|
-
import { t } from "./i18n/index.js";
|
|
6
|
-
function resolveLocalModuleRoot(args) {
|
|
7
|
-
const raw = (args.from ?? "").trim();
|
|
8
|
-
if (!raw) return path.resolve(args.cwd);
|
|
9
|
-
if (raw === "local") return path.resolve(args.cwd);
|
|
10
|
-
if (raw.startsWith("local:")) {
|
|
11
|
-
const p = raw.slice("local:".length).trim();
|
|
12
|
-
if (!p) return path.resolve(args.cwd);
|
|
13
|
-
return path.isAbsolute(p) ? path.resolve(p) : path.resolve(args.cwd, p);
|
|
14
|
-
}
|
|
15
|
-
if (raw.startsWith("dir:")) {
|
|
16
|
-
const p = raw.slice("dir:".length).trim();
|
|
17
|
-
return path.isAbsolute(p) ? path.resolve(p) : path.resolve(args.cwd, p);
|
|
18
|
-
}
|
|
19
|
-
return path.resolve(args.cwd);
|
|
20
|
-
}
|
|
21
|
-
function startWatch(opts) {
|
|
22
|
-
const sapiDir = path.join(opts.moduleRoot, "sapi");
|
|
23
|
-
if (!fs.existsSync(sapiDir)) {
|
|
24
|
-
opts.log(c.red(t("watch.noSapiDir", { path: sapiDir })));
|
|
25
|
-
return { stop: () => {
|
|
26
|
-
} };
|
|
27
|
-
}
|
|
28
|
-
const srcDir = path.join(sapiDir, "src");
|
|
29
|
-
if (!fs.existsSync(srcDir)) {
|
|
30
|
-
opts.log(c.yellow(t("watch.noSapiSrc", { path: srcDir })));
|
|
31
|
-
}
|
|
32
|
-
let debounceTimer = null;
|
|
33
|
-
let pending = /* @__PURE__ */ new Set();
|
|
34
|
-
let running = false;
|
|
35
|
-
let stopped = false;
|
|
36
|
-
opts.log(c.bold(t("watch.banner", { path: opts.moduleRoot })));
|
|
37
|
-
opts.log(c.dim(t("watch.hint")));
|
|
38
|
-
const trigger = (kind, files) => {
|
|
39
|
-
if (stopped) return;
|
|
40
|
-
if (kind === "manifest" || kind === "tsconfig") {
|
|
41
|
-
opts.log(c.yellow(t("watch.manifestOrTsconfig", { kind, files: files.join(", ") })));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
for (const f of files) pending.add(f);
|
|
45
|
-
if (debounceTimer) clearTimeout(debounceTimer);
|
|
46
|
-
debounceTimer = setTimeout(() => {
|
|
47
|
-
void runOnce();
|
|
48
|
-
}, opts.debounceMs);
|
|
49
|
-
};
|
|
50
|
-
const runOnce = async () => {
|
|
51
|
-
if (running || stopped) return;
|
|
52
|
-
running = true;
|
|
53
|
-
const changed = [...pending];
|
|
54
|
-
pending = /* @__PURE__ */ new Set();
|
|
55
|
-
const t0 = Date.now();
|
|
56
|
-
opts.log(c.dim(t("watch.rebuild.start", { count: changed.length, files: changed.join(", ") })));
|
|
57
|
-
try {
|
|
58
|
-
const { cmdModuleReload } = await import("./module-pack-build.js");
|
|
59
|
-
const out = await cmdModuleReload(opts.noReload ? ["--build-only"] : []);
|
|
60
|
-
const ok = !out.startsWith(c.red(""));
|
|
61
|
-
const elapsed = Date.now() - t0;
|
|
62
|
-
if (ok) {
|
|
63
|
-
opts.log(c.green(t("watch.rebuild.ok", { ms: elapsed })));
|
|
64
|
-
if (!opts.noReload) {
|
|
65
|
-
opts.log(c.green(t("watch.reload.sent")));
|
|
66
|
-
} else {
|
|
67
|
-
opts.log(c.yellow(t("watch.reload.manualHint")));
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
opts.log(c.red(t("watch.rebuild.fail", { ms: elapsed, output: out.trim() })));
|
|
71
|
-
}
|
|
72
|
-
} catch (e) {
|
|
73
|
-
opts.log(c.red(t("watch.rebuild.error", { message: e.message })));
|
|
74
|
-
} finally {
|
|
75
|
-
running = false;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
void runOnce;
|
|
79
|
-
const watchSrc = (dir) => {
|
|
80
|
-
if (!fs.existsSync(dir)) return null;
|
|
81
|
-
try {
|
|
82
|
-
return fs.watch(
|
|
83
|
-
dir,
|
|
84
|
-
{ recursive: true, persistent: true },
|
|
85
|
-
(_event, filename) => {
|
|
86
|
-
if (!filename) return;
|
|
87
|
-
const rel = filename.toString();
|
|
88
|
-
if (rel.includes("node_modules") || rel.includes("dist") || rel.endsWith(".tgz")) return;
|
|
89
|
-
trigger("src", [rel]);
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
} catch (e) {
|
|
93
|
-
opts.log(c.yellow(t("watch.recursiveFallback", { message: e.message })));
|
|
94
|
-
return fs.watch(dir, { persistent: true }, (_event, filename) => {
|
|
95
|
-
if (!filename) return;
|
|
96
|
-
trigger("src", [filename.toString()]);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
const watchMeta = (file, kind) => {
|
|
101
|
-
if (!fs.existsSync(file)) return null;
|
|
102
|
-
return fs.watch(file, { persistent: true }, (event) => {
|
|
103
|
-
if (event === "change") trigger(kind, [path.basename(file)]);
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
const watchers = [];
|
|
107
|
-
const ws = watchSrc(srcDir);
|
|
108
|
-
if (ws) watchers.push(ws);
|
|
109
|
-
const wm = watchMeta(path.join(sapiDir, "manifest.json"), "manifest");
|
|
110
|
-
if (wm) watchers.push(wm);
|
|
111
|
-
const wt = watchMeta(path.join(sapiDir, "tsconfig.json"), "tsconfig");
|
|
112
|
-
if (wt) watchers.push(wt);
|
|
113
|
-
const stop = () => {
|
|
114
|
-
stopped = true;
|
|
115
|
-
if (debounceTimer) {
|
|
116
|
-
clearTimeout(debounceTimer);
|
|
117
|
-
debounceTimer = null;
|
|
118
|
-
}
|
|
119
|
-
for (const w of watchers) {
|
|
120
|
-
try {
|
|
121
|
-
w.close();
|
|
122
|
-
} catch {
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
opts.log(c.dim(t("watch.stopped")));
|
|
126
|
-
};
|
|
127
|
-
return { stop };
|
|
128
|
-
}
|
|
129
|
-
async function cmdModuleWatch(args) {
|
|
130
|
-
let fromRaw = null;
|
|
131
|
-
let noReload = false;
|
|
132
|
-
for (let i = 0; i < args.length; i++) {
|
|
133
|
-
const a = args[i];
|
|
134
|
-
if (a === "--from") {
|
|
135
|
-
fromRaw = args[++i] ?? null;
|
|
136
|
-
} else if (a?.startsWith("--from=")) {
|
|
137
|
-
fromRaw = a.slice("--from=".length);
|
|
138
|
-
} else if (a === "--no-reload") {
|
|
139
|
-
noReload = true;
|
|
140
|
-
} else if (a === "--help" || a === "-h") {
|
|
141
|
-
return c.dim(t("watch.usage"));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const moduleRoot = resolveLocalModuleRoot({ from: fromRaw, cwd: process.cwd() });
|
|
145
|
-
const log = (line) => {
|
|
146
|
-
process.stdout.write(line + "\n");
|
|
147
|
-
};
|
|
148
|
-
let stopRef = null;
|
|
149
|
-
const onSig = () => {
|
|
150
|
-
if (stopRef) stopRef();
|
|
151
|
-
process.exit(0);
|
|
152
|
-
};
|
|
153
|
-
process.once("SIGINT", onSig);
|
|
154
|
-
process.once("SIGTERM", onSig);
|
|
155
|
-
const { stop } = startWatch({
|
|
156
|
-
moduleRoot,
|
|
157
|
-
noReload,
|
|
158
|
-
debounceMs: 200,
|
|
159
|
-
log
|
|
160
|
-
});
|
|
161
|
-
stopRef = stop;
|
|
162
|
-
await new Promise(() => {
|
|
163
|
-
});
|
|
164
|
-
return "";
|
|
165
|
-
}
|
|
166
|
-
export {
|
|
167
|
-
cmdModuleWatch,
|
|
168
|
-
resolveLocalModuleRoot,
|
|
169
|
-
startWatch
|
|
170
|
-
};
|
|
171
|
-
//# sourceMappingURL=module-watch.js.map
|
package/dist/module-watch.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/module-watch.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * sfmc/src/module-watch.ts \u2014 `sfmc mod watch` \u5F15\u64CE\n *\n * \u76D1\u542C cwd/local \u6A21\u5757\u7684 sapi/src \u53D8\u66F4 \u2192 \u590D\u7528 cmdModuleReload \u7684 build/deploy/reload\n * \u8DEF\u5F84\uFF0C\u907F\u514D\u5728\u6838\u5FC3 switch/if \u94FE\u4E0A\u518D\u6253\u6D1E\uFF08OCP/DRY\uFF09\u3002\n *\n * \u89E6\u53D1\u8BED\u4E49\uFF1A\n * - sapi/src/** \u53D8\u66F4 \u2192 rebuild + deploy + reload\n * - sapi/manifest.json \u53D8\u66F4 \u2192 \u4EC5\u63D0\u793A\u300CSAPI \u542F\u52A8\u671F\u7F13\u5B58\uFF0C\u8BF7\u91CD\u542F BDS \u8FDB\u7A0B\u300D\uFF0C\u4E0D\u81EA\u52A8\u70ED\u66F4\n * - sapi/tsconfig.json \u53D8\u66F4 \u2192 \u540C manifest\uFF0C\u63D0\u793A\u91CD\u542F\n * - \u5176\u4ED6\uFF08configs/\u3001SDK \u5185\u90E8\u3001node_modules\u3001dist\u3001*.tgz\uFF09\u2192 \u5FFD\u7565\n *\n * \u8FDB\u7A0B\u63A2\u6D4B\u590D\u7528 sfmc-cli \u7EDF\u4E00\u63A5\u53E3\uFF1AqueryServicesRuntime + probeBdsStatus\uFF1B\n * \u5916\u90E8 BDS\uFF08state === \"external\"\uFF09\u964D\u7EA7 build+deploy \u5E76\u63D0\u793A\u300C\u8BF7\u5728 BDS/\u6E38\u620F\u5185\u8F93\u5165 reload\u300D\u3002\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { c } from \"./theme.js\";\nimport { t } from \"./i18n/index.js\";\n\n/** watch \u76D1\u542C\u914D\u7F6E\u3002 */\nexport interface WatchOptions {\n /** \u6A21\u5757\u4ED3\u6839\uFF08cwd/local \u89E3\u6790\u51FA\u7684\u76EE\u5F55\uFF0C\u542B sapi/\uFF09\u3002 */\n moduleRoot: string;\n /** \u53EA build+deploy\uFF0C\u4E0D\u5411 BDS \u53D1 reload\u3002 */\n noReload: boolean;\n /** \u9632\u6296\u6BEB\u79D2\u6570\u3002 */\n debounceMs: number;\n /** \u7EC8\u7AEF\u6253\u5370\u56DE\u8C03\uFF08\u88AB watch \u547D\u4EE4\u81EA\u5DF1\u63A5\u4F4F\uFF1B\u8FD9\u91CC\u4EC5\u505A\u8F7B wrap\uFF09\u3002 */\n log: (line: string) => void;\n}\n\n/** \u4E00\u6B21 build+deploy(+reload) \u5468\u671F\u3002 */\nexport interface WatchRunResult {\n ok: boolean;\n rebuilt: boolean;\n reloadSent: boolean;\n /** \u82E5\u88AB\u63D0\u793A\u300C\u8BF7\u91CD\u542F\u300D\u5219\u4E3A true\u3002 */\n warnedRestart: boolean;\n message: string;\n}\n\n/** \u89E3\u6790 `--from local[:path]` \u89C4\u5219\uFF08\u4E0E mod install \u4E00\u81F4\uFF1B\u672C\u8F6E\u590D\u7528 watch \u5355\u4E00\u8DEF\u5F84\uFF09\u3002 */\nexport function resolveLocalModuleRoot(args: { from?: string | null; cwd: string }): string {\n const raw = (args.from ?? \"\").trim();\n if (!raw) return path.resolve(args.cwd);\n /* `--from local[:<path>]` */\n if (raw === \"local\") return path.resolve(args.cwd);\n if (raw.startsWith(\"local:\")) {\n const p = raw.slice(\"local:\".length).trim();\n if (!p) return path.resolve(args.cwd);\n return path.isAbsolute(p) ? path.resolve(p) : path.resolve(args.cwd, p);\n }\n /* `--from dir:<path>` \u517C\u5BB9\u65E7\u5199\u6CD5\uFF08\u6682\u4E0D\u5F3A\u5236\uFF1B\u672C\u671F watch \u4E0D\u5F3A\u5236\u94FE\u63A5 dir\uFF09\u3002 */\n if (raw.startsWith(\"dir:\")) {\n const p = raw.slice(\"dir:\".length).trim();\n return path.isAbsolute(p) ? path.resolve(p) : path.resolve(args.cwd, p);\n }\n return path.resolve(args.cwd);\n}\n\n/** \u542F\u52A8 chokidar \u98CE\u683C\u7684 fs.watch\uFF1B\u672C\u8F6E\u76F4\u63A5\u7528 node:fs.watch\uFF08\u8F7B\u91CF\u3001\u96F6\u4F9D\u8D56\uFF09\u3002 */\nexport function startWatch(opts: WatchOptions): { stop: () => void } {\n const sapiDir = path.join(opts.moduleRoot, \"sapi\");\n if (!fs.existsSync(sapiDir)) {\n opts.log(c.red(t(\"watch.noSapiDir\", { path: sapiDir })));\n return { stop: () => {} };\n }\n const srcDir = path.join(sapiDir, \"src\");\n if (!fs.existsSync(srcDir)) {\n opts.log(c.yellow(t(\"watch.noSapiSrc\", { path: srcDir })));\n }\n\n let debounceTimer: NodeJS.Timeout | null = null;\n let pending: Set<string> = new Set();\n let running = false;\n let stopped = false;\n\n /* \u542F\u52A8 banner */\n opts.log(c.bold(t(\"watch.banner\", { path: opts.moduleRoot })));\n opts.log(c.dim(t(\"watch.hint\")));\n\n const trigger = (kind: \"src\" | \"manifest\" | \"tsconfig\", files: string[]) => {\n if (stopped) return;\n if (kind === \"manifest\" || kind === \"tsconfig\") {\n opts.log(c.yellow(t(\"watch.manifestOrTsconfig\", { kind, files: files.join(\", \") })));\n return;\n }\n /* src \u53D8\u66F4\uFF1A\u5408\u5E76\u5230 pending\uFF0C\u7B49\u5F85 debounce \u89E6\u53D1\u4E00\u6B21 rebuild\u3002 */\n for (const f of files) pending.add(f);\n if (debounceTimer) clearTimeout(debounceTimer);\n debounceTimer = setTimeout(() => {\n void runOnce();\n }, opts.debounceMs);\n };\n\n const runOnce = async (): Promise<void> => {\n if (running || stopped) return;\n running = true;\n const changed = [...pending];\n pending = new Set();\n const t0 = Date.now();\n opts.log(c.dim(t(\"watch.rebuild.start\", { count: changed.length, files: changed.join(\", \") })));\n try {\n const { cmdModuleReload } = await import(\"./module-pack-build.js\");\n const out = await cmdModuleReload(opts.noReload ? [\"--build-only\"] : []);\n const ok = !out.startsWith(c.red(\"\"));\n const elapsed = Date.now() - t0;\n if (ok) {\n opts.log(c.green(t(\"watch.rebuild.ok\", { ms: elapsed })));\n if (!opts.noReload) {\n opts.log(c.green(t(\"watch.reload.sent\")));\n } else {\n opts.log(c.yellow(t(\"watch.reload.manualHint\")));\n }\n } else {\n opts.log(c.red(t(\"watch.rebuild.fail\", { ms: elapsed, output: out.trim() })));\n }\n } catch (e) {\n opts.log(c.red(t(\"watch.rebuild.error\", { message: (e as Error).message })));\n } finally {\n running = false;\n }\n };\n\n /**\n * \u4E00\u6B21\u6027 runOnce + send reload\uFF0C\u517C\u5BB9 `sfmc mod test`/wizard \u672A\u6765\u590D\u7528\uFF1A\n * \u672C\u671F\u4E0D\u5BFC\u51FA\uFF0C\u4F46\u4FDD\u7559\u6269\u5C55\u4F4D\u3002\n */\n void runOnce;\n\n /* \u76D1\u542C sapi/src \u6811\u3002 */\n const watchSrc = (dir: string): fs.FSWatcher | null => {\n if (!fs.existsSync(dir)) return null;\n try {\n return fs.watch(\n dir,\n { recursive: true, persistent: true },\n (_event, filename) => {\n if (!filename) return;\n const rel = filename.toString();\n /* \u8FC7\u6EE4\uFF1Adist / *.tgz / \u4E34\u65F6\u6587\u4EF6 */\n if (rel.includes(\"node_modules\") || rel.includes(\"dist\") || rel.endsWith(\".tgz\")) return;\n trigger(\"src\", [rel]);\n }\n );\n } catch (e) {\n /* Windows \u67D0\u4E9B\u957F\u8DEF\u5F84/\u6743\u9650\u573A\u666F\u4E0B recursive \u4E0D\u652F\u6301\uFF1B\u964D\u7EA7\u5230\u975E recursive\u3002 */\n opts.log(c.yellow(t(\"watch.recursiveFallback\", { message: (e as Error).message })));\n return fs.watch(dir, { persistent: true }, (_event, filename) => {\n if (!filename) return;\n trigger(\"src\", [filename.toString()]);\n });\n }\n };\n\n /* \u76D1\u542C manifest / tsconfig\uFF1A\u5355\u72EC watcher\uFF0C\u4E0D\u89E6\u53D1 build\u3002 */\n const watchMeta = (file: string, kind: \"manifest\" | \"tsconfig\"): fs.FSWatcher | null => {\n if (!fs.existsSync(file)) return null;\n return fs.watch(file, { persistent: true }, (event) => {\n if (event === \"change\") trigger(kind, [path.basename(file)]);\n });\n };\n\n const watchers: fs.FSWatcher[] = [];\n const ws = watchSrc(srcDir);\n if (ws) watchers.push(ws);\n const wm = watchMeta(path.join(sapiDir, \"manifest.json\"), \"manifest\");\n if (wm) watchers.push(wm);\n const wt = watchMeta(path.join(sapiDir, \"tsconfig.json\"), \"tsconfig\");\n if (wt) watchers.push(wt);\n\n const stop = (): void => {\n stopped = true;\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n debounceTimer = null;\n }\n for (const w of watchers) {\n try {\n w.close();\n } catch {\n /* ignore */\n }\n }\n opts.log(c.dim(t(\"watch.stopped\")));\n };\n\n return { stop };\n}\n\n/** CLI \u5165\u53E3\uFF1A`sfmc mod watch [--from local[:path]] [--no-reload]` */\nexport async function cmdModuleWatch(args: string[]): Promise<string> {\n let fromRaw: string | null = null;\n let noReload = false;\n for (let i = 0; i < args.length; i++) {\n const a = args[i];\n if (a === \"--from\") {\n fromRaw = args[++i] ?? null;\n } else if (a?.startsWith(\"--from=\")) {\n fromRaw = a.slice(\"--from=\".length);\n } else if (a === \"--no-reload\") {\n noReload = true;\n } else if (a === \"--help\" || a === \"-h\") {\n return c.dim(t(\"watch.usage\"));\n }\n }\n const moduleRoot = resolveLocalModuleRoot({ from: fromRaw, cwd: process.cwd() });\n\n /* \u96C6\u4E2D\u5230 stdout\uFF1A\u547D\u4EE4\u884C\u573A\u666F\u4E0B\u4E0D\u9700\u8981 sfmc \u65E5\u5FD7\u7BA1\u9053\u7684 stamp\u3002 */\n const log = (line: string): void => {\n process.stdout.write(line + \"\\n\");\n };\n\n /* Ctrl+C \u2192 stop watchers\uFF0C\u518D\u9000\u51FA\u3002 */\n let stopRef: (() => void) | null = null;\n const onSig = (): void => {\n if (stopRef) stopRef();\n process.exit(0);\n };\n process.once(\"SIGINT\", onSig);\n process.once(\"SIGTERM\", onSig);\n\n const { stop } = startWatch({\n moduleRoot,\n noReload,\n debounceMs: 200,\n log,\n });\n stopRef = stop;\n\n /* \u4FDD\u6301\u8FDB\u7A0B\u4E0D\u9000\u51FA\uFF1A\u7528\u4E00\u4E2A\u6C38\u9A7B Promise\u3002 */\n await new Promise<void>(() => {\n /* never resolves; SIGINT/SIGTERM \u89E6\u53D1 exit\u3002 */\n });\n return \"\";\n}\n"],
|
|
5
|
-
"mappings": "AAeA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,SAAS,SAAS;AAClB,SAAS,SAAS;AAyBX,SAAS,uBAAuB,MAAqD;AAC1F,QAAM,OAAO,KAAK,QAAQ,IAAI,KAAK;AACnC,MAAI,CAAC,IAAK,QAAO,KAAK,QAAQ,KAAK,GAAG;AAEtC,MAAI,QAAQ,QAAS,QAAO,KAAK,QAAQ,KAAK,GAAG;AACjD,MAAI,IAAI,WAAW,QAAQ,GAAG;AAC5B,UAAM,IAAI,IAAI,MAAM,SAAS,MAAM,EAAE,KAAK;AAC1C,QAAI,CAAC,EAAG,QAAO,KAAK,QAAQ,KAAK,GAAG;AACpC,WAAO,KAAK,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,KAAK,QAAQ,KAAK,KAAK,CAAC;AAAA,EACxE;AAEA,MAAI,IAAI,WAAW,MAAM,GAAG;AAC1B,UAAM,IAAI,IAAI,MAAM,OAAO,MAAM,EAAE,KAAK;AACxC,WAAO,KAAK,WAAW,CAA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