silgi 0.20.13 → 0.20.15
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 -1
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- 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);
|
|
@@ -92,7 +93,7 @@ const dev = defineCommand({
|
|
|
92
93
|
let watcher;
|
|
93
94
|
if (silgi.options.devServer.watch.length > 0) {
|
|
94
95
|
watcher = watch(silgi.options.devServer.watch, silgi.options.watchOptions);
|
|
95
|
-
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));
|
|
96
97
|
}
|
|
97
98
|
const close = async () => {
|
|
98
99
|
await silgi.close();
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
|
|
|
9
9
|
import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, RouteRules as RouteRules$1, ModuleMeta as ModuleMeta$1, SilgiRouteRules as SilgiRouteRules$1, DotenvOptions as DotenvOptions$1, EnvOptions as EnvOptions$1, SilgiRuntimeConfig as SilgiRuntimeConfig$1, ServiceParseModule as ServiceParseModule$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
|
|
10
10
|
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
11
11
|
import { Defu } from 'defu';
|
|
12
|
+
import { Stats } from 'node:fs';
|
|
12
13
|
import { Unimport } from 'unimport';
|
|
13
14
|
import { Storage, TransactionOptions, BuiltinDriverName, StorageValue } from 'unstorage';
|
|
14
15
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
@@ -233,6 +234,7 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
233
234
|
* @returns Promise
|
|
234
235
|
*/
|
|
235
236
|
'close': (silgi: SilgiCLI) => HookResult;
|
|
237
|
+
'reload:scan': (path: string, stats?: Stats) => HookResult;
|
|
236
238
|
'prepare:createCoreFramework': (options: Pick<ImportItem, 'customImports' | 'importItems'> & {
|
|
237
239
|
functions?: {
|
|
238
240
|
name: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
|
|
|
9
9
|
import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, RouteRules as RouteRules$1, ModuleMeta as ModuleMeta$1, SilgiRouteRules as SilgiRouteRules$1, DotenvOptions as DotenvOptions$1, EnvOptions as EnvOptions$1, SilgiRuntimeConfig as SilgiRuntimeConfig$1, ServiceParseModule as ServiceParseModule$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
|
|
10
10
|
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
11
11
|
import { Defu } from 'defu';
|
|
12
|
+
import { Stats } from 'node:fs';
|
|
12
13
|
import { Unimport } from 'unimport';
|
|
13
14
|
import { Storage, TransactionOptions, BuiltinDriverName, StorageValue } from 'unstorage';
|
|
14
15
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
@@ -233,6 +234,7 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
233
234
|
* @returns Promise
|
|
234
235
|
*/
|
|
235
236
|
'close': (silgi: SilgiCLI) => HookResult;
|
|
237
|
+
'reload:scan': (path: string, stats?: Stats) => HookResult;
|
|
236
238
|
'prepare:createCoreFramework': (options: Pick<ImportItem, 'customImports' | 'importItems'> & {
|
|
237
239
|
functions?: {
|
|
238
240
|
name: string;
|