@useavalon/avalon 0.1.46 → 0.1.47
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/README.md +54 -54
- package/dist/src/client/adapters/lit-adapter.js +1 -0
- package/dist/src/client/adapters/preact-adapter.js +1 -0
- package/dist/src/client/adapters/qwik-adapter.js +1 -0
- package/dist/src/client/adapters/react-adapter.js +1 -0
- package/dist/src/client/adapters/solid-adapter.js +1 -0
- package/dist/src/client/adapters/svelte-adapter.js +1 -0
- package/dist/src/client/adapters/vue-adapter.js +1 -0
- package/dist/src/client/components.js +1 -1
- package/dist/src/client/types/framework-runtime.d.ts +68 -68
- package/dist/src/client/types/vite-hmr.d.ts +46 -46
- package/dist/src/client/types/vite-virtual-modules.d.ts +70 -70
- package/dist/src/nitro/config.d.ts +39 -0
- package/dist/src/nitro/config.js +1 -1
- package/dist/src/prerender/index.d.ts +53 -0
- package/dist/src/prerender/index.js +1 -0
- package/dist/src/prerender/prerender.d.ts +20 -0
- package/dist/src/prerender/prerender.js +1 -0
- package/dist/src/types/image.d.ts +106 -106
- package/dist/src/types/index.d.ts +22 -22
- package/dist/src/types/island-jsx.d.ts +33 -33
- package/dist/src/types/island-prop.d.ts +20 -20
- package/dist/src/types/mdx.d.ts +6 -6
- package/dist/src/types/urlpattern.d.ts +49 -49
- package/dist/src/types/vite-env.d.ts +11 -11
- package/dist/src/vite-plugin/nitro-integration.js +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avalon Prerender Module
|
|
3
|
+
*
|
|
4
|
+
* Post-build prerendering for static site generation (SSG).
|
|
5
|
+
*
|
|
6
|
+
* Nitro v3's Vite builder does not yet support the built-in prerender
|
|
7
|
+
* pipeline. This module provides an equivalent: after the Vite/Nitro build
|
|
8
|
+
* completes, it boots the built server locally, fetches each configured
|
|
9
|
+
* route, and writes the resulting HTML to the public output directory.
|
|
10
|
+
*
|
|
11
|
+
* Prerendered pages are served as static files from the CDN — zero
|
|
12
|
+
* function invocations. Islands on prerendered pages still hydrate
|
|
13
|
+
* normally on the client.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // In post-build.mjs or build.mjs:
|
|
18
|
+
* import { prerenderRoutes } from '@useavalon/avalon/prerender';
|
|
19
|
+
*
|
|
20
|
+
* await prerenderRoutes({
|
|
21
|
+
* serverEntryPath: '.output/server/index.mjs',
|
|
22
|
+
* outputDir: '.output/public',
|
|
23
|
+
* routes: ['/'],
|
|
24
|
+
* crawlLinks: true,
|
|
25
|
+
* ignore: ['/demo/data-fetching'],
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export interface PrerenderConfig {
|
|
30
|
+
/** Path to the built Nitro server entry (e.g. '.output/server/index.mjs') */
|
|
31
|
+
serverEntryPath: string;
|
|
32
|
+
/** Directory to write prerendered HTML files */
|
|
33
|
+
outputDir: string;
|
|
34
|
+
/** Explicit routes to prerender */
|
|
35
|
+
routes?: string[];
|
|
36
|
+
/** Crawl <a> links in prerendered pages to discover more routes */
|
|
37
|
+
crawlLinks?: boolean;
|
|
38
|
+
/** Routes to ignore (strings, RegExps, or filter functions) */
|
|
39
|
+
ignore?: Array<string | RegExp | ((path: string) => undefined | null | boolean)>;
|
|
40
|
+
/** Number of concurrent prerender requests @default 4 */
|
|
41
|
+
concurrency?: number;
|
|
42
|
+
/** Fail the build if a prerender route errors @default false */
|
|
43
|
+
failOnError?: boolean;
|
|
44
|
+
/** Write /about as /about/index.html @default true */
|
|
45
|
+
autoSubfolderIndex?: boolean;
|
|
46
|
+
/** Number of retry attempts per route @default 3 */
|
|
47
|
+
retry?: number;
|
|
48
|
+
/** Delay between retries in ms @default 500 */
|
|
49
|
+
retryDelay?: number;
|
|
50
|
+
/** Port to run the prerender server on @default 13172 */
|
|
51
|
+
port?: number;
|
|
52
|
+
}
|
|
53
|
+
export { prerenderRoutes } from './prerender.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{prerenderRoutes}from"./prerender.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prerender implementation.
|
|
3
|
+
*
|
|
4
|
+
* Spawns the built Nitro server as a child process, fetches routes via HTTP,
|
|
5
|
+
* extracts links, and writes static HTML files to the output directory.
|
|
6
|
+
*
|
|
7
|
+
* This approach avoids dependency issues (e.g. undici, platform-specific
|
|
8
|
+
* modules) that occur when importing the server bundle directly.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrerenderConfig } from './index.ts';
|
|
11
|
+
/**
|
|
12
|
+
* Prerender routes by spawning the built server and fetching each route via HTTP.
|
|
13
|
+
*/
|
|
14
|
+
export declare function prerenderRoutes(config: PrerenderConfig): Promise<{
|
|
15
|
+
prerenderedRoutes: string[];
|
|
16
|
+
errors: Array<{
|
|
17
|
+
route: string;
|
|
18
|
+
error: string;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolve as e,join as t,dirname as n}from"node:path";import{existsSync as r,mkdirSync as i,writeFileSync as a}from"node:fs";import{spawn as o}from"node:child_process";function s(e){let t=[],n=/<a\s[^>]*href=["']([^"'#?]+)/gi,r;for(;(r=n.exec(e))!==null;){let e=r[1];if(e.startsWith(`/`)&&!e.startsWith(`//`)){if(e.startsWith(`/assets/`)||e.startsWith(`/islands/`)||e.startsWith(`/chunks/`)||e.startsWith(`/_`)||e.match(/\.\w{2,5}$/))continue;t.push(e)}}return[...new Set(t)]}function c(e,t){for(let n of t)if(typeof n==`string`){if(e===n||n.endsWith(`/**`)&&e.startsWith(n.slice(0,-2)))return!0}else if(n instanceof RegExp){if(n.test(e))return!0}else if(typeof n==`function`&&n(e))return!0;return!1}async function l(e,t=15e3){let n=Date.now();for(;Date.now()-n<t;){try{let t=await fetch(`${e}/`);if(t.ok||t.status<500)return}catch{}await new Promise(e=>setTimeout(e,200))}throw Error(`[prerender] Server did not become ready within ${t}ms`)}export async function prerenderRoutes(u){let{serverEntryPath:d,outputDir:f,routes:p=[`/`],crawlLinks:m=!1,ignore:h=[],concurrency:g=4,failOnError:_=!1,autoSubfolderIndex:v=!0,retry:y=3,retryDelay:b=500,port:x=13172}=u,S=e(d);if(!r(S))throw Error(`[prerender] Server entry not found: ${S}`);let C=e(f),w=`http://localhost:${x}`;console.log(`[prerender] Spawning server from ${d} on port ${x}...`);let T=null;try{T=o(`node`,[S],{env:{...process.env,PORT:String(x),NITRO_PORT:String(x),HOST:`127.0.0.1`,NITRO_HOST:`127.0.0.1`,NODE_ENV:`production`},stdio:[`ignore`,`pipe`,`pipe`]}),T.stdout?.on(`data`,e=>{let t=e.toString().trim();t&&console.log(`[prerender:server] ${t}`)}),T.stderr?.on(`data`,e=>{let t=e.toString().trim();t&&console.error(`[prerender:server:err] ${t}`)}),await l(w),console.log(`[prerender] Server ready at ${w}`)}catch(e){throw T?.kill(`SIGKILL`),Error(`[prerender] Failed to start server: ${e.message}`)}let E=[],D=[],O=new Set,k=[...p];console.log(`[prerender] Starting with ${k.length} route(s), crawlLinks=${m}`);async function A(e){for(let t=1;t<=y;t++)try{let t=await fetch(`${w}${e}`);return{html:await t.text(),status:t.status}}catch(n){let r=n instanceof Error?n.message:String(n);if(t<y)console.warn(`[prerender] Retry ${t}/${y} for ${e}: ${r}`),await new Promise(e=>setTimeout(e,b));else return console.error(`[prerender] All ${y} attempts failed for ${e}: ${r}`),null}return null}try{for(;k.length>0;){let e=k.splice(0,g);await Promise.all(e.map(async e=>{let r=e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e;if(O.has(r))return;if(O.add(r),c(r,h)){console.log(`[prerender] ⏭ ${r} (ignored)`);return}let o=await A(r);if(!o){let e=`Failed to fetch ${r} after ${y} attempts`;if(console.error(`[prerender] ❌ ${e}`),D.push({route:r,error:e}),_)throw Error(e);return}if(o.status>=400){let e=`${r} returned ${o.status}`;if(console.error(`[prerender] ❌ ${e}`),D.push({route:r,error:e}),_)throw Error(e);return}let l=v?t(r,`index.html`):r+`.html`,u=t(C,l);if(i(n(u),{recursive:!0}),a(u,o.html),E.push(r),console.log(`[prerender] ✅ ${r} → ${l}`),m){let e=s(o.html);for(let t of e){let e=t.endsWith(`/`)&&t!==`/`?t.slice(0,-1):t;!O.has(e)&&!c(e,h)&&k.push(e)}}}))}}finally{T&&(console.log(`[prerender] Shutting down server...`),T.kill(`SIGKILL`))}return console.log(`[prerender] Done: ${E.length} page(s) prerendered`+(D.length>0?`, ${D.length} error(s)`:``)),{prerenderedRoutes:E,errors:D}}
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type declarations for image imports with vite-imagetools
|
|
3
|
-
*
|
|
4
|
-
* These types enable TypeScript support for optimized image imports.
|
|
5
|
-
* Include this in your tsconfig.json `types` array:
|
|
6
|
-
*
|
|
7
|
-
* ```json
|
|
8
|
-
* {
|
|
9
|
-
* "compilerOptions": {
|
|
10
|
-
* "types": ["@useavalon/avalon/types"]
|
|
11
|
-
* }
|
|
12
|
-
* }
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
declare module "*.jpg" {
|
|
17
|
-
const src: string;
|
|
18
|
-
export default src;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare module "*.jpeg" {
|
|
22
|
-
const src: string;
|
|
23
|
-
export default src;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare module "*.png" {
|
|
27
|
-
const src: string;
|
|
28
|
-
export default src;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare module "*.webp" {
|
|
32
|
-
const src: string;
|
|
33
|
-
export default src;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
declare module "*.avif" {
|
|
37
|
-
const src: string;
|
|
38
|
-
export default src;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare module "*.gif" {
|
|
42
|
-
const src: string;
|
|
43
|
-
export default src;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare module "*.tiff" {
|
|
47
|
-
const src: string;
|
|
48
|
-
export default src;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare module "*.svg" {
|
|
52
|
-
const src: string;
|
|
53
|
-
export default src;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// vite-imagetools srcset output
|
|
57
|
-
interface ImageToolsSrcset {
|
|
58
|
-
src: string;
|
|
59
|
-
srcset: string;
|
|
60
|
-
width: number;
|
|
61
|
-
height: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
declare module "*&as=srcset" {
|
|
65
|
-
const srcset: ImageToolsSrcset;
|
|
66
|
-
export default srcset;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
declare module "*?as=srcset" {
|
|
70
|
-
const srcset: ImageToolsSrcset;
|
|
71
|
-
export default srcset;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// vite-imagetools picture output (multiple formats)
|
|
75
|
-
interface ImageToolsPicture {
|
|
76
|
-
sources: Record<string, ImageToolsSrcset>;
|
|
77
|
-
img: ImageToolsSrcset;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
declare module "*&as=picture" {
|
|
81
|
-
const picture: ImageToolsPicture;
|
|
82
|
-
export default picture;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
declare module "*?as=picture" {
|
|
86
|
-
const picture: ImageToolsPicture;
|
|
87
|
-
export default picture;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// vite-imagetools metadata output
|
|
91
|
-
interface ImageToolsMetadata {
|
|
92
|
-
src: string;
|
|
93
|
-
width: number;
|
|
94
|
-
height: number;
|
|
95
|
-
format: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
declare module "*&as=metadata" {
|
|
99
|
-
const metadata: ImageToolsMetadata;
|
|
100
|
-
export default metadata;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
declare module "*?as=metadata" {
|
|
104
|
-
const metadata: ImageToolsMetadata;
|
|
105
|
-
export default metadata;
|
|
106
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for image imports with vite-imagetools
|
|
3
|
+
*
|
|
4
|
+
* These types enable TypeScript support for optimized image imports.
|
|
5
|
+
* Include this in your tsconfig.json `types` array:
|
|
6
|
+
*
|
|
7
|
+
* ```json
|
|
8
|
+
* {
|
|
9
|
+
* "compilerOptions": {
|
|
10
|
+
* "types": ["@useavalon/avalon/types"]
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
declare module "*.jpg" {
|
|
17
|
+
const src: string;
|
|
18
|
+
export default src;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "*.jpeg" {
|
|
22
|
+
const src: string;
|
|
23
|
+
export default src;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module "*.png" {
|
|
27
|
+
const src: string;
|
|
28
|
+
export default src;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare module "*.webp" {
|
|
32
|
+
const src: string;
|
|
33
|
+
export default src;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module "*.avif" {
|
|
37
|
+
const src: string;
|
|
38
|
+
export default src;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare module "*.gif" {
|
|
42
|
+
const src: string;
|
|
43
|
+
export default src;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare module "*.tiff" {
|
|
47
|
+
const src: string;
|
|
48
|
+
export default src;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare module "*.svg" {
|
|
52
|
+
const src: string;
|
|
53
|
+
export default src;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// vite-imagetools srcset output
|
|
57
|
+
interface ImageToolsSrcset {
|
|
58
|
+
src: string;
|
|
59
|
+
srcset: string;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare module "*&as=srcset" {
|
|
65
|
+
const srcset: ImageToolsSrcset;
|
|
66
|
+
export default srcset;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare module "*?as=srcset" {
|
|
70
|
+
const srcset: ImageToolsSrcset;
|
|
71
|
+
export default srcset;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// vite-imagetools picture output (multiple formats)
|
|
75
|
+
interface ImageToolsPicture {
|
|
76
|
+
sources: Record<string, ImageToolsSrcset>;
|
|
77
|
+
img: ImageToolsSrcset;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare module "*&as=picture" {
|
|
81
|
+
const picture: ImageToolsPicture;
|
|
82
|
+
export default picture;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare module "*?as=picture" {
|
|
86
|
+
const picture: ImageToolsPicture;
|
|
87
|
+
export default picture;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// vite-imagetools metadata output
|
|
91
|
+
interface ImageToolsMetadata {
|
|
92
|
+
src: string;
|
|
93
|
+
width: number;
|
|
94
|
+
height: number;
|
|
95
|
+
format: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare module "*&as=metadata" {
|
|
99
|
+
const metadata: ImageToolsMetadata;
|
|
100
|
+
export default metadata;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare module "*?as=metadata" {
|
|
104
|
+
const metadata: ImageToolsMetadata;
|
|
105
|
+
export default metadata;
|
|
106
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Avalon type definitions.
|
|
3
|
-
*
|
|
4
|
-
* Include this in your tsconfig.json `types` array to get island prop support:
|
|
5
|
-
*
|
|
6
|
-
* ```json
|
|
7
|
-
* {
|
|
8
|
-
* "compilerOptions": {
|
|
9
|
-
* "types": ["@useavalon/avalon/types"]
|
|
10
|
-
* }
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// Re-export island prop types
|
|
16
|
-
export * from './island-prop.d.ts';
|
|
17
|
-
|
|
18
|
-
// Import JSX augmentations (side-effect import for type augmentation)
|
|
19
|
-
import './island-jsx.d.ts';
|
|
20
|
-
|
|
21
|
-
// Import image type declarations
|
|
22
|
-
import './image.d.ts';
|
|
1
|
+
/**
|
|
2
|
+
* Avalon type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Include this in your tsconfig.json `types` array to get island prop support:
|
|
5
|
+
*
|
|
6
|
+
* ```json
|
|
7
|
+
* {
|
|
8
|
+
* "compilerOptions": {
|
|
9
|
+
* "types": ["@useavalon/avalon/types"]
|
|
10
|
+
* }
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// Re-export island prop types
|
|
16
|
+
export * from './island-prop.d.ts';
|
|
17
|
+
|
|
18
|
+
// Import JSX augmentations (side-effect import for type augmentation)
|
|
19
|
+
import './island-jsx.d.ts';
|
|
20
|
+
|
|
21
|
+
// Import image type declarations
|
|
22
|
+
import './image.d.ts';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSX augmentation for the `island` prop.
|
|
3
|
-
*
|
|
4
|
-
* Automatically included via tsconfig.json `compilerOptions.types`.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { IslandDirective } from './island-prop.d.ts';
|
|
8
|
-
|
|
9
|
-
declare module 'preact' {
|
|
10
|
-
namespace JSX {
|
|
11
|
-
interface IntrinsicAttributes {
|
|
12
|
-
island?: IslandDirective;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Augment the global JSX namespace so the `island` prop is accepted on
|
|
18
|
-
// non-Preact components (Svelte, Solid) when used in a Preact JSX context.
|
|
19
|
-
declare global {
|
|
20
|
-
namespace JSX {
|
|
21
|
-
interface IntrinsicAttributes {
|
|
22
|
-
island?: IslandDirective;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Augment Vue's ComponentCustomProps so Volar accepts `island` on all Vue SFCs.
|
|
28
|
-
declare module '@vue/runtime-core' {
|
|
29
|
-
interface ComponentCustomProps {
|
|
30
|
-
island?: IslandDirective;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSX augmentation for the `island` prop.
|
|
3
|
+
*
|
|
4
|
+
* Automatically included via tsconfig.json `compilerOptions.types`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { IslandDirective } from './island-prop.d.ts';
|
|
8
|
+
|
|
9
|
+
declare module 'preact' {
|
|
10
|
+
namespace JSX {
|
|
11
|
+
interface IntrinsicAttributes {
|
|
12
|
+
island?: IslandDirective;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Augment the global JSX namespace so the `island` prop is accepted on
|
|
18
|
+
// non-Preact components (Svelte, Solid) when used in a Preact JSX context.
|
|
19
|
+
declare global {
|
|
20
|
+
namespace JSX {
|
|
21
|
+
interface IntrinsicAttributes {
|
|
22
|
+
island?: IslandDirective;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Augment Vue's ComponentCustomProps so Volar accepts `island` on all Vue SFCs.
|
|
28
|
+
declare module '@vue/runtime-core' {
|
|
29
|
+
interface ComponentCustomProps {
|
|
30
|
+
island?: IslandDirective;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type augmentation for the `island` prop on island components.
|
|
3
|
-
*
|
|
4
|
-
* When importing a component from the islands directory and using it in a page,
|
|
5
|
-
* you can pass an `island` prop to control hydration behavior. The Vite transform
|
|
6
|
-
* plugin intercepts this at build time and converts it to a renderIsland() call.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* import Counter from '../islands/Counter.tsx';
|
|
10
|
-
* <Counter island={{ condition: 'on:interaction' }} someProp={42} />
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export interface IslandDirective {
|
|
14
|
-
/** Hydration condition */
|
|
15
|
-
condition?: 'on:visible' | 'on:interaction' | 'on:idle' | 'on:client' | `media:${string}`;
|
|
16
|
-
/** Force SSR-only rendering without client hydration */
|
|
17
|
-
ssrOnly?: boolean;
|
|
18
|
-
/** Whether to render server-side (default: true) */
|
|
19
|
-
ssr?: boolean;
|
|
20
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Type augmentation for the `island` prop on island components.
|
|
3
|
+
*
|
|
4
|
+
* When importing a component from the islands directory and using it in a page,
|
|
5
|
+
* you can pass an `island` prop to control hydration behavior. The Vite transform
|
|
6
|
+
* plugin intercepts this at build time and converts it to a renderIsland() call.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import Counter from '../islands/Counter.tsx';
|
|
10
|
+
* <Counter island={{ condition: 'on:interaction' }} someProp={42} />
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface IslandDirective {
|
|
14
|
+
/** Hydration condition */
|
|
15
|
+
condition?: 'on:visible' | 'on:interaction' | 'on:idle' | 'on:client' | `media:${string}`;
|
|
16
|
+
/** Force SSR-only rendering without client hydration */
|
|
17
|
+
ssrOnly?: boolean;
|
|
18
|
+
/** Whether to render server-side (default: true) */
|
|
19
|
+
ssr?: boolean;
|
|
20
|
+
}
|
package/dist/src/types/mdx.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentType } from 'preact';
|
|
2
|
-
|
|
3
|
-
declare module '*.mdx' {
|
|
4
|
-
const MDXComponent: ComponentType<Record<string, unknown>>;
|
|
5
|
-
export default MDXComponent;
|
|
6
|
-
}
|
|
1
|
+
import type { ComponentType } from 'preact';
|
|
2
|
+
|
|
3
|
+
declare module '*.mdx' {
|
|
4
|
+
const MDXComponent: ComponentType<Record<string, unknown>>;
|
|
5
|
+
export default MDXComponent;
|
|
6
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global URLPattern type declaration.
|
|
3
|
-
* URLPattern is available at runtime in Node 22+, Bun, and Deno,
|
|
4
|
-
* but TypeScript's lib.dom.d.ts may not include it in all configurations.
|
|
5
|
-
*/
|
|
6
|
-
declare class URLPattern {
|
|
7
|
-
constructor(init?: URLPatternInit | string, baseURL?: string);
|
|
8
|
-
readonly protocol: string;
|
|
9
|
-
readonly username: string;
|
|
10
|
-
readonly password: string;
|
|
11
|
-
readonly hostname: string;
|
|
12
|
-
readonly port: string;
|
|
13
|
-
readonly pathname: string;
|
|
14
|
-
readonly search: string;
|
|
15
|
-
readonly hash: string;
|
|
16
|
-
test(input?: URLPatternInput, baseURL?: string): boolean;
|
|
17
|
-
exec(input?: URLPatternInput, baseURL?: string): URLPatternResult | null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface URLPatternInit {
|
|
21
|
-
baseURL?: string;
|
|
22
|
-
username?: string;
|
|
23
|
-
password?: string;
|
|
24
|
-
hostname?: string;
|
|
25
|
-
port?: string;
|
|
26
|
-
pathname?: string;
|
|
27
|
-
search?: string;
|
|
28
|
-
hash?: string;
|
|
29
|
-
protocol?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
type URLPatternInput = URLPatternInit | string;
|
|
33
|
-
|
|
34
|
-
interface URLPatternComponentResult {
|
|
35
|
-
input: string;
|
|
36
|
-
groups: Record<string, string | undefined>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface URLPatternResult {
|
|
40
|
-
inputs: [URLPatternInput, string?];
|
|
41
|
-
protocol: URLPatternComponentResult;
|
|
42
|
-
username: URLPatternComponentResult;
|
|
43
|
-
password: URLPatternComponentResult;
|
|
44
|
-
hostname: URLPatternComponentResult;
|
|
45
|
-
port: URLPatternComponentResult;
|
|
46
|
-
pathname: URLPatternComponentResult;
|
|
47
|
-
search: URLPatternComponentResult;
|
|
48
|
-
hash: URLPatternComponentResult;
|
|
49
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Global URLPattern type declaration.
|
|
3
|
+
* URLPattern is available at runtime in Node 22+, Bun, and Deno,
|
|
4
|
+
* but TypeScript's lib.dom.d.ts may not include it in all configurations.
|
|
5
|
+
*/
|
|
6
|
+
declare class URLPattern {
|
|
7
|
+
constructor(init?: URLPatternInit | string, baseURL?: string);
|
|
8
|
+
readonly protocol: string;
|
|
9
|
+
readonly username: string;
|
|
10
|
+
readonly password: string;
|
|
11
|
+
readonly hostname: string;
|
|
12
|
+
readonly port: string;
|
|
13
|
+
readonly pathname: string;
|
|
14
|
+
readonly search: string;
|
|
15
|
+
readonly hash: string;
|
|
16
|
+
test(input?: URLPatternInput, baseURL?: string): boolean;
|
|
17
|
+
exec(input?: URLPatternInput, baseURL?: string): URLPatternResult | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface URLPatternInit {
|
|
21
|
+
baseURL?: string;
|
|
22
|
+
username?: string;
|
|
23
|
+
password?: string;
|
|
24
|
+
hostname?: string;
|
|
25
|
+
port?: string;
|
|
26
|
+
pathname?: string;
|
|
27
|
+
search?: string;
|
|
28
|
+
hash?: string;
|
|
29
|
+
protocol?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type URLPatternInput = URLPatternInit | string;
|
|
33
|
+
|
|
34
|
+
interface URLPatternComponentResult {
|
|
35
|
+
input: string;
|
|
36
|
+
groups: Record<string, string | undefined>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface URLPatternResult {
|
|
40
|
+
inputs: [URLPatternInput, string?];
|
|
41
|
+
protocol: URLPatternComponentResult;
|
|
42
|
+
username: URLPatternComponentResult;
|
|
43
|
+
password: URLPatternComponentResult;
|
|
44
|
+
hostname: URLPatternComponentResult;
|
|
45
|
+
port: URLPatternComponentResult;
|
|
46
|
+
pathname: URLPatternComponentResult;
|
|
47
|
+
search: URLPatternComponentResult;
|
|
48
|
+
hash: URLPatternComponentResult;
|
|
49
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_TITLE: string;
|
|
5
|
-
// more env variables...
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ImportMeta {
|
|
9
|
-
readonly env: ImportMetaEnv;
|
|
10
|
-
readonly hot?: import('vite/types/hot').ViteHotContext;
|
|
11
|
-
}
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_APP_TITLE: string;
|
|
5
|
+
// more env variables...
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ImportMeta {
|
|
9
|
+
readonly env: ImportMetaEnv;
|
|
10
|
+
readonly hot?: import('vite/types/hot').ViteHotContext;
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{nitro as e}from"nitro/vite";import{stat as t}from"node:fs/promises";import{existsSync as n}from"node:fs";import{createRequire as r}from"node:module";import{dirname as i,join as a}from"node:path";import{createNitroConfig as o}from"../nitro/config.js";import{createNitroBuildPlugin as s,createIslandManifestPlugin as c,createSourceMapPlugin as l,createSourceMapConfig as u}from"../nitro/index.js";import{discoverScopedMiddleware as d,executeScopedMiddleware as f,clearMiddlewareCache as p}from"../middleware/index.js";import{generateErrorPage as m,generateFallback404 as h}from"../render/error-pages.js";import{collectCssFromModuleGraph as g,injectSsrCss as _}from"../render/collect-css.js";import{getUniversalCSSForHead as v}from"../islands/universal-css-collector.js";import{getUniversalHeadForInjection as y}from"../islands/universal-head-collector.js";function b(e){let t=a(i(r(import.meta.url).resolve(`@useavalon/avalon`)),e);if(e.endsWith(`.ts`)&&!n(t)){let e=t.replace(/\.ts$/,`.js`);if(n(e))return e}return t}function x(e,t){let o=a(i(r(a(process.cwd(),`package.json`)).resolve(`@useavalon/${e}`)),t);if(t.endsWith(`.ts`)&&!n(o)){let e=o.replace(/\.ts$/,`.js`);if(n(e))return e}return o}export const VIRTUAL_MODULE_IDS={PAGE_ROUTES:`virtual:avalon/page-routes`,PAGE_LOADER:`virtual:avalon/page-loader`,ISLAND_MANIFEST:`virtual:avalon/island-manifest`,RUNTIME_CONFIG:`virtual:avalon/runtime-config`,CONFIG:`virtual:avalon/config`};export const RESOLVED_VIRTUAL_IDS={PAGE_ROUTES:`\0`+VIRTUAL_MODULE_IDS.PAGE_ROUTES,PAGE_LOADER:`\0`+VIRTUAL_MODULE_IDS.PAGE_LOADER,ISLAND_MANIFEST:`\0`+VIRTUAL_MODULE_IDS.ISLAND_MANIFEST,RUNTIME_CONFIG:`\0`+VIRTUAL_MODULE_IDS.RUNTIME_CONFIG,CONFIG:`\0`+VIRTUAL_MODULE_IDS.CONFIG};export function createNitroIntegration(t,n={}){let r=o(n,t),i={preset:r.preset,serverDir:n.serverDir??r.serverDir??`./server`,routeRules:r.routeRules,runtimeConfig:r.runtimeConfig,compatibilityDate:r.compatibilityDate,scanDirs:[`.`],noExternals:[`estree-walker`,/^@useavalon\//,/^estree-util/]};n.renderer===!1?i.renderer=!1:r.renderer&&(i.renderer=r.renderer),r.publicRuntimeConfig&&(i.publicRuntimeConfig=r.publicRuntimeConfig),r.publicAssets&&(i.publicAssets=r.publicAssets),r.compressPublicAssets&&(i.compressPublicAssets=r.compressPublicAssets),r.serverEntry&&(i.serverEntry=r.serverEntry);let a=e(i),
|
|
1
|
+
import{nitro as e}from"nitro/vite";import{stat as t}from"node:fs/promises";import{existsSync as n}from"node:fs";import{createRequire as r}from"node:module";import{dirname as i,join as a}from"node:path";import{createNitroConfig as o}from"../nitro/config.js";import{createNitroBuildPlugin as s,createIslandManifestPlugin as c,createSourceMapPlugin as l,createSourceMapConfig as u}from"../nitro/index.js";import{discoverScopedMiddleware as d,executeScopedMiddleware as f,clearMiddlewareCache as p}from"../middleware/index.js";import{generateErrorPage as m,generateFallback404 as h}from"../render/error-pages.js";import{collectCssFromModuleGraph as g,injectSsrCss as _}from"../render/collect-css.js";import{getUniversalCSSForHead as v}from"../islands/universal-css-collector.js";import{getUniversalHeadForInjection as y}from"../islands/universal-head-collector.js";function b(e){let t=a(i(r(import.meta.url).resolve(`@useavalon/avalon`)),e);if(e.endsWith(`.ts`)&&!n(t)){let e=t.replace(/\.ts$/,`.js`);if(n(e))return e}return t}function x(e,t){let o=a(i(r(a(process.cwd(),`package.json`)).resolve(`@useavalon/${e}`)),t);if(t.endsWith(`.ts`)&&!n(o)){let e=o.replace(/\.ts$/,`.js`);if(n(e))return e}return o}export const VIRTUAL_MODULE_IDS={PAGE_ROUTES:`virtual:avalon/page-routes`,PAGE_LOADER:`virtual:avalon/page-loader`,ISLAND_MANIFEST:`virtual:avalon/island-manifest`,RUNTIME_CONFIG:`virtual:avalon/runtime-config`,CONFIG:`virtual:avalon/config`};export const RESOLVED_VIRTUAL_IDS={PAGE_ROUTES:`\0`+VIRTUAL_MODULE_IDS.PAGE_ROUTES,PAGE_LOADER:`\0`+VIRTUAL_MODULE_IDS.PAGE_LOADER,ISLAND_MANIFEST:`\0`+VIRTUAL_MODULE_IDS.ISLAND_MANIFEST,RUNTIME_CONFIG:`\0`+VIRTUAL_MODULE_IDS.RUNTIME_CONFIG,CONFIG:`\0`+VIRTUAL_MODULE_IDS.CONFIG};export function createNitroIntegration(t,n={}){let r=o(n,t),i={preset:r.preset,serverDir:n.serverDir??r.serverDir??`./server`,routeRules:r.routeRules,runtimeConfig:r.runtimeConfig,compatibilityDate:r.compatibilityDate,scanDirs:[`.`],noExternals:[`estree-walker`,/^@useavalon\//,/^estree-util/]};n.renderer===!1?i.renderer=!1:r.renderer&&(i.renderer=r.renderer),r.publicRuntimeConfig&&(i.publicRuntimeConfig=r.publicRuntimeConfig),r.publicAssets&&(i.publicAssets=r.publicAssets),r.compressPublicAssets&&(i.compressPublicAssets=r.compressPublicAssets),r.serverEntry&&(i.serverEntry=r.serverEntry);let a=r.traceDeps??[];i.traceDeps=[...new Set([`undici`,...a])],r.prerender&&(i.prerender={routes:[],crawlLinks:!1});let d=e(i),f=createNitroCoordinationPlugin({avalonConfig:t,nitroConfig:n,verbose:t.verbose}),p=createVirtualModulesPlugin({avalonConfig:t,nitroConfig:n,verbose:t.verbose}),m=s(t,n),h=c(t,{verbose:t.verbose,generatePreloadHints:!0}),g=l(u(n.preset??`node_server`,t.isDev));return{nitroOptions:r,plugins:[...Array.isArray(d)?d:[d],f,p,m,h,g]}}export function createNitroCoordinationPlugin(e){let{avalonConfig:t,verbose:n}=e;return{name:`avalon:nitro-coordination`,enforce:`pre`,configResolved(e){globalThis.__avalonConfig=t},configureServer(e){globalThis.__viteDevServer=e;let r=null;async function i(){return r||=await d({baseDir:`${e.config.root||process.cwd()}/src`,devMode:!1}),r}function a(){r=null}A(e,t,n,a),i().catch(e=>{console.warn(`[middleware] Failed to discover middleware:`,e)}),O(e,t.integrations,n).catch(e=>{console.error(`[prewarm] Core modules pre-warm failed:`,e)}),e.middlewares.use(async(r,a,o)=>{let s=r.url||`/`;if(s.endsWith(`.html`)&&(s=s.slice(0,-5)||`/`),s===`/index`&&(s=`/`),s.startsWith(`/@`)||s.startsWith(`/__`)||s.startsWith(`/node_modules/`)||s.startsWith(`/src/client/`)||s.startsWith(`/packages/`)||s.includes(`.`)&&!s.endsWith(`/`)||s.startsWith(`/api/`))return o();try{if(await E(e,s,r,a,i,n)||await R(e,s,t,a))return;let o=await z(e,s,t);if(o){a.statusCode=200,a.setHeader(`Content-Type`,`text/html`),a.end(o);return}await D(e,s,a,t)}catch(e){console.error(`[SSR Error]`,e),a.statusCode=500,a.setHeader(`Content-Type`,`text/html`),a.end(m(e))}})},buildStart(){}}}async function E(e,t,n,r,i,a){let o=performance.now(),s=await i();if(s.length===0)return!1;let c={};for(let[e,t]of Object.entries(n.headers))typeof t==`string`?c[e]=t:Array.isArray(t)&&(c[e]=t.join(`, `));let l=`http://${n.headers.host||`localhost`}${t}`,u=await f({url:l,method:n.method||`GET`,path:t,node:{req:n,res:r},req:new Request(l,{method:n.method||`GET`,headers:c}),context:{}},s,{devMode:!1}),d=performance.now()-o;return d>100&&console.warn(`⚠️ Slow middleware: ${d.toFixed(0)}ms for ${t}`),u?(r.statusCode=u.status,u.headers.forEach((e,t)=>{r.setHeader(t,e)}),r.end(await u.text()),!0):!1}async function D(e,t,n,r){try{let{discoverErrorPages:i,getErrorPageModule:a,generateDefaultErrorPage:o}=await import(`../nitro/error-handler.js`),s=a(404,await i({isDev:r.isDev,pagesDir:r.pagesDir,loadPageModule:async t=>await e.ssrLoadModule(t)}));if(s?.default&&typeof s.default==`function`){let{renderToHtml:e}=await import(`../render/ssr.js`),r=s.default,i=await e({component:()=>r({statusCode:404,message:`Page not found: ${t}`,url:t})},{});n.statusCode=404,n.setHeader(`Content-Type`,`text/html`),n.end(i);return}let c=o(404,`Page not found: ${t}`,r.isDev);n.statusCode=404,n.setHeader(`Content-Type`,`text/html`),n.end(c)}catch{n.statusCode=404,n.setHeader(`Content-Type`,`text/html`),n.end(h(t))}}async function O(e,t,n){let r=performance.now(),i=[{path:b(`src/render/ssr.ts`),assignTo:`ssr`},{path:b(`src/core/layout/enhanced-layout-resolver.ts`),assignTo:`layout`},{path:b(`src/middleware/index.ts`),assignTo:null},...t.map(e=>({path:x(e,`server/renderer.ts`),assignTo:null}))],a=(await Promise.allSettled(i.map(async({path:t,assignTo:n})=>{let r=await e.ssrLoadModule(t);n===`ssr`&&(I=r),n===`layout`&&(L=r)}))).filter(e=>e.status===`fulfilled`).length,o=performance.now()-r;n&&a>0&&console.log(`🔥 SSR ready in ${o.toFixed(0)}ms (${a}/${i.length} core modules)`)}export function createVirtualModulesPlugin(e){let{avalonConfig:t,nitroConfig:n,verbose:r}=e;return{name:`avalon:nitro-virtual-modules`,enforce:`pre`,resolveId(e){return e===VIRTUAL_MODULE_IDS.PAGE_ROUTES?RESOLVED_VIRTUAL_IDS.PAGE_ROUTES:e===VIRTUAL_MODULE_IDS.PAGE_LOADER?RESOLVED_VIRTUAL_IDS.PAGE_LOADER:e===VIRTUAL_MODULE_IDS.ISLAND_MANIFEST?RESOLVED_VIRTUAL_IDS.ISLAND_MANIFEST:e===VIRTUAL_MODULE_IDS.RUNTIME_CONFIG?RESOLVED_VIRTUAL_IDS.RUNTIME_CONFIG:e===VIRTUAL_MODULE_IDS.CONFIG?RESOLVED_VIRTUAL_IDS.CONFIG:null},async load(e){return e===RESOLVED_VIRTUAL_IDS.PAGE_ROUTES?await j(t,r):e===RESOLVED_VIRTUAL_IDS.PAGE_LOADER?await M(t,r):e===RESOLVED_VIRTUAL_IDS.ISLAND_MANIFEST?N():e===RESOLVED_VIRTUAL_IDS.RUNTIME_CONFIG?P(t,n):e===RESOLVED_VIRTUAL_IDS.CONFIG?generateConfigModule(t,n):null},handleHotUpdate({file:e,server:n}){if(e.includes(t.pagesDir)){let e=n.moduleGraph.getModuleById(RESOLVED_VIRTUAL_IDS.PAGE_ROUTES);e&&n.moduleGraph.invalidateModule(e)}if(e.includes(`vite.config`)||e.includes(`avalon.config`)||e.includes(`nitro.config`)){let e=n.moduleGraph.getModuleById(RESOLVED_VIRTUAL_IDS.CONFIG);e&&n.moduleGraph.invalidateModule(e)}}}}function A(e,t,n,r){e.watcher.on(`change`,e=>{e.includes(`_middleware`)&&(p(),r?.()),(e.includes(`/render/`)||e.includes(`/layout/`)||e.includes(`/islands/`))&&(I=null,L=null),(e.includes(`/layouts/`)||e.includes(`_layout`))&&globalThis.__avalonLayoutResolver?.clearCache?.()}),e.watcher.on(`add`,e=>{e.includes(`_middleware`)&&(p(),r?.())}),e.watcher.on(`unlink`,e=>{e.includes(`_middleware`)&&(p(),r?.())})}async function j(e,t){try{let{getAllPageDirs:t}=await import(`./module-discovery.js`),{discoverPageRoutesFromMultipleDirs:n}=await import(`../nitro/route-discovery.js`),r=await n(await t(e.pagesDir,e.modules,process.cwd()),{developmentMode:e.isDev});return`export const pageRoutes = ${JSON.stringify(r,null,2)};\nexport default pageRoutes;\n`}catch{return`export const pageRoutes = [];
|
|
2
2
|
export default pageRoutes;
|
|
3
3
|
`}}async function M(e,t){try{let{getAllPageDirs:t}=await import(`./module-discovery.js`),{discoverPageRoutesFromMultipleDirs:n}=await import(`../nitro/route-discovery.js`),{relative:r}=await import(`node:path`),i=process.cwd(),a=await n(await t(e.pagesDir,e.modules,i),{developmentMode:e.isDev}),o=[],s=[];for(let e=0;e<a.length;e++){let t=a[e],n=`page_${e}`,c=r(i,t.filePath).replaceAll(`\\`,`/`),l=c.startsWith(`/`)?c:`/`+c;o.push(`import * as ${n} from '${l}';`),s.push(` { pattern: ${JSON.stringify(t.pattern)}, params: ${JSON.stringify(t.params)}, module: ${n} }`)}return[...o,``,`const routes = [`,s.join(`,
|
|
4
4
|
`),`];`,``,`/**`,` * Match a pathname against discovered routes and return the page module.`,` * Uses the same pattern matching as Avalon's route discovery.`,` */`,`export function loadPage(pathname) {`,` const cleanPath = pathname.split('?')[0];`,` for (const route of routes) {`,` if (matchRoute(cleanPath, route.pattern, route.params)) {`,` return route.module;`,` }`,` }`,` return null;`,`}`,``,`function matchRoute(pathname, pattern, paramNames) {`,` // Exact match`,` if (pattern === pathname) return true;`,` // Normalize trailing slashes`,` const normPath = pathname === '/' ? '/' : pathname.replace(/\\/$/, '');`,` const normPattern = pattern === '/' ? '/' : pattern.replace(/\\/$/, '');`,` if (normPath === normPattern) return true;`,` // Dynamic segments: /users/:id matches /users/123`,` if (paramNames.length > 0) {`,` const patternParts = normPattern.split('/');`,` const pathParts = normPath.split('/');`,` if (patternParts.length !== pathParts.length) return false;`,` return patternParts.every((part, i) => part.startsWith(':') || part === pathParts[i]);`,` }`,` return false;`,`}`,``,`export default { loadPage, routes };`,``].join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useavalon/avalon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "Multi-framework islands architecture for the modern web",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -85,7 +85,11 @@
|
|
|
85
85
|
"default": "./dist/src/nitro/config.js"
|
|
86
86
|
},
|
|
87
87
|
"./types/island-jsx": "./dist/src/types/island-jsx.d.ts",
|
|
88
|
-
"./types": "./dist/src/types/index.d.ts"
|
|
88
|
+
"./types": "./dist/src/types/index.d.ts",
|
|
89
|
+
"./prerender": {
|
|
90
|
+
"types": "./dist/src/prerender/index.d.ts",
|
|
91
|
+
"default": "./dist/src/prerender/index.js"
|
|
92
|
+
}
|
|
89
93
|
},
|
|
90
94
|
"typesVersions": {
|
|
91
95
|
"*": {
|