silgi 0.43.24 → 0.43.26
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/build/dev.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { silgiCLIIClose, useSilgiCLI } from "../../core/silgiApp.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { watchFile } from "../core/devServer.mjs";
|
|
3
3
|
import { prepareBuild } from "./prepare.mjs";
|
|
4
4
|
import { watch } from "chokidar";
|
|
5
5
|
import consola from "consola";
|
|
@@ -69,7 +69,7 @@ async function watchDev() {
|
|
|
69
69
|
if (!watchReloadEvents.has(event)) return;
|
|
70
70
|
changedFiles.add(path);
|
|
71
71
|
try {
|
|
72
|
-
await
|
|
72
|
+
await watchFile(event, path, stats);
|
|
73
73
|
await reload();
|
|
74
74
|
} catch (error) {
|
|
75
75
|
consola.withTag("silgi").error(error);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createSilgiCLI } from "../core/silgi.mjs";
|
|
2
2
|
import { build } from "./build.mjs";
|
|
3
|
+
import { tryUseSilgiCLI } from "silgi";
|
|
3
4
|
|
|
4
5
|
//#region src/cli/build/prepare.ts
|
|
5
6
|
async function prepareBuild(config) {
|
|
6
|
-
|
|
7
|
+
let silgi = null;
|
|
8
|
+
if (config?.dev) silgi = tryUseSilgiCLI();
|
|
9
|
+
if (!silgi) silgi = await createSilgiCLI({
|
|
7
10
|
commandType: config?.commandType || "prepare",
|
|
8
11
|
...config
|
|
9
12
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useSilgiCLI } from "silgi";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/core/devServer.ts
|
|
4
|
-
async function
|
|
4
|
+
async function watchFile(event, file, stats) {
|
|
5
5
|
const silgi = useSilgiCLI();
|
|
6
|
-
await silgi.callHook("
|
|
6
|
+
await silgi.callHook("watch:file", event, file, stats);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
|
-
export {
|
|
10
|
+
export { watchFile };
|
package/dist/package.mjs
CHANGED
|
@@ -20,7 +20,7 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
20
20
|
* @returns Promise
|
|
21
21
|
*/
|
|
22
22
|
"close": (silgi: SilgiCLI) => HookResult;
|
|
23
|
-
"
|
|
23
|
+
"watch:file": (event: string, file: string, stats?: Stats) => HookResult;
|
|
24
24
|
// Kit
|
|
25
25
|
/**
|
|
26
26
|
* Allows extending compatibility checks.
|