olova 2.0.57 → 2.0.59

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/package.json CHANGED
@@ -1,24 +1,42 @@
1
1
  {
2
2
  "name": "olova",
3
- "version": "2.0.57",
3
+ "version": "2.0.59",
4
4
  "description": "Vite plugin for Olova SSR/SSG framework with React",
5
5
  "type": "module",
6
- "main": "./olova.ts",
7
- "module": "./olova.ts",
8
- "types": "./olova.ts",
6
+ "main": "./dist/olova.cjs",
7
+ "module": "./dist/olova.js",
8
+ "types": "./dist/olova.d.ts",
9
9
  "exports": {
10
- ".": "./olova.ts",
11
- "./main": "./main.tsx",
12
- "./entry-server": "./src/entry-server.tsx",
13
- "./entry-worker": "./src/entry-worker.tsx",
14
- "./hydration": "./src/hydration/index.ts",
15
- "./router": "./src/router/index.ts"
10
+ ".": {
11
+ "types": "./dist/olova.d.ts",
12
+ "import": "./dist/olova.js",
13
+ "require": "./dist/olova.cjs"
14
+ },
15
+ "./vite": {
16
+ "types": "./dist/olova.d.ts",
17
+ "import": "./dist/olova.js",
18
+ "require": "./dist/olova.cjs"
19
+ },
20
+ "./main": {
21
+ "import": "./dist/main.js",
22
+ "require": "./dist/main.cjs"
23
+ },
24
+ "./entry-server": {
25
+ "import": "./dist/entry-server.js",
26
+ "require": "./dist/entry-server.cjs"
27
+ },
28
+ "./entry-worker": {
29
+ "import": "./dist/entry-worker.js",
30
+ "require": "./dist/entry-worker.cjs"
31
+ },
32
+ "./router": {
33
+ "types": "./dist/router.d.ts",
34
+ "import": "./dist/router.js",
35
+ "require": "./dist/router.cjs"
36
+ }
16
37
  },
17
38
  "files": [
18
- "dist",
19
- "src",
20
- "*.ts",
21
- "*.tsx"
39
+ "dist"
22
40
  ],
23
41
  "scripts": {
24
42
  "build": "tsup",
@@ -56,10 +74,8 @@
56
74
  "vite": "^7.2.4"
57
75
  },
58
76
  "dependencies": {
59
- "@cloudflare/workers-types": "^4.20260228.0",
77
+ "picocolors": "^1.1.1",
60
78
  "@mdx-js/react": "^3.1.1",
61
- "@mdx-js/rollup": "^3.1.1",
62
- "@tanstack/react-query": "^5.90.21",
63
- "picocolors": "^1.1.1"
79
+ "@mdx-js/rollup": "^3.1.1"
64
80
  }
65
81
  }
package/main.tsx DELETED
@@ -1,76 +0,0 @@
1
- // @ts-nocheck - Path aliases resolved by Vite at runtime; tsconfig conflicts with plugins/tsconfig.json
2
- import "@/index.css";
3
- import { notFoundPages, OlovaRouter, layouts as originalLayouts, Outlet, routes } from '@/route.tree';
4
- import { StrictMode } from 'react';
5
- import { hydrateRoot } from 'react-dom/client';
6
- import { QueryClient, QueryClientProvider, HydrationBoundary } from '@tanstack/react-query';
7
-
8
- // Wrapper to support "children" prop style layouts (Next.js style)
9
- const layouts = originalLayouts.map((item: any) => ({
10
- ...item,
11
- layout: (props: any) => (
12
- <item.layout {...props}>
13
- <Outlet />
14
- </item.layout>
15
- )
16
- }));
17
-
18
- const isBrowser = typeof window !== 'undefined' && !(import.meta as any).env.SSR;
19
-
20
- /**
21
- * Get the global $OLOVA object (populated by Flight runtime)
22
- */
23
- function getOlova(): any {
24
- if (typeof globalThis === 'undefined') return null;
25
- return (globalThis as any).$OLOVA || null;
26
- }
27
-
28
- /**
29
- * Get TanStack Query state from Flight hydration
30
- */
31
- function getQueryState(): any {
32
- const olova = getOlova();
33
- return olova?.$query?.state || null;
34
- }
35
-
36
- /**
37
- * Get loader data from Flight hydration
38
- */
39
- function getLoaderData(): any {
40
- const olova = getOlova();
41
- return olova?.$loader?.data || null;
42
- }
43
-
44
- if (isBrowser) {
45
- // Dev logging
46
- if (import.meta.env?.DEV) {
47
- const olova = getOlova();
48
- if (olova) {
49
- console.log('[Olova] Flight hydrated:', Object.keys(olova));
50
- }
51
- }
52
-
53
- // Get pre-hydrated state from Flight runtime
54
- const queryState = getQueryState();
55
-
56
- // Create QueryClient
57
- const queryClient = new QueryClient({
58
- defaultOptions: {
59
- queries: {
60
- staleTime: 1000 * 60 * 5,
61
- gcTime: 1000 * 60 * 30,
62
- },
63
- },
64
- });
65
-
66
- // Hydrate with pre-loaded state
67
- hydrateRoot(document, (
68
- <StrictMode>
69
- <QueryClientProvider client={queryClient}>
70
- <HydrationBoundary state={queryState || {}}>
71
- <OlovaRouter routes={routes} layouts={layouts} notFoundPages={notFoundPages} />
72
- </HydrationBoundary>
73
- </QueryClientProvider>
74
- </StrictMode>
75
- ));
76
- }