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.
@@ -1,5 +1,5 @@
1
1
  import { silgiCLIIClose, useSilgiCLI } from "../../core/silgiApp.mjs";
2
- import { reloadScan } from "../core/devServer.mjs";
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 reloadScan(path, stats);
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
- const silgi = await createSilgiCLI({
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 reloadScan(path, _stats) {
4
+ async function watchFile(event, file, stats) {
5
5
  const silgi = useSilgiCLI();
6
- await silgi.callHook("reload:scan", path, _stats);
6
+ await silgi.callHook("watch:file", event, file, stats);
7
7
  }
8
8
 
9
9
  //#endregion
10
- export { reloadScan };
10
+ export { watchFile };
package/dist/package.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var name = "silgi";
3
3
  var type = "module";
4
- var version = "0.43.24";
4
+ var version = "0.43.26";
5
5
  var private$1 = false;
6
6
  var packageManager = "pnpm@10.12.4";
7
7
  var sideEffects = false;
@@ -20,7 +20,7 @@ interface SilgiCLIHooks extends SilgiHooks {
20
20
  * @returns Promise
21
21
  */
22
22
  "close": (silgi: SilgiCLI) => HookResult;
23
- "reload:scan": (path: string, stats?: Stats) => HookResult;
23
+ "watch:file": (event: string, file: string, stats?: Stats) => HookResult;
24
24
  // Kit
25
25
  /**
26
26
  * Allows extending compatibility checks.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.43.24",
4
+ "version": "0.43.26",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {