silgi 0.20.14 → 0.20.16
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/_chunks/index.mjs +1 -1
- package/dist/cli/dev.mjs +2 -2
- package/dist/core/index.mjs +7 -2
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/dev.mjs
CHANGED
|
@@ -42,6 +42,7 @@ import 'pathe/utils';
|
|
|
42
42
|
async function reloadScan(silgi, path, _stats) {
|
|
43
43
|
const startTime = performance.now();
|
|
44
44
|
silgi.errors = [];
|
|
45
|
+
await silgi.callHook("reload:scan", path, _stats);
|
|
45
46
|
if (silgiCLICtx.tryUse()) {
|
|
46
47
|
silgiCLICtx.unset();
|
|
47
48
|
silgiCLICtx.set(silgi);
|
|
@@ -54,7 +55,6 @@ async function reloadScan(silgi, path, _stats) {
|
|
|
54
55
|
if (!hasError("Parser", silgi)) {
|
|
55
56
|
await writeScanFiles(silgi);
|
|
56
57
|
}
|
|
57
|
-
await silgi.callHook("reload:scan", path, _stats);
|
|
58
58
|
silgi.errors = [];
|
|
59
59
|
const endTime = performance.now();
|
|
60
60
|
const elapsedTime = Math.round(endTime - startTime);
|
|
@@ -93,7 +93,7 @@ const dev = defineCommand({
|
|
|
93
93
|
let watcher;
|
|
94
94
|
if (silgi.options.devServer.watch.length > 0) {
|
|
95
95
|
watcher = watch(silgi.options.devServer.watch, silgi.options.watchOptions);
|
|
96
|
-
watcher.on("add", (...data) => reloadScan(silgi, ...data)).on("change", (...data) => reloadScan(silgi, ...data));
|
|
96
|
+
watcher.on("add", async (...data) => await reloadScan(silgi, ...data)).on("change", async (...data) => await reloadScan(silgi, ...data));
|
|
97
97
|
}
|
|
98
98
|
const close = async () => {
|
|
99
99
|
await silgi.close();
|
package/dist/core/index.mjs
CHANGED
|
@@ -2,10 +2,11 @@ import { createConsola } from 'consola';
|
|
|
2
2
|
import defu, { defu as defu$1 } from 'defu';
|
|
3
3
|
import { createHooks } from 'hookable';
|
|
4
4
|
import { c as createRouteRules } from '../_chunks/routeRules.mjs';
|
|
5
|
-
import { getContext } from 'unctx';
|
|
5
|
+
import { getContext, useContext } from 'unctx';
|
|
6
6
|
import { Buffer } from 'node:buffer';
|
|
7
7
|
import { klona } from 'klona';
|
|
8
8
|
import { createStorage as createStorage$1, builtinDrivers, prefixStorage } from 'unstorage';
|
|
9
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
9
10
|
import 'ufo';
|
|
10
11
|
|
|
11
12
|
const silgiCtx = getContext("silgi");
|
|
@@ -716,7 +717,11 @@ function createShared(shared) {
|
|
|
716
717
|
return shared;
|
|
717
718
|
}
|
|
718
719
|
|
|
719
|
-
|
|
720
|
+
useContext("silgi-cli", {
|
|
721
|
+
asyncContext: true,
|
|
722
|
+
AsyncLocalStorage
|
|
723
|
+
});
|
|
724
|
+
const silgiCLICtx = getContext("silgi-cli");
|
|
720
725
|
function useSilgiCLI() {
|
|
721
726
|
const instance = silgiCLICtx.tryUse();
|
|
722
727
|
if (!instance) {
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED