@useavalon/avalon 0.1.18 → 0.1.19

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 CHANGED
@@ -1,54 +1,54 @@
1
- # @useavalon/avalon
2
-
3
- Core framework package for [Avalon](https://useavalon.dev) — a multi-framework islands architecture for the modern web.
4
-
5
- ## Features
6
-
7
- - Islands architecture with zero JavaScript by default
8
- - Multi-framework support (React, Preact, Vue, Svelte, Solid, Lit, Qwik)
9
- - Selective hydration (`on:client`, `on:visible`, `on:idle`, `on:interaction`)
10
- - File-system routing with nested layouts
11
- - API routes and middleware
12
- - MDX support with rehype/remark plugins
13
- - SSR with streaming support
14
- - Edge deployment via Nitro (Node, Deno, Bun, Cloudflare, Vercel, etc.)
15
- - Vite 8 powered with HMR
16
-
17
- ## Quick start
18
-
19
- ```bash
20
- npm create avalon@latest
21
- # or
22
- bun create avalon
23
- ```
24
-
25
- Or install manually:
26
-
27
- ```bash
28
- bun add @useavalon/avalon
29
- ```
30
-
31
- ## Usage
32
-
33
- ```tsx
34
- // pages/index.tsx
35
- import Counter from '../components/Counter.tsx';
36
-
37
- export default function Home() {
38
- return (
39
- <div>
40
- <h1>Hello Avalon</h1>
41
- <Counter island={{ condition: 'on:visible' }} />
42
- </div>
43
- );
44
- }
45
- ```
46
-
47
- ## Links
48
-
49
- - [Documentation](https://useavalon.dev/docs/introduction)
50
- - [GitHub](https://github.com/useAvalon/Avalon)
51
-
52
- ## License
53
-
54
- MIT
1
+ # @useavalon/avalon
2
+
3
+ Core framework package for [Avalon](https://useavalon.dev) — a multi-framework islands architecture for the modern web.
4
+
5
+ ## Features
6
+
7
+ - Islands architecture with zero JavaScript by default
8
+ - Multi-framework support (React, Preact, Vue, Svelte, Solid, Lit, Qwik)
9
+ - Selective hydration (`on:client`, `on:visible`, `on:idle`, `on:interaction`)
10
+ - File-system routing with nested layouts
11
+ - API routes and middleware
12
+ - MDX support with rehype/remark plugins
13
+ - SSR with streaming support
14
+ - Edge deployment via Nitro (Node, Deno, Bun, Cloudflare, Vercel, etc.)
15
+ - Vite 8 powered with HMR
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ npm create avalon@latest
21
+ # or
22
+ bun create avalon
23
+ ```
24
+
25
+ Or install manually:
26
+
27
+ ```bash
28
+ bun add @useavalon/avalon
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```tsx
34
+ // pages/index.tsx
35
+ import Counter from '../components/Counter.tsx';
36
+
37
+ export default function Home() {
38
+ return (
39
+ <div>
40
+ <h1>Hello Avalon</h1>
41
+ <Counter island={{ condition: 'on:visible' }} />
42
+ </div>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ## Links
48
+
49
+ - [Documentation](https://useavalon.dev/docs/introduction)
50
+ - [GitHub](https://github.com/useAvalon/Avalon)
51
+
52
+ ## License
53
+
54
+ MIT
@@ -1 +1 @@
1
- export{PersistentIsland}from"../components/PersistentIsland.tsx";export{usePersistentIslandContext,PersistentIslandProvider,createPersistentIslandContext}from"../core/islands/persistent-island-context.tsx";export{usePersistentState}from"../core/islands/use-persistent-state.js";export{IslandPersistence,defaultIslandPersistence}from"../core/islands/island-persistence.js";export{IslandStateSerializer}from"../core/islands/island-state-serializer.js";export{IslandErrorBoundary,withIslandErrorBoundary}from"../components/IslandErrorBoundary.tsx";export{LayoutErrorBoundary}from"../components/LayoutErrorBoundary.tsx";export{LayoutDataErrorBoundary}from"../components/LayoutDataErrorBoundary.tsx";export{StreamingErrorBoundary,withStreamingErrorBoundary}from"../components/StreamingErrorBoundary.tsx";export{StreamingLayout,StreamingSuspense,withStreaming,useStreamingState}from"../components/StreamingLayout.tsx";export{Image}from"../components/Image.tsx";
1
+ export{PersistentIsland}from"../components/PersistentIsland.js";export{usePersistentIslandContext,PersistentIslandProvider,createPersistentIslandContext}from"../core/islands/persistent-island-context.js";export{usePersistentState}from"../core/islands/use-persistent-state.js";export{IslandPersistence,defaultIslandPersistence}from"../core/islands/island-persistence.js";export{IslandStateSerializer}from"../core/islands/island-state-serializer.js";export{IslandErrorBoundary,withIslandErrorBoundary}from"../components/IslandErrorBoundary.js";export{LayoutErrorBoundary}from"../components/LayoutErrorBoundary.js";export{LayoutDataErrorBoundary}from"../components/LayoutDataErrorBoundary.js";export{StreamingErrorBoundary,withStreamingErrorBoundary}from"../components/StreamingErrorBoundary.js";export{StreamingLayout,StreamingSuspense,withStreaming,useStreamingState}from"../components/StreamingLayout.js";export{Image}from"../components/Image.js";
@@ -1,68 +1,68 @@
1
- /**
2
- * Type declarations for framework runtime imports
3
- *
4
- * These are dynamic imports that are resolved by Vite at runtime in the browser.
5
- * The actual packages are provided by the user's project dependencies.
6
- */
7
-
8
- declare module 'react' {
9
- export function createElement<P = Record<string, unknown>>(
10
- component: unknown,
11
- props: P | null,
12
- ...children: unknown[]
13
- ): unknown;
14
- export const version: string;
15
- }
16
-
17
- declare module 'react-dom/client' {
18
- export interface Root {
19
- render(element: unknown): void;
20
- unmount(): void;
21
- }
22
-
23
- export function hydrateRoot(
24
- container: HTMLElement,
25
- element: unknown,
26
- options?: {
27
- onRecoverableError?: (error: Error) => void;
28
- }
29
- ): Root;
30
-
31
- export function createRoot(container: HTMLElement): Root;
32
- }
33
-
34
- declare module 'vue' {
35
- export interface App {
36
- mount(rootContainer: HTMLElement | string, isHydrate?: boolean): unknown;
37
- unmount(): void;
38
- use(plugin: unknown, ...options: unknown[]): App;
39
- component(name: string, component: unknown): App;
40
- directive(name: string, directive: unknown): App;
41
- provide(key: string | symbol, value: unknown): App;
42
- config: {
43
- errorHandler?: (err: Error, instance: unknown, info: string) => void;
44
- warnHandler?: (msg: string, instance: unknown, trace: string) => void;
45
- };
46
- }
47
-
48
- export function createApp(rootComponent: unknown, rootProps?: Record<string, unknown>): App;
49
- export const version: string;
50
- }
51
-
52
-
53
- declare module 'svelte' {
54
- export interface SvelteComponent {
55
- new (options: {
56
- target: HTMLElement;
57
- props?: Record<string, unknown>;
58
- hydrate?: boolean;
59
- intro?: boolean;
60
- anchor?: Element | null;
61
- context?: Map<unknown, unknown>;
62
- }): {
63
- $set(props: Record<string, unknown>): void;
64
- $destroy(): void;
65
- $on?(event: string, handler: (...args: unknown[]) => void): () => void;
66
- };
67
- }
68
- }
1
+ /**
2
+ * Type declarations for framework runtime imports
3
+ *
4
+ * These are dynamic imports that are resolved by Vite at runtime in the browser.
5
+ * The actual packages are provided by the user's project dependencies.
6
+ */
7
+
8
+ declare module 'react' {
9
+ export function createElement<P = Record<string, unknown>>(
10
+ component: unknown,
11
+ props: P | null,
12
+ ...children: unknown[]
13
+ ): unknown;
14
+ export const version: string;
15
+ }
16
+
17
+ declare module 'react-dom/client' {
18
+ export interface Root {
19
+ render(element: unknown): void;
20
+ unmount(): void;
21
+ }
22
+
23
+ export function hydrateRoot(
24
+ container: HTMLElement,
25
+ element: unknown,
26
+ options?: {
27
+ onRecoverableError?: (error: Error) => void;
28
+ }
29
+ ): Root;
30
+
31
+ export function createRoot(container: HTMLElement): Root;
32
+ }
33
+
34
+ declare module 'vue' {
35
+ export interface App {
36
+ mount(rootContainer: HTMLElement | string, isHydrate?: boolean): unknown;
37
+ unmount(): void;
38
+ use(plugin: unknown, ...options: unknown[]): App;
39
+ component(name: string, component: unknown): App;
40
+ directive(name: string, directive: unknown): App;
41
+ provide(key: string | symbol, value: unknown): App;
42
+ config: {
43
+ errorHandler?: (err: Error, instance: unknown, info: string) => void;
44
+ warnHandler?: (msg: string, instance: unknown, trace: string) => void;
45
+ };
46
+ }
47
+
48
+ export function createApp(rootComponent: unknown, rootProps?: Record<string, unknown>): App;
49
+ export const version: string;
50
+ }
51
+
52
+
53
+ declare module 'svelte' {
54
+ export interface SvelteComponent {
55
+ new (options: {
56
+ target: HTMLElement;
57
+ props?: Record<string, unknown>;
58
+ hydrate?: boolean;
59
+ intro?: boolean;
60
+ anchor?: Element | null;
61
+ context?: Map<unknown, unknown>;
62
+ }): {
63
+ $set(props: Record<string, unknown>): void;
64
+ $destroy(): void;
65
+ $on?(event: string, handler: (...args: unknown[]) => void): () => void;
66
+ };
67
+ }
68
+ }
@@ -1,46 +1,46 @@
1
- /**
2
- * Type definitions for Vite HMR API
3
- */
4
-
5
- declare module 'vite/types/hmrPayload' {
6
- export interface HMRPayload {
7
- type: 'update' | 'full-reload' | 'prune' | 'error' | 'connected' | 'custom';
8
- updates?: Update[];
9
- timestamp?: number;
10
- path?: string;
11
- err?: Error;
12
- data?: unknown;
13
- event?: string;
14
- }
15
-
16
- export interface Update {
17
- type: 'js-update' | 'css-update';
18
- path: string;
19
- acceptedPath: string;
20
- timestamp: number;
21
- explicitImportRequired?: boolean;
22
- }
23
- }
24
-
25
- declare global {
26
- interface ImportMeta {
27
- hot?: {
28
- accept(): void;
29
- accept(cb: (mod: unknown) => void): void;
30
- accept(dep: string, cb: (mod: unknown) => void): void;
31
- accept(deps: readonly string[], cb: (mods: unknown[]) => void): void;
32
-
33
- dispose(cb: (data: unknown) => void): void;
34
- decline(): void;
35
- invalidate(): void;
36
-
37
- on(event: string, cb: (payload: unknown) => void): void;
38
- off(event: string, cb: (payload: unknown) => void): void;
39
- send(event: string, data?: unknown): void;
40
-
41
- data: unknown;
42
- };
43
- }
44
- }
45
-
46
- export {};
1
+ /**
2
+ * Type definitions for Vite HMR API
3
+ */
4
+
5
+ declare module 'vite/types/hmrPayload' {
6
+ export interface HMRPayload {
7
+ type: 'update' | 'full-reload' | 'prune' | 'error' | 'connected' | 'custom';
8
+ updates?: Update[];
9
+ timestamp?: number;
10
+ path?: string;
11
+ err?: Error;
12
+ data?: unknown;
13
+ event?: string;
14
+ }
15
+
16
+ export interface Update {
17
+ type: 'js-update' | 'css-update';
18
+ path: string;
19
+ acceptedPath: string;
20
+ timestamp: number;
21
+ explicitImportRequired?: boolean;
22
+ }
23
+ }
24
+
25
+ declare global {
26
+ interface ImportMeta {
27
+ hot?: {
28
+ accept(): void;
29
+ accept(cb: (mod: unknown) => void): void;
30
+ accept(dep: string, cb: (mod: unknown) => void): void;
31
+ accept(deps: readonly string[], cb: (mods: unknown[]) => void): void;
32
+
33
+ dispose(cb: (data: unknown) => void): void;
34
+ decline(): void;
35
+ invalidate(): void;
36
+
37
+ on(event: string, cb: (payload: unknown) => void): void;
38
+ off(event: string, cb: (payload: unknown) => void): void;
39
+ send(event: string, data?: unknown): void;
40
+
41
+ data: unknown;
42
+ };
43
+ }
44
+ }
45
+
46
+ export {};
@@ -1,70 +1,70 @@
1
- /**
2
- * Type declarations for Vite virtual modules
3
- *
4
- * These modules are resolved by Vite at runtime in the browser.
5
- * They don't exist as actual files but are provided by Vite's plugin system.
6
- */
7
-
8
- declare module '/@useavalon/preact/client' {
9
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
10
- export function getHydrationScript(): string;
11
- }
12
-
13
- declare module '/@useavalon/react/client' {
14
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
15
- export function getHydrationScript(): string;
16
- }
17
-
18
- declare module '/@useavalon/vue/client' {
19
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
20
- export function getHydrationScript(): string;
21
- }
22
-
23
- declare module '/@useavalon/svelte/client' {
24
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
25
- export function getHydrationScript(): string;
26
- }
27
-
28
- declare module '/@useavalon/solid/client' {
29
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
30
- export function getHydrationScript(): string;
31
- }
32
-
33
- declare module '/@useavalon/lit/client' {
34
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
35
- export function getHydrationScript(): string;
36
- }
37
-
38
- declare module '/@useavalon/qwik/client' {
39
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
40
- export function getHydrationScript(): string;
41
- }
42
-
43
- // HMR adapter virtual modules
44
- declare module '/@useavalon/react/client/hmr' {
45
- export { reactAdapter } from '@useavalon/react/client/hmr';
46
- }
47
-
48
- declare module '/@useavalon/preact/client/hmr' {
49
- export { preactAdapter } from '@useavalon/preact/client/hmr';
50
- }
51
-
52
- declare module '/@useavalon/vue/client/hmr' {
53
- export { vueAdapter } from '@useavalon/vue/client/hmr';
54
- }
55
-
56
- declare module '/@useavalon/svelte/client/hmr' {
57
- export { svelteAdapter } from '@useavalon/svelte/client/hmr';
58
- }
59
-
60
- declare module '/@useavalon/solid/client/hmr' {
61
- export { solidAdapter } from '@useavalon/solid/client/hmr';
62
- }
63
-
64
- declare module '/@useavalon/lit/client/hmr' {
65
- export { litAdapter } from '@useavalon/lit/client/hmr';
66
- }
67
-
68
- declare module '/@useavalon/qwik/client/hmr' {
69
- export { qwikAdapter } from '@useavalon/qwik/client/hmr';
70
- }
1
+ /**
2
+ * Type declarations for Vite virtual modules
3
+ *
4
+ * These modules are resolved by Vite at runtime in the browser.
5
+ * They don't exist as actual files but are provided by Vite's plugin system.
6
+ */
7
+
8
+ declare module '/@useavalon/preact/client' {
9
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
10
+ export function getHydrationScript(): string;
11
+ }
12
+
13
+ declare module '/@useavalon/react/client' {
14
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
15
+ export function getHydrationScript(): string;
16
+ }
17
+
18
+ declare module '/@useavalon/vue/client' {
19
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
20
+ export function getHydrationScript(): string;
21
+ }
22
+
23
+ declare module '/@useavalon/svelte/client' {
24
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
25
+ export function getHydrationScript(): string;
26
+ }
27
+
28
+ declare module '/@useavalon/solid/client' {
29
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
30
+ export function getHydrationScript(): string;
31
+ }
32
+
33
+ declare module '/@useavalon/lit/client' {
34
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
35
+ export function getHydrationScript(): string;
36
+ }
37
+
38
+ declare module '/@useavalon/qwik/client' {
39
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
40
+ export function getHydrationScript(): string;
41
+ }
42
+
43
+ // HMR adapter virtual modules
44
+ declare module '/@useavalon/react/client/hmr' {
45
+ export { reactAdapter } from '@useavalon/react/client/hmr';
46
+ }
47
+
48
+ declare module '/@useavalon/preact/client/hmr' {
49
+ export { preactAdapter } from '@useavalon/preact/client/hmr';
50
+ }
51
+
52
+ declare module '/@useavalon/vue/client/hmr' {
53
+ export { vueAdapter } from '@useavalon/vue/client/hmr';
54
+ }
55
+
56
+ declare module '/@useavalon/svelte/client/hmr' {
57
+ export { svelteAdapter } from '@useavalon/svelte/client/hmr';
58
+ }
59
+
60
+ declare module '/@useavalon/solid/client/hmr' {
61
+ export { solidAdapter } from '@useavalon/solid/client/hmr';
62
+ }
63
+
64
+ declare module '/@useavalon/lit/client/hmr' {
65
+ export { litAdapter } from '@useavalon/lit/client/hmr';
66
+ }
67
+
68
+ declare module '/@useavalon/qwik/client/hmr' {
69
+ export { qwikAdapter } from '@useavalon/qwik/client/hmr';
70
+ }