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.
Files changed (46) hide show
  1. package/cli.js +4 -0
  2. package/dist/index.js +0 -1
  3. package/package.json +2 -2
  4. package/template/01_template/package.json +6 -6
  5. package/template/01_template/tsconfig.json +3 -3
  6. package/template/02_demo/package.json +6 -6
  7. package/template/02_demo/src/components/footer.tsx +1 -1
  8. package/template/02_demo/src/components/header.tsx +9 -1
  9. package/template/02_demo/src/components/reload.tsx +16 -0
  10. package/template/02_demo/src/templates/home-page.tsx +37 -23
  11. package/template/02_demo/src/templates/pokemon-page.tsx +46 -44
  12. package/template/02_demo/src/templates/root-layout.tsx +1 -1
  13. package/template/02_demo/tsconfig.json +3 -3
  14. package/template/03_minimal/package.json +6 -6
  15. package/template/03_minimal/tsconfig.json +2 -2
  16. package/template/04_promise/package.json +6 -6
  17. package/template/04_promise/src/components/Counter.tsx +3 -0
  18. package/template/04_promise/src/components/Hello.tsx +7 -0
  19. package/template/04_promise/tsconfig.json +2 -2
  20. package/template/05_actions/package.json +6 -6
  21. package/template/05_actions/src/components/App.tsx +1 -1
  22. package/template/05_actions/src/components/Counter.tsx +3 -1
  23. package/template/05_actions/tsconfig.json +2 -2
  24. package/template/05_actions/vite.config.ts +6 -0
  25. package/template/06_nesting/package.json +6 -6
  26. package/template/06_nesting/tsconfig.json +2 -2
  27. package/template/07_router/package.json +6 -6
  28. package/template/07_router/src/components/HomeLayout.tsx +2 -0
  29. package/template/07_router/src/styles.css +3 -0
  30. package/template/07_router/tsconfig.json +2 -2
  31. package/template/08_cookies/package.json +7 -7
  32. package/template/08_cookies/tsconfig.json +2 -2
  33. package/template/09_cssmodules/package.json +6 -6
  34. package/template/09_cssmodules/tsconfig.json +2 -2
  35. package/template/10_dynamicroute/package.json +6 -6
  36. package/template/10_dynamicroute/src/entries.tsx +17 -16
  37. package/template/10_dynamicroute/tsconfig.json +2 -2
  38. package/template/10_dynamicroute/vite.config.ts +0 -3
  39. package/template/11_form/package.json +6 -6
  40. package/template/11_form/tsconfig.json +2 -2
  41. package/template/12_css/package.json +10 -10
  42. package/template/12_css/tsconfig.json +2 -2
  43. package/template/12_css/vite.config.ts +3 -8
  44. package/template/13_path-alias/package.json +7 -7
  45. package/template/13_path-alias/tsconfig.json +3 -3
  46. package/template/13_path-alias/vite.config.ts +9 -4
package/cli.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ // eslint-disable-next-line import/no-unresolved
4
+ import './dist/index.js';
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import{createRequire as t}from"module";var r={1706:t=>{
3
2
  /*!
4
3
  * @description Recursive object extending
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-waku",
3
- "version": "0.7.1",
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": "./dist/index.js"
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-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
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"
@@ -11,7 +11,7 @@
11
11
  "types": ["react/experimental"],
12
12
  "jsx": "react-jsx",
13
13
  "paths": {
14
- "~/*": ["./src/*"],
15
- },
16
- },
14
+ "~/*": ["./src/*"]
15
+ }
16
+ }
17
17
  }
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
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"
@@ -1,6 +1,6 @@
1
1
  export const Footer = () => {
2
2
  return (
3
- <footer className="fixed bottom-0 left-0 p-6">
3
+ <footer className="p-6 lg:fixed lg:bottom-0 lg:left-0">
4
4
  <div>
5
5
  visit{' '}
6
6
  <a
@@ -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 p-6">
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 Pokemon</title>
11
- <ul className="grid h-full w-full max-w-xl grid-cols-2 gap-6 px-6 py-20 leading-none md:grid-cols-3 md:px-0">
12
- {rows.map((row) => (
13
- <li key={row.id}>
14
- <Link
15
- to={`/${row.slug}`}
16
- 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"
17
- >
18
- <img
19
- src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${row.id}.png`}
20
- alt={row.slug}
21
- className="size-[96px]"
22
- />
23
- <div className="flex flex-col items-center justify-center gap-1 font-bold">
24
- <span className="font-bold">{row.name.english}</span>
25
- <span className="font-zen-maru-gothic text-[0.875em] font-bold opacity-40">
26
- {row.name.japanese}
27
- </span>
28
- </div>
29
- </Link>
30
- </li>
31
- ))}
32
- </ul>
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="mx-auto flex w-1/2 flex-col items-center justify-center gap-6 leading-none md:w-full md:max-w-xl">
17
- <div>
18
- <ul className="flex items-center justify-center gap-1.5">
19
- {pokemon.type.map((type) => (
20
- <div
21
- key={type}
22
- className="rounded-full bg-gray-100 px-3 py-1 text-xs font-bold uppercase leading-none tracking-wide text-black/60"
23
- >
24
- {type}
25
- </div>
26
- ))}
27
- </ul>
28
- </div>
29
- <div className="inline-flex aspect-square flex-col items-center justify-center">
30
- <img
31
- src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${pokemon.id}.png`}
32
- alt={pokemon.slug}
33
- className="size-[144px]"
34
- />
35
- <div className="flex flex-col items-center justify-center gap-1 text-2xl leading-none">
36
- <span className="font-bold">{pokemon.name.english}</span>
37
- <span className="font-zen-maru-gothic text-[0.875em] font-bold opacity-40">
38
- {pokemon.name.japanese}
39
- </span>
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 min-h-svh items-center justify-center">
18
+ <main className="flex items-center justify-center lg:min-h-svh">
19
19
  {children}
20
20
  </main>
21
21
  <Footer />
@@ -11,7 +11,7 @@
11
11
  "types": ["react/experimental"],
12
12
  "jsx": "react-jsx",
13
13
  "paths": {
14
- "~/*": ["./src/*"],
15
- },
16
- },
14
+ "~/*": ["./src/*"]
15
+ }
16
+ }
17
17
  }
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
18
+ "@types/react": "18.2.55",
19
+ "@types/react-dom": "18.2.19",
20
20
  "typescript": "5.3.3"
21
21
  }
22
22
  }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
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
  };
@@ -0,0 +1,7 @@
1
+ export const Hello = () => {
2
+ return (
3
+ <div style={{ border: '3px gray dashed', margin: '1em', padding: '1em' }}>
4
+ This is a component without {'"use client"'}.
5
+ </div>
6
+ );
7
+ };
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -9,15 +9,15 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
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.1"
16
+ "waku": "0.19.3"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/react": "18.2.48",
20
- "@types/react-dom": "18.2.18",
19
+ "@types/react": "18.2.55",
20
+ "@types/react-dom": "18.2.19",
21
21
  "typescript": "5.3.3"
22
22
  }
23
23
  }
@@ -1,6 +1,6 @@
1
1
  import { Balancer } from 'react-wrap-balancer';
2
2
 
3
- import { Counter } from './Counter.js';
3
+ import Counter from './Counter.js';
4
4
  import { greet, getCounter, increment } from './funcs.js';
5
5
 
6
6
  type ServerFunction<T> = T extends (...args: infer A) => infer R
@@ -4,7 +4,7 @@ import { useState, useTransition } from 'react';
4
4
 
5
5
  import { TextBox } from './TextBox.js';
6
6
 
7
- export const Counter = ({
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,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -0,0 +1,6 @@
1
+ /** @type {import('vite').UserConfig} */
2
+ export default {
3
+ ssr: {
4
+ noExternal: ['react-wrap-balancer'],
5
+ },
6
+ };
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
18
+ "@types/react": "18.2.55",
19
+ "@types/react-dom": "18.2.19",
20
20
  "typescript": "5.3.3"
21
21
  }
22
22
  }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
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
  }
@@ -2,6 +2,8 @@ import type { ReactNode } from 'react';
2
2
 
3
3
  import { Link } from 'waku/router/client';
4
4
 
