create-waku 0.7.1 → 0.7.2
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/cli.js +4 -0
- package/dist/index.js +0 -1
- package/package.json +2 -2
- package/template/01_template/package.json +5 -5
- package/template/01_template/tsconfig.json +3 -3
- package/template/02_demo/package.json +5 -5
- package/template/02_demo/tsconfig.json +3 -3
- package/template/03_minimal/package.json +5 -5
- package/template/03_minimal/tsconfig.json +2 -2
- package/template/04_promise/package.json +5 -5
- package/template/04_promise/tsconfig.json +2 -2
- package/template/05_actions/package.json +5 -5
- package/template/05_actions/src/components/App.tsx +1 -1
- package/template/05_actions/src/components/Counter.tsx +3 -1
- package/template/05_actions/tsconfig.json +2 -2
- package/template/05_actions/vite.config.ts +6 -0
- 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/package.json +6 -6
- package/template/08_cookies/tsconfig.json +2 -2
- package/template/09_cssmodules/package.json +5 -5
- package/template/09_cssmodules/tsconfig.json +2 -2
- package/template/10_dynamicroute/package.json +5 -5
- package/template/10_dynamicroute/src/entries.tsx +17 -16
- package/template/10_dynamicroute/tsconfig.json +2 -2
- package/template/10_dynamicroute/vite.config.ts +0 -3
- package/template/11_form/package.json +5 -5
- package/template/11_form/tsconfig.json +2 -2
- package/template/12_css/package.json +9 -9
- package/template/12_css/tsconfig.json +2 -2
- package/template/12_css/vite.config.ts +3 -8
- package/template/13_path-alias/package.json +6 -6
- package/template/13_path-alias/tsconfig.json +3 -3
- package/template/13_path-alias/vite.config.ts +9 -4
package/cli.js
ADDED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-waku",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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": "./
|
|
15
|
+
"create-waku": "./cli.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"autoprefixer": "10.4.17",
|
|
21
21
|
"tailwindcss": "3.4.1",
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"autoprefixer": "10.4.17",
|
|
21
21
|
"tailwindcss": "3.4.1",
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
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-
|
|
12
|
+
"react": "18.3.0-canary-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
15
|
"react-wrap-balancer": "1.1.0",
|
|
16
|
-
"waku": "0.19.
|
|
16
|
+
"waku": "0.19.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "18.2.
|
|
19
|
+
"@types/react": "18.2.54",
|
|
20
20
|
"@types/react-dom": "18.2.18",
|
|
21
21
|
"typescript": "5.3.3"
|
|
22
22
|
}
|
|
@@ -4,7 +4,7 @@ import { useState, useTransition } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { TextBox } from './TextBox.js';
|
|
6
6
|
|
|
7
|
-
|
|
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,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"server-only": "0.0.1",
|
|
21
21
|
"typescript": "5.3.3"
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cookie-parser": "1.4.6",
|
|
13
13
|
"express": "4.18.2",
|
|
14
|
-
"react": "18.3.0-canary-
|
|
15
|
-
"react-dom": "18.3.0-canary-
|
|
16
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
17
|
-
"waku": "0.19.
|
|
14
|
+
"react": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
16
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
17
|
+
"waku": "0.19.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/node": "20.11.
|
|
21
|
-
"@types/react": "18.2.
|
|
20
|
+
"@types/node": "20.11.16",
|
|
21
|
+
"@types/react": "18.2.54",
|
|
22
22
|
"@types/react-dom": "18.2.18",
|
|
23
23
|
"typescript": "5.3.3"
|
|
24
24
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"glob": "10.3.10",
|
|
13
|
-
"react": "18.3.0-canary-
|
|
14
|
-
"react-dom": "18.3.0-canary-
|
|
15
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
16
|
-
"waku": "0.19.
|
|
13
|
+
"react": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
16
|
+
"waku": "0.19.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "18.2.
|
|
19
|
+
"@types/react": "18.2.54",
|
|
20
20
|
"@types/react-dom": "18.2.18",
|
|
21
21
|
"typescript": "5.3.3"
|
|
22
22
|
}
|
|
@@ -54,24 +54,27 @@ const getMappingAndItems = async (id: string) => {
|
|
|
54
54
|
return { mapping, items };
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
const
|
|
57
|
+
const getPathConfig = async () => {
|
|
58
58
|
const files = await glob('**/page.{tsx,js}', { cwd: routesDir });
|
|
59
|
-
return files
|
|
60
|
-
|
|
61
|
-
.map((
|
|
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
|
-
//
|
|
66
|
-
|
|
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,13 +9,13 @@
|
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3"
|
|
21
21
|
}
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
"start": "waku start --with-ssr"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@stylexjs/stylex": "0.
|
|
13
|
-
"@vanilla-extract/css": "1.14.
|
|
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-
|
|
16
|
-
"react-dom": "18.3.0-canary-
|
|
17
|
-
"react-server-dom-webpack": "18.3.0-canary-
|
|
18
|
-
"waku": "0.19.
|
|
15
|
+
"react": "18.3.0-canary-4b2a1115a-20240202",
|
|
16
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
17
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
18
|
+
"waku": "0.19.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/react": "18.2.
|
|
21
|
+
"@types/react": "18.2.54",
|
|
22
22
|
"@types/react-dom": "18.2.18",
|
|
23
|
-
"@vanilla-extract/vite-plugin": "3.9.
|
|
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.
|
|
26
|
+
"vite-plugin-stylex-dev": "0.3.0"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -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
|
-
|
|
6
|
-
|
|
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-
|
|
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-4b2a1115a-20240202",
|
|
13
|
+
"react-dom": "18.3.0-canary-4b2a1115a-20240202",
|
|
14
|
+
"react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202",
|
|
15
|
+
"waku": "0.19.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/react": "18.2.
|
|
18
|
+
"@types/react": "18.2.54",
|
|
19
19
|
"@types/react-dom": "18.2.18",
|
|
20
20
|
"typescript": "5.3.3",
|
|
21
21
|
"vite": "5.0.12",
|
|
22
|
-
"vite-tsconfig-paths": "4.
|
|
22
|
+
"vite-tsconfig-paths": "4.3.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** @type {import('vite').UserConfig} */
|
|
5
|
+
export default {
|
|
6
|
+
plugins: [
|
|
7
|
+
tsconfigPaths({
|
|
8
|
+
root: fileURLToPath(new URL('.', import.meta.url)),
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|