create-waku 0.7.1 → 0.7.3
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/cli.js +4 -0
- package/dist/index.js +0 -1
- package/package.json +2 -2
- package/template/01_template/package.json +6 -6
- package/template/01_template/tsconfig.json +3 -3
- package/template/02_demo/package.json +6 -6
- package/template/02_demo/src/components/footer.tsx +1 -1
- package/template/02_demo/src/components/header.tsx +9 -1
- package/template/02_demo/src/components/reload.tsx +16 -0
- package/template/02_demo/src/templates/home-page.tsx +37 -23
- package/template/02_demo/src/templates/pokemon-page.tsx +46 -44
- package/template/02_demo/src/templates/root-layout.tsx +1 -1
- package/template/02_demo/tsconfig.json +3 -3
- package/template/03_minimal/package.json +6 -6
- package/template/03_minimal/tsconfig.json +2 -2
- package/template/04_promise/package.json +6 -6
- package/template/04_promise/src/components/Counter.tsx +3 -0
- package/template/04_promise/src/components/Hello.tsx +7 -0
- package/template/04_promise/tsconfig.json +2 -2
- package/template/05_actions/package.json +6 -6
- package/template/05_actions/src/components/App.tsx +1 -1
- package/template/05_actions/src/components/Counter.tsx +3 -1
- package/template/05_actions/tsconfig.json +2 -2
- package/template/05_actions/vite.config.ts +6 -0
- package/template/06_nesting/package.json +6 -6
- package/template/06_nesting/tsconfig.json +2 -2
- package/template/07_router/package.json +6 -6
- package/template/07_router/src/components/HomeLayout.tsx +2 -0
- package/template/07_router/src/styles.css +3 -0
- package/template/07_router/tsconfig.json +2 -2
- package/template/08_cookies/package.json +7 -7
- package/template/08_cookies/tsconfig.json +2 -2
- package/template/09_cssmodules/package.json +6 -6
- package/template/09_cssmodules/tsconfig.json +2 -2
- package/template/10_dynamicroute/package.json +6 -6
- package/template/10_dynamicroute/src/entries.tsx +17 -16
- package/template/10_dynamicroute/tsconfig.json +2 -2
- package/template/10_dynamicroute/vite.config.ts +0 -3
- package/template/11_form/package.json +6 -6
- package/template/11_form/tsconfig.json +2 -2
- package/template/12_css/package.json +10 -10
- package/template/12_css/tsconfig.json +2 -2
- package/template/12_css/vite.config.ts +3 -8
- package/template/13_path-alias/package.json +7 -7
- package/template/13_path-alias/tsconfig.json +3 -3
- package/template/13_path-alias/vite.config.ts +9 -4
package/cli.js
ADDED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-waku",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"author": "Daishi Kato",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"contributors": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/create-waku"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"create-waku": "./
|
|
15
|
+
"create-waku": "./cli.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"autoprefixer": "10.4.17",
|
|
21
21
|
"tailwindcss": "3.4.1",
|
|
22
22
|
"typescript": "5.3.3"
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"autoprefixer": "10.4.17",
|
|
21
21
|
"tailwindcss": "3.4.1",
|
|
22
22
|
"typescript": "5.3.3"
|
|
@@ -2,10 +2,18 @@ import { Link } from 'waku';
|
|
|
2
2
|
|
|
3
3
|
export const Header = () => {
|
|
4
4
|
return (
|
|
5
|
-
<header className="fixed left-0 top-0
|
|
5
|
+
<header className="flex items-center gap-4 p-6 lg:fixed lg:left-0 lg:top-0">
|
|
6
6
|
<h2 className="text-lg font-bold tracking-tight">
|
|
7
7
|
<Link to="/">Waku pokemon</Link>
|
|
8
8
|
</h2>
|
|
9
|
+
<a
|
|
10
|
+
href="https://github.com/dai-shi/waku/tree/main/examples/02_demo/src"
|
|
11
|
+
target="_blank"
|
|
12
|
+
rel="noreferrer"
|
|
13
|
+
className="text-sm hover:underline"
|
|
14
|
+
>
|
|
15
|
+
(source)
|
|
16
|
+
</a>
|
|
9
17
|
</header>
|
|
10
18
|
);
|
|
11
19
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
export const Reload = () => {
|
|
4
|
+
const handleReload = () => {
|
|
5
|
+
window.location.reload();
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<button
|
|
10
|
+
onClick={handleReload}
|
|
11
|
+
className="inline-flex aspect-square size-16 items-center justify-center rounded-full bg-black"
|
|
12
|
+
>
|
|
13
|
+
<span className="text-sm font-bold text-white">reload</span>
|
|
14
|
+
</button>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Link } from 'waku';
|
|
2
2
|
|
|
3
|
+
import { Reload } from '../components/reload.js';
|
|
3
4
|
import { sql } from '../lib/index.js';
|
|
4
5
|
|
|
5
6
|
export const HomePage = async () => {
|
|
@@ -7,29 +8,42 @@ export const HomePage = async () => {
|
|
|
7
8
|
|
|
8
9
|
return (
|
|
9
10
|
<>
|
|
10
|
-
<title>Waku
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
<title>Waku pokemon</title>
|
|
12
|
+
<div className="flex h-full w-full flex-col items-center justify-center p-6">
|
|
13
|
+
<div className="px-6">
|
|
14
|
+
<a
|
|
15
|
+
href="https://github.com/dai-shi/waku/tree/main/examples/02_demo/src"
|
|
16
|
+
target="_blank"
|
|
17
|
+
rel="noreferrer"
|
|
18
|
+
className="whitespace-nowrap text-xs font-bold hover:underline sm:text-base"
|
|
19
|
+
>{`SELECT * FROM pokemon ORDER BY RANDOM() LIMIT 9`}</a>
|
|
20
|
+
</div>
|
|
21
|
+
<ul className="relative mt-6 grid h-full w-full max-w-xl flex-shrink-0 grid-cols-2 gap-6 leading-none md:grid-cols-3 md:px-0">
|
|
22
|
+
{rows.map((row) => (
|
|
23
|
+
<li key={row.id}>
|
|
24
|
+
<Link
|
|
25
|
+
to={`/${row.slug}`}
|
|
26
|
+
className="flex aspect-square w-full flex-shrink-0 flex-col items-center justify-center rounded-xl bg-gray-50 p-3 text-gray-950 transition-colors duration-500 ease-in-out hover:bg-gray-200"
|
|
27
|
+
>
|
|
28
|
+
<img
|
|
29
|
+
src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${row.id}.png`}
|
|
30
|
+
alt={row.slug}
|
|
31
|
+
className="size-[96px]"
|
|
32
|
+
/>
|
|
33
|
+
<div className="flex flex-col items-center justify-center gap-1 font-bold">
|
|
34
|
+
<span className="font-bold">{row.name.english}</span>
|
|
35
|
+
<span className="font-zen-maru-gothic text-[0.875em] font-bold opacity-40">
|
|
36
|
+
{row.name.japanese}
|
|
37
|
+
</span>
|
|
38
|
+
</div>
|
|
39
|
+
</Link>
|
|
40
|
+
</li>
|
|
41
|
+
))}
|
|
42
|
+
<div className="absolute bottom-0 right-0 md:translate-x-full md:translate-y-full md:p-3">
|
|
43
|
+
<Reload />
|
|
44
|
+
</div>
|
|
45
|
+
</ul>
|
|
46
|
+
</div>
|
|
33
47
|
</>
|
|
34
48
|
);
|
|
35
49
|
};
|
|
@@ -13,51 +13,53 @@ export const PokemonPage = async ({ slug }: PokemonPageProps) => {
|
|
|
13
13
|
return (
|
|
14
14
|
<>
|
|
15
15
|
<title>{`Waku ${pokemon.name.english}`}</title>
|
|
16
|
-
<div className="
|
|
17
|
-
<div>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
<div className="w-full p-6">
|
|
17
|
+
<div className="mx-auto flex w-full flex-shrink-0 flex-col items-center justify-center gap-6 rounded-xl bg-gray-50 p-12 leading-none md:w-full md:max-w-xl">
|
|
18
|
+
<div>
|
|
19
|
+
<ul className="flex items-center justify-center gap-1.5">
|
|
20
|
+
{pokemon.type.map((type) => (
|
|
21
|
+
<div
|
|
22
|
+
key={type}
|
|
23
|
+
className="rounded-full bg-gray-200 px-3 py-1 text-xs font-bold uppercase leading-none tracking-wide text-black/60"
|
|
24
|
+
>
|
|
25
|
+
{type}
|
|
26
|
+
</div>
|
|
27
|
+
))}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
<div className="inline-flex aspect-square flex-col items-center justify-center">
|
|
31
|
+
<img
|
|
32
|
+
src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${pokemon.id}.png`}
|
|
33
|
+
alt={pokemon.slug}
|
|
34
|
+
className="block size-[144px] flex-shrink-0"
|
|
35
|
+
/>
|
|
36
|
+
<div className="flex flex-col items-center justify-center gap-1 text-2xl leading-none">
|
|
37
|
+
<span className="font-bold">{pokemon.name.english}</span>
|
|
38
|
+
<span className="font-zen-maru-gothic text-[0.875em] font-bold opacity-40">
|
|
39
|
+
{pokemon.name.japanese}
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div className="hidden lg:block">
|
|
44
|
+
<ul className="mx-auto flex w-32 flex-col flex-wrap justify-center gap-1.5">
|
|
45
|
+
{stats.map(([stat, value]: any) => (
|
|
46
|
+
<li
|
|
47
|
+
key={stat}
|
|
48
|
+
className="inline-block rounded-sm bg-black px-1.5 py-1 text-[0.5rem] font-bold uppercase tracking-wider text-white"
|
|
49
|
+
>
|
|
50
|
+
{stat}: {value}
|
|
51
|
+
</li>
|
|
52
|
+
))}
|
|
53
|
+
</ul>
|
|
54
|
+
</div>
|
|
55
|
+
<div className="mt-12">
|
|
56
|
+
<Link
|
|
57
|
+
to="/"
|
|
58
|
+
className="inline-flex aspect-square size-16 items-center justify-center rounded-full bg-black text-sm font-bold text-white"
|
|
59
|
+
>
|
|
60
|
+
<span>back</span>
|
|
61
|
+
</Link>
|
|
40
62
|
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
<ul className="mx-auto flex w-32 flex-col flex-wrap justify-center gap-1.5">
|
|
44
|
-
{stats.map(([stat, value]: any) => (
|
|
45
|
-
<li
|
|
46
|
-
key={stat}
|
|
47
|
-
className="inline-block rounded-sm bg-black px-1.5 py-1 text-[0.5rem] font-bold uppercase tracking-wider text-white"
|
|
48
|
-
>
|
|
49
|
-
{stat}: {value}
|
|
50
|
-
</li>
|
|
51
|
-
))}
|
|
52
|
-
</ul>
|
|
53
|
-
</div>
|
|
54
|
-
<div className="mt-12">
|
|
55
|
-
<Link
|
|
56
|
-
to="/"
|
|
57
|
-
className="inline-block rounded-xl bg-gray-100 px-6 py-4 font-bold transition-colors duration-500 ease-in-out hover:bg-gray-200"
|
|
58
|
-
>
|
|
59
|
-
back
|
|
60
|
-
</Link>
|
|
61
63
|
</div>
|
|
62
64
|
</div>
|
|
63
65
|
</>
|
|
@@ -15,7 +15,7 @@ export const RootLayout = async ({ children }: RootLayoutProps) => {
|
|
|
15
15
|
<meta property="description" content={data.description} />
|
|
16
16
|
<link rel="icon" type="image/png" href={data.icon} />
|
|
17
17
|
<Header />
|
|
18
|
-
<main className="flex
|
|
18
|
+
<main className="flex items-center justify-center lg:min-h-svh">
|
|
19
19
|
{children}
|
|
20
20
|
</main>
|
|
21
21
|
<Footer />
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
import { Suspense, useState, use } from 'react';
|
|
5
5
|
|
|
6
|
+
import { Hello } from './Hello.js';
|
|
7
|
+
|
|
6
8
|
export const Counter = ({
|
|
7
9
|
delayedMessage,
|
|
8
10
|
}: {
|
|
@@ -17,6 +19,7 @@ export const Counter = ({
|
|
|
17
19
|
<Suspense fallback="Pending...">
|
|
18
20
|
<Message count={count} delayedMessage={delayedMessage} />
|
|
19
21
|
</Suspense>
|
|
22
|
+
<Hello />
|
|
20
23
|
</div>
|
|
21
24
|
);
|
|
22
25
|
};
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
15
|
"react-wrap-balancer": "1.1.0",
|
|
16
|
-
"waku": "0.19.
|
|
16
|
+
"waku": "0.19.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "18.2.
|
|
20
|
-
"@types/react-dom": "18.2.
|
|
19
|
+
"@types/react": "18.2.55",
|
|
20
|
+
"@types/react-dom": "18.2.19",
|
|
21
21
|
"typescript": "5.3.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -4,7 +4,7 @@ import { useState, useTransition } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { TextBox } from './TextBox.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const Counter = ({
|
|
8
8
|
greet,
|
|
9
9
|
increment,
|
|
10
10
|
}: {
|
|
@@ -36,3 +36,5 @@ export const Counter = ({
|
|
|
36
36
|
</div>
|
|
37
37
|
);
|
|
38
38
|
};
|
|
39
|
+
|
|
40
|
+
export default Counter;
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"server-only": "0.0.1",
|
|
21
21
|
"typescript": "5.3.3"
|
|
22
22
|
}
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cookie-parser": "1.4.6",
|
|
13
13
|
"express": "4.18.2",
|
|
14
|
-
"react": "18.3.0-canary-
|
|
15
|
-
"react-dom": "18.3.0-canary-
|
|
16
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
17
|
-
"waku": "0.19.
|
|
14
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
16
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
17
|
+
"waku": "0.19.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/node": "20.11.
|
|
21
|
-
"@types/react": "18.2.
|
|
22
|
-
"@types/react-dom": "18.2.
|
|
20
|
+
"@types/node": "20.11.17",
|
|
21
|
+
"@types/react": "18.2.55",
|
|
22
|
+
"@types/react-dom": "18.2.19",
|
|
23
23
|
"typescript": "5.3.3"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"glob": "10.3.10",
|
|
13
|
-
"react": "18.3.0-canary-
|
|
14
|
-
"react-dom": "18.3.0-canary-
|
|
15
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
16
|
-
"waku": "0.19.
|
|
13
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
16
|
+
"waku": "0.19.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "18.2.
|
|
20
|
-
"@types/react-dom": "18.2.
|
|
19
|
+
"@types/react": "18.2.55",
|
|
20
|
+
"@types/react-dom": "18.2.19",
|
|
21
21
|
"typescript": "5.3.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -54,24 +54,27 @@ const getMappingAndItems = async (id: string) => {
|
|
|
54
54
|
return { mapping, items };
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
const
|
|
57
|
+
const getPathConfig = async () => {
|
|
58
58
|
const files = await glob('**/page.{tsx,js}', { cwd: routesDir });
|
|
59
|
-
return files
|
|
60
|
-
|
|
61
|
-
.map((
|
|
59
|
+
return files.map((file) => {
|
|
60
|
+
const names = file.split('/').filter(Boolean).slice(0, -1);
|
|
61
|
+
const pathSpec = names.map((name) => {
|
|
62
|
+
const match = name.match(/^(\[\w+\]|_\w+_)$/);
|
|
63
|
+
if (match) {
|
|
64
|
+
return { type: 'group', name: match[1]!.slice(1, -1) } as const;
|
|
65
|
+
}
|
|
66
|
+
return { type: 'literal', name } as const;
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
path: pathSpec,
|
|
70
|
+
isStatic: pathSpec.every(({ type }) => type === 'literal'),
|
|
71
|
+
};
|
|
72
|
+
});
|
|
62
73
|
};
|
|
63
74
|
|
|
64
75
|
export default defineRouter(
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
if ((await getStaticPaths()).includes(path)) {
|
|
68
|
-
return 'static';
|
|
69
|
-
}
|
|
70
|
-
if ((await getMappingAndItems(path + '/page')) !== null) {
|
|
71
|
-
return 'dynamic';
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
},
|
|
76
|
+
// getPathConfig
|
|
77
|
+
() => getPathConfig(),
|
|
75
78
|
// getComponent (id is "**/layout" or "**/page")
|
|
76
79
|
async (id, unstable_setShouldSkip) => {
|
|
77
80
|
unstable_setShouldSkip({}); // always skip if possible
|
|
@@ -86,6 +89,4 @@ export default defineRouter(
|
|
|
86
89
|
);
|
|
87
90
|
return Component;
|
|
88
91
|
},
|
|
89
|
-
// getPathsForBuild
|
|
90
|
-
() => getStaticPaths(),
|
|
91
92
|
);
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@stylexjs/stylex": "0.
|
|
13
|
-
"@vanilla-extract/css": "1.14.
|
|
12
|
+
"@stylexjs/stylex": "0.5.1",
|
|
13
|
+
"@vanilla-extract/css": "1.14.1",
|
|
14
14
|
"classnames": "2.3.2",
|
|
15
|
-
"react": "18.3.0-canary-
|
|
16
|
-
"react-dom": "18.3.0-canary-
|
|
17
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
18
|
-
"waku": "0.19.
|
|
15
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
16
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
17
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
18
|
+
"waku": "0.19.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/react": "18.2.
|
|
22
|
-
"@types/react-dom": "18.2.
|
|
23
|
-
"@vanilla-extract/vite-plugin": "3.9.
|
|
21
|
+
"@types/react": "18.2.55",
|
|
22
|
+
"@types/react-dom": "18.2.19",
|
|
23
|
+
"@vanilla-extract/vite-plugin": "3.9.5",
|
|
24
24
|
"typescript": "5.3.3",
|
|
25
25
|
"vite": "5.0.12",
|
|
26
|
-
"vite-plugin-stylex-dev": "0.
|
|
26
|
+
"vite-plugin-stylex-dev": "0.3.0"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
1
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
3
2
|
import { stylexPlugin } from 'vite-plugin-stylex-dev';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ssr: {
|
|
8
|
-
external: ['@stylexjs/stylex', 'classnames'],
|
|
9
|
-
},
|
|
10
|
-
}),
|
|
4
|
+
/** @type {import('vite').UserConfig} */
|
|
5
|
+
export default {
|
|
11
6
|
plugins: [vanillaExtractPlugin({ emitCssInSsr: true }), stylexPlugin()],
|
|
12
|
-
}
|
|
7
|
+
};
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "18.3.0-canary-
|
|
13
|
-
"react-dom": "18.3.0-canary-
|
|
14
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
15
|
-
"waku": "0.19.
|
|
12
|
+
"react": "18.3.0-canary-14fd9630e-20240213",
|
|
13
|
+
"react-dom": "18.3.0-canary-14fd9630e-20240213",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
|
|
15
|
+
"waku": "0.19.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
19
|
-
"@types/react-dom": "18.2.
|
|
18
|
+
"@types/react": "18.2.55",
|
|
19
|
+
"@types/react-dom": "18.2.19",
|
|
20
20
|
"typescript": "5.3.3",
|
|
21
21
|
"vite": "5.0.12",
|
|
22
|
-
"vite-tsconfig-paths": "4.
|
|
22
|
+
"vite-tsconfig-paths": "4.3.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
1
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** @type {import('vite').UserConfig} */
|
|
5
|
+
export default {
|
|
6
|
+
plugins: [
|
|
7
|
+
tsconfigPaths({
|
|
8
|
+
root: fileURLToPath(new URL('.', import.meta.url)),
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|