silgi 0.7.3 → 0.7.4
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/config/index.mjs +7 -167
- package/dist/cli/prepare.mjs +4 -3
- package/dist/cli/{loader.mjs → types.mjs} +163 -4
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/_resolve.d.ts +1 -1
- package/dist/runtime/internal/nuxt.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
|
@@ -1,177 +1,17 @@
|
|
|
1
|
-
export { l as loadOptions } from '../
|
|
2
|
-
import { promises, lstatSync } from 'node:fs';
|
|
3
|
-
import { defu } from 'defu';
|
|
4
|
-
import { resolve, dirname, join, isAbsolute, relative } from 'pathe';
|
|
5
|
-
import { readPackageJSON } from 'pkg-types';
|
|
6
|
-
import { relativeWithDot, resolveSilgiModule } from 'silgi/kit';
|
|
7
|
-
import { withTrailingSlash } from 'ufo';
|
|
1
|
+
export { l as loadOptions, s as silgiGenerateType } from '../types.mjs';
|
|
8
2
|
import 'c12';
|
|
9
3
|
import 'compatx';
|
|
10
4
|
import 'klona/full';
|
|
11
5
|
import 'std-env';
|
|
12
6
|
import 'consola';
|
|
13
7
|
import 'consola/utils';
|
|
8
|
+
import 'pathe';
|
|
14
9
|
import 'escape-string-regexp';
|
|
15
10
|
import 'mlly';
|
|
11
|
+
import 'node:fs';
|
|
16
12
|
import 'node:url';
|
|
13
|
+
import 'pkg-types';
|
|
14
|
+
import 'silgi/kit';
|
|
17
15
|
import 'silgi/runtime/meta';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
return isAbsolute(p) && lstatSync(p).isFile() ? dirname(p) : p;
|
|
22
|
-
} catch {
|
|
23
|
-
}
|
|
24
|
-
return p;
|
|
25
|
-
}
|
|
26
|
-
function renderAttrs(obj) {
|
|
27
|
-
const attrs = [];
|
|
28
|
-
for (const key in obj) {
|
|
29
|
-
attrs.push(renderAttr(key, obj[key]));
|
|
30
|
-
}
|
|
31
|
-
return attrs.join(" ");
|
|
32
|
-
}
|
|
33
|
-
function renderAttr(key, value) {
|
|
34
|
-
return value ? `${key}="${value}"` : "";
|
|
35
|
-
}
|
|
36
|
-
async function silgiGenerateType(silgi) {
|
|
37
|
-
const rootDirWithSlash = withTrailingSlash(silgi.options.rootDir);
|
|
38
|
-
const tsConfigPath = resolve(
|
|
39
|
-
silgi.options.rootDir,
|
|
40
|
-
silgi.options.typescript.tsconfigPath
|
|
41
|
-
);
|
|
42
|
-
const tsconfigDir = dirname(tsConfigPath);
|
|
43
|
-
const include = /* @__PURE__ */ new Set([
|
|
44
|
-
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi.d.ts")).replace(
|
|
45
|
-
/^(?=[^.])/,
|
|
46
|
-
"./"
|
|
47
|
-
),
|
|
48
|
-
join(relativeWithDot(tsconfigDir, silgi.options.rootDir), "**/*"),
|
|
49
|
-
...silgi.options.srcDir === silgi.options.rootDir ? [] : [join(relativeWithDot(tsconfigDir, silgi.options.srcDir), "**/*")]
|
|
50
|
-
]);
|
|
51
|
-
const exclude = /* @__PURE__ */ new Set([
|
|
52
|
-
// nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
|
|
53
|
-
relativeWithDot(silgi.options.build.dir, resolve(silgi.options.rootDir, "dist"))
|
|
54
|
-
]);
|
|
55
|
-
for (const dir of silgi.options.modulesDir) {
|
|
56
|
-
exclude.add(relativeWithDot(silgi.options.build.dir, dir));
|
|
57
|
-
}
|
|
58
|
-
const moduleEntryPaths = [];
|
|
59
|
-
for (const m of silgi.scanModules) {
|
|
60
|
-
if (m.entryPath) {
|
|
61
|
-
moduleEntryPaths.push(getDirectory(m.entryPath));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const modulePaths = await resolveSilgiModule(rootDirWithSlash, moduleEntryPaths);
|
|
65
|
-
for (const path of modulePaths) {
|
|
66
|
-
const relative2 = relativeWithDot(silgi.options.build.dir, path);
|
|
67
|
-
include.add(join(relative2, "runtime"));
|
|
68
|
-
exclude.add(join(relative2, "runtime/server"));
|
|
69
|
-
include.add(join(relative2, "dist/runtime"));
|
|
70
|
-
exclude.add(join(relative2, "dist/runtime/server"));
|
|
71
|
-
}
|
|
72
|
-
const tsConfig = defu(silgi.options.typescript?.tsConfig, {
|
|
73
|
-
compilerOptions: {
|
|
74
|
-
forceConsistentCasingInFileNames: true,
|
|
75
|
-
strict: silgi.options.typescript.strict,
|
|
76
|
-
noEmit: true,
|
|
77
|
-
target: "ESNext",
|
|
78
|
-
module: "ESNext",
|
|
79
|
-
moduleResolution: "Bundler",
|
|
80
|
-
allowJs: true,
|
|
81
|
-
resolveJsonModule: true,
|
|
82
|
-
jsx: "preserve",
|
|
83
|
-
allowSyntheticDefaultImports: true,
|
|
84
|
-
jsxFactory: "h",
|
|
85
|
-
jsxFragmentFactory: "Fragment",
|
|
86
|
-
allowImportingTsExtensions: true,
|
|
87
|
-
...silgi.options.typescript.customConditions ? { customConditions: ["silgiTypes"] } : {},
|
|
88
|
-
paths: {
|
|
89
|
-
"#silgiImports": [
|
|
90
|
-
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi-imports"))
|
|
91
|
-
],
|
|
92
|
-
...silgi.scanModules.reduce((acc, m) => {
|
|
93
|
-
if (m.entryPath) {
|
|
94
|
-
acc[m.meta.name] = [relativeWithDot(tsconfigDir, m.entryPath)];
|
|
95
|
-
}
|
|
96
|
-
return acc;
|
|
97
|
-
}, {}),
|
|
98
|
-
...silgi.scanModules.reduce((acc, m) => {
|
|
99
|
-
if (m.entryPath) {
|
|
100
|
-
const directory = getDirectory(m.entryPath);
|
|
101
|
-
acc[`${m.meta.name}/*`] = [`${relativeWithDot(tsconfigDir, directory)}/*`];
|
|
102
|
-
}
|
|
103
|
-
return acc;
|
|
104
|
-
}, {})
|
|
105
|
-
// ...(silgi.options.typescript?.internalPaths
|
|
106
|
-
// ? {
|
|
107
|
-
// 'silgi/runtime': [
|
|
108
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
109
|
-
// ],
|
|
110
|
-
// '#internal/silgi': [
|
|
111
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
112
|
-
// ],
|
|
113
|
-
// 'silgi/runtime/*': [
|
|
114
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
115
|
-
// ],
|
|
116
|
-
// '#internal/silgi/*': [
|
|
117
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
118
|
-
// ],
|
|
119
|
-
// }
|
|
120
|
-
// : {}),
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
include: [...include],
|
|
124
|
-
exclude: [...exclude]
|
|
125
|
-
});
|
|
126
|
-
tsConfig.compilerOptions ||= {};
|
|
127
|
-
tsConfig.compilerOptions.paths ||= {};
|
|
128
|
-
tsConfig.include ||= [];
|
|
129
|
-
for (const alias in tsConfig.compilerOptions.paths) {
|
|
130
|
-
const paths = tsConfig.compilerOptions.paths[alias];
|
|
131
|
-
tsConfig.compilerOptions.paths[alias] = await Promise.all(
|
|
132
|
-
paths.map(async (path) => {
|
|
133
|
-
if (!isAbsolute(path)) {
|
|
134
|
-
return path;
|
|
135
|
-
}
|
|
136
|
-
const stats = await promises.stat(path).catch(
|
|
137
|
-
() => null
|
|
138
|
-
/* file does not exist */
|
|
139
|
-
);
|
|
140
|
-
return relativeWithDot(
|
|
141
|
-
tsconfigDir,
|
|
142
|
-
stats?.isFile() ? path.replace(/\b\.\w+$/g, "") : path
|
|
143
|
-
);
|
|
144
|
-
})
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
const references = [];
|
|
148
|
-
await Promise.all([...silgi.options.modules, ...silgi.options._modules].map(async (id) => {
|
|
149
|
-
if (typeof id !== "string") {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const pkg = await readPackageJSON(id, { url: silgi.options.modulesDir }).catch(() => null);
|
|
153
|
-
references.push({ types: pkg?.name || id });
|
|
154
|
-
}));
|
|
155
|
-
const declarations = [];
|
|
156
|
-
await silgi.callHook("prepare:types", { references, declarations, tsConfig });
|
|
157
|
-
tsConfig.include = [...new Set(tsConfig.include.map((p) => isAbsolute(p) ? relativeWithDot(silgi.options.build.dir, p) : p))];
|
|
158
|
-
tsConfig.exclude = [...new Set(tsConfig.exclude.map((p) => isAbsolute(p) ? relativeWithDot(silgi.options.build.dir, p) : p))];
|
|
159
|
-
const _declarations = [
|
|
160
|
-
...references.map((ref) => {
|
|
161
|
-
if ("path" in ref && isAbsolute(ref.path)) {
|
|
162
|
-
ref.path = relative(silgi.options.build.dir, ref.path);
|
|
163
|
-
}
|
|
164
|
-
return `/// <reference ${renderAttrs(ref)} />`;
|
|
165
|
-
}),
|
|
166
|
-
...declarations,
|
|
167
|
-
"",
|
|
168
|
-
"export {}",
|
|
169
|
-
""
|
|
170
|
-
];
|
|
171
|
-
return {
|
|
172
|
-
declarations: _declarations,
|
|
173
|
-
tsConfig
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export { silgiGenerateType };
|
|
16
|
+
import 'ufo';
|
|
17
|
+
import 'defu';
|
package/dist/cli/prepare.mjs
CHANGED
|
@@ -6,14 +6,15 @@ import { promises, existsSync, readFileSync, writeFileSync, mkdirSync } from 'no
|
|
|
6
6
|
import { readdir } from 'node:fs/promises';
|
|
7
7
|
import { resolvePath, parseNodeModulePath, lookupNodeModuleSubpath, resolve as resolve$1 } from 'mlly';
|
|
8
8
|
import { resolveAlias } from 'pathe/utils';
|
|
9
|
-
import { silgiGenerateType, useSilgiCLI, silgiCLICtx } from 'silgi/core';
|
|
10
9
|
import { relativeWithDot, isDirectory, writeFile, resolveAlias as resolveAlias$1, resolvePath as resolvePath$1, normalizeTemplate, useLogger } from 'silgi/kit';
|
|
11
10
|
import { toExports, scanExports, createUnimport } from 'unimport';
|
|
12
11
|
import { createJiti } from 'dev-jiti';
|
|
13
12
|
import { readPackageJSON } from 'pkg-types';
|
|
14
13
|
import { hash } from 'ohash';
|
|
14
|
+
import { s as silgiGenerateType, l as loadOptions } from './types.mjs';
|
|
15
15
|
import { consola } from 'consola';
|
|
16
16
|
import { createHooks, createDebugger } from 'hookable';
|
|
17
|
+
import { useSilgiCLI, silgiCLICtx } from 'silgi/core';
|
|
17
18
|
import { pascalCase } from 'scule';
|
|
18
19
|
import { h as hasInstalledModule } from './compatibility.mjs';
|
|
19
20
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
@@ -23,14 +24,14 @@ import ignore from 'ignore';
|
|
|
23
24
|
import { parseSync } from '@oxc-parser/wasm';
|
|
24
25
|
import { klona } from 'klona';
|
|
25
26
|
import { createStorage, builtinDrivers } from 'unstorage';
|
|
26
|
-
import { l as loadOptions } from './loader.mjs';
|
|
27
|
-
import 'semver/functions/satisfies.js';
|
|
28
27
|
import 'c12';
|
|
29
28
|
import 'compatx';
|
|
30
29
|
import 'klona/full';
|
|
31
30
|
import 'std-env';
|
|
32
31
|
import 'consola/utils';
|
|
33
32
|
import 'escape-string-regexp';
|
|
33
|
+
import 'defu';
|
|
34
|
+
import 'semver/functions/satisfies.js';
|
|
34
35
|
|
|
35
36
|
async function h3Framework(silgi, skip = false) {
|
|
36
37
|
if (silgi.options.preset !== "h3" && skip === false)
|
|
@@ -4,15 +4,16 @@ import { klona } from 'klona/full';
|
|
|
4
4
|
import { isDebug, isTest } from 'std-env';
|
|
5
5
|
import consola from 'consola';
|
|
6
6
|
import { colors } from 'consola/utils';
|
|
7
|
-
import { relative, join, resolve, isAbsolute } from 'pathe';
|
|
7
|
+
import { relative, join, resolve, isAbsolute, dirname } from 'pathe';
|
|
8
8
|
import escapeRE from 'escape-string-regexp';
|
|
9
9
|
import { resolveModuleExportNames, resolvePath as resolvePath$1 } from 'mlly';
|
|
10
|
-
import { existsSync } from 'node:fs';
|
|
10
|
+
import { existsSync, promises, lstatSync } from 'node:fs';
|
|
11
11
|
import { pathToFileURL } from 'node:url';
|
|
12
12
|
import { findWorkspaceDir, readPackageJSON } from 'pkg-types';
|
|
13
|
-
import { resolveSilgiPath, resolveAlias, resolvePath } from 'silgi/kit';
|
|
13
|
+
import { resolveSilgiPath, resolveAlias, resolvePath, relativeWithDot, resolveSilgiModule } from 'silgi/kit';
|
|
14
14
|
import { runtimeDir, pkgDir } from 'silgi/runtime/meta';
|
|
15
15
|
import { isRelative, withLeadingSlash, withTrailingSlash } from 'ufo';
|
|
16
|
+
import { defu } from 'defu';
|
|
16
17
|
|
|
17
18
|
const SilgiCLIDefaults = {
|
|
18
19
|
// General
|
|
@@ -578,4 +579,162 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
|
|
|
578
579
|
return options;
|
|
579
580
|
}
|
|
580
581
|
|
|
581
|
-
|
|
582
|
+
function getDirectory(p) {
|
|
583
|
+
try {
|
|
584
|
+
return isAbsolute(p) && lstatSync(p).isFile() ? dirname(p) : p;
|
|
585
|
+
} catch {
|
|
586
|
+
}
|
|
587
|
+
return p;
|
|
588
|
+
}
|
|
589
|
+
function renderAttrs(obj) {
|
|
590
|
+
const attrs = [];
|
|
591
|
+
for (const key in obj) {
|
|
592
|
+
attrs.push(renderAttr(key, obj[key]));
|
|
593
|
+
}
|
|
594
|
+
return attrs.join(" ");
|
|
595
|
+
}
|
|
596
|
+
function renderAttr(key, value) {
|
|
597
|
+
return value ? `${key}="${value}"` : "";
|
|
598
|
+
}
|
|
599
|
+
async function silgiGenerateType(silgi) {
|
|
600
|
+
const rootDirWithSlash = withTrailingSlash(silgi.options.rootDir);
|
|
601
|
+
const tsConfigPath = resolve(
|
|
602
|
+
silgi.options.rootDir,
|
|
603
|
+
silgi.options.typescript.tsconfigPath
|
|
604
|
+
);
|
|
605
|
+
const tsconfigDir = dirname(tsConfigPath);
|
|
606
|
+
const include = /* @__PURE__ */ new Set([
|
|
607
|
+
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi.d.ts")).replace(
|
|
608
|
+
/^(?=[^.])/,
|
|
609
|
+
"./"
|
|
610
|
+
),
|
|
611
|
+
join(relativeWithDot(tsconfigDir, silgi.options.rootDir), "**/*"),
|
|
612
|
+
...silgi.options.srcDir === silgi.options.rootDir ? [] : [join(relativeWithDot(tsconfigDir, silgi.options.srcDir), "**/*")]
|
|
613
|
+
]);
|
|
614
|
+
const exclude = /* @__PURE__ */ new Set([
|
|
615
|
+
// nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
|
|
616
|
+
relativeWithDot(silgi.options.build.dir, resolve(silgi.options.rootDir, "dist"))
|
|
617
|
+
]);
|
|
618
|
+
for (const dir of silgi.options.modulesDir) {
|
|
619
|
+
exclude.add(relativeWithDot(silgi.options.build.dir, dir));
|
|
620
|
+
}
|
|
621
|
+
const moduleEntryPaths = [];
|
|
622
|
+
for (const m of silgi.scanModules) {
|
|
623
|
+
if (m.entryPath) {
|
|
624
|
+
moduleEntryPaths.push(getDirectory(m.entryPath));
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
const modulePaths = await resolveSilgiModule(rootDirWithSlash, moduleEntryPaths);
|
|
628
|
+
for (const path of modulePaths) {
|
|
629
|
+
const relative2 = relativeWithDot(silgi.options.build.dir, path);
|
|
630
|
+
include.add(join(relative2, "runtime"));
|
|
631
|
+
exclude.add(join(relative2, "runtime/server"));
|
|
632
|
+
include.add(join(relative2, "dist/runtime"));
|
|
633
|
+
exclude.add(join(relative2, "dist/runtime/server"));
|
|
634
|
+
}
|
|
635
|
+
const tsConfig = defu(silgi.options.typescript?.tsConfig, {
|
|
636
|
+
compilerOptions: {
|
|
637
|
+
forceConsistentCasingInFileNames: true,
|
|
638
|
+
strict: silgi.options.typescript.strict,
|
|
639
|
+
noEmit: true,
|
|
640
|
+
target: "ESNext",
|
|
641
|
+
module: "ESNext",
|
|
642
|
+
moduleResolution: "Bundler",
|
|
643
|
+
allowJs: true,
|
|
644
|
+
resolveJsonModule: true,
|
|
645
|
+
jsx: "preserve",
|
|
646
|
+
allowSyntheticDefaultImports: true,
|
|
647
|
+
jsxFactory: "h",
|
|
648
|
+
jsxFragmentFactory: "Fragment",
|
|
649
|
+
allowImportingTsExtensions: true,
|
|
650
|
+
...silgi.options.typescript.customConditions ? { customConditions: ["silgiTypes"] } : {},
|
|
651
|
+
paths: {
|
|
652
|
+
"#silgiImports": [
|
|
653
|
+
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi-imports"))
|
|
654
|
+
],
|
|
655
|
+
...silgi.scanModules.reduce((acc, m) => {
|
|
656
|
+
if (m.entryPath) {
|
|
657
|
+
acc[m.meta.name] = [relativeWithDot(tsconfigDir, m.entryPath)];
|
|
658
|
+
}
|
|
659
|
+
return acc;
|
|
660
|
+
}, {}),
|
|
661
|
+
...silgi.scanModules.reduce((acc, m) => {
|
|
662
|
+
if (m.entryPath) {
|
|
663
|
+
const directory = getDirectory(m.entryPath);
|
|
664
|
+
acc[`${m.meta.name}/*`] = [`${relativeWithDot(tsconfigDir, directory)}/*`];
|
|
665
|
+
}
|
|
666
|
+
return acc;
|
|
667
|
+
}, {})
|
|
668
|
+
// ...(silgi.options.typescript?.internalPaths
|
|
669
|
+
// ? {
|
|
670
|
+
// 'silgi/runtime': [
|
|
671
|
+
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
672
|
+
// ],
|
|
673
|
+
// '#internal/silgi': [
|
|
674
|
+
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
675
|
+
// ],
|
|
676
|
+
// 'silgi/runtime/*': [
|
|
677
|
+
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
678
|
+
// ],
|
|
679
|
+
// '#internal/silgi/*': [
|
|
680
|
+
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
681
|
+
// ],
|
|
682
|
+
// }
|
|
683
|
+
// : {}),
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
include: [...include],
|
|
687
|
+
exclude: [...exclude]
|
|
688
|
+
});
|
|
689
|
+
tsConfig.compilerOptions ||= {};
|
|
690
|
+
tsConfig.compilerOptions.paths ||= {};
|
|
691
|
+
tsConfig.include ||= [];
|
|
692
|
+
for (const alias in tsConfig.compilerOptions.paths) {
|
|
693
|
+
const paths = tsConfig.compilerOptions.paths[alias];
|
|
694
|
+
tsConfig.compilerOptions.paths[alias] = await Promise.all(
|
|
695
|
+
paths.map(async (path) => {
|
|
696
|
+
if (!isAbsolute(path)) {
|
|
697
|
+
return path;
|
|
698
|
+
}
|
|
699
|
+
const stats = await promises.stat(path).catch(
|
|
700
|
+
() => null
|
|
701
|
+
/* file does not exist */
|
|
702
|
+
);
|
|
703
|
+
return relativeWithDot(
|
|
704
|
+
tsconfigDir,
|
|
705
|
+
stats?.isFile() ? path.replace(/\b\.\w+$/g, "") : path
|
|
706
|
+
);
|
|
707
|
+
})
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
const references = [];
|
|
711
|
+
await Promise.all([...silgi.options.modules, ...silgi.options._modules].map(async (id) => {
|
|
712
|
+
if (typeof id !== "string") {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
const pkg = await readPackageJSON(id, { url: silgi.options.modulesDir }).catch(() => null);
|
|
716
|
+
references.push({ types: pkg?.name || id });
|
|
717
|
+
}));
|
|
718
|
+
const declarations = [];
|
|
719
|
+
await silgi.callHook("prepare:types", { references, declarations, tsConfig });
|
|
720
|
+
tsConfig.include = [...new Set(tsConfig.include.map((p) => isAbsolute(p) ? relativeWithDot(silgi.options.build.dir, p) : p))];
|
|
721
|
+
tsConfig.exclude = [...new Set(tsConfig.exclude.map((p) => isAbsolute(p) ? relativeWithDot(silgi.options.build.dir, p) : p))];
|
|
722
|
+
const _declarations = [
|
|
723
|
+
...references.map((ref) => {
|
|
724
|
+
if ("path" in ref && isAbsolute(ref.path)) {
|
|
725
|
+
ref.path = relative(silgi.options.build.dir, ref.path);
|
|
726
|
+
}
|
|
727
|
+
return `/// <reference ${renderAttrs(ref)} />`;
|
|
728
|
+
}),
|
|
729
|
+
...declarations,
|
|
730
|
+
"",
|
|
731
|
+
"export {}",
|
|
732
|
+
""
|
|
733
|
+
];
|
|
734
|
+
return {
|
|
735
|
+
declarations: _declarations,
|
|
736
|
+
tsConfig
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export { loadOptions as l, silgiGenerateType as s };
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { CompatibilityDateSpec } from 'compatx';
|
|
1
2
|
import type { SilgiPreset, SilgiPresetMeta } from 'silgi/types';
|
|
2
|
-
import { type CompatibilityDateSpec } from 'compatx';
|
|
3
3
|
export declare function resolvePreset(name: string, opts: {
|
|
4
4
|
static?: boolean;
|
|
5
5
|
compatibilityDate?: false | CompatibilityDateSpec;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { AsyncData, UseFetchOptions } from 'nuxt/app';
|
|
1
2
|
import type { FetchError } from 'ofetch';
|
|
2
3
|
import type { SilgiRouterTypes } from 'silgi/types';
|
|
3
|
-
import { type AsyncData, type UseFetchOptions } from 'nuxt/app';
|
|
4
4
|
type TrimAfterFourSlashes<T extends string> = T extends `/${infer S1}/${infer S2}/${infer S3}/${infer S4}/${infer _}` ? `/${S1}/${S2}/${S3}/${S4}` : T;
|
|
5
5
|
type AllPaths = SilgiRouterTypes extends {
|
|
6
6
|
keys: infer U;
|