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.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/01_template/package.json +6 -6
- package/template/01_template/src/components/counter.tsx +7 -2
- package/template/01_template/src/components/footer.tsx +6 -1
- package/template/01_template/src/components/header.tsx +1 -1
- package/template/01_template/src/styles.css +1 -13
- package/template/01_template/src/templates/about-page.tsx +6 -3
- package/template/01_template/src/templates/home-page.tsx +5 -2
- package/template/01_template/src/templates/root-layout.tsx +1 -1
- package/template/01_template/tsconfig.json +3 -3
- package/template/{04_callserver → 02_demo}/package.json +8 -6
- package/template/02_demo/postcss.config.js +7 -0
- package/template/02_demo/public/images/favicon.png +0 -0
- package/template/02_demo/src/components/error-boundary.tsx +28 -0
- package/template/02_demo/src/components/footer.tsx +18 -0
- package/template/02_demo/src/components/header.tsx +11 -0
- package/template/02_demo/src/entries.tsx +29 -0
- package/template/02_demo/src/lib/index.ts +26 -0
- package/template/02_demo/src/lib/pokemon.ts +2586 -0
- package/template/{05_mutation → 02_demo}/src/main.tsx +6 -4
- package/template/02_demo/src/styles.css +5 -0
- package/template/02_demo/src/templates/home-page.tsx +35 -0
- package/template/02_demo/src/templates/pokemon-page.tsx +69 -0
- package/template/02_demo/src/templates/root-layout.tsx +33 -0
- package/template/02_demo/tailwind.config.js +10 -0
- package/template/{03_promise → 02_demo}/tsconfig.json +5 -2
- package/template/{02_minimal → 03_minimal}/package.json +5 -5
- package/template/{04_callserver → 03_minimal}/tsconfig.json +2 -2
- package/template/{03_promise → 04_promise}/package.json +5 -5
- package/template/{05_mutation → 04_promise}/tsconfig.json +2 -2
- package/template/{05_mutation → 05_actions}/package.json +5 -5
- package/template/{05_mutation → 05_actions}/src/components/App.tsx +2 -1
- package/template/{04_callserver → 05_actions}/src/components/Counter.tsx +12 -8
- package/template/{05_mutation → 05_actions}/src/components/funcs.ts +2 -0
- package/template/{02_minimal → 05_actions}/tsconfig.json +2 -2
- package/template/06_nesting/package.json +5 -5
- package/template/06_nesting/tsconfig.json +2 -2
- package/template/07_router/package.json +5 -5
- package/template/07_router/tsconfig.json +2 -2
- package/template/08_cookies/dev.js +1 -1
- package/template/08_cookies/package.json +6 -6
- package/template/08_cookies/start.js +3 -4
- package/template/08_cookies/tsconfig.json +2 -2
- package/template/09_cssmodules/package.json +5 -5
- package/template/09_cssmodules/src/components/Layout.tsx +22 -0
- package/template/09_cssmodules/src/components/styles.css +3 -0
- package/template/09_cssmodules/src/entries.tsx +6 -1
- package/template/09_cssmodules/tsconfig.json +2 -2
- package/template/10_dynamicroute/package.json +5 -5
- package/template/10_dynamicroute/tsconfig.json +2 -2
- package/template/11_form/package.json +5 -5
- package/template/11_form/tsconfig.json +2 -2
- package/template/12_css/package.json +8 -8
- package/template/12_css/tsconfig.json +2 -2
- package/template/13_path-alias/package.json +6 -6
- package/template/13_path-alias/tsconfig.json +3 -3
- package/template/04_callserver/src/components/App.tsx +0 -20
- package/template/04_callserver/src/components/funcs.ts +0 -3
- package/template/04_callserver/src/entries.tsx +0 -31
- package/template/05_mutation/src/components/Counter.tsx +0 -24
- /package/template/{02_minimal → 03_minimal}/src/components/App.tsx +0 -0
- /package/template/{02_minimal → 03_minimal}/src/components/Counter.tsx +0 -0
- /package/template/{02_minimal → 03_minimal}/src/entries.tsx +0 -0
- /package/template/{02_minimal → 03_minimal}/src/main.tsx +0 -0
- /package/template/{03_promise → 04_promise}/src/components/App.tsx +0 -0
- /package/template/{03_promise → 04_promise}/src/components/Counter.tsx +0 -0
- /package/template/{03_promise → 04_promise}/src/entries.tsx +0 -0
- /package/template/{03_promise → 04_promise}/src/main.tsx +0 -0
- /package/template/{04_callserver → 05_actions}/src/components/TextBox.tsx +0 -0
- /package/template/{05_mutation → 05_actions}/src/entries.tsx +0 -0
- /package/template/{04_callserver → 05_actions}/src/main.tsx +0 -0
|
@@ -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-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.
|
|
18
|
+
"@types/react": "18.2.48",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3",
|
|
21
|
-
"vite": "5.0.
|
|
21
|
+
"vite": "5.0.12",
|
|
22
22
|
"vite-tsconfig-paths": "4.2.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -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,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
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|