@gnosticdev/hono-actions 1.0.16 → 1.0.17

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/actions.d.ts CHANGED
@@ -51,7 +51,7 @@ type HonoActionParams<TPath extends string, TSchema extends HonoActionSchema, TR
51
51
  * @param handler - The handler function for the action.
52
52
  * @returns A Hono app instance with the defined route
53
53
  */
54
- declare function defineHonoAction<TPath extends string, TSchema extends HonoActionSchema, TReturn, TEnv extends HonoEnv = HonoEnv>({ path, schema, handler }: HonoActionParams<TPath, TSchema, TReturn, TEnv>): hono_hono_base.HonoBase<TEnv, { [K in hono_types.MergePath<"/", TPath>]: {
54
+ declare function defineHonoAction<TEnv extends HonoEnv, TPath extends string, TSchema extends HonoActionSchema, TReturn>({ path, schema, handler }: HonoActionParams<TPath, TSchema, TReturn, TEnv>): hono_hono_base.HonoBase<TEnv, { [K in hono_types.MergePath<"/", TPath>]: {
55
55
  $post: {
56
56
  input: hono_types.AddParam<unknown extends ((undefined extends v.InferInput<TSchema | v.UnionSchema<[v.NeverSchema<undefined>, v.ObjectSchema<{}, undefined>], undefined>> ? true : false) extends true ? {
57
57
  json?: (v.InferInput<TSchema | v.UnionSchema<[v.NeverSchema<undefined>, v.ObjectSchema<{}, undefined>], undefined>> extends infer T_1 ? T_1 extends v.InferInput<TSchema | v.UnionSchema<[v.NeverSchema<undefined>, v.ObjectSchema<{}, undefined>], undefined>> ? T_1 extends any ? T_1 : { [K2 in keyof T_1]?: any; } : never : never) | undefined;
package/dist/index.js CHANGED
@@ -2307,12 +2307,9 @@ export async function buildRouter(){
2307
2307
  export type HonoRouter = Awaited<ReturnType<typeof buildRouter>>
2308
2308
 
2309
2309
  const app = await buildRouter()
2310
- console.log('------- Hono Routes -------
2311
- ')
2310
+ console.log('------- Hono Routes -------')
2312
2311
  showRoutes(app)
2313
- console.log('
2314
- ---------------------------
2315
- ')
2312
+ console.log('---------------------------')
2316
2313
  export default app`;
2317
2314
  }
2318
2315
  var getAstroHandler = (adapter) => {
@@ -2337,7 +2334,7 @@ export { handler as ALL }
2337
2334
  throw new Error(`Unsupported adapter: ${adapter}`);
2338
2335
  }
2339
2336
  };
2340
- var getHonoClient = (port, siteUrl) => `
2337
+ var getHonoClient = (port) => `
2341
2338
  // Generated by Hono Actions Integration
2342
2339
  import type { HonoRouter } from './router.js'
2343
2340
  import { hc } from 'hono/client'
@@ -2354,7 +2351,7 @@ export function getBaseUrl() {
2354
2351
  }
2355
2352
 
2356
2353
  // server side (production) needs full url
2357
- return ${siteUrl ?? "import.meta.env.SITE"}
2354
+ return import.meta.env.SITE ?? ''
2358
2355
  }
2359
2356
 
2360
2357
  export const honoClient = hc<HonoRouter>(getBaseUrl())
@@ -2437,10 +2434,7 @@ ${ACTION_PATTERNS.map((p) => ` - ${p}`).join("\n")}`
2437
2434
  codeGenDir.pathname,
2438
2435
  "client.ts"
2439
2436
  );
2440
- const clientContent = getHonoClient(
2441
- config.server.port,
2442
- config.site
2443
- );
2437
+ const clientContent = getHonoClient(config.server.port);
2444
2438
  await fs.writeFile(clientPathAbs, clientContent, "utf-8");
2445
2439
  addVirtualImports(params, {
2446
2440
  name,
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  },
55
55
  "type": "module",
56
56
  "types": "./dist/index.d.ts",
57
- "version": "1.0.16"
57
+ "version": "1.0.17"
58
58
  }