@useavalon/avalon 0.1.0
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 -0
- package/mod.ts +301 -0
- package/package.json +85 -0
- package/src/build/README.md +310 -0
- package/src/build/integration-bundler-plugin.ts +116 -0
- package/src/build/integration-config.ts +168 -0
- package/src/build/integration-detection-plugin.ts +117 -0
- package/src/build/integration-resolver-plugin.ts +90 -0
- package/src/build/island-manifest.ts +269 -0
- package/src/build/island-types-generator.ts +476 -0
- package/src/build/mdx-island-transform.ts +464 -0
- package/src/build/mdx-plugin.ts +98 -0
- package/src/build/page-island-transform.ts +598 -0
- package/src/build/prop-extractors/index.ts +21 -0
- package/src/build/prop-extractors/lit.ts +140 -0
- package/src/build/prop-extractors/qwik.ts +16 -0
- package/src/build/prop-extractors/solid.ts +125 -0
- package/src/build/prop-extractors/svelte.ts +194 -0
- package/src/build/prop-extractors/vue.ts +111 -0
- package/src/build/sidecar-file-manager.ts +104 -0
- package/src/build/sidecar-renderer.ts +30 -0
- package/src/client/adapters/index.ts +13 -0
- package/src/client/adapters/lit-adapter.ts +654 -0
- package/src/client/adapters/preact-adapter.ts +331 -0
- package/src/client/adapters/qwik-adapter.ts +345 -0
- package/src/client/adapters/react-adapter.ts +353 -0
- package/src/client/adapters/solid-adapter.ts +451 -0
- package/src/client/adapters/svelte-adapter.ts +524 -0
- package/src/client/adapters/vue-adapter.ts +467 -0
- package/src/client/components.ts +35 -0
- package/src/client/css-hmr-handler.ts +344 -0
- package/src/client/framework-adapter.ts +462 -0
- package/src/client/hmr-coordinator.ts +396 -0
- package/src/client/hmr-error-overlay.js +533 -0
- package/src/client/main.js +816 -0
- package/src/client/tests/css-hmr-handler.test.ts +360 -0
- package/src/client/tests/framework-adapter.test.ts +519 -0
- package/src/client/tests/hmr-coordinator.test.ts +176 -0
- package/src/client/tests/hydration-option-parsing.test.ts +107 -0
- package/src/client/tests/lit-adapter.test.ts +427 -0
- package/src/client/tests/preact-adapter.test.ts +353 -0
- package/src/client/tests/qwik-adapter.test.ts +343 -0
- package/src/client/tests/react-adapter.test.ts +317 -0
- package/src/client/tests/solid-adapter.test.ts +396 -0
- package/src/client/tests/svelte-adapter.test.ts +387 -0
- package/src/client/tests/vue-adapter.test.ts +407 -0
- package/src/client/types/framework-runtime.d.ts +68 -0
- package/src/client/types/vite-hmr.d.ts +46 -0
- package/src/client/types/vite-virtual-modules.d.ts +60 -0
- package/src/components/Image.tsx +123 -0
- package/src/components/IslandErrorBoundary.tsx +145 -0
- package/src/components/LayoutDataErrorBoundary.tsx +141 -0
- package/src/components/LayoutErrorBoundary.tsx +127 -0
- package/src/components/PersistentIsland.tsx +52 -0
- package/src/components/StreamingErrorBoundary.tsx +233 -0
- package/src/components/StreamingLayout.tsx +538 -0
- package/src/components/tests/component-analyzer.test.ts +96 -0
- package/src/components/tests/component-detection.test.ts +347 -0
- package/src/components/tests/persistent-islands.test.ts +398 -0
- package/src/core/components/component-analyzer.ts +192 -0
- package/src/core/components/component-detection.ts +508 -0
- package/src/core/components/enhanced-framework-detector.ts +500 -0
- package/src/core/components/framework-registry.ts +563 -0
- package/src/core/components/tests/enhanced-framework-detector.test.ts +577 -0
- package/src/core/components/tests/framework-registry.test.ts +465 -0
- package/src/core/content/mdx-processor.ts +46 -0
- package/src/core/integrations/README.md +282 -0
- package/src/core/integrations/index.ts +19 -0
- package/src/core/integrations/loader.ts +125 -0
- package/src/core/integrations/registry.ts +195 -0
- package/src/core/islands/island-persistence.ts +325 -0
- package/src/core/islands/island-state-serializer.ts +258 -0
- package/src/core/islands/persistent-island-context.tsx +80 -0
- package/src/core/islands/use-persistent-state.ts +68 -0
- package/src/core/layout/enhanced-layout-resolver.ts +322 -0
- package/src/core/layout/layout-cache-manager.ts +485 -0
- package/src/core/layout/layout-composer.ts +357 -0
- package/src/core/layout/layout-data-loader.ts +516 -0
- package/src/core/layout/layout-discovery.ts +243 -0
- package/src/core/layout/layout-matcher.ts +299 -0
- package/src/core/layout/layout-types.ts +110 -0
- package/src/core/layout/tests/enhanced-layout-resolver.test.ts +477 -0
- package/src/core/layout/tests/layout-cache-optimization.test.ts +149 -0
- package/src/core/layout/tests/layout-composer.test.ts +486 -0
- package/src/core/layout/tests/layout-data-loader.test.ts +443 -0
- package/src/core/layout/tests/layout-discovery.test.ts +253 -0
- package/src/core/layout/tests/layout-matcher.test.ts +480 -0
- package/src/core/modules/framework-module-resolver.ts +273 -0
- package/src/core/modules/tests/framework-module-resolver.test.ts +263 -0
- package/src/core/modules/tests/module-resolution-integration.test.ts +117 -0
- package/src/islands/component-analysis.ts +213 -0
- package/src/islands/css-utils.ts +565 -0
- package/src/islands/discovery/index.ts +80 -0
- package/src/islands/discovery/registry.ts +340 -0
- package/src/islands/discovery/resolver.ts +477 -0
- package/src/islands/discovery/scanner.ts +386 -0
- package/src/islands/discovery/tests/island-discovery.test.ts +881 -0
- package/src/islands/discovery/types.ts +117 -0
- package/src/islands/discovery/validator.ts +544 -0
- package/src/islands/discovery/watcher.ts +368 -0
- package/src/islands/framework-detection.ts +428 -0
- package/src/islands/integration-loader.ts +490 -0
- package/src/islands/island.tsx +565 -0
- package/src/islands/render-cache.ts +550 -0
- package/src/islands/types.ts +80 -0
- package/src/islands/universal-css-collector.ts +157 -0
- package/src/islands/universal-head-collector.ts +137 -0
- package/src/layout-system.d.ts +592 -0
- package/src/layout-system.ts +218 -0
- package/src/middleware/__tests__/discovery.test.ts +107 -0
- package/src/middleware/discovery.ts +268 -0
- package/src/middleware/executor.ts +315 -0
- package/src/middleware/index.ts +76 -0
- package/src/middleware/types.ts +99 -0
- package/src/nitro/build-config.ts +576 -0
- package/src/nitro/config.ts +483 -0
- package/src/nitro/error-handler.ts +636 -0
- package/src/nitro/index.ts +173 -0
- package/src/nitro/island-manifest.ts +584 -0
- package/src/nitro/middleware-adapter.ts +260 -0
- package/src/nitro/renderer.ts +1458 -0
- package/src/nitro/route-discovery.ts +439 -0
- package/src/nitro/types.ts +321 -0
- package/src/render/collect-css.ts +198 -0
- package/src/render/error-pages.ts +79 -0
- package/src/render/isolated-ssr-renderer.ts +654 -0
- package/src/render/ssr.ts +1030 -0
- package/src/schemas/api.ts +30 -0
- package/src/schemas/core.ts +64 -0
- package/src/schemas/index.ts +212 -0
- package/src/schemas/layout.ts +279 -0
- package/src/schemas/routing/index.ts +38 -0
- package/src/schemas/routing.ts +376 -0
- package/src/types/as-island.ts +20 -0
- package/src/types/image.d.ts +106 -0
- package/src/types/index.d.ts +22 -0
- package/src/types/island-jsx.d.ts +33 -0
- package/src/types/island-prop.d.ts +20 -0
- package/src/types/layout.ts +285 -0
- package/src/types/mdx.d.ts +6 -0
- package/src/types/routing.ts +555 -0
- package/src/types/tests/layout-types.test.ts +197 -0
- package/src/types/types.ts +5 -0
- package/src/types/urlpattern.d.ts +49 -0
- package/src/types/vite-env.d.ts +11 -0
- package/src/utils/dev-logger.ts +299 -0
- package/src/utils/fs.ts +151 -0
- package/src/vite-plugin/auto-discover.ts +551 -0
- package/src/vite-plugin/config.ts +266 -0
- package/src/vite-plugin/errors.ts +127 -0
- package/src/vite-plugin/image-optimization.ts +151 -0
- package/src/vite-plugin/integration-activator.ts +126 -0
- package/src/vite-plugin/island-sidecar-plugin.ts +176 -0
- package/src/vite-plugin/module-discovery.ts +189 -0
- package/src/vite-plugin/nitro-integration.ts +1334 -0
- package/src/vite-plugin/plugin.ts +329 -0
- package/src/vite-plugin/tests/image-optimization.test.ts +54 -0
- package/src/vite-plugin/types.ts +327 -0
- package/src/vite-plugin/validation.ts +228 -0
package/README.md
ADDED
|
@@ -0,0 +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
|
package/mod.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// === Core Avalon + Vite Architecture ===
|
|
2
|
+
|
|
3
|
+
// Vite Plugin - unified configuration API
|
|
4
|
+
export {
|
|
5
|
+
avalon,
|
|
6
|
+
getResolvedConfig,
|
|
7
|
+
getPagesDir,
|
|
8
|
+
getLayoutsDir,
|
|
9
|
+
getNitroConfig,
|
|
10
|
+
isNitroEnabled,
|
|
11
|
+
} from './src/vite-plugin/plugin.ts';
|
|
12
|
+
export type {
|
|
13
|
+
AvalonPluginConfig,
|
|
14
|
+
IntegrationName,
|
|
15
|
+
ResolvedAvalonConfig,
|
|
16
|
+
MDXConfig,
|
|
17
|
+
ResolvedMDXConfig,
|
|
18
|
+
AvalonNitroConfig,
|
|
19
|
+
CacheOptions,
|
|
20
|
+
RouteRule,
|
|
21
|
+
NitroConfigOutput,
|
|
22
|
+
AvalonRuntimeConfig,
|
|
23
|
+
} from './src/vite-plugin/types.ts';
|
|
24
|
+
|
|
25
|
+
// Nitro Integration - virtual modules and coordination
|
|
26
|
+
export {
|
|
27
|
+
createNitroIntegration,
|
|
28
|
+
createNitroCoordinationPlugin,
|
|
29
|
+
createVirtualModulesPlugin,
|
|
30
|
+
getViteDevServer,
|
|
31
|
+
getAvalonConfig,
|
|
32
|
+
isDevelopmentMode,
|
|
33
|
+
VIRTUAL_MODULE_IDS,
|
|
34
|
+
RESOLVED_VIRTUAL_IDS,
|
|
35
|
+
} from './src/vite-plugin/nitro-integration.ts';
|
|
36
|
+
export type { NitroIntegrationResult, NitroCoordinationPluginOptions } from './src/vite-plugin/nitro-integration.ts';
|
|
37
|
+
|
|
38
|
+
// Main exports
|
|
39
|
+
export { renderToHtml } from './src/render/ssr.ts';
|
|
40
|
+
|
|
41
|
+
// Universal Island component (single function auto-detects framework)
|
|
42
|
+
export { default as Island, renderIsland, type IslandProps } from './src/islands/island.tsx';
|
|
43
|
+
|
|
44
|
+
// Island utilities
|
|
45
|
+
export {
|
|
46
|
+
addSvelteSSRCSS,
|
|
47
|
+
getSvelteSSRCSS,
|
|
48
|
+
getSvelteSSRCSSForHead,
|
|
49
|
+
getSvelteSSRCSSStats,
|
|
50
|
+
getSvelteComponentCSS,
|
|
51
|
+
clearSvelteComponentCSS,
|
|
52
|
+
generateComponentScopeId,
|
|
53
|
+
} from './src/islands/css-utils.ts';
|
|
54
|
+
export { detectFramework, detectFrameworkFromSrc, resolveIslandPath } from './src/islands/framework-detection.ts';
|
|
55
|
+
export { analyzeComponentFile, renderComponentSSROnly } from './src/islands/component-analysis.ts';
|
|
56
|
+
export type { Framework, RenderParams, SvelteSSRCSSEntry } from './src/islands/types.ts';
|
|
57
|
+
|
|
58
|
+
// Island render cache utilities
|
|
59
|
+
export {
|
|
60
|
+
clearCache,
|
|
61
|
+
clearIslandCache,
|
|
62
|
+
invalidateCacheForPath,
|
|
63
|
+
invalidateCacheForFile,
|
|
64
|
+
getCacheStats,
|
|
65
|
+
logCacheStats,
|
|
66
|
+
configureCache,
|
|
67
|
+
getCacheConfig,
|
|
68
|
+
} from './src/islands/render-cache.ts';
|
|
69
|
+
export type { CacheConfig as IslandCacheConfig, CacheStats as IslandCacheStats } from './src/islands/render-cache.ts';
|
|
70
|
+
|
|
71
|
+
// Island Discovery Utilities (optional - for advanced use cases)
|
|
72
|
+
// Note: Islands are detected by usage (island prop), not by directory.
|
|
73
|
+
// These utilities are provided for tooling that needs to scan component files.
|
|
74
|
+
export {
|
|
75
|
+
// Scanner functions
|
|
76
|
+
discoverIslandDirectories,
|
|
77
|
+
discoverIslandsInDirectory,
|
|
78
|
+
discoverAllIslands,
|
|
79
|
+
isIslandsDirectory,
|
|
80
|
+
getDefaultIslandsPath,
|
|
81
|
+
hasDefaultIslandsDirectory,
|
|
82
|
+
getQualifiedIslandName,
|
|
83
|
+
parseQualifiedIslandName,
|
|
84
|
+
// Registry
|
|
85
|
+
IslandRegistry,
|
|
86
|
+
createIslandRegistry,
|
|
87
|
+
// Resolver
|
|
88
|
+
IslandResolver,
|
|
89
|
+
createIslandResolver,
|
|
90
|
+
// Validator
|
|
91
|
+
IslandValidator,
|
|
92
|
+
createIslandValidator,
|
|
93
|
+
validateAllIslands,
|
|
94
|
+
formatValidationError,
|
|
95
|
+
formatValidationWarning,
|
|
96
|
+
formatCircularDependency,
|
|
97
|
+
formatValidationResult,
|
|
98
|
+
// Watcher
|
|
99
|
+
IslandWatcher,
|
|
100
|
+
createIslandWatcher,
|
|
101
|
+
// Type utilities
|
|
102
|
+
ISLAND_FILE_EXTENSIONS,
|
|
103
|
+
DEFAULT_DISCOVERY_CONFIG,
|
|
104
|
+
isSupportedIslandExtension,
|
|
105
|
+
} from './src/islands/discovery/index.ts';
|
|
106
|
+
|
|
107
|
+
// Island Discovery Types
|
|
108
|
+
export type {
|
|
109
|
+
IslandDirectory,
|
|
110
|
+
DiscoveredIsland,
|
|
111
|
+
IslandCollision,
|
|
112
|
+
IslandChangeEvent,
|
|
113
|
+
IslandFileExtension,
|
|
114
|
+
IslandDiscoveryConfig,
|
|
115
|
+
ResolutionResult,
|
|
116
|
+
ImportPathOptions,
|
|
117
|
+
ValidationResult,
|
|
118
|
+
ValidationError,
|
|
119
|
+
ValidationWarning,
|
|
120
|
+
CircularDependency,
|
|
121
|
+
IslandChangeCallback,
|
|
122
|
+
IslandWatcherOptions,
|
|
123
|
+
} from './src/islands/discovery/index.ts';
|
|
124
|
+
|
|
125
|
+
// Integration system
|
|
126
|
+
export {
|
|
127
|
+
loadIntegration,
|
|
128
|
+
detectAndLoadIntegration,
|
|
129
|
+
preloadIntegrations,
|
|
130
|
+
detectFrameworksFromPageContent,
|
|
131
|
+
DEFAULT_PRELOAD_FRAMEWORKS,
|
|
132
|
+
} from './src/islands/integration-loader.ts';
|
|
133
|
+
export type { PreloadIntegrationsOptions } from './src/islands/integration-loader.ts';
|
|
134
|
+
export { registry as integrationRegistry } from './src/core/integrations/registry.ts';
|
|
135
|
+
export type {
|
|
136
|
+
Integration,
|
|
137
|
+
RenderParams as IntegrationRenderParams,
|
|
138
|
+
RenderResult,
|
|
139
|
+
IntegrationConfig,
|
|
140
|
+
} from '@useavalon/core';
|
|
141
|
+
|
|
142
|
+
// Build utilities
|
|
143
|
+
export { generateIslandManifest, loadIslandManifest, getIslandBundlePath } from './src/build/island-manifest.ts';
|
|
144
|
+
export type {
|
|
145
|
+
IslandManifest,
|
|
146
|
+
IslandEntry,
|
|
147
|
+
ExtendedIslandManifest,
|
|
148
|
+
ExtendedIslandEntry,
|
|
149
|
+
} from './src/build/island-manifest.ts';
|
|
150
|
+
|
|
151
|
+
// MDX island transform (auto-wraps island imports in MDX with Island() calls)
|
|
152
|
+
export { mdxIslandTransform } from './src/build/mdx-island-transform.ts';
|
|
153
|
+
export type { MDXIslandTransformOptions } from './src/build/mdx-island-transform.ts';
|
|
154
|
+
|
|
155
|
+
// Page island transform (auto-wraps island imports in TSX pages when using `island` prop)
|
|
156
|
+
export { pageIslandTransform } from './src/build/page-island-transform.ts';
|
|
157
|
+
export type { PageIslandTransformOptions } from './src/build/page-island-transform.ts';
|
|
158
|
+
|
|
159
|
+
// Island directive type for the `island` prop
|
|
160
|
+
export type { IslandDirective } from './src/types/island-prop.d.ts';
|
|
161
|
+
export { asIsland } from './src/types/as-island.ts';
|
|
162
|
+
|
|
163
|
+
// Island type generation
|
|
164
|
+
export { generateIslandTypes, watchAndGenerateTypes } from './src/build/island-types-generator.ts';
|
|
165
|
+
export type { IslandTypeGeneratorOptions, TypeGenerationResult } from './src/build/island-types-generator.ts';
|
|
166
|
+
|
|
167
|
+
// Build command (batteries included)
|
|
168
|
+
// Note: This is exported as a function that dynamically imports the build module
|
|
169
|
+
// to avoid top-level await issues when SSR loading modules that import from @useavalon/avalon
|
|
170
|
+
export async function build(_options?: Record<string, unknown>) {
|
|
171
|
+
const { build: buildFn } = await import('../../scripts/build.ts');
|
|
172
|
+
return buildFn();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Middleware system (Nitro-aligned)
|
|
176
|
+
// Note: defineMiddleware removed — use defineHandler from 'nitro/h3' directly.
|
|
177
|
+
// Scoped middleware discovery/execution is Avalon's value-add over Nitro.
|
|
178
|
+
export {
|
|
179
|
+
discoverScopedMiddleware,
|
|
180
|
+
executeScopedMiddleware,
|
|
181
|
+
clearMiddlewareCache,
|
|
182
|
+
invalidateMiddleware,
|
|
183
|
+
getMatchingMiddleware,
|
|
184
|
+
clearDiscoveryCache,
|
|
185
|
+
hasContextValue,
|
|
186
|
+
getContextValue,
|
|
187
|
+
setContextValue,
|
|
188
|
+
getMiddlewareCacheSize,
|
|
189
|
+
} from './src/middleware/index.ts';
|
|
190
|
+
|
|
191
|
+
export type {
|
|
192
|
+
MiddlewareHandler,
|
|
193
|
+
MiddlewareFileExport,
|
|
194
|
+
MiddlewareRoute,
|
|
195
|
+
MiddlewareDiscoveryOptions,
|
|
196
|
+
MiddlewareExecutorOptions,
|
|
197
|
+
} from './src/middleware/types.ts';
|
|
198
|
+
|
|
199
|
+
// Layout system - comprehensive export (all layout functionality)
|
|
200
|
+
export * from './src/layout-system.ts';
|
|
201
|
+
|
|
202
|
+
// Core types
|
|
203
|
+
export type { RenderOptions, MetaTag, ScriptConfig } from './src/schemas/core.ts';
|
|
204
|
+
export type { ApiRoute, ApiMethod } from './src/schemas/api.ts';
|
|
205
|
+
export type { MiddlewareContext } from './src/nitro/middleware-adapter.ts';
|
|
206
|
+
|
|
207
|
+
// Layout data loading types
|
|
208
|
+
export type { LayoutDataLoadingResult, LayoutDataLoadingOptions } from './src/core/layout/layout-data-loader.ts';
|
|
209
|
+
|
|
210
|
+
// Enhanced layout resolver types
|
|
211
|
+
export type { EnhancedLayoutResolverOptions } from './src/core/layout/enhanced-layout-resolver.ts';
|
|
212
|
+
|
|
213
|
+
// Layout cache types (essential only)
|
|
214
|
+
export type { CacheEntry, CacheStats, CacheConfig } from './src/core/layout/layout-cache-manager.ts';
|
|
215
|
+
|
|
216
|
+
// Layout system types - comprehensive export
|
|
217
|
+
export type {
|
|
218
|
+
// Core layout types (from hand-written interfaces — proper types, no Zod inference)
|
|
219
|
+
LayoutProps,
|
|
220
|
+
LayoutContext,
|
|
221
|
+
LayoutData,
|
|
222
|
+
LayoutRoute,
|
|
223
|
+
LayoutHandler,
|
|
224
|
+
LayoutDiscoveryOptions,
|
|
225
|
+
LayoutConfig,
|
|
226
|
+
RouteInfo,
|
|
227
|
+
LayoutRule,
|
|
228
|
+
LayoutLoader,
|
|
229
|
+
ResolvedLayout,
|
|
230
|
+
LayoutCache,
|
|
231
|
+
LayoutErrorInfo
|
|
232
|
+
} from './src/core/layout/layout-types.ts';
|
|
233
|
+
|
|
234
|
+
export type {
|
|
235
|
+
// Zod-inferred types for schemas that don't have hand-written equivalents
|
|
236
|
+
EnhancedLayoutContext,
|
|
237
|
+
|
|
238
|
+
// Persistent islands types
|
|
239
|
+
IslandState,
|
|
240
|
+
PersistentIslandProps,
|
|
241
|
+
PersistentIslandContext,
|
|
242
|
+
IslandStateSaver,
|
|
243
|
+
IslandStateLoader,
|
|
244
|
+
IslandStateClearer,
|
|
245
|
+
|
|
246
|
+
// Error boundary types
|
|
247
|
+
LayoutErrorBoundaryProps,
|
|
248
|
+
ErrorRecoveryStrategy,
|
|
249
|
+
LayoutErrorHandler,
|
|
250
|
+
LayoutRetryFunction,
|
|
251
|
+
LayoutFallbackRenderer,
|
|
252
|
+
|
|
253
|
+
// Streaming types
|
|
254
|
+
StreamingLayoutProps,
|
|
255
|
+
StreamingComponent,
|
|
256
|
+
StreamingReadyCheck,
|
|
257
|
+
|
|
258
|
+
// Function types
|
|
259
|
+
LayoutMatcherFunction,
|
|
260
|
+
} from './src/schemas/layout.ts';
|
|
261
|
+
|
|
262
|
+
// Persistent islands system
|
|
263
|
+
export { IslandPersistence, defaultIslandPersistence } from './src/core/islands/island-persistence.ts';
|
|
264
|
+
export { IslandStateSerializer } from './src/core/islands/island-state-serializer.ts';
|
|
265
|
+
export {
|
|
266
|
+
createPersistentIslandContext,
|
|
267
|
+
usePersistentIslandContext,
|
|
268
|
+
PersistentIslandProvider,
|
|
269
|
+
} from './src/core/islands/persistent-island-context.tsx';
|
|
270
|
+
export { PersistentIsland } from './src/components/PersistentIsland.tsx';
|
|
271
|
+
export { usePersistentState } from './src/core/islands/use-persistent-state.ts';
|
|
272
|
+
|
|
273
|
+
// Error boundary system
|
|
274
|
+
export { LayoutErrorBoundary } from './src/components/LayoutErrorBoundary.tsx';
|
|
275
|
+
export { LayoutDataErrorBoundary } from './src/components/LayoutDataErrorBoundary.tsx';
|
|
276
|
+
export { IslandErrorBoundary, withIslandErrorBoundary } from './src/components/IslandErrorBoundary.tsx';
|
|
277
|
+
export { StreamingErrorBoundary, withStreamingErrorBoundary } from './src/components/StreamingErrorBoundary.tsx';
|
|
278
|
+
|
|
279
|
+
// Layout system interfaces
|
|
280
|
+
export type {
|
|
281
|
+
ILayoutDiscovery,
|
|
282
|
+
ILayoutMatcher,
|
|
283
|
+
ILayoutComposer,
|
|
284
|
+
IIslandPersistence,
|
|
285
|
+
ILayoutErrorRecovery,
|
|
286
|
+
ILayoutStreaming,
|
|
287
|
+
IEnhancedLayoutResolver,
|
|
288
|
+
ILayoutComponent,
|
|
289
|
+
IPersistentIslandComponent,
|
|
290
|
+
ILayoutErrorBoundaryComponent,
|
|
291
|
+
IStreamingLayoutComponent,
|
|
292
|
+
LayoutModule,
|
|
293
|
+
PageModule,
|
|
294
|
+
LayoutResolutionContext,
|
|
295
|
+
LayoutPerformanceMetrics,
|
|
296
|
+
LayoutDebugInfo,
|
|
297
|
+
LayoutEventType,
|
|
298
|
+
LayoutEventData,
|
|
299
|
+
LayoutEventHandler,
|
|
300
|
+
ILayoutEventEmitter,
|
|
301
|
+
} from './src/types/layout.ts';
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@useavalon/avalon",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Multi-framework islands architecture for the modern web",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": "github:useAvalon/Avalon",
|
|
8
|
+
"homepage": "https://useavalon.dev",
|
|
9
|
+
"keywords": ["avalon", "islands", "ssr", "vite", "preact", "multi-framework", "hydration"],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./mod.ts",
|
|
12
|
+
"./client": "./src/client/components.ts",
|
|
13
|
+
"./middleware": "./src/middleware/index.ts",
|
|
14
|
+
"./nitro/renderer": "./src/nitro/renderer.ts",
|
|
15
|
+
"./nitro/types": "./src/nitro/types.ts",
|
|
16
|
+
"./nitro/config": "./src/nitro/config.ts",
|
|
17
|
+
"./types/island-jsx": "./src/types/island-jsx.d.ts",
|
|
18
|
+
"./types": "./src/types/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
"*": {
|
|
22
|
+
"types": ["./src/types/index.d.ts"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": ["mod.ts", "src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.d.ts", "README.md"],
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/mime-types": "^3.0.1"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@useavalon/core": "0.1.0",
|
|
31
|
+
"@mdx-js/react": "^3.0.0",
|
|
32
|
+
"@mdx-js/rollup": "^3.0.0",
|
|
33
|
+
"@types/mdx": "^2.0.0",
|
|
34
|
+
"consola": "^3.4.2",
|
|
35
|
+
"cookie-es": "^2.0.0",
|
|
36
|
+
"croner": "^10.0.1",
|
|
37
|
+
"crossws": "^0.4.3",
|
|
38
|
+
"db0": "^0.3.4",
|
|
39
|
+
"defu": "^6.1.4",
|
|
40
|
+
"destr": "^2.0.5",
|
|
41
|
+
"error-stack-parser-es": "^1.0.5",
|
|
42
|
+
"get-port-please": "^3.2.0",
|
|
43
|
+
"h3": "^2.0.1-rc.16",
|
|
44
|
+
"hast-util-to-text": "^4.0.0",
|
|
45
|
+
"hookable": "^6.0.1",
|
|
46
|
+
"jiti": "^2.6.1",
|
|
47
|
+
"kleur": "^4.1.5",
|
|
48
|
+
"lowlight": "^3.1.0",
|
|
49
|
+
"marked": "^17.0.4",
|
|
50
|
+
"mime-types": "^3.0.2",
|
|
51
|
+
"nf3": "^0.3.11",
|
|
52
|
+
"nitro": "3.0.1-alpha.2",
|
|
53
|
+
"ofetch": "^2.0.0-alpha.3",
|
|
54
|
+
"ohash": "^2.0.11",
|
|
55
|
+
"oxc-minify": "^0.117.0",
|
|
56
|
+
"oxc-transform": "^0.117.0",
|
|
57
|
+
"preact": "10.28.4",
|
|
58
|
+
"preact-render-to-string": "6.6.6",
|
|
59
|
+
"rehype-highlight": "^7.0.0",
|
|
60
|
+
"remark-frontmatter": "^5.0.0",
|
|
61
|
+
"remark-gfm": "^4.0.0",
|
|
62
|
+
"remark-mdx-frontmatter": "^5.0.0",
|
|
63
|
+
"rendu": "^0.0.7",
|
|
64
|
+
"rolldown": "^1.0.0-rc.8",
|
|
65
|
+
"rollup": "^4.55.0",
|
|
66
|
+
"rou3": "^0.8.1",
|
|
67
|
+
"scule": "^1.3.0",
|
|
68
|
+
"srvx": "^0.11.9",
|
|
69
|
+
"std-env": "^3.9.0",
|
|
70
|
+
"supports-color": "^10.2.2",
|
|
71
|
+
"typescript": "5.9.3",
|
|
72
|
+
"ufo": "^1.6.3",
|
|
73
|
+
"unctx": "^2.4.1",
|
|
74
|
+
"undici": "^7.18.2",
|
|
75
|
+
"unenv": "^2.0.0-rc.24",
|
|
76
|
+
"unified": "^11.0.0",
|
|
77
|
+
"unstorage": "^2.0.0-alpha.5",
|
|
78
|
+
"vite": "8.0.0",
|
|
79
|
+
"vite-imagetools": "^7.0.5",
|
|
80
|
+
"xml2js": "^0.6.2",
|
|
81
|
+
"youch": "^4.1.0-beta.13",
|
|
82
|
+
"youch-core": "^0.3.3",
|
|
83
|
+
"zod": "4.3.6"
|
|
84
|
+
}
|
|
85
|
+
}
|