create-waku 0.6.6 → 0.6.7

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 (32) hide show
  1. package/package.json +1 -1
  2. package/template/01_counter/package.json +10 -10
  3. package/template/01_counter/src/entries.tsx +2 -1
  4. package/template/02_async/package.json +10 -10
  5. package/template/02_async/src/entries.tsx +2 -1
  6. package/template/03_promise/package.json +10 -10
  7. package/template/03_promise/src/entries.tsx +2 -1
  8. package/template/04_callserver/package.json +10 -10
  9. package/template/04_callserver/src/entries.tsx +2 -1
  10. package/template/05_mutation/package.json +11 -11
  11. package/template/05_mutation/src/entries.tsx +2 -1
  12. package/template/06_nesting/package.json +10 -10
  13. package/template/06_nesting/src/entries.tsx +2 -1
  14. package/template/07_router/package.json +10 -10
  15. package/template/08_cookies/package.json +10 -10
  16. package/template/08_cookies/src/entries.tsx +2 -1
  17. package/template/09_cssmodules/package.json +10 -10
  18. package/template/09_cssmodules/src/entries.tsx +2 -1
  19. package/template/10_dynamicroute/package.json +11 -11
  20. package/template/11_form/package.json +10 -10
  21. package/template/11_form/src/entries.tsx +2 -1
  22. package/template/12_css/index.html +37 -0
  23. package/template/12_css/package.json +29 -0
  24. package/template/12_css/src/components/App.css +3 -0
  25. package/template/12_css/src/components/App.module.css +3 -0
  26. package/template/12_css/src/components/App.tsx +18 -0
  27. package/template/12_css/src/components/Counter.tsx +14 -0
  28. package/template/12_css/src/components/styles.css.ts +7 -0
  29. package/template/12_css/src/entries.tsx +35 -0
  30. package/template/12_css/src/main.tsx +17 -0
  31. package/template/12_css/tsconfig.json +15 -0
  32. package/template/12_css/vite.config.ts +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-waku",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "author": "Daishi Kato",
5
5
  "type": "module",
