silgi 0.29.10 → 0.29.12
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 -3
- package/dist/kit/index.d.mts +3 -1
- package/dist/kit/index.mjs +5 -1
- package/dist/types/index.d.mts +5 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/silgi.mjs
CHANGED
|
@@ -365,12 +365,12 @@ async function prepareCoreFile(silgi) {
|
|
|
365
365
|
addImportItem,
|
|
366
366
|
addImportItemType,
|
|
367
367
|
addFunction: (data) => {
|
|
368
|
-
for (const item of data) {
|
|
368
|
+
for (const item of toArray(data)) {
|
|
369
369
|
if (item.where === "after") {
|
|
370
|
-
after.push(item.params?.length ? ` await ${item.name}(option, ${item.params.join(",")})` : ` await ${item.name}(
|
|
370
|
+
after.push(item.params?.length ? ` await ${item.name}(option, ${item.params.join(",")})` : ` await ${item.name}(option)`);
|
|
371
371
|
}
|
|
372
372
|
if (item.where === "before") {
|
|
373
|
-
before.push(item.params?.length ? ` await ${item.name}(option, ${item.params.join(",")})` : ` await ${item.name}(
|
|
373
|
+
before.push(item.params?.length ? ` await ${item.name}(option, ${item.params.join(",")})` : ` await ${item.name}(option)`);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
}
|
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