silgi 0.8.41 → 0.8.43
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/prepare.mjs +9 -5
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/_all.gen.mjs +2 -2
- package/dist/runtime/internal/ofetch.d.ts +5 -7
- package/dist/runtime/internal/ofetch.mjs +1 -1
- package/package.json +1 -1
- /package/dist/presets/{npmpackage → npmPackage}/preset.d.ts +0 -0
- /package/dist/presets/{npmpackage → npmPackage}/preset.mjs +0 -0
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCommand } from 'citty';
|
|
2
|
-
import consola
|
|
2
|
+
import consola, { consola as consola$1 } from 'consola';
|
|
3
3
|
import { join, resolve, isAbsolute, relative, dirname, basename, extname } from 'pathe';
|
|
4
4
|
import { devDependencies, version } from 'silgi/meta';
|
|
5
5
|
import { runtimeDir } from 'silgi/runtime/meta';
|
|
@@ -275,6 +275,10 @@ async function readCoreFile(silgi) {
|
|
|
275
275
|
} catch (error) {
|
|
276
276
|
if (silgi.options.debug) {
|
|
277
277
|
console.error("Failed to read core.ts file:", error);
|
|
278
|
+
} else {
|
|
279
|
+
if (error instanceof Error) {
|
|
280
|
+
consola.withTag("silgi").error(error.message);
|
|
281
|
+
}
|
|
278
282
|
}
|
|
279
283
|
return {
|
|
280
284
|
context,
|
|
@@ -988,7 +992,7 @@ async function installModule(moduleToInstall, silgi = useSilgiCLI(), inlineOptio
|
|
|
988
992
|
}
|
|
989
993
|
}
|
|
990
994
|
|
|
991
|
-
const logger$1 = consola;
|
|
995
|
+
const logger$1 = consola$1;
|
|
992
996
|
async function _resolveSilgiModule(mod, silgi) {
|
|
993
997
|
let _url;
|
|
994
998
|
let buildTimeModuleMeta = {};
|
|
@@ -1367,7 +1371,7 @@ async function scanFiles$1(silgi) {
|
|
|
1367
1371
|
if (caseCorrected) {
|
|
1368
1372
|
const original = relative(silgi.options.serverDir, dir);
|
|
1369
1373
|
const corrected = relative(silgi.options.serverDir, join(dirname(dir), caseCorrected));
|
|
1370
|
-
consola.warn(`Components not scanned from \`~/${corrected}\`. Did you mean to name the directory \`~/${original}\` instead?`);
|
|
1374
|
+
consola$1.warn(`Components not scanned from \`~/${corrected}\`. Did you mean to name the directory \`~/${original}\` instead?`);
|
|
1371
1375
|
}
|
|
1372
1376
|
}
|
|
1373
1377
|
}
|
|
@@ -1721,7 +1725,7 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1721
1725
|
hooks,
|
|
1722
1726
|
// vfs: {}
|
|
1723
1727
|
_requiredModules: {},
|
|
1724
|
-
logger: consola.withTag("silgi"),
|
|
1728
|
+
logger: consola$1.withTag("silgi"),
|
|
1725
1729
|
close: () => silgi.hooks.callHook("close", silgi),
|
|
1726
1730
|
storage: void 0,
|
|
1727
1731
|
scanModules: [],
|
|
@@ -1809,7 +1813,7 @@ const prepare = defineCommand({
|
|
|
1809
1813
|
}
|
|
1810
1814
|
await generate();
|
|
1811
1815
|
await generate();
|
|
1812
|
-
consola
|
|
1816
|
+
consola.withTag("silgi").success("Prepare completed");
|
|
1813
1817
|
}
|
|
1814
1818
|
});
|
|
1815
1819
|
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _h3 from "./h3/preset.mjs";
|
|
2
2
|
import _nitro from "./nitro/preset.mjs";
|
|
3
|
-
import
|
|
3
|
+
import _npmPackage from "./npmPackage/preset.mjs";
|
|
4
4
|
import _nuxt from "./nuxt/preset.mjs";
|
|
5
5
|
export default [
|
|
6
6
|
..._h3,
|
|
7
7
|
..._nitro,
|
|
8
|
-
...
|
|
8
|
+
..._npmPackage,
|
|
9
9
|
..._nuxt
|
|
10
10
|
];
|
|
@@ -20,13 +20,11 @@ export type RequestBodyOption<R extends ValidRoute, M extends Method<R>> = TrimA
|
|
|
20
20
|
body?: never;
|
|
21
21
|
} : never;
|
|
22
22
|
export type RouterParams<R extends ValidRoute> = ExtractPathParams<R>;
|
|
23
|
-
type SilgiFetchOptions<
|
|
24
|
-
method
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
params?: never;
|
|
29
|
-
}) & Omit<FetchOptions, 'query' | 'body' | 'method'>;
|
|
23
|
+
type SilgiFetchOptions<P extends AllPaths | (string & {}), BasePath extends keyof SilgiRouterTypes = TrimAfterFourSlashes<P> extends keyof SilgiRouterTypes ? TrimAfterFourSlashes<P> : never, M extends keyof SilgiRouterTypes[BasePath] = keyof SilgiRouterTypes[BasePath]> = {
|
|
24
|
+
method?: M;
|
|
25
|
+
params?: ExtractPathParams<P>;
|
|
26
|
+
body?: SilgiRouterTypes[BasePath][M]['input'];
|
|
27
|
+
} & Omit<FetchOptions, 'method' | 'body' | 'params'>;
|
|
30
28
|
export type SilgiFetchClient = <R extends ValidRoute, M extends Method<R> = 'get' extends Method<R> ? 'get' : Method<R>>(url: R, options: SilgiFetchOptions<R, M>) => Promise<FetchResponseData<R, M>>;
|
|
31
29
|
export declare function silgiFetchRequestInterceptor(ctx: FetchContext): void;
|
|
32
30
|
export declare function createSilgiFetch(options: FetchOptions | ((options: FetchOptions) => FetchOptions), localFetch?: typeof globalThis.$fetch): SilgiFetchClient;
|
|
@@ -6,7 +6,7 @@ export function createSilgiFetch(options, localFetch) {
|
|
|
6
6
|
const finalOpts = {
|
|
7
7
|
...typeof options === "function" ? options(opts) : options,
|
|
8
8
|
...opts,
|
|
9
|
-
method: opts
|
|
9
|
+
method: opts?.method || "get"
|
|
10
10
|
};
|
|
11
11
|
const $fetch = getFetch(url, finalOpts, localFetch);
|
|
12
12
|
return $fetch(fillPath(url, opts.params), finalOpts);
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|