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.
@@ -1,4 +1,4 @@
1
- const version = "0.20.14";
1
+ const version = "0.20.16";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
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();
@@ -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
- const silgiCLICtx = getContext("SilgiCLI");
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) {
@@ -1,4 +1,4 @@
1
- const version = "0.20.14";
1
+ const version = "0.20.16";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.20.14";
1
+ const version = "0.20.16";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.20.14",
4
+ "version": "0.20.16",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {