create-waku 0.7.0 → 0.7.1

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 (72) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/template/01_template/package.json +6 -6
  4. package/template/01_template/src/components/counter.tsx +7 -2
  5. package/template/01_template/src/components/footer.tsx +6 -1
  6. package/template/01_template/src/components/header.tsx +1 -1
  7. package/template/01_template/src/styles.css +1 -13
  8. package/template/01_template/src/templates/about-page.tsx +6 -3
  9. package/template/01_template/src/templates/home-page.tsx +5 -2
  10. package/template/01_template/src/templates/root-layout.tsx +1 -1
  11. package/template/01_template/tsconfig.json +3 -3
  12. package/template/{04_callserver → 02_demo}/package.json +8 -6
  13. package/template/02_demo/postcss.config.js +7 -0
  14. package/template/02_demo/public/images/favicon.png +0 -0
  15. package/template/02_demo/src/components/error-boundary.tsx +28 -0
  16. package/template/02_demo/src/components/footer.tsx +18 -0
  17. package/template/02_demo/src/components/header.tsx +11 -0
  18. package/template/02_demo/src/entries.tsx +29 -0
  19. package/template/02_demo/src/lib/index.ts +26 -0
  20. package/template/02_demo/src/lib/pokemon.ts +2586 -0
  21. package/template/{05_mutation → 02_demo}/src/main.tsx +6 -4
  22. package/template/02_demo/src/styles.css +5 -0
  23. package/template/02_demo/src/templates/home-page.tsx +35 -0
  24. package/template/02_demo/src/templates/pokemon-page.tsx +69 -0
  25. package/template/02_demo/src/templates/root-layout.tsx +33 -0
  26. package/template/02_demo/tailwind.config.js +10 -0
  27. package/template/{03_promise → 02_demo}/tsconfig.json +5 -2
  28. package/template/{02_minimal → 03_minimal}/package.json +5 -5
  29. package/template/{04_callserver → 03_minimal}/tsconfig.json +2 -2
  30. package/template/{03_promise → 04_promise}/package.json +5 -5
  31. package/template/{05_mutation → 04_promise}/tsconfig.json +2 -2
  32. package/template/{05_mutation → 05_actions}/package.json +5 -5
  33. package/template/{05_mutation → 05_actions}/src/components/App.tsx +2 -1
  34. package/template/{04_callserver → 05_actions}/src/components/Counter.tsx +12 -8
  35. package/template/{05_mutation → 05_actions}/src/components/funcs.ts +2 -0
  36. package/template/{02_minimal → 05_actions}/tsconfig.json +2 -2
  37. package/template/06_nesting/package.json +5 -5
  38. package/template/06_nesting/tsconfig.json +2 -2
  39. package/template/07_router/package.json +5 -5
  40. package/template/07_router/tsconfig.json +2 -2
  41. package/template/08_cookies/dev.js +1 -1
  42. package/template/08_cookies/package.json +6 -6
  43. package/template/08_cookies/start.js +3 -4
  44. package/template/08_cookies/tsconfig.json +2 -2
  45. package/template/09_cssmodules/package.json +5 -5
  46. package/template/09_cssmodules/src/components/Layout.tsx +22 -0
  47. package/template/09_cssmodules/src/components/styles.css +3 -0
  48. package/template/09_cssmodules/src/entries.tsx +6 -1
  49. package/template/09_cssmodules/tsconfig.json +2 -2
  50. package/template/10_dynamicroute/package.json +5 -5
  51. package/template/10_dynamicroute/tsconfig.json +2 -2
  52. package/template/11_form/package.json +5 -5
  53. package/template/11_form/tsconfig.json +2 -2
  54. package/template/12_css/package.json +8 -8
  55. package/template/12_css/tsconfig.json +2 -2
  56. package/template/13_path-alias/package.json +6 -6
  57. package/template/13_path-alias/tsconfig.json +3 -3
  58. package/template/04_callserver/src/components/App.tsx +0 -20
  59. package/template/04_callserver/src/components/funcs.ts +0 -3
  60. package/template/04_callserver/src/entries.tsx +0 -31
  61. package/template/05_mutation/src/components/Counter.tsx +0 -24
  62. /package/template/{02_minimal → 03_minimal}/src/components/App.tsx +0 -0
  63. /package/template/{02_minimal → 03_minimal}/src/components/Counter.tsx +0 -0
  64. /package/template/{02_minimal → 03_minimal}/src/entries.tsx +0 -0
  65. /package/template/{02_minimal → 03_minimal}/src/main.tsx +0 -0
  66. /package/template/{03_promise → 04_promise}/src/components/App.tsx +0 -0
  67. /package/template/{03_promise → 04_promise}/src/components/Counter.tsx +0 -0
  68. /package/template/{03_promise → 04_promise}/src/entries.tsx +0 -0
  69. /package/template/{03_promise → 04_promise}/src/main.tsx +0 -0
  70. /package/template/{04_callserver → 05_actions}/src/components/TextBox.tsx +0 -0
  71. /package/template/{05_mutation → 05_actions}/src/entries.tsx +0 -0
  72. /package/template/{04_callserver → 05_actions}/src/main.tsx +0 -0
@@ -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,16 +9,16 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-c5b937576-20231219",
13
- "react-dom": "18.3.0-canary-c5b937576-20231219",
14
- "react-server-dom-webpack": "18.3.0-canary-c5b937576-20231219",
15
- "waku": "0.19.0"
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"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/react": "18.2.46",
18
+ "@types/react": "18.2.48",
19
19
  "@types/react-dom": "18.2.18",
20
20
  "typescript": "5.3.3",
21
- "vite": "5.0.10",
21
+ "vite": "5.0.12",
22
22
  "vite-tsconfig-paths": "4.2.3"
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,20 +0,0 @@
1
- import { Counter } from './Counter.js';
2
- import { greet } from './funcs.js';
3
-
4
- type ServerFunction<T> = T extends (...args: infer A) => infer R
5
- ? (...args: A) => Promise<R>
6
- : never;
7
-
8
- const App = ({ name }: { name: string }) => {
9
- return (
10
- <div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
11
- <title>Waku</title>
12
- <h1>Hello {name}!!</h1>
13
- <h3>This is a server component.</h3>
14
- <Counter greet={greet as unknown as ServerFunction<typeof greet>} />
15
- <div>{new Date().toISOString()}</div>
16
- </div>
17
- );
18
- };
19
-
20
- export default App;
@@ -1,3 +0,0 @@
1
- 'use server';
2
-
3
- export const greet = (name: string) => `Hello ${name} from server!`;
@@ -1,31 +0,0 @@
1
- import { lazy } from 'react';
2
- import { defineEntries } from 'waku/server';
3
- import { Slot } from 'waku/client';
4
-
5
- const App = lazy(() => import('./components/App.js'));
6
-
7
- export default defineEntries(
8
- // renderEntries
9
- async (input) => {
10
- return {
11
- App: <App name={input || 'Waku'} />,
12
- };
13
- },
14
- // getBuildConfig
15
- async () => [{ pathname: '/', entries: [{ input: '', isStatic: true }] }],
16
- // getSsrConfig
17
- async (pathname, { isPrd }) => {
18
- if (isPrd) {
19
- return null;
20
- }
21
- switch (pathname) {
22
- case '/':
23
- return {
24
- input: '',
25
- body: <Slot id="App" />,
26
- };
27
- default:
28
- return null;
29
- }
30
- },
31
- );
@@ -1,24 +0,0 @@
1
- 'use client';
2
-
3
- import { useState, useTransition } from 'react';
4
-
5
- export const Counter = ({ increment }: { increment: () => void }) => {
6
- const [count, setCount] = useState(0);
7
- const [isPending, startTransition] = useTransition();
8
- const handleClick = () => {
9
- startTransition(() => {
10
- increment();
11
- });
12
- };
13
- return (
14
- <div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
15
- <p>Count: {count}</p>
16
- <button onClick={() => setCount((c) => c + 1)}>Increment</button>
17
- <p>
18
- <button onClick={handleClick}>Increment server counter</button>{' '}
19
- {isPending ? 'Pending...' : ''}
20
- </p>
21
- <h3>This is a client component.</h3>
22
- </div>
23
- );
24
- };