create-waku 0.6.2 → 0.6.4

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 (143) hide show
  1. package/package.json +5 -3
  2. package/template/01_counter/package.json +7 -6
  3. package/template/02_async/package.json +7 -6
  4. package/template/03_promise/package.json +7 -6
  5. package/template/04_callserver/package.json +7 -6
  6. package/template/05_mutation/package.json +7 -6
  7. package/template/06_nesting/package.json +7 -6
  8. package/template/07_router/package.json +7 -6
  9. package/template/08_cookies/db/items.json +12 -0
  10. package/template/08_cookies/package.json +4 -4
  11. package/template/08_cookies/src/components/App.tsx +2 -1
  12. package/template/08_cookies/src/entries.tsx +13 -1
  13. package/template/09_cssmodules/package.json +7 -6
  14. package/template/10_dynamicroute/package.json +7 -6
  15. package/template/11_form/package.json +7 -6
  16. package/template/01_counter/dist/components/App.js +0 -6
  17. package/template/01_counter/dist/components/Counter.js +0 -7
  18. package/template/01_counter/dist/entries.js +0 -32
  19. package/template/01_counter/dist/main.js +0 -11
  20. package/template/01_counter/node_modules/.bin/tsc +0 -17
  21. package/template/01_counter/node_modules/.bin/tsserver +0 -17
  22. package/template/01_counter/node_modules/.bin/vite +0 -17
  23. package/template/01_counter/node_modules/.bin/waku +0 -17
  24. package/template/02_async/dist/components/App.js +0 -13
  25. package/template/02_async/dist/components/Counter.js +0 -7
  26. package/template/02_async/dist/entries.js +0 -32
  27. package/template/02_async/dist/main.js +0 -11
  28. package/template/02_async/node_modules/.bin/tsc +0 -17
  29. package/template/02_async/node_modules/.bin/tsserver +0 -17
  30. package/template/02_async/node_modules/.bin/vite +0 -17
  31. package/template/02_async/node_modules/.bin/waku +0 -17
  32. package/template/03_promise/dist/components/App.js +0 -9
  33. package/template/03_promise/dist/components/Counter.js +0 -8
  34. package/template/03_promise/dist/entries.js +0 -32
  35. package/template/03_promise/dist/main.js +0 -11
  36. package/template/03_promise/node_modules/.bin/tsc +0 -17
  37. package/template/03_promise/node_modules/.bin/tsserver +0 -17
  38. package/template/03_promise/node_modules/.bin/vite +0 -17
  39. package/template/03_promise/node_modules/.bin/waku +0 -17
  40. package/template/04_callserver/dist/components/App.js +0 -7
  41. package/template/04_callserver/dist/components/Counter.js +0 -15
  42. package/template/04_callserver/dist/components/TextBox.js +0 -6
  43. package/template/04_callserver/dist/components/funcs.js +0 -2
  44. package/template/04_callserver/dist/entries.js +0 -32
  45. package/template/04_callserver/dist/main.js +0 -11
  46. package/template/04_callserver/node_modules/.bin/tsc +0 -17
  47. package/template/04_callserver/node_modules/.bin/tsserver +0 -17
  48. package/template/04_callserver/node_modules/.bin/vite +0 -17
  49. package/template/04_callserver/node_modules/.bin/waku +0 -17
  50. package/template/05_mutation/dist/components/App.js +0 -8
  51. package/template/05_mutation/dist/components/Counter.js +0 -13
  52. package/template/05_mutation/dist/components/funcs.js +0 -9
  53. package/template/05_mutation/dist/entries.js +0 -32
  54. package/template/05_mutation/dist/main.js +0 -11
  55. package/template/05_mutation/node_modules/.bin/tsc +0 -17
  56. package/template/05_mutation/node_modules/.bin/tsserver +0 -17
  57. package/template/05_mutation/node_modules/.bin/vite +0 -17
  58. package/template/05_mutation/node_modules/.bin/waku +0 -17
  59. package/template/06_nesting/dist/components/App.js +0 -6
  60. package/template/06_nesting/dist/components/Counter.js +0 -24
  61. package/template/06_nesting/dist/components/InnerApp.js +0 -6
  62. package/template/06_nesting/dist/entries.js +0 -46
  63. package/template/06_nesting/dist/main.js +0 -11
  64. package/template/06_nesting/node_modules/.bin/tsc +0 -17
  65. package/template/06_nesting/node_modules/.bin/tsserver +0 -17
  66. package/template/06_nesting/node_modules/.bin/vite +0 -17
  67. package/template/06_nesting/node_modules/.bin/waku +0 -17
  68. package/template/07_router/dist/node/tsconfig.node.tsbuildinfo +0 -1
  69. package/template/07_router/dist/node/vite.config.d.ts +0 -15
  70. package/template/07_router/dist/node/vite.config.js +0 -19
  71. package/template/07_router/dist/src/components/Counter.d.ts +0 -1
  72. package/template/07_router/dist/src/components/Counter.js +0 -8
  73. package/template/07_router/dist/src/components/ErrorBoundary.d.ts +0 -7
  74. package/template/07_router/dist/src/components/ErrorBoundary.js +0 -17
  75. package/template/07_router/dist/src/entries.d.ts +0 -6
  76. package/template/07_router/dist/src/entries.js +0 -29
  77. package/template/07_router/dist/src/main.d.ts +0 -1
  78. package/template/07_router/dist/src/main.js +0 -12
  79. package/template/07_router/dist/src/routes/bar/page.d.ts +0 -2
  80. package/template/07_router/dist/src/routes/bar/page.js +0 -4
  81. package/template/07_router/dist/src/routes/foo/page.d.ts +0 -2
  82. package/template/07_router/dist/src/routes/foo/page.js +0 -4
  83. package/template/07_router/dist/src/routes/layout.d.ts +0 -5
  84. package/template/07_router/dist/src/routes/layout.js +0 -9
  85. package/template/07_router/dist/src/routes/nested/baz/page.d.ts +0 -2
  86. package/template/07_router/dist/src/routes/nested/baz/page.js +0 -3
  87. package/template/07_router/dist/src/routes/nested/layout.d.ts +0 -5
  88. package/template/07_router/dist/src/routes/nested/layout.js +0 -4
  89. package/template/07_router/dist/src/routes/nested/qux/page.d.ts +0 -2
  90. package/template/07_router/dist/src/routes/nested/qux/page.js +0 -3
  91. package/template/07_router/dist/src/routes/page.d.ts +0 -2
  92. package/template/07_router/dist/src/routes/page.js +0 -3
  93. package/template/07_router/dist/tsconfig.tsbuildinfo +0 -1
  94. package/template/07_router/node_modules/.bin/glob +0 -17
  95. package/template/07_router/node_modules/.bin/tsc +0 -17
  96. package/template/07_router/node_modules/.bin/tsserver +0 -17
  97. package/template/07_router/node_modules/.bin/vite +0 -17
  98. package/template/07_router/node_modules/.bin/waku +0 -17
  99. package/template/08_cookies/dist/components/App.js +0 -8
  100. package/template/08_cookies/dist/components/Counter.js +0 -7
  101. package/template/08_cookies/dist/entries.js +0 -35
  102. package/template/08_cookies/dist/main.js +0 -11
  103. package/template/08_cookies/node_modules/.bin/tsc +0 -17
  104. package/template/08_cookies/node_modules/.bin/tsserver +0 -17
  105. package/template/08_cookies/node_modules/.bin/vite +0 -17
  106. package/template/08_cookies/node_modules/.bin/waku +0 -17
  107. package/template/09_cssmodules/dist/components/App.js +0 -8
  108. package/template/09_cssmodules/dist/components/Counter.js +0 -7
  109. package/template/09_cssmodules/dist/entries.js +0 -32
  110. package/template/09_cssmodules/dist/main.js +0 -11
  111. package/template/09_cssmodules/node_modules/.bin/tsc +0 -17
  112. package/template/09_cssmodules/node_modules/.bin/tsserver +0 -17
  113. package/template/09_cssmodules/node_modules/.bin/vite +0 -17
  114. package/template/09_cssmodules/node_modules/.bin/waku +0 -17
  115. package/template/10_dynamicroute/dist/node/tsconfig.node.tsbuildinfo +0 -1
  116. package/template/10_dynamicroute/dist/node/vite.config.d.ts +0 -15
  117. package/template/10_dynamicroute/dist/node/vite.config.js +0 -19
  118. package/template/10_dynamicroute/dist/src/entries.d.ts +0 -6
  119. package/template/10_dynamicroute/dist/src/entries.js +0 -61
  120. package/template/10_dynamicroute/dist/src/main.d.ts +0 -1
  121. package/template/10_dynamicroute/dist/src/main.js +0 -11
  122. package/template/10_dynamicroute/dist/src/routes/[name]/page.d.ts +0 -4
  123. package/template/10_dynamicroute/dist/src/routes/[name]/page.js +0 -3
  124. package/template/10_dynamicroute/dist/src/routes/layout.d.ts +0 -5
  125. package/template/10_dynamicroute/dist/src/routes/layout.js +0 -4
  126. package/template/10_dynamicroute/dist/src/routes/page.d.ts +0 -2
  127. package/template/10_dynamicroute/dist/src/routes/page.js +0 -3
  128. package/template/10_dynamicroute/dist/tsconfig.tsbuildinfo +0 -1
  129. package/template/10_dynamicroute/node_modules/.bin/glob +0 -17
  130. package/template/10_dynamicroute/node_modules/.bin/tsc +0 -17
  131. package/template/10_dynamicroute/node_modules/.bin/tsserver +0 -17
  132. package/template/10_dynamicroute/node_modules/.bin/vite +0 -17
  133. package/template/10_dynamicroute/node_modules/.bin/waku +0 -17
  134. package/template/11_form/dist/components/App.js +0 -8
  135. package/template/11_form/dist/components/Counter.js +0 -13
  136. package/template/11_form/dist/components/Form.js +0 -10
  137. package/template/11_form/dist/components/funcs.js +0 -10
  138. package/template/11_form/dist/entries.js +0 -32
  139. package/template/11_form/dist/main.js +0 -11
  140. package/template/11_form/node_modules/.bin/tsc +0 -17
  141. package/template/11_form/node_modules/.bin/tsserver +0 -17
  142. package/template/11_form/node_modules/.bin/vite +0 -17
  143. package/template/11_form/node_modules/.bin/waku +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-waku",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "author": "Daishi Kato",
