silgi 0.29.39 → 0.30.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.29.39";
4
+ const version = "0.30.0";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -22,7 +22,7 @@ const main = defineCommand({
22
22
  init: () => import('./init.mjs').then((m) => m.default),
23
23
  run: () => import('./prepare.mjs').then(function (n) { return n.r; }).then((m) => m.default),
24
24
  install: () => import('./install.mjs').then((m) => m.default),
25
- dev: () => import('./dev.mjs').then((m) => m.default)
25
+ watch: () => import('./watch.mjs').then((m) => m.default)
26
26
  },
27
27
  run() {
28
28
  }
@@ -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, resolveModuleExportNames, findTypeExports, findExports } from 'mlly';
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
- consola.info("Silgi OpenAPI module not found, if you want to use it, please install it @silgi/openapi");
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
  {
@@ -14,7 +14,7 @@ const nitro = defineSilgiPreset(
14
14
  },
15
15
  imports: {
16
16
  dirs: [
17
- "{{ serverDir }}/**",
17
+ // '{{ serverDir }}/**',
18
18
  "!{{ serverDir }}/runtime/**",
19
19
  "!{{ serverDir }}/api/**",
20
20
  "!{{ serverDir }}/routes/**",
@@ -15,7 +15,7 @@ const npmPackage = defineSilgiPreset(
15
15
  },
16
16
  imports: {
17
17
  dirs: [
18
- "{{ serverDir }}/**",
18
+ // '{{ serverDir }}/**',
19
19
  "!{{ serverDir }}/runtime/**",
20
20
  "!{{ silgi.serverDir }}/**",
21
21
  "!{{ serverDir }}/module.ts",
@@ -15,7 +15,7 @@ const nuxt = defineSilgiPreset(
15
15
  },
16
16
  imports: {
17
17
  dirs: [
18
- "{{ serverDir }}/**",
18
+ // '{{ serverDir }}/**',
19
19
  "!{{ serverDir }}/runtime/**",
20
20
  "!{{ serverDir }}/api/**",
21
21
  "!{{ serverDir }}/routes/**",
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.29.39",
4
+ "version": "0.30.0",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
File without changes