olova 2.0.60 → 2.0.62

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +42 -61
  3. package/dist/compiler.d.ts +44 -0
  4. package/dist/compiler.js +2139 -0
  5. package/dist/compiler.js.map +1 -0
  6. package/dist/core.d.ts +4 -0
  7. package/dist/core.js +859 -0
  8. package/dist/core.js.map +1 -0
  9. package/dist/global.d.ts +15 -0
  10. package/dist/global.js +226 -0
  11. package/dist/global.js.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +2268 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/runtime.d.ts +89 -0
  16. package/dist/runtime.js +633 -0
  17. package/dist/runtime.js.map +1 -0
  18. package/dist/signals-core-BdfWh1Yt.d.ts +43 -0
  19. package/dist/vite.d.ts +5 -0
  20. package/dist/vite.js +2268 -0
  21. package/dist/vite.js.map +1 -0
  22. package/package.json +83 -65
  23. package/dist/chunk-D7SIC5TC.js +0 -367
  24. package/dist/chunk-D7SIC5TC.js.map +0 -1
  25. package/dist/entry-server.cjs +0 -120
  26. package/dist/entry-server.cjs.map +0 -1
  27. package/dist/entry-server.js +0 -115
  28. package/dist/entry-server.js.map +0 -1
  29. package/dist/entry-worker.cjs +0 -133
  30. package/dist/entry-worker.cjs.map +0 -1
  31. package/dist/entry-worker.js +0 -127
  32. package/dist/entry-worker.js.map +0 -1
  33. package/dist/main.cjs +0 -18
  34. package/dist/main.cjs.map +0 -1
  35. package/dist/main.js +0 -16
  36. package/dist/main.js.map +0 -1
  37. package/dist/olova.cjs +0 -1680
  38. package/dist/olova.cjs.map +0 -1
  39. package/dist/olova.d.cts +0 -72
  40. package/dist/olova.d.ts +0 -72
  41. package/dist/olova.js +0 -1321
  42. package/dist/olova.js.map +0 -1
  43. package/dist/performance.cjs +0 -386
  44. package/dist/performance.cjs.map +0 -1
  45. package/dist/performance.js +0 -3
  46. package/dist/performance.js.map +0 -1
  47. package/dist/router.cjs +0 -646
  48. package/dist/router.cjs.map +0 -1
  49. package/dist/router.d.cts +0 -113
  50. package/dist/router.d.ts +0 -113
  51. package/dist/router.js +0 -632
  52. package/dist/router.js.map +0 -1
  53. package/main.tsx +0 -76
  54. package/olova.ts +0 -619
  55. package/src/entry-server.tsx +0 -165
  56. package/src/entry-worker.tsx +0 -201
  57. package/src/generator/index.ts +0 -409
  58. package/src/hydration/flight.ts +0 -320
  59. package/src/hydration/index.ts +0 -12
  60. package/src/hydration/types.ts +0 -225
  61. package/src/logger.ts +0 -182
  62. package/src/main.tsx +0 -24
  63. package/src/performance.ts +0 -488
  64. package/src/plugin/index.ts +0 -204
  65. package/src/router/ErrorBoundary.tsx +0 -145
  66. package/src/router/Link.tsx +0 -117
  67. package/src/router/OlovaRouter.tsx +0 -354
  68. package/src/router/Outlet.tsx +0 -8
  69. package/src/router/context.ts +0 -117
  70. package/src/router/index.ts +0 -29
  71. package/src/router/matching.ts +0 -63
  72. package/src/router/router.tsx +0 -23
  73. package/src/router/search-params.ts +0 -29
  74. package/src/scanner/index.ts +0 -114
  75. package/src/types/index.ts +0 -190
  76. package/src/utils/export.ts +0 -85
  77. package/src/utils/index.ts +0 -4
  78. package/src/utils/naming.ts +0 -54
  79. package/src/utils/path.ts +0 -45
  80. package/tsup.config.ts +0 -35
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial standalone package setup for publishing the Olova plugin, compiler, runtime, and Vite integration.
package/README.md CHANGED
@@ -1,61 +1,42 @@
1
- # vite-plugin-olova
2
-
3
- A Vite plugin for building SSR/SSG applications with React and the Olova framework.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install vite-plugin-olova
9
- ```
10
-
11
- ## Usage
12
-
13
- Add the plugin to your `vite.config.ts`:
14
-
15
- ```typescript
16
- import { defineConfig } from "vite";
17
- import react from "@vitejs/plugin-react";
18
- import { olova } from "vite-plugin-olova";
19
-
20
- export default defineConfig({
21
- plugins: [
22
- react(),
23
- olova({
24
- staticPaths: ["/about", "/contact"], // Optional: additional paths to pre-render
25
- }),
26
- ],
27
- });
28
- ```
29
-
30
- ## How It Works
31
-
32
- The plugin provides:
33
-
34
- 1. **`vite-plugin-olova`** - The main Vite plugin
35
- 2. **`vite-plugin-olova/entry-client`** - Client-side hydration entry
36
- 3. **`vite-plugin-olova/entry-server`** - Server-side rendering entry
37
-
38
- The entry files use `virtual:olova-app` which resolves to your app's route configuration from `@/route.tree`.
39
-
40
- ## Features
41
-
42
- - **SSR (Server-Side Rendering)**: Full server-side rendering support during development
43
- - **SSG (Static Site Generation)**: Automatically generates static HTML files at build time
44
- - **Route-based code splitting**: Lazy loading for optimal performance
45
- - **Hydration**: Seamless client-side hydration
46
-
47
- ## Options
48
-
49
- | Option | Type | Description |
50
- | ------------- | ---------- | ----------------------------------------------- |
51
- | `staticPaths` | `string[]` | Additional paths to pre-render during SSG build |
52
-
53
- ## Peer Dependencies
54
-
55
- - `react` >= 18.0.0
56
- - `react-dom` >= 18.0.0
57
- - `vite` >= 5.0.0
58
-
59
- ## License
60
-
61
- MIT
1
+ # olova
2
+
3
+ Standalone npm package for the Olova compiler, runtime, and Vite plugin.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install olova
9
+ ```
10
+
11
+ Install Vite separately if you plan to use `olova/vite`.
12
+
13
+ ```bash
14
+ npm install -D vite
15
+ ```
16
+
17
+ ## Exports
18
+
19
+ - `olova`
20
+ - `olova/runtime`
21
+ - `olova/core`
22
+ - `olova/state`
23
+ - `olova/global`
24
+ - `olova/compiler`
25
+ - `olova/vite`
26
+
27
+ ## Local package workflow
28
+
29
+ ```bash
30
+ npm install
31
+ npm run build
32
+ npm run pack:check
33
+ ```
34
+
35
+ ## Publish later
36
+
37
+ ```bash
38
+ npm login
39
+ npm publish
40
+ ```
41
+
42
+ If the `olova` package name is already taken on npm, change the `name` field in `package.json` before publishing.
@@ -0,0 +1,44 @@
1
+ type CompileResult = {
2
+ code: string;
3
+ css?: string;
4
+ map?: unknown;
5
+ };
6
+ interface CompileOptions {
7
+ filename?: string;
8
+ dev?: boolean;
9
+ exportName?: string;
10
+ }
11
+ declare function compileOlovaScriptModule(source: string, options?: CompileOptions): CompileResult;
12
+ declare function compileOlova(source: string, options?: CompileOptions): CompileResult;
13
+
14
+ type ASTNode = ASTElement | ASTText | ASTComment;
15
+ interface ASTElement {
16
+ type: "element";
17
+ tag: string;
18
+ attrs: Record<string, string | true>;
19
+ children: ASTNode[];
20
+ isSelfClosing: boolean;
21
+ }
22
+ interface ASTText {
23
+ type: "text";
24
+ content: string;
25
+ }
26
+ interface ASTComment {
27
+ type: "comment";
28
+ content: string;
29
+ }
30
+ declare function parseHTML(html: string): ASTNode[];
31
+
32
+ type TransformContext = {
33
+ text: number;
34
+ attr: number;
35
+ event: number;
36
+ comp: number;
37
+ slot: number;
38
+ };
39
+ declare function generateBuildFunction(html: string, stateNames: Set<string>, transformExpr: (expr: string, stateNames: Set<string>) => {
40
+ code: string;
41
+ containsJsx: boolean;
42
+ }, counters: TransformContext, componentNames: Set<string>): string;
43
+
44
+ export { compileOlova, compileOlovaScriptModule, generateBuildFunction, parseHTML };