5
5
  "type": "module",
6
6
  "contributors": [
@@ -10,7 +10,9 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/dai-shi/waku.git"
12
12
  },
13
- "bin": "./dist/cli.js",
13
+ "bin": {
14
+ "create-waku": "./dist/cli.js"
15
+ },
14
16
  "files": [
15
17
  "src",
16
18
  "dist",
@@ -28,7 +30,7 @@
28
30
  "scripts": {
29
31
  "start": "node dist/cli.js",
30
32
  "compile": "rm -rf template dist *.tsbuildinfo && pnpm run template && pnpm run build",
31
- "template": "cp -r ../../examples template/",
33
+ "template": "cp -r ../../examples template/ && rm -rf template/*/dist && rm -rf template/*/node_modules",
32
34
  "build": "tsc -b"
33
35
  }
34
36
  }
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,17 +4,18 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
16
17
  "react-wrap-balancer": "^1.1.0",
17
- "waku": "0.17.0"
18
+ "waku": "0.17.1"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@swc/core": "1.3.96",
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,17 +4,18 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
13
14
  "glob": "^10.3.10",
14
- "react": "18.3.0-canary-0e352ea01-20231109",
15
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
16
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
17
- "waku": "0.17.0"
15
+ "react": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
17
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
18
+ "waku": "0.17.1"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@swc/core": "1.3.96",
@@ -0,0 +1,12 @@
1
+ [
2
+ { "id": 1, "name": "John" },
3
+ { "id": 2, "name": "Jane" },
4
+ { "id": 3, "name": "Bob" },
5
+ { "id": 4, "name": "Mary" },
6
+ { "id": 5, "name": "Peter" },
7
+ { "id": 6, "name": "Kate" },
8
+ { "id": 7, "name": "Mike" },
9
+ { "id": 8, "name": "Liz" },
10
+ { "id": 9, "name": "Steve" },
11
+ { "id": 10, "name": "Sue" }
12
+ ]
@@ -11,10 +11,10 @@
11
11
  "dependencies": {
12
12
  "cookie-parser": "^1.4.6",
13
13
  "express": "^4.18.2",
14
- "react": "18.3.0-canary-0e352ea01-20231109",
15
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
16
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
17
- "waku": "0.17.0"
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@swc/core": "1.3.96",
@@ -1,7 +1,7 @@
1
1
  import { getContext } from 'waku/server';
2
2
  import { Counter } from './Counter.js';
3
3
 
4
- const App = ({ name }: { name: string }) => {
4
+ const App = ({ name, items }: { name: string; items: unknown[] }) => {
5
5
  const ctx = getContext<{ count: number }>();
6
6
  return (
7
7
  <div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
@@ -9,6 +9,7 @@ const App = ({ name }: { name: string }) => {
9
9
  <h3>This is a server component.</h3>
10
10
  <p>Cookie count: {ctx.count}</p>
11
11
  <Counter />
12
+ <p>Item count: {items.length}</p>
12
13
  </div>
13
14
  );
14
15
  };
@@ -1,3 +1,6 @@
1
+ import path from 'node:path';
2
+ import url from 'node:url';
3
+ import fsPromises from 'node:fs/promises';
1
4
  import { lazy } from 'react';
2
5
  import { defineEntries, getContext } from 'waku/server';
3
6
  import { Slot } from 'waku/client';
@@ -9,8 +12,17 @@ export default defineEntries(
9
12
  async (input) => {
10
13
  const ctx = getContext<{ count: number }>();
11
14
  ++ctx.count;
15
+ const items = JSON.parse(
16
+ await fsPromises.readFile(
17
+ path.join(
18
+ path.dirname(url.fileURLToPath(import.meta.url)),
19
+ '../db/items.json',
20
+ ),
21
+ 'utf8',
22
+ ),
23
+ );
12
24
  return {
13
- App: <App name={input || 'Waku'} />,
25
+ App: <App name={input || 'Waku'} items={items} />,
14
26
  };
15
27
  },
16
28
  // getBuildConfig
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -4,17 +4,18 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
13
14
  "glob": "^10.3.10",
14
- "react": "18.3.0-canary-0e352ea01-20231109",
15
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
16
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
17
- "waku": "0.17.0"
15
+ "react": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
17
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
18
+ "waku": "0.17.1"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@swc/core": "1.3.96",
@@ -4,16 +4,17 @@
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "waku dev --with-ssr",
7
+ "dev": "waku dev",
8
8
  "build": "waku build --with-ssr",
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "express": "^4.18.2",
13
- "react": "18.3.0-canary-0e352ea01-20231109",
14
- "react-dom": "18.3.0-canary-0e352ea01-20231109",
15
- "react-server-dom-webpack": "18.3.0-canary-0e352ea01-20231109",
16
- "waku": "0.17.0"
12
+ "@hono/node-server": "^1.2.2",
13
+ "hono": "^3.10.0",
14
+ "react": "18.3.0-canary-6c7b41da3-20231123",
15
+ "react-dom": "18.3.0-canary-6c7b41da3-20231123",
16
+ "react-server-dom-webpack": "18.3.0-canary-6c7b41da3-20231123",
17
+ "waku": "0.17.1"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@swc/core": "1.3.96",
@@ -1,6 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Counter } from './Counter.js';
3
- const App = ({ name }) => {
4
- return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsx(Counter, {})] }));
5
- };
6
- export default App;
@@ -1,7 +0,0 @@
1
- 'use client';
2
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- export const Counter = () => {
5
- const [count, setCount] = useState(0);
6
- return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount((c) => c + 1), children: "Increment" }), _jsx("h3", { children: "This is a client component." })] }));
7
- };
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { lazy } from 'react';
3
- import { defineEntries } from 'waku/server';
4
- import { Slot } from 'waku/client';
5
- const App = lazy(() => import('./components/App.js'));
6
- export default defineEntries(
7
- // renderEntries
8
- async (input) => {
9
- return {
10
- App: _jsx(App, { name: input || 'Waku' }),
11
- };
12
- },
13
- // getBuildConfig
14
- async () => {
15
- return {
16
- '/': {
17
- entries: [['']],
18
- },
19
- };
20
- },
21
- // getSsrConfig
22
- async (pathStr) => {
23
- switch (pathStr) {
24
- case '/':
25
- return {
26
- input: '',
27
- unstable_render: () => _jsx(Slot, { id: "App" }),
28
- };
29
- default:
30
- return null;
31
- }
32
- });
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { StrictMode } from 'react';
3
- import { createRoot, hydrateRoot } from 'react-dom/client';
4
- import { Root, Slot } from 'waku/client';
5
- const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App" }) }) }));
6
- if (globalThis.__WAKU_SSR_ENABLED__) {
7
- hydrateRoot(document.getElementById('root'), rootElement);
8
- }
9
- else {
10
- createRoot(document.getElementById('root')).render(rootElement);
11
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
15
- else
16
- exec node "$basedir/../typescript/bin/tsc" "$@"
17
- fi
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
15
- else
16
- exec node "$basedir/../typescript/bin/tsserver" "$@"
17
- fi
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
15
- else
16
- exec node "$basedir/../vite/bin/vite.js" "$@"
17
- fi
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../waku/dist/cli.js" "$@"
15
- else
16
- exec node "$basedir/../waku/dist/cli.js" "$@"
17
- fi
@@ -1,13 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- /// Async Server Component
3
- /// <reference types="react/experimental" />
4
- import { Suspense } from 'react';
5
- import { Counter } from './Counter.js';
6
- const App = ({ name }) => {
7
- return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsx(Suspense, { fallback: "Pending...", children: _jsx(ServerMessage, {}) }), _jsx(Counter, {})] }));
8
- };
9
- const ServerMessage = async () => {
10
- await new Promise((resolve) => setTimeout(resolve, 2000));
11
- return _jsx("p", { children: "Hello from server!" });
12
- };
13
- export default App;
@@ -1,7 +0,0 @@
1
- 'use client';
2
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- export const Counter = () => {
5
- const [count, setCount] = useState(0);
6
- return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount((c) => c + 1), children: "Increment" }), _jsx("h3", { children: "This is a client component." })] }));
7
- };
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { lazy } from 'react';
3
- import { defineEntries } from 'waku/server';
4
- import { Slot } from 'waku/client';
5
- const App = lazy(() => import('./components/App.js'));
6
- export default defineEntries(
7
- // renderEntries
8
- async (input) => {
9
- return {
10
- App: _jsx(App, { name: input || 'Waku' }),
11
- };
12
- },
13
- // getBuildConfig
14
- async () => {
15
- return {
16
- '/': {
17
- entries: [['']],
18
- },
19
- };
20
- },
21
- // getSsrConfig
22
- async (pathStr) => {
23
- switch (pathStr) {
24
- case '/':
25
- return {
26
- input: '',
27
- unstable_render: () => _jsx(Slot, { id: "App" }),
28
- };
29
- default:
30
- return null;
31
- }
32
- });
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { StrictMode } from 'react';
3
- import { createRoot, hydrateRoot } from 'react-dom/client';
4
- import { Root, Slot } from 'waku/client';
5
- const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App" }) }) }));
6
- if (globalThis.__WAKU_SSR_ENABLED__) {
7
- hydrateRoot(document.getElementById('root'), rootElement);
8
- }
9
- else {
10
- createRoot(document.getElementById('root')).render(rootElement);
11
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
15
- else
16
- exec node "$basedir/../typescript/bin/tsc" "$@"
17
- fi
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
15
- else
16
- exec node "$basedir/../typescript/bin/tsserver" "$@"
17
- fi
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
15
- else
16
- exec node "$basedir/../vite/bin/vite.js" "$@"
17
- fi