@gnosticdev/hono-actions 2.0.8 → 2.0.9
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.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/dist/actions.js
CHANGED
|
@@ -2,7 +2,7 @@ import { zValidator } from '@hono/zod-validator';
|
|
|
2
2
|
import { z } from 'astro/zod';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
4
|
|
|
5
|
-
// src/
|
|
5
|
+
// src/define-action.ts
|
|
6
6
|
|
|
7
7
|
// src/error.ts
|
|
8
8
|
var HonoActionError = class extends Error {
|
|
@@ -20,7 +20,7 @@ var HonoActionError = class extends Error {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
// src/
|
|
23
|
+
// src/define-action.ts
|
|
24
24
|
function defineHonoAction({ schema, handler }) {
|
|
25
25
|
const app = new Hono();
|
|
26
26
|
const route = app.post(
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ declare const optionsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
14
14
|
* - `src/hono/actions.ts`
|
|
15
15
|
* - `src/hono/index.ts`
|
|
16
16
|
* - `src/hono.ts`
|
|
17
|
+
* - `src/hono-actions.ts`
|
|
18
|
+
*
|
|
19
|
+
* **NOTE** `src/actions.ts` is reserved for Astro Actions and will be ignored.
|
|
17
20
|
*
|
|
18
21
|
* @default 'src/server/actions.ts'
|
|
19
22
|
*/
|
package/dist/index.js
CHANGED
|
@@ -213,6 +213,9 @@ var optionsSchema = z.object({
|
|
|
213
213
|
* - `src/hono/actions.ts`
|
|
214
214
|
* - `src/hono/index.ts`
|
|
215
215
|
* - `src/hono.ts`
|
|
216
|
+
* - `src/hono-actions.ts`
|
|
217
|
+
*
|
|
218
|
+
* **NOTE** `src/actions.ts` is reserved for Astro Actions and will be ignored.
|
|
216
219
|
*
|
|
217
220
|
* @default 'src/server/actions.ts'
|
|
218
221
|
*/
|
|
@@ -224,7 +227,8 @@ var ACTION_PATTERNS = [
|
|
|
224
227
|
"src/server/actions.ts",
|
|
225
228
|
"src/hono/actions.ts",
|
|
226
229
|
"src/hono/index.ts",
|
|
227
|
-
"src/hono.ts"
|
|
230
|
+
"src/hono.ts",
|
|
231
|
+
"src/hono-actions.ts"
|
|
228
232
|
];
|
|
229
233
|
var integration_default = defineIntegration({
|
|
230
234
|
name: "@gnosticdev/hono-actions",
|
|
@@ -236,7 +240,7 @@ var integration_default = defineIntegration({
|
|
|
236
240
|
`Base path ${basePath} is reserved by Astro; pick another (e.g. /api2).`
|
|
237
241
|
);
|
|
238
242
|
}
|
|
239
|
-
const
|
|
243
|
+
const { resolve } = createResolver(import.meta.url);
|
|
240
244
|
return {
|
|
241
245
|
name,
|
|
242
246
|
hooks: {
|
|
@@ -256,7 +260,7 @@ ${ACTION_PATTERNS.map((p) => ` - ${p}`).join("\n")}`
|
|
|
256
260
|
);
|
|
257
261
|
return;
|
|
258
262
|
}
|
|
259
|
-
const resolvedActionsPath =
|
|
263
|
+
const resolvedActionsPath = resolve(actionsPath);
|
|
260
264
|
params.addWatchFile(resolvedActionsPath);
|
|
261
265
|
logger.info(
|
|
262
266
|
`Found actions: ${path.relative(root, resolvedActionsPath)}`
|
|
@@ -302,7 +306,9 @@ ${ACTION_PATTERNS.map((p) => ` - ${p}`).join("\n")}`
|
|
|
302
306
|
"client.ts"
|
|
303
307
|
);
|
|
304
308
|
if (!config.site) {
|
|
305
|
-
logger.warn(
|
|
309
|
+
logger.warn(
|
|
310
|
+
"No site url found in astro config, add one if you want to use the hono client with SSR"
|
|
311
|
+
);
|
|
306
312
|
}
|
|
307
313
|
const clientContent = generateHonoClient(config.server.port);
|
|
308
314
|
await fs.writeFile(clientPathAbs, clientContent, "utf-8");
|
package/package.json
CHANGED