silgi 0.8.42 → 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.
@@ -1,4 +1,4 @@
1
- const version = "0.8.42";
1
+ const version = "0.8.43";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -277,7 +277,7 @@ async function readCoreFile(silgi) {
277
277
  console.error("Failed to read core.ts file:", error);
278
278
  } else {
279
279
  if (error instanceof Error) {
280
- consola.error(error.message);
280
+ consola.withTag("silgi").error(error.message);
281
281
  }
282
282
  }
283
283
  return {
@@ -1813,7 +1813,7 @@ const prepare = defineCommand({
1813
1813
  }
1814
1814
  await generate();
1815
1815
  await generate();
1816
- consola.success("Prepare completed");
1816
+ consola.withTag("silgi").success("Prepare completed");
1817
1817
  }
1818
1818
  });
1819
1819
 
@@ -1,4 +1,4 @@
1
- const version = "0.8.42";
1
+ const version = "0.8.43";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1,4 +1,4 @@
1
- const version = "0.8.42";
1
+ const version = "0.8.43";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1,10 +1,10 @@
1
1
  import _h3 from "./h3/preset.mjs";
2
2
  import _nitro from "./nitro/preset.mjs";
3
- import _npmpackage from "./npmpackage/preset.mjs";
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
- ..._npmpackage,
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<R extends ValidRoute, M extends Method<R>> = {
24
- method: M;
25
- } & RequestBodyOption<R, M> & (RouterParams<R> extends object ? {
26
- params?: RouterParams<R>;
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.method || "get"
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.8.42",
4
+ "version": "0.8.43",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {