@hakubase/cli 0.4.0 → 0.4.1

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/astro.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { HakubaseViteOptions } from './vite.js'
2
+ /** The Vite plugin of @hakubase/cli, as an Astro integration. */
3
+ export default function hakubase(options?: HakubaseViteOptions): { name: string; hooks: Record<string, (...args: any[]) => void> }
4
+ export { hakubase }
package/next.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ export interface HakubaseNextOptions {
2
+ /** The site's address; else HAKUBASE_SITE_URL, else the linked project. */
3
+ siteUrl?: string
4
+ /** The key; else HAKUBASE_KEY, else .env.local. */
5
+ key?: string
6
+ /** Where to look for the linked project. */
7
+ root?: string
8
+ log?(message: string): void
9
+ }
10
+
11
+ type Config = Record<string, any>
12
+ type ConfigFunction = (phase: string, context: { defaultConfig: Config }) => Config | Promise<Config>
13
+
14
+ /**
15
+ * In `next dev`, Hakubase's paths (/_hb, /_data, /_fn, /_m) reach the real
16
+ * site with the key; the build sees the config untouched.
17
+ */
18
+ export declare function withHakubase<T extends Config>(config: T | ConfigFunction, options?: HakubaseNextOptions):
19
+ (phase: string, context: { defaultConfig: Config }) => Promise<T>
20
+ export default withHakubase
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "name": "@hakubase/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Link, type, develop and deploy Hakubase code sites; Vite, Astro and Next.js helpers for development with real data.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "hakubase": "./bin/hakubase.js"
8
8
  },
9
9
  "exports": {
10
- "./vite": "./vite.js",
11
- "./astro": "./astro.js",
12
- "./package.json": "./package.json",
13
- "./next": "./next.js"
10
+ "./vite": {
11
+ "types": "./vite.d.ts",
12
+ "default": "./vite.js"
13
+ },
14
+ "./astro": {
15
+ "types": "./astro.d.ts",
16
+ "default": "./astro.js"
17
+ },
18
+ "./next": {
19
+ "types": "./next.d.ts",
20
+ "default": "./next.js"
21
+ },
22
+ "./package.json": "./package.json"
14
23
  },
15
24
  "files": [
16
25
  "bin",
@@ -18,7 +27,10 @@
18
27
  "vite.js",
19
28
  "astro.js",
20
29
  "next.js",
21
- "README.md"
30
+ "README.md",
31
+ "vite.d.ts",
32
+ "astro.d.ts",
33
+ "next.d.ts"
22
34
  ],
23
35
  "engines": {
24
36
  "node": ">=20"
package/vite.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export interface HakubaseViteOptions {
2
+ root?: string
3
+ key?: string
4
+ log?(message: string): void
5
+ }
6
+ /** In development, Hakubase's paths reach the real site with the key. */
7
+ export default function hakubase(options?: HakubaseViteOptions): { name: string; apply: 'serve'; config(): Record<string, unknown> }
8
+ export { hakubase }