silgi 0.42.5 → 0.43.0

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.
Files changed (266) hide show
  1. package/dist/_virtual/rolldown_runtime.mjs +11 -0
  2. package/dist/build.d.mts +3 -11
  3. package/dist/build.mjs +4 -48
  4. package/dist/cli/build/build.mjs +17 -0
  5. package/dist/cli/build/dev.d.mts +9 -0
  6. package/dist/cli/build/dev.mjs +59 -0
  7. package/dist/cli/build/prepare.d.mts +6 -0
  8. package/dist/cli/build/prepare.mjs +15 -0
  9. package/dist/cli/commands/commands.mjs +90 -0
  10. package/dist/cli/commands/env.mjs +53 -0
  11. package/dist/cli/commands/init.mjs +84 -0
  12. package/dist/cli/commands/install.mjs +52 -0
  13. package/dist/cli/commands/prepare.mjs +65 -0
  14. package/dist/cli/commands/reset.mjs +46 -0
  15. package/dist/cli/commands/run.mjs +105 -0
  16. package/dist/cli/commands/watch.mjs +48 -0
  17. package/dist/cli/config/defaults.mjs +117 -0
  18. package/dist/cli/config/index.d.mts +3 -11
  19. package/dist/cli/config/index.mjs +4 -17
  20. package/dist/cli/config/loader.d.mts +6 -0
  21. package/dist/cli/config/loader.mjs +71 -0
  22. package/dist/cli/config/resolvers/compatibility.mjs +71 -0
  23. package/dist/cli/config/resolvers/imports.mjs +35 -0
  24. package/dist/cli/config/resolvers/paths.mjs +98 -0
  25. package/dist/cli/config/resolvers/storage.mjs +23 -0
  26. package/dist/cli/config/resolvers/url.mjs +9 -0
  27. package/dist/cli/config/types.d.mts +14 -0
  28. package/dist/cli/config/types.mjs +147 -0
  29. package/dist/cli/core/apiful.mjs +36 -0
  30. package/dist/cli/core/app.mjs +105 -0
  31. package/dist/cli/core/devServer.mjs +10 -0
  32. package/dist/cli/core/env.mjs +68 -0
  33. package/dist/cli/core/installPackage.mjs +60 -0
  34. package/dist/cli/core/runtimeConfig.mjs +70 -0
  35. package/dist/cli/core/scan.mjs +35 -0
  36. package/dist/cli/core/silgi.mjs +111 -0
  37. package/dist/cli/core/templates.mjs +38 -0
  38. package/dist/cli/framework/emptyFramework.mjs +7 -0
  39. package/dist/cli/framework/h3.mjs +55 -0
  40. package/dist/cli/framework/index.mjs +15 -0
  41. package/dist/cli/framework/nitro.mjs +24 -0
  42. package/dist/cli/framework/nuxt.mjs +10 -0
  43. package/dist/cli/index.d.mts +1 -1
  44. package/dist/cli/index.mjs +24 -27
  45. package/dist/cli/module/exportScan.mjs +180 -0
  46. package/dist/cli/module/install.mjs +49 -0
  47. package/dist/cli/module/scan.mjs +195 -0
  48. package/dist/cli/scan/prepareCommands.mjs +40 -0
  49. package/dist/cli/scan/prepareConfigs.mjs +33 -0
  50. package/dist/cli/scan/prepareCoreFile.mjs +118 -0
  51. package/dist/cli/scan/prepareScanFile.mjs +59 -0
  52. package/dist/cli/scan/prepareSchema.mjs +140 -0
  53. package/dist/cli/scan/scanExportFile.mjs +312 -0
  54. package/dist/cli/scan/writeCoreFile.mjs +22 -0
  55. package/dist/cli/scan/writeTypesAndFiles.mjs +72 -0
  56. package/dist/cli/utils/cancel.mjs +14 -0
  57. package/dist/cli/utils/common.mjs +15 -0
  58. package/dist/cli/utils/compatibility.mjs +33 -0
  59. package/dist/cli/utils/debug.mjs +11 -0
  60. package/dist/cli/utils/ignore.mjs +56 -0
  61. package/dist/cli/utils/readScanFile.mjs +58 -0
  62. package/dist/cli/utils/storage.mjs +23 -0
  63. package/dist/core/context.d.mts +30 -0
  64. package/dist/core/context.mjs +32 -0
  65. package/dist/core/createSilgi.d.mts +6 -0
  66. package/dist/core/createSilgi.mjs +152 -0
  67. package/dist/core/error.d.mts +65 -0
  68. package/dist/core/error.mjs +106 -0
  69. package/dist/core/event.d.mts +26 -0
  70. package/dist/core/event.mjs +44 -0
  71. package/dist/core/index.d.mts +24 -316
  72. package/dist/core/index.mjs +27 -1345
  73. package/dist/core/orchestrate.mjs +113 -0
  74. package/dist/core/response.d.mts +20 -0
  75. package/dist/core/response.mjs +105 -0
  76. package/dist/core/silgi.d.mts +19 -0
  77. package/dist/core/silgi.mjs +141 -0
  78. package/dist/core/silgiApp.d.mts +9 -0
  79. package/dist/core/silgiApp.mjs +23 -0
  80. package/dist/core/storage.d.mts +7 -0
  81. package/dist/core/storage.mjs +15 -0
  82. package/dist/core/unctx.d.mts +21 -0
  83. package/dist/core/unctx.mjs +35 -0
  84. package/dist/core/utils/event-stream.d.mts +53 -0
  85. package/dist/core/utils/event-stream.mjs +38 -0
  86. package/dist/core/utils/event.d.mts +8 -0
  87. package/dist/core/utils/event.mjs +12 -0
  88. package/dist/core/utils/internal/event-stream.d.mts +45 -0
  89. package/dist/core/utils/internal/event-stream.mjs +137 -0
  90. package/dist/core/utils/internal/obj.mjs +9 -0
  91. package/dist/core/utils/internal/object.mjs +29 -0
  92. package/dist/core/utils/internal/query.mjs +73 -0
  93. package/dist/core/utils/internal/req.mjs +35 -0
  94. package/dist/core/utils/merge.d.mts +14 -0
  95. package/dist/core/utils/merge.mjs +27 -0
  96. package/dist/{shared/silgi.DTwQEdSr.d.mts → core/utils/middleware.d.mts} +11 -13
  97. package/dist/core/utils/middleware.mjs +12 -0
  98. package/dist/core/utils/request.mjs +35 -0
  99. package/dist/core/utils/resolver.d.mts +7 -0
  100. package/dist/core/utils/resolver.mjs +29 -0
  101. package/dist/core/utils/runtime.d.mts +7 -0
  102. package/dist/core/utils/runtime.mjs +20 -0
  103. package/dist/core/utils/sanitize.mjs +22 -0
  104. package/dist/core/utils/schema.d.mts +34 -0
  105. package/dist/core/utils/schema.mjs +33 -0
  106. package/dist/core/utils/service.d.mts +13 -0
  107. package/dist/core/utils/service.mjs +19 -0
  108. package/dist/core/utils/shared.d.mts +6 -0
  109. package/dist/core/utils/shared.mjs +7 -0
  110. package/dist/core/utils/storage.d.mts +24 -0
  111. package/dist/core/utils/storage.mjs +54 -0
  112. package/dist/index.d.mts +21 -6
  113. package/dist/index.mjs +22 -16
  114. package/dist/kit/add/add-commands.d.mts +6 -0
  115. package/dist/kit/add/add-commands.mjs +12 -0
  116. package/dist/kit/add/add-core-file.d.mts +9 -0
  117. package/dist/kit/add/add-core-file.mjs +11 -0
  118. package/dist/kit/add/add-imports.d.mts +14 -0
  119. package/dist/kit/add/add-imports.mjs +56 -0
  120. package/dist/kit/add/add-npm.d.mts +14 -0
  121. package/dist/kit/add/add-npm.mjs +23 -0
  122. package/dist/kit/define.d.mts +28 -0
  123. package/dist/kit/define.mjs +25 -0
  124. package/dist/kit/errors.d.mts +6 -0
  125. package/dist/kit/errors.mjs +11 -0
  126. package/dist/kit/esm.d.mts +11 -0
  127. package/dist/kit/esm.mjs +21 -0
  128. package/dist/kit/fs.d.mts +7 -0
  129. package/dist/kit/fs.mjs +23 -0
  130. package/dist/kit/function-utils.d.mts +27 -0
  131. package/dist/kit/function-utils.mjs +75 -0
  132. package/dist/kit/gen.d.mts +5 -0
  133. package/dist/kit/gen.mjs +26 -0
  134. package/dist/kit/hash.d.mts +4 -0
  135. package/dist/kit/hash.mjs +10 -0
  136. package/dist/kit/index.d.mts +22 -321
  137. package/dist/kit/index.mjs +23 -1039
  138. package/dist/kit/isFramework.d.mts +6 -0
  139. package/dist/kit/isFramework.mjs +21 -0
  140. package/dist/kit/logger.d.mts +6 -0
  141. package/dist/kit/logger.mjs +10 -0
  142. package/dist/kit/migration.d.mts +113 -0
  143. package/dist/kit/migration.mjs +301 -0
  144. package/dist/kit/module.d.mts +14 -0
  145. package/dist/kit/module.mjs +53 -0
  146. package/dist/kit/path.d.mts +7 -0
  147. package/dist/kit/path.mjs +26 -0
  148. package/dist/kit/preset.d.mts +8 -0
  149. package/dist/kit/preset.mjs +11 -0
  150. package/dist/kit/resolve.d.mts +37 -0
  151. package/dist/kit/resolve.mjs +82 -0
  152. package/dist/kit/template.d.mts +14 -0
  153. package/dist/kit/template.mjs +59 -0
  154. package/dist/kit/useRequest.d.mts +19 -0
  155. package/dist/kit/useRequest.mjs +63 -0
  156. package/dist/kit/utils.d.mts +34 -0
  157. package/dist/kit/utils.mjs +90 -0
  158. package/dist/package.mjs +176 -0
  159. package/dist/presets/_all.gen.d.mts +5 -2
  160. package/dist/presets/_all.gen.mjs +16 -13
  161. package/dist/presets/_resolve.d.mts +10 -6
  162. package/dist/presets/_resolve.mjs +51 -65
  163. package/dist/presets/_types.gen.d.mts +8 -5
  164. package/dist/presets/_types.gen.mjs +5 -1
  165. package/dist/presets/h3/preset.d.mts +5 -2
  166. package/dist/presets/h3/preset.mjs +33 -38
  167. package/dist/presets/hono/preset.d.mts +5 -2
  168. package/dist/presets/hono/preset.mjs +28 -35
  169. package/dist/presets/index.d.mts +3 -2
  170. package/dist/presets/index.mjs +3 -1
  171. package/dist/presets/nitro/preset.d.mts +5 -2
  172. package/dist/presets/nitro/preset.mjs +35 -42
  173. package/dist/presets/npmpackage/preset.d.mts +5 -2
  174. package/dist/presets/npmpackage/preset.mjs +27 -32
  175. package/dist/presets/nuxt/preset.d.mts +5 -2
  176. package/dist/presets/nuxt/preset.mjs +39 -44
  177. package/dist/runtime/index.d.mts +4 -3
  178. package/dist/runtime/index.mjs +5 -3
  179. package/dist/runtime/internal/config.d.mts +11 -7
  180. package/dist/runtime/internal/config.mjs +79 -90
  181. package/dist/runtime/internal/debug.d.mts +6 -3
  182. package/dist/runtime/internal/debug.mjs +9 -4
  183. package/dist/runtime/internal/defu.d.mts +4 -1
  184. package/dist/runtime/internal/defu.mjs +7 -2
  185. package/dist/runtime/internal/index.d.mts +7 -6
  186. package/dist/runtime/internal/index.mjs +8 -20
  187. package/dist/runtime/internal/nitro.d.mts +6 -3
  188. package/dist/runtime/internal/nitro.mjs +29 -37
  189. package/dist/runtime/internal/nuxt.d.mts +12 -8
  190. package/dist/runtime/internal/nuxt.mjs +12 -7
  191. package/dist/runtime/internal/ofetch.d.mts +8 -4
  192. package/dist/runtime/internal/ofetch.mjs +33 -34
  193. package/dist/runtime/internal/plugin.d.mts +7 -3
  194. package/dist/runtime/internal/plugin.mjs +7 -3
  195. package/dist/types/cliConfig.d.mts +288 -0
  196. package/dist/types/cliConfig.mjs +0 -0
  197. package/dist/types/cliHooks.d.mts +154 -0
  198. package/dist/types/cliHooks.mjs +0 -0
  199. package/dist/types/compatibility.d.mts +13 -0
  200. package/dist/types/compatibility.mjs +0 -0
  201. package/dist/types/config.d.mts +46 -0
  202. package/dist/types/config.mjs +0 -0
  203. package/dist/types/dotenv.d.mts +29 -0
  204. package/dist/types/dotenv.mjs +0 -0
  205. package/dist/types/event.d.mts +63 -0
  206. package/dist/types/event.mjs +0 -0
  207. package/dist/types/global.d.mts +24 -0
  208. package/dist/types/global.mjs +0 -0
  209. package/dist/types/helper.d.mts +25 -0
  210. package/dist/types/helper.mjs +0 -0
  211. package/dist/types/hooks.d.mts +37 -0
  212. package/dist/types/hooks.mjs +0 -0
  213. package/dist/types/index.d.mts +26 -1306
  214. package/dist/types/index.mjs +0 -1
  215. package/dist/types/kits.d.mts +32 -0
  216. package/dist/types/kits.mjs +0 -0
  217. package/dist/types/middleware.d.mts +31 -0
  218. package/dist/types/middleware.mjs +0 -0
  219. package/dist/types/module.d.mts +102 -0
  220. package/dist/types/module.mjs +0 -0
  221. package/dist/types/preset.d.mts +20 -0
  222. package/dist/types/preset.mjs +0 -0
  223. package/dist/types/route.d.mts +59 -0
  224. package/dist/types/route.mjs +0 -0
  225. package/dist/types/runtime/index.d.mts +5 -0
  226. package/dist/types/runtime/index.mjs +0 -0
  227. package/dist/types/runtime/nuxt.d.mts +13 -0
  228. package/dist/types/runtime/nuxt.mjs +0 -0
  229. package/dist/types/runtime/ofetch.d.mts +14 -0
  230. package/dist/types/runtime/ofetch.mjs +0 -0
  231. package/dist/types/runtime/plugin.d.mts +8 -0
  232. package/dist/types/runtime/plugin.mjs +0 -0
  233. package/dist/types/runtime/silgi.d.mts +11 -0
  234. package/dist/types/runtime/silgi.mjs +0 -0
  235. package/dist/types/schema.d.mts +86 -0
  236. package/dist/types/schema.mjs +0 -0
  237. package/dist/types/service.d.mts +102 -0
  238. package/dist/types/service.mjs +0 -0
  239. package/dist/types/shared.d.mts +19 -0
  240. package/dist/types/shared.mjs +0 -0
  241. package/dist/types/silgi.d.mts +71 -0
  242. package/dist/types/silgi.mjs +0 -0
  243. package/dist/types/silgiCLI.d.mts +118 -0
  244. package/dist/types/silgiCLI.mjs +0 -0
  245. package/dist/types/standard-schema.d.mts +61 -0
  246. package/dist/types/standard-schema.mjs +0 -0
  247. package/dist/types/storage.d.mts +30 -0
  248. package/dist/types/storage.mjs +0 -0
  249. package/package.json +20 -35
  250. package/dist/_chunks/silgiApp.mjs +0 -25
  251. package/dist/cli/build.mjs +0 -2190
  252. package/dist/cli/common.mjs +0 -13
  253. package/dist/cli/compatibility.mjs +0 -30
  254. package/dist/cli/dev.mjs +0 -67
  255. package/dist/cli/init.mjs +0 -112
  256. package/dist/cli/install.mjs +0 -151
  257. package/dist/cli/loader.mjs +0 -618
  258. package/dist/cli/prepare.mjs +0 -188
  259. package/dist/cli/reset.mjs +0 -55
  260. package/dist/cli/run.mjs +0 -159
  261. package/dist/cli/types.mjs +0 -232
  262. package/dist/cli/watch.mjs +0 -91
  263. package/dist/presets/next/preset.d.mts +0 -3
  264. package/dist/presets/next/preset.mjs +0 -38
  265. package/dist/runtime/internal/next.d.mts +0 -9
  266. package/dist/runtime/internal/next.mjs +0 -22
