silgi 0.29.11 → 0.29.13
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/cli/index.mjs +1 -1
- package/dist/cli/silgi.mjs +3 -1
- package/dist/kit/index.d.mts +3 -1
- package/dist/kit/index.mjs +5 -1
- package/dist/types/index.d.mts +1 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/silgi.mjs
CHANGED
|
@@ -364,7 +364,7 @@ async function prepareCoreFile(silgi) {
|
|
|
364
364
|
silgiConfigs: [],
|
|
365
365
|
addImportItem,
|
|
366
366
|
addImportItemType,
|
|
367
|
-
|
|
367
|
+
addBuildFunction: (data) => {
|
|
368
368
|
for (const item of toArray(data)) {
|
|
369
369
|
if (item.where === "after") {
|
|
370
370
|
after.push(item.params?.length ? ` await ${item.name}(option, ${item.params.join(",")})` : ` await ${item.name}(option)`);
|
|
@@ -398,6 +398,7 @@ async function prepareCoreFile(silgi) {
|
|
|
398
398
|
"",
|
|
399
399
|
"export async function buildSilgi(option: BuildSilgi) {",
|
|
400
400
|
"",
|
|
401
|
+
"// buildSilgiBefore",
|
|
401
402
|
...before,
|
|
402
403
|
"",
|
|
403
404
|
"const silgi = await createSilgi({",
|
|
@@ -423,6 +424,7 @@ async function prepareCoreFile(silgi) {
|
|
|
423
424
|
" }) as any,",
|
|
424
425
|
" })",
|
|
425
426
|
"",
|
|
427
|
+
"// buildSilgiAfter",
|
|
426
428
|
...after,
|
|
427
429
|
"",
|
|
428
430
|
" return silgi",
|
package/dist/kit/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import { Buffer } from 'node:buffer';
|
|
|
3
3
|
import { ConsolaOptions, ConsolaInstance } from 'consola';
|
|
4
4
|
import * as rfc6902 from 'rfc6902';
|
|
5
5
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
6
|
+
import { PresetName } from 'silgi/presets';
|
|
6
7
|
|
|
7
8
|
declare function addCommands(data: Commands | Commands[]): Promise<void>;
|
|
8
9
|
|
|
@@ -300,6 +301,7 @@ declare function hasSilgiModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
|
300
301
|
declare function hasInstalledModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
301
302
|
declare const baseHeaderBannerComment: string[];
|
|
302
303
|
declare function processFilePath(src: string): string;
|
|
304
|
+
declare function isPresents(names: PresetName[]): boolean;
|
|
303
305
|
|
|
304
|
-
export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, hasError, hasInstalledModule, hasSilgiModule, hash, ipAddress, isDirectory, isH3, isNitro, isNuxt, listMigrations, migrationDown, migrationUp, normalizeTemplate, parseServices, prettyPath, processFilePath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, serviceParseModule, toArray, tryResolveModule, useLogger, useRequest, useResponse, writeFile };
|
|
306
|
+
export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, hasError, hasInstalledModule, hasSilgiModule, hash, ipAddress, isDirectory, isH3, isNitro, isNuxt, isPresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, parseServices, prettyPath, processFilePath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, serviceParseModule, toArray, tryResolveModule, useLogger, useRequest, useResponse, writeFile };
|
|
305
307
|
export type { FunctionConfig, JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -60,6 +60,10 @@ function processFilePath(src) {
|
|
|
60
60
|
}
|
|
61
61
|
return src;
|
|
62
62
|
}
|
|
63
|
+
function isPresents(names) {
|
|
64
|
+
const silgi = useSilgiCLI();
|
|
65
|
+
return names.filter((name) => silgi.options.preset.includes(name)).length > 0;
|
|
66
|
+
}
|
|
63
67
|
|
|
64
68
|
async function addCommands(data) {
|
|
65
69
|
useSilgiCLI$1().hook("prepare:commands", (commads) => {
|
|
@@ -969,4 +973,4 @@ function isValidIp(ip) {
|
|
|
969
973
|
return false;
|
|
970
974
|
}
|
|
971
975
|
|
|
972
|
-
export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, hasError, hasInstalledModule, hasSilgiModule, hash, ipAddress, isDirectory$1 as isDirectory, isH3, isNitro, isNuxt, listMigrations, migrationDown, migrationUp, normalizeTemplate, parseServices, prettyPath, processFilePath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, serviceParseModule, toArray, tryResolveModule, useLogger, useRequest, useResponse, writeFile };
|
|
976
|
+
export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, hasError, hasInstalledModule, hasSilgiModule, hash, ipAddress, isDirectory$1 as isDirectory, isH3, isNitro, isNuxt, isPresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, parseServices, prettyPath, processFilePath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, serviceParseModule, toArray, tryResolveModule, useLogger, useRequest, useResponse, writeFile };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -297,7 +297,7 @@ interface PrepareCore {
|
|
|
297
297
|
silgiConfigs: Record<string, any>[];
|
|
298
298
|
addImportItem: (data: GenImport | GenImport[]) => void;
|
|
299
299
|
addImportItemType: (data: GenImport | GenImport[]) => void;
|
|
300
|
-
|
|
300
|
+
addBuildFunction: (data: {
|
|
301
301
|
name: string;
|
|
302
302
|
params?: string[];
|
|
303
303
|
where: 'before' | 'after';
|