silgi 0.17.6 → 0.17.8
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/_chunks/index.mjs +1 -1
- package/dist/cli/writeTypesAndFiles.mjs +11 -8
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/nitro/preset.mjs +10 -11
- package/dist/presets/npmpackage/preset.mjs +4 -13
- package/dist/presets/nuxt/preset.mjs +9 -9
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import consola$1, { consola } from 'consola';
|
|
|
4
4
|
import { createHooks, createDebugger } from 'hookable';
|
|
5
5
|
import { join, resolve, isAbsolute, relative, dirname, basename, extname } from 'pathe';
|
|
6
6
|
import { useSilgiCLI, silgiCLICtx } from 'silgi/core';
|
|
7
|
-
import { relativeWithDot, hash, resolveAlias, resolvePath, writeFile, parseServices, normalizeTemplate, useLogger, addTemplate, initRuntimeConfig, hasError as hasError$1, isDirectory } from 'silgi/kit';
|
|
7
|
+
import { relativeWithDot, hash, resolveAlias, resolvePath, writeFile, parseServices, normalizeTemplate, useLogger, addTemplate, initRuntimeConfig, hasError as hasError$1, resolveSilgiPath, isDirectory } from 'silgi/kit';
|
|
8
8
|
import { runtimeDir } from 'silgi/runtime/meta';
|
|
9
9
|
import { autoImportTypes } from 'silgi/types';
|
|
10
10
|
import { scanExports, createUnimport, toExports } from 'unimport';
|
|
@@ -1483,12 +1483,15 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1483
1483
|
await generateApp(silgi);
|
|
1484
1484
|
if (silgi.options.imports) {
|
|
1485
1485
|
silgi.options.imports.dirs ??= [];
|
|
1486
|
-
silgi.options.imports.dirs.
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1486
|
+
silgi.options.imports.dirs = silgi.options.imports.dirs.map((dir) => {
|
|
1487
|
+
if (typeof dir === "string") {
|
|
1488
|
+
if (dir.startsWith("!")) {
|
|
1489
|
+
return `!${resolveSilgiPath(dir.slice(1), options, silgi.options.rootDir)}`;
|
|
1490
|
+
}
|
|
1491
|
+
return resolveSilgiPath(dir, options, silgi.options.rootDir);
|
|
1492
|
+
}
|
|
1493
|
+
return dir;
|
|
1494
|
+
});
|
|
1492
1495
|
silgi.options.imports.presets.push({
|
|
1493
1496
|
from: "silgi/types",
|
|
1494
1497
|
imports: autoImportTypes.map((type) => type),
|
|
@@ -1513,7 +1516,7 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1513
1516
|
|
|
1514
1517
|
function serializeToJs(obj, indent = 2, level = 0) {
|
|
1515
1518
|
if (obj === null || obj === void 0) {
|
|
1516
|
-
return String(obj);
|
|
1519
|
+
return obj === void 0 ? "undefined as any" : String(obj);
|
|
1517
1520
|
}
|
|
1518
1521
|
if (typeof obj === "function") {
|
|
1519
1522
|
return obj.toString();
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
|
@@ -13,17 +13,16 @@ const nitro = defineSilgiPreset(
|
|
|
13
13
|
prefix: "NITRO_"
|
|
14
14
|
},
|
|
15
15
|
imports: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/
|
|
19
|
-
/
|
|
20
|
-
/
|
|
21
|
-
/
|
|
22
|
-
/
|
|
23
|
-
/
|
|
24
|
-
|
|
25
|
-
]
|
|
26
|
-
include: []
|
|
16
|
+
dirs: [
|
|
17
|
+
"{{ serverDir }}/**",
|
|
18
|
+
"!{{ serverDir }}/runtime/**",
|
|
19
|
+
"!{{ serverDir }}/api/**",
|
|
20
|
+
"!{{ serverDir }}/routers/**",
|
|
21
|
+
"!{{ serverDir }}/modules/**",
|
|
22
|
+
"!{{ serverDir }}/assets/**",
|
|
23
|
+
"!{{ serverDir }}/public/**",
|
|
24
|
+
"!{{ silgi.serverDir }}/**"
|
|
25
|
+
]
|
|
27
26
|
},
|
|
28
27
|
storages: ["data", "/assets"]
|
|
29
28
|
},
|
|
@@ -14,19 +14,10 @@ const npmPackage = defineSilgiPreset(
|
|
|
14
14
|
removeFileExtension: true
|
|
15
15
|
},
|
|
16
16
|
imports: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/
|
|
20
|
-
|
|
21
|
-
/[/\\]static[/\\]/,
|
|
22
|
-
/[/\\]api[/\\]/,
|
|
23
|
-
/[/\\]routers[/\\]/,
|
|
24
|
-
/[/\\]modules[/\\]/,
|
|
25
|
-
/[/\\]generated[/\\]/,
|
|
26
|
-
/[/\\]runtime[/\\]/,
|
|
27
|
-
// Changed to properly exclude all runtime directory content
|
|
28
|
-
/[/\\]types[/\\]/,
|
|
29
|
-
/[/\\]src[/\\][^/\\]+\.ts$/
|
|
17
|
+
dirs: [
|
|
18
|
+
"{{ serverDir }}/**",
|
|
19
|
+
"!{{ serverDir }}/runtime/**",
|
|
20
|
+
"!{{ silgi.serverDir }}/**"
|
|
30
21
|
]
|
|
31
22
|
}
|
|
32
23
|
},
|
|
@@ -14,15 +14,15 @@ const nuxt = defineSilgiPreset(
|
|
|
14
14
|
altPrefix: "NUXT_"
|
|
15
15
|
},
|
|
16
16
|
imports: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/
|
|
20
|
-
/
|
|
21
|
-
/
|
|
22
|
-
/
|
|
23
|
-
/
|
|
24
|
-
/
|
|
25
|
-
|
|
17
|
+
dirs: [
|
|
18
|
+
"{{ serverDir }}/**",
|
|
19
|
+
"!{{ serverDir }}/runtime/**",
|
|
20
|
+
"!{{ serverDir }}/api/**",
|
|
21
|
+
"!{{ serverDir }}/routers/**",
|
|
22
|
+
"!{{ serverDir }}/modules/**",
|
|
23
|
+
"!{{ serverDir }}/assets/**",
|
|
24
|
+
"!{{ serverDir }}/public/**",
|
|
25
|
+
"!{{ silgi.serverDir }}/**"
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
storages: ["data", "/assets"]
|