@@ -1,321 +1,22 @@
1
- import { Commands, SilgiCLIHooks, GenImport, DefineFrameworkOptions, SilgiCLI, ModuleOptionsCustom, ModuleDefinition, SilgiModule, SilgiPreset, SilgiPresetMeta, SilgiTemplate, ResolvedSilgiTemplate, SilgiEvent } from 'silgi/types';
2
- import { PresetName } from 'silgi/presets';
3
- import { Buffer } from 'node:buffer';
4
- import { ConsolaOptions, ConsolaInstance } from 'consola';
5
- import * as rfc6902 from 'rfc6902';
6
- import { IncomingMessage } from 'node:http';
7
-
8
- declare function addCommands(data: Commands | Commands[]): Promise<void>;
9
-
10
- declare function addCoreFile(data: {
11
- before?: SilgiCLIHooks['before:core.ts'];
12
- after?: SilgiCLIHooks['after:core.ts'];
13
- }): Promise<void>;
14
-
15
- declare function addImports(data?: {
16
- imports?: GenImport[];
17
- typeImports?: GenImport[];
18
- }): {
19
- genImports: GenImport[];
20
- genTypeImports: GenImport[];
21
- addImportItem: (data: GenImport | GenImport[]) => void;
22
- addImportItemType: (data: GenImport | GenImport[]) => void;
23
- };
24
-
25
- declare function addNPMPackage(data: {
26
- name: string;
27
- version?: string;
28
- isDev?: boolean;
29
- when?: boolean;
30
- }[] | {
31
- name: string;
32
- version?: string;
33
- isDev?: boolean;
34
- when?: boolean;
35
- }): Promise<void>;
36
-
37
- /**
38
- * Define a framework handler with proper type safety using a fluent API
39
- *
40
- * @param preset The framework preset to use
41
- * @example
42
- * ```ts
43
- * const h3Handler = defineFramework('h3').build(async (options) => {
44
- * // Type-safe access to h3 router
45
- * const router = options.framework
46
- * // Implementation here with async/await support
47
- * await someAsyncOperation()
48
- * })
49
- * ```
50
- */
51
- declare function defineFramework<T extends PresetName>(preset: T): {
52
- /**
53
- * Build the framework handler
54
- * @param callback The callback function that will receive typed options (can be async)
55
- */
56
- build(callback: (options: DefineFrameworkOptions<T>) => void | Promise<void>): (options: DefineFrameworkOptions<T>) => Promise<void>;
57
- };
58
-
59
- declare function hasError(type: SilgiCLI['errors'][0]['type'], silgi?: SilgiCLI): boolean;
60
-
61
- declare function directoryToURL(dir: string): URL;
62
- /**
63
- * Resolve a module from a given root path using an algorithm patterned on
64
- * the upcoming `import.meta.resolve`. It returns a file URL
65
- *
66
- * @internal
67
- */
68
- declare function tryResolveModule(id: string, url?: string | string[]): Promise<string | undefined>;
69
-
70
- declare function writeFile(file: string, contents: Buffer | string, log?: boolean): Promise<void>;
71
- declare function isDirectory(path: string): Promise<boolean>;
72
-
73
- /**
74
- * Interface for function call configurations
75
- */
76
- interface FunctionConfig {
77
- name: string;
78
- args: any[];
79
- }
80
- declare function createFunctionConfigs(configs: FunctionConfig[]): FunctionConfig[];
81
- /**
82
- * Generic utility function to create function call configurations
83
- * @param name Function name
84
- * @param args Function arguments (default empty object)
85
- * @returns Structured function configuration
86
- */
87
- declare function createFunction(name: string, args?: any): FunctionConfig;
88
- /**
89
- * Format function calls with consistent indentation for code generation
90
- * @param configs Array of function configurations
91
- * @param indentation Spaces for indentation (default 4)
92
- * @param specialVars Array of variable names that should be treated as code references not strings
93
- * @param deduplicateArgs Whether to extract duplicate arguments into variables (default false)
94
- * @returns Formatted string of function calls
95
- */
96
- declare function formatFunctions(configs: FunctionConfig[], indentation?: number, specialVars?: string[], deduplicateArgs?: boolean): string;
97
-
98
- declare function genEnsureSafeVar(name: string | any): string;
99
- declare function getAllEntries(obj: object): [string, any][];
100
-
101
- declare function hash(data: any): string;
102
-
103
- declare function isNuxt(): boolean;
104
- declare function isNitro(): boolean;
105
- declare function isH3(): boolean;
106
-
107
- declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance;
108
-
109
- /**
110
- * Migration bilgisi
111
- */
112
- interface MigrationInfo {
113
- /** Migration zaman damgası */
114
- timestamp: number;
115
- /** Migration dosya adı */
116
- file: string;
117
- /** Migration oluşturulma tarihi */
118
- created: string;
119
- /** Migration açıklaması */
120
- description?: string;
121
- /** Patch formatında mı? */
122
- isPatch?: boolean;
123
- }
124
- /**
125
- * İzin migration verisi
126
- */
127
- interface MigrationData {
128
- }
129
- /**
130
- * JSON Patch formatı (RFC6902)
131
- */
132
- type JsonPatch = Array<rfc6902.Operation>;
133
- /**
134
- * Migration durumu
135
- */
136
- declare enum MigrationStatus {
137
- SUCCESS = "success",
138
- ERROR = "error",
139
- SKIPPED = "skipped"
140
- }
141
- /**
142
- * Migration options
143
- */
144
- interface MigrationOptions {
145
- /** Migration açıklaması (opsiyonel) */
146
- description?: string;
147
- /** Değişiklikler için log göster */
148
- verbose?: boolean;
149
- /** JSON dosyasını pretty-print formatında kaydet */
150
- prettyPrint?: boolean;
151
- /** Patch formatını kullanmalı mı? */
152
- usePatch?: boolean;
153
- /** Değişiklik yoksa dosya oluşturma */
154
- skipIfNoChanges?: boolean;
155
- }
156
- /**
157
- * Migration başlatma sonucu
158
- */
159
- interface MigrationResult {
160
- /** İşlem başarılı mı? */
161
- success: boolean;
162
- /** Migration durumu */
163
- status: MigrationStatus;
164
- /** Migration dosya yolu (başarılıysa) */
165
- filePath?: string;
166
- /** Migration zaman damgası (başarılıysa) */
167
- timestamp?: number;
168
- /** Hata mesajı (başarısızsa) */
169
- error?: string;
170
- /** Patch türünde mi? */
171
- isPatch?: boolean;
172
- /** Migration verisi */
173
- data?: MigrationData[] | JsonPatch;
174
- }
175
- /**
176
- * Migration oluşturur
177
- *
178
- * @param data Migration verisi
179
- * @param directoryPath Migration dizini
180
- * @param fileNamePrefix Dosya adı öneki
181
- * @param options Migration seçenekleri
182
- * @returns Migration sonucu
183
- */
184
- declare function generateMigration<T>(data: T, directoryPath: string, fileNamePrefix?: string, options?: MigrationOptions): Promise<MigrationResult>;
185
- /**
186
- * Belirli bir migration dosyasının bilgilerini alır
187
- *
188
- * @param migrationsDir Migration dizini
189
- * @param fileName Dosya adı (belirtilmezse son migration dosyası)
190
- * @returns Migration bilgileri ve verisi
191
- */
192
- declare function getMigration(migrationsDir: string, fileName?: string): Promise<MigrationResult>;
193
- /**
194
- * Tüm migration dosyalarını listeler
195
- *
196
- * @param migrationsDir Migration dizini
197
- * @param filePrefix Dosya adı öneki filtreleme (opsiyonel)
198
- * @returns Migration listesi
199
- */
200
- declare function listMigrations(migrationsDir: string, filePrefix?: string): Promise<MigrationInfo[]>;
201
- /**
202
- * Migration'ları ileri uygular (son duruma getirir)
203
- *
204
- * @param migrationsDir Migration dizini
205
- * @param targetTimestamp Hedef zaman damgası (belirtilmezse son migration'a kadar)
206
- * @returns Migration sonucu
207
- */
208
- declare function migrationUp(migrationsDir: string, targetTimestamp?: number): Promise<MigrationResult>;
209
- /**
210
- * Migration'ları geri alır (belirtilen noktaya kadar veya bir önceki migration'a)
211
- *
212
- * @param migrationsDir Migration dizini
213
- * @param targetTimestamp Hedef zaman damgası (belirtilmezse bir önceki migration'a döner)
214
- * @returns Migration sonucu
215
- */
216
- declare function migrationDown(migrationsDir: string, targetTimestamp?: number): Promise<MigrationResult>;
217
-
218
- /**
219
- * Define a Silgi module, automatically merging defaults with user provided options, installing
220
- * any hooks that are provided, and calling an optional setup function for full control.
221
- */
222
- declare function defineSilgiModule<TOptions extends ModuleOptionsCustom>(definition: ModuleDefinition<TOptions, Partial<TOptions>, false> | SilgiModule<TOptions, Partial<TOptions>, false>): SilgiModule<TOptions, TOptions, false>;
223
- declare function defineSilgiModule<TOptions extends ModuleOptionsCustom>(): {
224
- with: <TOptionsDefaults extends Partial<TOptions>>(definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | SilgiModule<TOptions, TOptionsDefaults, true>) => SilgiModule<TOptions, TOptionsDefaults, true>;
225
- };
226
-
227
- declare function prettyPath(p: string, highlight?: boolean): string;
228
- declare function resolveSilgiPath(path: string, silgiCLIOptions: SilgiCLI['options'], base?: string): string;
229
-
230
- declare function defineSilgiPreset<P extends SilgiPreset, M extends SilgiPresetMeta>(preset: P, meta?: M): P & {
231
- _meta: SilgiPresetMeta;
232
- };
233
-
234
- interface ResolvePathOptions {
235
- modulesDir?: string[];
236
- /** Base for resolving paths from. Default is Nuxt rootDir. */
237
- cwd?: string;
238
- /** An object of aliases. Default is Nuxt configured aliases. */
239
- alias?: Record<string, string>;
240
- /** The file extensions to try. Default is Nuxt configured extensions. */
241
- extensions?: string[];
242
- /**
243
- * Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path.
244
- *
245
- * @default false
246
- */
247
- fallbackToOriginal?: boolean;
248
- }
249
- /**
250
- * Resolve full path to a file or directory respecting Nuxt alias and extensions options
251
- *
252
- * If path could not be resolved, normalized input path will be returned
253
- */
254
- declare function resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>;
255
- /**
256
- * Resolve path aliases respecting Nuxt alias options
257
- */
258
- declare function resolveAlias(path: string, alias?: Record<string, string>): string;
259
- interface Resolver {
260
- resolve: (...path: string[]) => string;
261
- resolvePath: (path: string, opts?: ResolvePathOptions) => Promise<string>;
262
- }
263
- /**
264
- * Create a relative resolver
265
- */
266
- declare function createResolver(base: string | URL): Resolver;
267
- declare function resolveSilgiModule(base: string, paths: string[]): Promise<string[]>;
268
-
269
- /**
270
- * Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
271
- */
272
- declare function addTemplate<T>(_template: SilgiTemplate<T> | string): ResolvedSilgiTemplate<T>;
273
- /**
274
- * Normalize a silgi template object
275
- */
276
- declare function normalizeTemplate<T>(template: SilgiTemplate<T> | string, buildDir?: string): ResolvedSilgiTemplate<T>;
277
-
278
- /**
279
- * @deprecated
280
- */
281
- declare function useRequest<T extends IncomingMessage>(event: SilgiEvent): T | (IncomingMessage & {
282
- originalUrl?: string;
283
- });
284
- /**
285
- * Extract the client's IP address from request headers with high accuracy
286
- * @param req - The incoming HTTP request (Fetch API Request)
287
- * @returns The client's IP address or empty string if not found
288
- */
289
- declare function getIpAddress(req: Request): string;
290
-
291
- declare function relativeWithDot(from: string, to: string): string;
292
- declare function toArray<T>(value: T | T[]): T[];
293
- /**
294
- * Filter out items from an array in place. This function mutates the array.
295
- * `predicate` get through the array from the end to the start for performance.
296
- *
297
- * This function should be faster than `Array.prototype.filter` on large arrays.
298
- */
299
- declare function filterInPlace<T>(array: T[], predicate: (item: T, index: number, arr: T[]) => unknown): T[];
300
- declare const MODE_RE: RegExp;
301
- /**
302
- * Check if a Silgi module is installed by name.
303
- *
304
- * This will check both the installed modules and the modules to be installed. Note
305
- * that it cannot detect if a module is _going to be_ installed programmatically by another module.
306
- */
307
- declare function hasSilgiModule(moduleKey: string, silgi?: SilgiCLI): boolean;
308
- declare function hasInstalledModule(moduleKey: string, silgi?: SilgiCLI): boolean;
309
- declare const baseHeaderBannerComment: string[];
310
- declare function processFilePath(src: string): string;
311
- declare function isPresents(names: PresetName[]): boolean;
312
- declare function isRuntimePresents(names: PresetName[]): boolean;
313
- declare function removeExtension(filePath: string, force?: boolean): string;
314
- declare function getServicePath(_route: string): {
315
- method: string;
316
- type: string;
317
- route: string;
318
- };
319
-
320
- export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addImports, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineFramework, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, getServicePath, hasError, hasInstalledModule, hasSilgiModule, hash, isDirectory, isH3, isNitro, isNuxt, isPresents, isRuntimePresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, prettyPath, processFilePath, relativeWithDot, removeExtension, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, useRequest, writeFile };
321
- export type { FunctionConfig, JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult };
1
+ import { addCommands$1 as addCommands } from "./add/add-commands.mjs";
2
+ import { addCoreFile$1 as addCoreFile } from "./add/add-core-file.mjs";
3
+ import { addImports$1 as addImports } from "./add/add-imports.mjs";
4
+ import { addNPMPackage$1 as addNPMPackage } from "./add/add-npm.mjs";
5
+ import { defineFramework$1 as defineFramework } from "./define.mjs";
6
+ import { hasError$1 as hasError } from "./errors.mjs";
7
+ import { directoryToURL$1 as directoryToURL, tryResolveModule$1 as tryResolveModule } from "./esm.mjs";
8
+ import { isDirectory$1 as isDirectory, writeFile$1 as writeFile } from "./fs.mjs";
9
+ import { FunctionConfig, createFunction$1 as createFunction, createFunctionConfigs$1 as createFunctionConfigs, formatFunctions$1 as formatFunctions } from "./function-utils.mjs";
10
+ import { genEnsureSafeVar$1 as genEnsureSafeVar, getAllEntries$1 as getAllEntries } from "./gen.mjs";
11
+ import { hash$1 as hash } from "./hash.mjs";
12
+ import { isH3$1 as isH3, isNitro$1 as isNitro, isNuxt$1 as isNuxt } from "./isFramework.mjs";
13
+ import { useLogger$1 as useLogger } from "./logger.mjs";
14
+ import { JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus$1 as MigrationStatus, generateMigration$1 as generateMigration, getMigration$1 as getMigration, listMigrations$1 as listMigrations, migrationDown$1 as migrationDown, migrationUp$1 as migrationUp } from "./migration.mjs";
15
+ import { defineSilgiModule$1 as defineSilgiModule } from "./module.mjs";
16
+ import { prettyPath$1 as prettyPath, resolveSilgiPath$1 as resolveSilgiPath } from "./path.mjs";
17
+ import { defineSilgiPreset$1 as defineSilgiPreset } from "./preset.mjs";
18
+ import { createResolver$2 as createResolver, resolveAlias$1 as resolveAlias, resolvePath$1 as resolvePath, resolveSilgiModule$1 as resolveSilgiModule } from "./resolve.mjs";
19
+ import { addTemplate$1 as addTemplate, normalizeTemplate$1 as normalizeTemplate } from "./template.mjs";
20
+ import { getIpAddress$1 as getIpAddress, useRequest$1 as useRequest } from "./useRequest.mjs";
21
+ import { MODE_RE$1 as MODE_RE, baseHeaderBannerComment$1 as baseHeaderBannerComment, filterInPlace$1 as filterInPlace, getServicePath$1 as getServicePath, hasInstalledModule$2 as hasInstalledModule, hasSilgiModule$1 as hasSilgiModule, isPresents$1 as isPresents, isRuntimePresents$1 as isRuntimePresents, processFilePath$1 as processFilePath, relativeWithDot$1 as relativeWithDot, removeExtension$1 as removeExtension, toArray$1 as toArray } from "./utils.mjs";
22
+ export { FunctionConfig, JsonPatch, MODE_RE, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus, addCommands, addCoreFile, addImports, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineFramework, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, getServicePath, hasError, hasInstalledModule, hasSilgiModule, hash, isDirectory, isH3, isNitro, isNuxt, isPresents, isRuntimePresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, prettyPath, processFilePath, relativeWithDot, removeExtension, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, useRequest, writeFile };