6
6
  "contributors": [
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -25,7 +25,8 @@ export default defineEntries(
25
25
  },
26
26
  // getSsrConfig
27
27
  async (pathStr) => {
28
- switch (pathStr) {
28
+ const { pathname } = new URL(pathStr, 'http://localhost');
29
+ switch (pathname) {
29
30
  case '/':
30
31
  return {
31
32
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -9,20 +9,20 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "react-wrap-balancer": "^1.1.0",
18
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "react-wrap-balancer": "1.1.0",
18
+ "waku": "0.18.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@swc/core": "1.3.100",
22
- "@types/react": "^18.2.43",
23
- "@types/react-dom": "^18.2.17",
22
+ "@types/react": "18.2.45",
23
+ "@types/react-dom": "18.2.17",
24
24
  "@vitejs/plugin-react": "4.2.1",
25
- "typescript": "^5.3.3",
26
- "vite": "5.0.7"
25
+ "typescript": "5.3.3",
26
+ "vite": "5.0.9"
27
27
  }
28
28
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -35,7 +35,8 @@ export default defineEntries(
35
35
  },
36
36
  // getSsrConfig
37
37
  async (pathStr) => {
38
- switch (pathStr) {
38
+ const { pathname } = new URL(pathStr, 'http://localhost');
39
+ switch (pathname) {
39
40
  case '/':
40
41
  return {
41
42
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -9,19 +9,19 @@
9
9
  "start": "node start.js --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "cookie-parser": "^1.4.6",
13
- "express": "^4.18.2",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "cookie-parser": "1.4.6",
13
+ "express": "4.18.2",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -35,7 +35,8 @@ export default defineEntries(
35
35
  },
36
36
  // getSsrConfig
37
37
  async (pathStr) => {
38
- switch (pathStr) {
38
+ const { pathname } = new URL(pathStr, 'http://localhost');
39
+ switch (pathname) {
39
40
  case '/':
40
41
  return {
41
42
  input: '',
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -9,20 +9,20 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "glob": "^10.3.10",
14
- "hono": "^3.11.4",
15
- "react": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
17
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
18
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "glob": "10.3.10",
14
+ "hono": "3.11.7",
15
+ "react": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
17
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
18
+ "waku": "0.18.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@swc/core": "1.3.100",
22
- "@types/react": "^18.2.43",
23
- "@types/react-dom": "^18.2.17",
22
+ "@types/react": "18.2.45",
23
+ "@types/react-dom": "18.2.17",
24
24
  "@vitejs/plugin-react": "4.2.1",
25
- "typescript": "^5.3.3",
26
- "vite": "5.0.7"
25
+ "typescript": "5.3.3",
26
+ "vite": "5.0.9"
27
27
  }
28
28
  }
@@ -9,19 +9,19 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "@hono/node-server": "^1.3.1",
13
- "hono": "^3.11.4",
14
- "react": "18.3.0-canary-5bcade5fc-20231208",
15
- "react-dom": "18.3.0-canary-5bcade5fc-20231208",
16
- "react-server-dom-webpack": "18.3.0-canary-5bcade5fc-20231208",
17
- "waku": "0.18.0"
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.100",
21
- "@types/react": "^18.2.43",
22
- "@types/react-dom": "^18.2.17",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
23
  "@vitejs/plugin-react": "4.2.1",
24
- "typescript": "^5.3.3",
25
- "vite": "5.0.7"
24
+ "typescript": "5.3.3",
25
+ "vite": "5.0.9"
26
26
  }
27
27
  }
@@ -20,7 +20,8 @@ export default defineEntries(
20
20
  },
21
21
  // getSsrConfig
22
22
  async (pathStr) => {
23
- switch (pathStr) {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
24
25
  case '/':
25
26
  return {
26
27
  input: '',
@@ -0,0 +1,37 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Waku example</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <style>
8
+ @keyframes spinner {
9
+ to {
10
+ transform: rotate(360deg);
11
+ }
12
+ }
13
+ .spinner {
14
+ width: 36px;
15
+ height: 36px;
16
+ margin: auto;
17
+ border: 2px solid #ddd;
18
+ border-top-color: #222;
19
+ border-radius: 50%;
20
+ animation: spinner 1s linear infinite;
21
+ }
22
+ #root > .spinner {
23
+ margin-top: calc(50% - 18px);
24
+ }
25
+ </style>
26
+ </head>
27
+ <body>
28
+ <!--placeholder1-->
29
+ <div id="root">
30
+ <div class="spinner"></div>
31
+ </div>
32
+ <!--/placeholder1-->
33
+ <script src="/src/main.tsx" async type="module"></script>
34
+ <!--placeholder2-->
35
+ <!--/placeholder2-->
36
+ </body>
37
+ </html>
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "waku-example",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "scripts": {
7
+ "dev": "waku dev --with-ssr",
8
+ "build": "waku build --with-ssr",
9
+ "start": "waku start --with-ssr"
10
+ },
11
+ "dependencies": {
12
+ "@hono/node-server": "1.3.3",
13
+ "hono": "3.11.7",
14
+ "react": "18.3.0-canary-0cdfef19b-20231211",
15
+ "react-dom": "18.3.0-canary-0cdfef19b-20231211",
16
+ "react-server-dom-webpack": "18.3.0-canary-0cdfef19b-20231211",
17
+ "waku": "0.18.1"
18
+ },
19
+ "devDependencies": {
20
+ "@swc/core": "1.3.100",
21
+ "@types/react": "18.2.45",
22
+ "@types/react-dom": "18.2.17",
23
+ "@vanilla-extract/css": "1.14.0",
24
+ "@vanilla-extract/vite-plugin": "3.9.3",
25
+ "@vitejs/plugin-react": "4.2.1",
26
+ "typescript": "5.3.3",
27
+ "vite": "5.0.9"
28
+ }
29
+ }
@@ -0,0 +1,3 @@
1
+ h1 {
2
+ color: red;
3
+ }
@@ -0,0 +1,3 @@
1
+ .title {
2
+ background-color: pink;
3
+ }
@@ -0,0 +1,18 @@
1
+ // @ts-expect-error no types
2
+ import styles from './App.module.css';
3
+ import './App.css';
4
+ import { container } from './styles.css.js';
5
+ import { Counter } from './Counter.js';
6
+
7
+ const App = ({ name }: { name: string }) => {
8
+ return (
9
+ <div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
10
+ <h1>Hello {name}!!</h1>
11
+ <h1 className={styles.title}>Hello {name}!!</h1>
12
+ <h3 className={container}>This is a server component.</h3>
13
+ <Counter />
14
+ </div>
15
+ );
16
+ };
17
+
18
+ export default App;
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+
3
+ import { useState } from 'react';
4
+
5
+ export const Counter = () => {
6
+ const [count, setCount] = useState(0);
7
+ return (
8
+ <div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
9
+ <p>Count: {count}</p>
10
+ <button onClick={() => setCount((c) => c + 1)}>Increment</button>
11
+ <h3>This is a client component.</h3>
12
+ </div>
13
+ );
14
+ };
@@ -0,0 +1,7 @@
1
+ import { style } from '@vanilla-extract/css';
2
+
3
+ export const container = style({
4
+ border: '3px green dashed',
5
+ margin: '1em',
6
+ padding: '1em',
7
+ });
@@ -0,0 +1,35 @@
1
+ import { lazy } from 'react';
2
+ import { defineEntries } from 'waku/server';
3
+
4
+ const App = lazy(() => import('./components/App.js'));
5
+
6
+ export default defineEntries(
7
+ // renderEntries
8
+ async (input) => {
9
+ return {
10
+ App: <App name={input || 'Waku'} />,
11
+ };
12
+ },
13
+ // getBuildConfig
14
+ async () => {
15
+ return {
16
+ '/': {
17
+ entries: [['']],
18
+ },
19
+ };
20
+ },
21
+ // getSsrConfig
22
+ async (pathStr) => {
23
+ const { pathname } = new URL(pathStr, 'http://localhost');
24
+ switch (pathname) {
25
+ case '/':
26
+ return {
27
+ input: '',
28
+ unstable_render: ({ createElement, Slot }) =>
29
+ createElement(Slot, { id: 'App' }),
30
+ };
31
+ default:
32
+ return null;
33
+ }
34
+ },
35
+ );
@@ -0,0 +1,17 @@
1
+ import { StrictMode } from 'react';
2
+ import { createRoot, hydrateRoot } from 'react-dom/client';
3
+ import { Root, Slot } from 'waku/client';
4
+
5
+ const rootElement = (
6
+ <StrictMode>
7
+ <Root>
8
+ <Slot id="App" />
9
+ </Root>
10
+ </StrictMode>
11
+ );
12
+
13
+ if ((globalThis as any).__WAKU_SSR_ENABLED__) {
14
+ hydrateRoot(document.getElementById('root')!, rootElement);
15
+ } else {
16
+ createRoot(document.getElementById('root')!).render(rootElement);
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "target": "esnext",
5
+ "downlevelIteration": true,
6
+ "esModuleInterop": true,
7
+ "module": "nodenext",
8
+ "skipLibCheck": true,
9
+ "noUncheckedIndexedAccess": true,
10
+ "exactOptionalPropertyTypes": true,
11
+ "jsx": "react-jsx",
12
+ "rootDir": "./src",
13
+ "outDir": "./dist"
14
+ }
15
+ }
@@ -0,0 +1,9 @@
1
+ import url from 'node:url';
2
+ import path from 'node:path';
3
+ import { defineConfig } from 'vite';
4
+ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
5
+
6
+ export default defineConfig({
7
+ root: path.dirname(url.fileURLToPath(import.meta.url)),
8
+ plugins: [vanillaExtractPlugin({ emitCssInSsr: true })],
9
+ });