silgi 0.20.12 → 0.20.14
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 +1 -0
- package/dist/kit/index.d.mts +5 -4
- package/dist/kit/index.d.ts +5 -4
- 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
|
@@ -54,6 +54,7 @@ async function reloadScan(silgi, path, _stats) {
|
|
|
54
54
|
if (!hasError("Parser", silgi)) {
|
|
55
55
|
await writeScanFiles(silgi);
|
|
56
56
|
}
|
|
57
|
+
await silgi.callHook("reload:scan", path, _stats);
|
|
57
58
|
silgi.errors = [];
|
|
58
59
|
const endTime = performance.now();
|
|
59
60
|
const elapsedTime = Math.round(endTime - startTime);
|
package/dist/kit/index.d.mts
CHANGED
|
@@ -2,8 +2,7 @@ import { SilgiCLI, ModuleOptionsCustom, ModuleDefinition, SilgiModule, ServicePa
|
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
3
|
import * as consola from 'consola';
|
|
4
4
|
import { ConsolaOptions } from 'consola';
|
|
5
|
-
import
|
|
6
|
-
import { IncomingMessage } from 'node:http';
|
|
5
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
6
|
|
|
8
7
|
declare function hasError(type: SilgiCLI['errors'][0]['type'], silgi?: SilgiCLI): boolean;
|
|
9
8
|
|
|
@@ -122,8 +121,10 @@ declare function addTemplate<T>(_template: SilgiTemplate<T> | string): ResolvedS
|
|
|
122
121
|
*/
|
|
123
122
|
declare function normalizeTemplate<T>(template: SilgiTemplate<T> | string, buildDir?: string): ResolvedSilgiTemplate<T>;
|
|
124
123
|
|
|
125
|
-
declare function useRequest(event: SilgiEvents): IncomingMessage
|
|
126
|
-
|
|
124
|
+
declare function useRequest<T extends IncomingMessage>(event: SilgiEvents): T | (IncomingMessage & {
|
|
125
|
+
originalUrl?: string;
|
|
126
|
+
});
|
|
127
|
+
declare function useResponse<T extends ServerResponse>(event: SilgiEvents): ServerResponse<IncomingMessage>;
|
|
127
128
|
declare function getIpAddress(event: SilgiEvents): string | false;
|
|
128
129
|
/**
|
|
129
130
|
* Extract the client's IP address from request headers with high accuracy
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { SilgiCLI, ModuleOptionsCustom, ModuleDefinition, SilgiModule, ServicePa
|
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
3
|
import * as consola from 'consola';
|
|
4
4
|
import { ConsolaOptions } from 'consola';
|
|
5
|
-
import
|
|
6
|
-
import { IncomingMessage } from 'node:http';
|
|
5
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
6
|
|
|
8
7
|
declare function hasError(type: SilgiCLI['errors'][0]['type'], silgi?: SilgiCLI): boolean;
|
|
9
8
|
|
|
@@ -122,8 +121,10 @@ declare function addTemplate<T>(_template: SilgiTemplate<T> | string): ResolvedS
|
|
|
122
121
|
*/
|
|
123
122
|
declare function normalizeTemplate<T>(template: SilgiTemplate<T> | string, buildDir?: string): ResolvedSilgiTemplate<T>;
|
|
124
123
|
|
|
125
|
-
declare function useRequest(event: SilgiEvents): IncomingMessage
|
|
126
|
-
|
|
124
|
+
declare function useRequest<T extends IncomingMessage>(event: SilgiEvents): T | (IncomingMessage & {
|
|
125
|
+
originalUrl?: string;
|
|
126
|
+
});
|
|
127
|
+
declare function useResponse<T extends ServerResponse>(event: SilgiEvents): ServerResponse<IncomingMessage>;
|
|
127
128
|
declare function getIpAddress(event: SilgiEvents): string | false;
|
|
128
129
|
/**
|
|
129
130
|
* Extract the client's IP address from request headers with high accuracy
|
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;
|