5
+ import '../styles.css';
6
+
5
7
  const Pending = ({ isPending }: { isPending: boolean }) => (
6
8
  <span
7
9
  style={{
@@ -0,0 +1,3 @@
1
+ body {
2
+ background-color: #fefefe;
3
+ }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -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-b30030471-20240117",
15
- "react-dom": "18.3.0-canary-b30030471-20240117",
16
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
17
- "waku": "0.19.1"
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.5",
21
- "@types/react": "18.2.48",
22
- "@types/react-dom": "18.2.18",
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,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental", "node"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
18
+ "@types/react": "18.2.55",
19
+ "@types/react-dom": "18.2.19",
20
20
  "typescript": "5.3.3"
21
21
  }
22
22
  }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -10,14 +10,14 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "glob": "10.3.10",
13
- "react": "18.3.0-canary-b30030471-20240117",
14
- "react-dom": "18.3.0-canary-b30030471-20240117",
15
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
16
- "waku": "0.19.1"
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.48",
20
- "@types/react-dom": "18.2.18",
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 getStaticPaths = async () => {
57
+ const getPathConfig = async () => {
58
58
  const files = await glob('**/page.{tsx,js}', { cwd: routesDir });
59
- return files
60
- .filter((file) => !/(^|\/)(\[\w+\]|_\w+_)\//.test(file))
61
- .map((file) => '/' + file.slice(0, Math.max(0, file.lastIndexOf('/'))));
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
- // existsPath
66
- async (path: string) => {
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,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -7,9 +7,6 @@ const routeFiles = glob.sync('routes/**/*.{tsx,js}', { cwd: rootDir });
7
7
 
8
8
  /** @type {import('vite').UserConfig} */
9
9
  export default {
10
- ssr: {
11
- external: ['glob'],
12
- },
13
10
  build: {
14
11
  rollupOptions: {
15
12
  input: Object.fromEntries(
@@ -9,14 +9,14 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
18
+ "@types/react": "18.2.55",
19
+ "@types/react-dom": "18.2.19",
20
20
  "typescript": "5.3.3"
21
21
  }
22
22
  }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -9,20 +9,20 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@stylexjs/stylex": "0.4.1",
13
- "@vanilla-extract/css": "1.14.0",
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-b30030471-20240117",
16
- "react-dom": "18.3.0-canary-b30030471-20240117",
17
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
18
- "waku": "0.19.1"
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.48",
22
- "@types/react-dom": "18.2.18",
23
- "@vanilla-extract/vite-plugin": "3.9.4",
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.2.4"
26
+ "vite-plugin-stylex-dev": "0.3.0"
27
27
  }
28
28
  }
@@ -9,6 +9,6 @@
9
9
  "noUncheckedIndexedAccess": true,
10
10
  "exactOptionalPropertyTypes": true,
11
11
  "types": ["react/experimental"],
12
- "jsx": "react-jsx",
13
- },
12
+ "jsx": "react-jsx"
13
+ }
14
14
  }
@@ -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
- export default defineConfig(({ mode }) => ({
6
- ...(mode === 'development' && {
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-b30030471-20240117",
13
- "react-dom": "18.3.0-canary-b30030471-20240117",
14
- "react-server-dom-webpack": "18.3.0-canary-b30030471-20240117",
15
- "waku": "0.19.1"
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.48",
19
- "@types/react-dom": "18.2.18",
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.2.3"
22
+ "vite-tsconfig-paths": "4.3.1"
23
23
  }
24
24
  }
@@ -11,7 +11,7 @@
11
11
  "types": ["react/experimental"],
12
12
  "jsx": "react-jsx",
13
13
  "paths": {
14
- "@/*": ["./src/*"],
15
- },
16
- },
14
+ "@/*": ["./src/*"]
15
+ }
16
+ }
17
17
  }
@@ -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
- export default defineConfig({
5
- plugins: [tsconfigPaths()],
6
- });
4
+ /** @type {import('vite').UserConfig} */
5
+ export default {
6
+ plugins: [
7
+ tsconfigPaths({
8
+ root: fileURLToPath(new URL('.', import.meta.url)),
9
+ }),
10
+ ],
11
+ };