silgi 0.29.39 → 0.29.40
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 -10
- package/dist/presets/h3/preset.mjs +12 -0
- package/dist/presets/nitro/preset.mjs +1 -1
- package/dist/presets/npmpackage/preset.mjs +1 -1
- package/dist/presets/nuxt/preset.mjs +1 -1
- package/dist/types/index.d.mts +2 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/silgi.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { mkdirSync, existsSync, writeFileSync, promises, readFileSync } from 'no
|
|
|
6
6
|
import { readdir, readFile } from 'node:fs/promises';
|
|
7
7
|
import { genAugmentation, genObjectFromRawEntries, genImport, genTypeImport, genObjectFromRaw, genObjectFromValues } from 'knitwork';
|
|
8
8
|
import { u as useSilgiCLI } from '../_chunks/silgiApp.mjs';
|
|
9
|
-
import { resolvePath, parseNodeModulePath, lookupNodeModuleSubpath,
|
|
9
|
+
import { resolvePath, parseNodeModulePath, lookupNodeModuleSubpath, findTypeExports, findExports } from 'mlly';
|
|
10
10
|
import { resolveAlias } from 'pathe/utils';
|
|
11
11
|
import { runtimeDir } from 'silgi/runtime/meta';
|
|
12
12
|
import { toExports, scanExports, createUnimport } from 'unimport';
|
|
@@ -34,7 +34,7 @@ import { snakeCase } from 'scule';
|
|
|
34
34
|
async function generateApiFul(silgi) {
|
|
35
35
|
const config = silgi.options.apiFul;
|
|
36
36
|
if (!hasSilgiModule("openapi")) {
|
|
37
|
-
|
|
37
|
+
silgi.logger.info("Silgi OpenAPI module not found, if you want to use it, please install it @silgi/openapi");
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
if (!config.services || hasSilgiModule("openapi")) {
|
|
@@ -1051,14 +1051,7 @@ async function h3Framework(silgi, skip = false) {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
if (silgi.options.imports !== false) {
|
|
1054
|
-
const h3Exports = await resolveModuleExportNames("h3", {
|
|
1055
|
-
url: import.meta.url
|
|
1056
|
-
});
|
|
1057
1054
|
silgi.options.imports.presets ??= [];
|
|
1058
|
-
silgi.options.imports.presets.push({
|
|
1059
|
-
from: "h3",
|
|
1060
|
-
imports: h3Exports.filter((n) => !/^[A-Z]/.test(n) && n !== "use")
|
|
1061
|
-
});
|
|
1062
1055
|
}
|
|
1063
1056
|
}
|
|
1064
1057
|
|
|
@@ -2288,7 +2281,7 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
2288
2281
|
hooks,
|
|
2289
2282
|
errors: [],
|
|
2290
2283
|
_requiredModules: {},
|
|
2291
|
-
logger: consola.withTag("silgi"),
|
|
2284
|
+
logger: opts.consola || consola.withTag("silgi"),
|
|
2292
2285
|
close: () => silgi.hooks.callHook("close", silgi),
|
|
2293
2286
|
storage: void 0,
|
|
2294
2287
|
scanModules: [],
|
|
@@ -16,6 +16,18 @@ const h3 = defineSilgiPreset(
|
|
|
16
16
|
isDev: true
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
+
},
|
|
20
|
+
imports: {
|
|
21
|
+
dirs: [
|
|
22
|
+
// '{{ serverDir }}/**',
|
|
23
|
+
"!{{ serverDir }}/runtime/**",
|
|
24
|
+
"!{{ serverDir }}/api/**",
|
|
25
|
+
"!{{ serverDir }}/routes/**",
|
|
26
|
+
"!{{ serverDir }}/modules/**",
|
|
27
|
+
"!{{ serverDir }}/assets/**",
|
|
28
|
+
"!{{ serverDir }}/public/**",
|
|
29
|
+
"!{{ silgi.serverDir }}/**"
|
|
30
|
+
]
|
|
19
31
|
}
|
|
20
32
|
},
|
|
21
33
|
{
|
package/dist/types/index.d.mts
CHANGED
|
@@ -820,7 +820,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
820
820
|
/**
|
|
821
821
|
* Silgi input config (silgi.config)
|
|
822
822
|
*/
|
|
823
|
-
interface SilgiCLIConfig extends DeepPartial<Omit<SilgiCLIOptions, 'preset' | 'compatibilityDate' | '_config' | '_c12'>>, C12InputConfig<SilgiCLIConfig>, Partial<SilgiModuleOptions> {
|
|
823
|
+
interface SilgiCLIConfig extends DeepPartial<Omit<SilgiCLIOptions, 'preset' | 'compatibilityDate' | '_config' | '_c12' | 'consola'>>, C12InputConfig<SilgiCLIConfig>, Partial<SilgiModuleOptions> {
|
|
824
824
|
preset?: PresetNameInput;
|
|
825
825
|
extends?: string | string[] | SilgiPreset;
|
|
826
826
|
compatibilityDate?: CompatibilityDateSpec;
|
|
@@ -832,6 +832,7 @@ interface LoadConfigOptions {
|
|
|
832
832
|
watch?: boolean;
|
|
833
833
|
c12?: WatchConfigOptions;
|
|
834
834
|
compatibilityDate?: CompatibilityDateSpec;
|
|
835
|
+
consola?: ConsolaInstance;
|
|
835
836
|
}
|
|
836
837
|
|
|
837
838
|
type TrimAfterFourSlashes<T extends string> = T extends `/${infer S1}/${infer S2}/${infer S3}/${infer S4}/${infer _}` ? `/${S1}/${S2}/${S3}/${S4}` : T;
|