@batijs/cli 0.0.12 → 0.0.13
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/boilerplates/@batijs/express/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/{chunk-package-RT4FORKS.js → chunk-package-QR3QOE4L.js} +4 -19
- package/dist/boilerplates/@batijs/express/{$$express-entry.ts.ts → express-entry.ts} +23 -20
- package/dist/boilerplates/@batijs/hattip/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hattip/{chunk-package-CG6L5HQ3.js → chunk-package-R6L7KHPL.js} +4 -19
- package/dist/boilerplates/@batijs/hattip/{$$hattip-entry.ts.ts → hattip-entry.ts} +25 -21
- package/dist/boilerplates/@batijs/shared/package.json +1 -1
- package/dist/boilerplates/@batijs/solid/$package.json.js +3 -2
- package/dist/boilerplates/@batijs/solid/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/solid/{chunk-package-QUP3GCCY.js → chunk-package-YV4T2FDR.js} +6 -20
- package/dist/boilerplates/@batijs/solid/components/Link.tsx +1 -1
- package/dist/boilerplates/@batijs/solid/layouts/LayoutDefault.tsx +14 -0
- package/dist/boilerplates/@batijs/solid/pages/+config.ts +3 -3
- package/dist/boilerplates/@batijs/solid/pages/index/+Page.tsx +6 -1
- package/dist/boilerplates/@batijs/solid/pages/index/Counter.tsx +6 -1
- package/dist/boilerplates/@batijs/solid/pages/star-wars/@id/+onBeforeRender.ts +2 -4
- package/dist/boilerplates/@batijs/solid/pages/star-wars/index/+onBeforeRender.ts +2 -2
- package/dist/boilerplates/@batijs/tailwindcss/$package.json.js +11 -0
- package/dist/boilerplates/@batijs/tailwindcss/chunk-package-GHAJQRWT.js +62 -0
- package/dist/boilerplates/@batijs/tailwindcss/layouts/tailwind.css +3 -0
- package/dist/boilerplates/@batijs/tailwindcss/postcss.config.js +6 -0
- package/dist/boilerplates/@batijs/tailwindcss/tailwind.config.js +8 -0
- package/dist/boilerplates/@batijs/telefunc/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/{chunk-package-5GHBS6WD.js → chunk-package-ZIL4MEPW.js} +4 -19
- package/dist/boilerplates/boilerplates.json +1 -1
- package/dist/index.js +16 -8
- package/package.json +4 -4
|
@@ -4,7 +4,7 @@ async function getPackageJson(currentContent, meta) {
|
|
|
4
4
|
const packageJson = await loadAsJson(currentContent);
|
|
5
5
|
packageJson.scripts.dev = "tsx ./express-entry.ts";
|
|
6
6
|
packageJson.scripts.build = "vite build";
|
|
7
|
-
return addDependency(packageJson, await import("./chunk-package-
|
|
7
|
+
return addDependency(packageJson, await import("./chunk-package-QR3QOE4L.js"), {
|
|
8
8
|
devDependencies: ["@types/express"],
|
|
9
9
|
dependencies: [
|
|
10
10
|
"@hattip/adapter-node",
|
package/dist/boilerplates/@batijs/express/{chunk-package-RT4FORKS.js → chunk-package-QR3QOE4L.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@batijs/express";
|
|
3
|
-
var
|
|
3
|
+
var private2 = true;
|
|
4
|
+
var version = "0.0.13";
|
|
4
5
|
var description = "";
|
|
5
6
|
var type = "module";
|
|
6
7
|
var scripts = {
|
|
@@ -25,20 +26,6 @@ var devDependencies = {
|
|
|
25
26
|
var dependencies = {
|
|
26
27
|
"@batijs/core": "workspace:*"
|
|
27
28
|
};
|
|
28
|
-
var exports = {
|
|
29
|
-
".": "./dist/index.js",
|
|
30
|
-
"./files": "./dist/index.js"
|
|
31
|
-
};
|
|
32
|
-
var typesVersions = {
|
|
33
|
-
"*": {
|
|
34
|
-
".": [
|
|
35
|
-
"./dist/index.d.ts"
|
|
36
|
-
],
|
|
37
|
-
files: [
|
|
38
|
-
"./dist/index.d.ts"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
29
|
var files = [
|
|
43
30
|
"dist/"
|
|
44
31
|
];
|
|
@@ -48,6 +35,7 @@ var bati = {
|
|
|
48
35
|
};
|
|
49
36
|
var package_default = {
|
|
50
37
|
name,
|
|
38
|
+
private: private2,
|
|
51
39
|
version,
|
|
52
40
|
description,
|
|
53
41
|
type,
|
|
@@ -57,8 +45,6 @@ var package_default = {
|
|
|
57
45
|
license,
|
|
58
46
|
devDependencies,
|
|
59
47
|
dependencies,
|
|
60
|
-
exports,
|
|
61
|
-
typesVersions,
|
|
62
48
|
files,
|
|
63
49
|
bati
|
|
64
50
|
};
|
|
@@ -69,13 +55,12 @@ export {
|
|
|
69
55
|
dependencies,
|
|
70
56
|
description,
|
|
71
57
|
devDependencies,
|
|
72
|
-
exports,
|
|
73
58
|
files,
|
|
74
59
|
keywords,
|
|
75
60
|
license,
|
|
76
61
|
name,
|
|
62
|
+
private2 as private,
|
|
77
63
|
scripts,
|
|
78
64
|
type,
|
|
79
|
-
typesVersions,
|
|
80
65
|
version
|
|
81
66
|
};
|
|
@@ -34,21 +34,19 @@ async function startServer() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (import.meta.VIKE_MODULES?.includes("auth:authjs")) {
|
|
37
|
+
/**
|
|
38
|
+
* AuthJS
|
|
39
|
+
*
|
|
40
|
+
* TODO: Replace secret {@see https://authjs.dev/reference/core#secret}
|
|
41
|
+
* TODO: Choose and implement providers
|
|
42
|
+
*
|
|
43
|
+
* @link {@see https://authjs.dev/guides/providers/custom-provider}
|
|
44
|
+
**/
|
|
37
45
|
const Auth = VikeAuth({
|
|
38
|
-
secret: "
|
|
39
|
-
/**
|
|
40
|
-
* Add your providers here
|
|
41
|
-
*
|
|
42
|
-
* @link {@see https://authjs.dev/guides/providers/custom-provider}
|
|
43
|
-
* */
|
|
46
|
+
secret: "MY_SECRET",
|
|
44
47
|
providers: [
|
|
45
48
|
CredentialsProvider({
|
|
46
|
-
// The name to display on the sign in form (e.g. "Sign in with...")
|
|
47
49
|
name: "Credentials",
|
|
48
|
-
// `credentials` is used to generate a form on the sign in page.
|
|
49
|
-
// You can specify which fields should be submitted, by adding keys to the `credentials` object.
|
|
50
|
-
// e.g. domain, username, password, 2FA token, etc.
|
|
51
|
-
// You can pass any HTML attribute to the <input> tag through the object.
|
|
52
50
|
credentials: {
|
|
53
51
|
username: { label: "Username", type: "text", placeholder: "jsmith" },
|
|
54
52
|
password: { label: "Password", type: "password" },
|
|
@@ -57,15 +55,10 @@ async function startServer() {
|
|
|
57
55
|
// Add logic here to look up the user from the credentials supplied
|
|
58
56
|
const user = { id: "1", name: "J Smith", email: "jsmith@example.com" };
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// If you return null then an error will be displayed advising the user to check their details.
|
|
65
|
-
return null;
|
|
66
|
-
|
|
67
|
-
// You can also Reject this callback with an Error thus the user will be sent to the error page with the error message as a query parameter
|
|
68
|
-
}
|
|
58
|
+
// Any object returned will be saved in `user` property of the JWT
|
|
59
|
+
// If you return null then an error will be displayed advising the user to check their details.
|
|
60
|
+
// You can also Reject this callback with an Error thus the user will be sent to the error page with the error message as a query parameter
|
|
61
|
+
return user ?? null;
|
|
69
62
|
},
|
|
70
63
|
}),
|
|
71
64
|
],
|
|
@@ -80,6 +73,11 @@ async function startServer() {
|
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
|
|
76
|
+
/**
|
|
77
|
+
* Telefunc route
|
|
78
|
+
*
|
|
79
|
+
* @link {@see https://telefunc.com}
|
|
80
|
+
**/
|
|
83
81
|
app.post(
|
|
84
82
|
"/_telefunc",
|
|
85
83
|
createMiddleware(
|
|
@@ -105,6 +103,11 @@ async function startServer() {
|
|
|
105
103
|
);
|
|
106
104
|
}
|
|
107
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Vike route
|
|
108
|
+
*
|
|
109
|
+
* @link {@see https://vite-plugin-ssr.com}
|
|
110
|
+
**/
|
|
108
111
|
app.all("*", async (req, res, next) => {
|
|
109
112
|
const pageContextInit = { urlOriginal: req.originalUrl };
|
|
110
113
|
const pageContext = await renderPage(pageContextInit);
|
|
@@ -7,7 +7,7 @@ async function getPackageJson(currentContent, meta) {
|
|
|
7
7
|
if (packageJson.scripts.preview) {
|
|
8
8
|
delete packageJson.scripts.preview;
|
|
9
9
|
}
|
|
10
|
-
return addDependency(packageJson, await import("./chunk-package-
|
|
10
|
+
return addDependency(packageJson, await import("./chunk-package-R6L7KHPL.js"), {
|
|
11
11
|
devDependencies: ["@hattip/vite", "@hattip/adapter-node"],
|
|
12
12
|
dependencies: [
|
|
13
13
|
"@hattip/router",
|
package/dist/boilerplates/@batijs/hattip/{chunk-package-CG6L5HQ3.js → chunk-package-R6L7KHPL.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@batijs/hattip";
|
|
3
|
-
var
|
|
3
|
+
var private2 = true;
|
|
4
|
+
var version = "0.0.13";
|
|
4
5
|
var description = "";
|
|
5
6
|
var type = "module";
|
|
6
7
|
var scripts = {
|
|
@@ -25,20 +26,6 @@ var devDependencies = {
|
|
|
25
26
|
var dependencies = {
|
|
26
27
|
"@batijs/core": "workspace:*"
|
|
27
28
|
};
|
|
28
|
-
var exports = {
|
|
29
|
-
".": "./dist/index.js",
|
|
30
|
-
"./files": "./dist/index.js"
|
|
31
|
-
};
|
|
32
|
-
var typesVersions = {
|
|
33
|
-
"*": {
|
|
34
|
-
".": [
|
|
35
|
-
"./dist/index.d.ts"
|
|
36
|
-
],
|
|
37
|
-
files: [
|
|
38
|
-
"./dist/index.d.ts"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
29
|
var files = [
|
|
43
30
|
"dist/"
|
|
44
31
|
];
|
|
@@ -48,6 +35,7 @@ var bati = {
|
|
|
48
35
|
};
|
|
49
36
|
var package_default = {
|
|
50
37
|
name,
|
|
38
|
+
private: private2,
|
|
51
39
|
version,
|
|
52
40
|
description,
|
|
53
41
|
type,
|
|
@@ -57,8 +45,6 @@ var package_default = {
|
|
|
57
45
|
license,
|
|
58
46
|
devDependencies,
|
|
59
47
|
dependencies,
|
|
60
|
-
exports,
|
|
61
|
-
typesVersions,
|
|
62
48
|
files,
|
|
63
49
|
bati
|
|
64
50
|
};
|
|
@@ -69,13 +55,12 @@ export {
|
|
|
69
55
|
dependencies,
|
|
70
56
|
description,
|
|
71
57
|
devDependencies,
|
|
72
|
-
exports,
|
|
73
58
|
files,
|
|
74
59
|
keywords,
|
|
75
60
|
license,
|
|
76
61
|
name,
|
|
62
|
+
private2 as private,
|
|
77
63
|
scripts,
|
|
78
64
|
type,
|
|
79
|
-
typesVersions,
|
|
80
65
|
version
|
|
81
66
|
};
|
|
@@ -7,6 +7,11 @@ import CredentialsProvider from "@auth/core/providers/credentials";
|
|
|
7
7
|
const router = createRouter();
|
|
8
8
|
|
|
9
9
|
if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
|
|
10
|
+
/**
|
|
11
|
+
* Telefunc route
|
|
12
|
+
*
|
|
13
|
+
* @link {@see https://telefunc.com}
|
|
14
|
+
**/
|
|
10
15
|
router.post("/_telefunc", async (context) => {
|
|
11
16
|
const httpResponse = await telefunc({
|
|
12
17
|
url: context.url.toString(),
|
|
@@ -25,38 +30,32 @@ if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
|
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
if (import.meta.VIKE_MODULES?.includes("auth:authjs")) {
|
|
33
|
+
/**
|
|
34
|
+
* AuthJS
|
|
35
|
+
*
|
|
36
|
+
* TODO: Replace secret {@see https://authjs.dev/reference/core#secret}
|
|
37
|
+
* TODO: Choose and implement providers
|
|
38
|
+
*
|
|
39
|
+
* @link {@see https://authjs.dev/guides/providers/custom-provider}
|
|
40
|
+
**/
|
|
28
41
|
const Auth = VikeAuth({
|
|
29
|
-
secret: "
|
|
30
|
-
|
|
31
|
-
* Add your providers here
|
|
32
|
-
*
|
|
33
|
-
* @link {@see https://authjs.dev/guides/providers/custom-provider}
|
|
34
|
-
* */
|
|
42
|
+
secret: "MY_SECRET", // See
|
|
43
|
+
|
|
35
44
|
providers: [
|
|
36
45
|
CredentialsProvider({
|
|
37
|
-
// The name to display on the sign in form (e.g. "Sign in with...")
|
|
38
46
|
name: "Credentials",
|
|
39
|
-
// `credentials` is used to generate a form on the sign in page.
|
|
40
|
-
// You can specify which fields should be submitted, by adding keys to the `credentials` object.
|
|
41
|
-
// e.g. domain, username, password, 2FA token, etc.
|
|
42
|
-
// You can pass any HTML attribute to the <input> tag through the object.
|
|
43
47
|
credentials: {
|
|
44
|
-
username: { label: "Username", type: "text", placeholder: "
|
|
48
|
+
username: { label: "Username", type: "text", placeholder: "username" },
|
|
45
49
|
password: { label: "Password", type: "password" },
|
|
46
50
|
},
|
|
47
51
|
async authorize(credentials, req) {
|
|
48
52
|
// Add logic here to look up the user from the credentials supplied
|
|
49
53
|
const user = { id: "1", name: "J Smith", email: "jsmith@example.com" };
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// If you return null then an error will be displayed advising the user to check their details.
|
|
56
|
-
return null;
|
|
57
|
-
|
|
58
|
-
// You can also Reject this callback with an Error thus the user will be sent to the error page with the error message as a query parameter
|
|
59
|
-
}
|
|
55
|
+
// Any object returned will be saved in `user` property of the JWT
|
|
56
|
+
// If you return null then an error will be displayed advising the user to check their details.
|
|
57
|
+
// You can also Reject this callback with an Error thus the user will be sent to the error page with the error message as a query parameter
|
|
58
|
+
return user ?? null;
|
|
60
59
|
},
|
|
61
60
|
}),
|
|
62
61
|
],
|
|
@@ -66,6 +65,11 @@ if (import.meta.VIKE_MODULES?.includes("auth:authjs")) {
|
|
|
66
65
|
router.post("/api/auth/*", Auth);
|
|
67
66
|
}
|
|
68
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Vike route
|
|
70
|
+
*
|
|
71
|
+
* @link {@see https://vite-plugin-ssr.com}
|
|
72
|
+
**/
|
|
69
73
|
router.use(async (context) => {
|
|
70
74
|
const pageContextInit = { urlOriginal: context.request.url };
|
|
71
75
|
const pageContext = await renderPage(pageContextInit);
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { addDependency, loadAsJson } from "@batijs/core";
|
|
3
3
|
async function getPackageJson(currentContent) {
|
|
4
4
|
const packageJson = await loadAsJson(currentContent);
|
|
5
|
-
return addDependency(packageJson, await import("./chunk-package-
|
|
6
|
-
|
|
5
|
+
return addDependency(packageJson, await import("./chunk-package-YV4T2FDR.js"), {
|
|
6
|
+
devDependencies: ["vite"],
|
|
7
|
+
dependencies: ["cross-fetch", "solid-js", "vike-solid"]
|
|
7
8
|
});
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
@@ -4,7 +4,7 @@ async function getTsConfig(currentContent) {
|
|
|
4
4
|
const tsConfig = await loadAsJson(currentContent);
|
|
5
5
|
tsConfig.compilerOptions.jsx = "preserve";
|
|
6
6
|
tsConfig.compilerOptions.jsxImportSource = "solid-js";
|
|
7
|
-
tsConfig.compilerOptions.types = [...tsConfig.compilerOptions.types ?? [], "
|
|
7
|
+
tsConfig.compilerOptions.types = [...tsConfig.compilerOptions.types ?? [], "vike-solid/client"];
|
|
8
8
|
return tsConfig;
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
@@ -3,7 +3,7 @@ import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
|
3
3
|
async function getViteConfig(currentContent) {
|
|
4
4
|
const mod = await loadAsMagicast(currentContent);
|
|
5
5
|
addVitePlugin(mod, {
|
|
6
|
-
from: "
|
|
6
|
+
from: "vike-solid/vite",
|
|
7
7
|
constructor: "solid"
|
|
8
8
|
});
|
|
9
9
|
return mod.generate().code;
|
package/dist/boilerplates/@batijs/solid/{chunk-package-QUP3GCCY.js → chunk-package-YV4T2FDR.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@batijs/solid";
|
|
3
|
-
var
|
|
3
|
+
var private2 = true;
|
|
4
|
+
var version = "0.0.13";
|
|
4
5
|
var description = "";
|
|
5
6
|
var type = "module";
|
|
6
7
|
var scripts = {
|
|
@@ -14,8 +15,9 @@ var devDependencies = {
|
|
|
14
15
|
"@types/node": "^16.18.27",
|
|
15
16
|
"cross-fetch": "^3.1.5",
|
|
16
17
|
"solid-js": "^1.7.5",
|
|
17
|
-
|
|
18
|
+
tailwindcss: "^3.3.2",
|
|
18
19
|
typescript: "^5.0.4",
|
|
20
|
+
"vike-solid": "^0.0.6",
|
|
19
21
|
vite: "^4.3.5",
|
|
20
22
|
"vite-plugin-solid": "^2.7.0",
|
|
21
23
|
"vite-plugin-ssr": "^0.4.123"
|
|
@@ -23,20 +25,6 @@ var devDependencies = {
|
|
|
23
25
|
var dependencies = {
|
|
24
26
|
"@batijs/core": "workspace:*"
|
|
25
27
|
};
|
|
26
|
-
var exports = {
|
|
27
|
-
".": "./dist/index.js",
|
|
28
|
-
"./files": "./dist/index.js"
|
|
29
|
-
};
|
|
30
|
-
var typesVersions = {
|
|
31
|
-
"*": {
|
|
32
|
-
".": [
|
|
33
|
-
"./dist/index.d.ts"
|
|
34
|
-
],
|
|
35
|
-
files: [
|
|
36
|
-
"./dist/index.d.ts"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
28
|
var files = [
|
|
41
29
|
"dist/"
|
|
42
30
|
];
|
|
@@ -46,6 +34,7 @@ var bati = {
|
|
|
46
34
|
};
|
|
47
35
|
var package_default = {
|
|
48
36
|
name,
|
|
37
|
+
private: private2,
|
|
49
38
|
version,
|
|
50
39
|
description,
|
|
51
40
|
type,
|
|
@@ -55,8 +44,6 @@ var package_default = {
|
|
|
55
44
|
license,
|
|
56
45
|
devDependencies,
|
|
57
46
|
dependencies,
|
|
58
|
-
exports,
|
|
59
|
-
typesVersions,
|
|
60
47
|
files,
|
|
61
48
|
bati
|
|
62
49
|
};
|
|
@@ -67,13 +54,12 @@ export {
|
|
|
67
54
|
dependencies,
|
|
68
55
|
description,
|
|
69
56
|
devDependencies,
|
|
70
|
-
exports,
|
|
71
57
|
files,
|
|
72
58
|
keywords,
|
|
73
59
|
license,
|
|
74
60
|
name,
|
|
61
|
+
private2 as private,
|
|
75
62
|
scripts,
|
|
76
63
|
type,
|
|
77
|
-
typesVersions,
|
|
78
64
|
version
|
|
79
65
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
3
|
+
import "./tailwind.css";
|
|
2
4
|
import logoUrl from "../assets/logo.svg";
|
|
3
5
|
import { Link } from "../components/Link";
|
|
4
6
|
import type { JSX } from "solid-js";
|
|
@@ -6,6 +8,9 @@ import type { JSX } from "solid-js";
|
|
|
6
8
|
export default function LayoutDefault(props: { children?: JSX.Element }) {
|
|
7
9
|
return (
|
|
8
10
|
<div
|
|
11
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
12
|
+
class="flex max-w-5xl m-auto"
|
|
13
|
+
//# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
9
14
|
style={{
|
|
10
15
|
display: "flex",
|
|
11
16
|
"max-width": "900px",
|
|
@@ -26,6 +31,9 @@ function Sidebar(props: { children: JSX.Element }) {
|
|
|
26
31
|
return (
|
|
27
32
|
<div
|
|
28
33
|
id="sidebar"
|
|
34
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
35
|
+
class="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"
|
|
36
|
+
//# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
29
37
|
style={{
|
|
30
38
|
padding: "20px",
|
|
31
39
|
"flex-shrink": 0,
|
|
@@ -45,6 +53,9 @@ function Content(props: { children: JSX.Element }) {
|
|
|
45
53
|
<div id="page-container">
|
|
46
54
|
<div
|
|
47
55
|
id="page-content"
|
|
56
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
57
|
+
class="p-5 pb-12 min-h-screen"
|
|
58
|
+
//# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
48
59
|
style={{
|
|
49
60
|
padding: "20px",
|
|
50
61
|
"padding-bottom": "50px",
|
|
@@ -60,6 +71,9 @@ function Content(props: { children: JSX.Element }) {
|
|
|
60
71
|
function Logo() {
|
|
61
72
|
return (
|
|
62
73
|
<div
|
|
74
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
75
|
+
class="p-5 mb-2"
|
|
76
|
+
//# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
63
77
|
style={{
|
|
64
78
|
"margin-top": "20px",
|
|
65
79
|
"margin-bottom": "10px",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Config } from "
|
|
1
|
+
import type { Config } from "vike-solid";
|
|
2
2
|
import Layout from "../layouts/LayoutDefault";
|
|
3
3
|
|
|
4
4
|
// Default config (can be overriden by pages)
|
|
5
5
|
export default {
|
|
6
6
|
Layout,
|
|
7
7
|
// <title>
|
|
8
|
-
title: "My
|
|
8
|
+
title: "My Vike App",
|
|
9
9
|
// <meta name="description">
|
|
10
|
-
description: "Demo showcasing
|
|
10
|
+
description: "Demo showcasing Vike",
|
|
11
11
|
} satisfies Config;
|
|
@@ -3,7 +3,12 @@ import { Counter } from "./Counter";
|
|
|
3
3
|
export default function Page() {
|
|
4
4
|
return (
|
|
5
5
|
<>
|
|
6
|
-
<h1
|
|
6
|
+
<h1
|
|
7
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
8
|
+
class="font-bold text-3xl pb-4"
|
|
9
|
+
>
|
|
10
|
+
My Vike app
|
|
11
|
+
</h1>
|
|
7
12
|
This page is:
|
|
8
13
|
<ul>
|
|
9
14
|
<li>Rendered to HTML.</li>
|
|
@@ -6,7 +6,12 @@ function Counter() {
|
|
|
6
6
|
const [count, setCount] = createSignal(0);
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<button
|
|
9
|
+
<button
|
|
10
|
+
type="button"
|
|
11
|
+
//# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
|
|
12
|
+
class="inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
|
|
13
|
+
onClick={() => setCount((count) => count + 1)}
|
|
14
|
+
>
|
|
10
15
|
Counter {count()}
|
|
11
16
|
</button>
|
|
12
17
|
);
|
|
@@ -2,13 +2,11 @@ export default onBeforeRender;
|
|
|
2
2
|
|
|
3
3
|
import fetch from "cross-fetch";
|
|
4
4
|
import { filterMovieData } from "../filterMovieData";
|
|
5
|
-
import type { PageContextBuiltIn } from "
|
|
5
|
+
import type { PageContextBuiltIn } from "vike-solid";
|
|
6
6
|
import type { MovieDetails } from "../types";
|
|
7
7
|
|
|
8
8
|
async function onBeforeRender(pageContext: PageContextBuiltIn) {
|
|
9
|
-
const response = await fetch(
|
|
10
|
-
`https://star-wars.brillout.com/api/films/${pageContext.routeParams.id}.json`
|
|
11
|
-
);
|
|
9
|
+
const response = await fetch(`https://star-wars.brillout.com/api/films/${pageContext.routeParams.id}.json`);
|
|
12
10
|
let movie = (await response.json()) as MovieDetails;
|
|
13
11
|
|
|
14
12
|
// We remove data we don't need because we pass `pageContext.movie` to
|
|
@@ -44,7 +44,7 @@ async function prerender() {
|
|
|
44
44
|
return [
|
|
45
45
|
{
|
|
46
46
|
url: '/star-wars',
|
|
47
|
-
// We already provide `pageContext` here so that
|
|
47
|
+
// We already provide `pageContext` here so that Vike
|
|
48
48
|
// will *not* have to call the `onBeforeRender()` hook defined
|
|
49
49
|
// above in this file.
|
|
50
50
|
pageContext: {
|
|
@@ -59,7 +59,7 @@ async function prerender() {
|
|
|
59
59
|
return {
|
|
60
60
|
url,
|
|
61
61
|
// Note that we can also provide the `pageContext` of other pages.
|
|
62
|
-
// This means that
|
|
62
|
+
// This means that Vike will not call any
|
|
63
63
|
// `onBeforeRender()` hook and the Star Wars API will be called
|
|
64
64
|
// only once (in this `prerender()` hook).
|
|
65
65
|
pageContext: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// files/$package.json.ts
|
|
2
|
+
import { addDependency, loadAsJson } from "@batijs/core";
|
|
3
|
+
async function getPackageJson(currentContent, meta) {
|
|
4
|
+
const packageJson = await loadAsJson(currentContent);
|
|
5
|
+
return addDependency(packageJson, await import("./chunk-package-GHAJQRWT.js"), {
|
|
6
|
+
devDependencies: ["tailwindcss", "postcss", "autoprefixer"]
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
getPackageJson as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var name = "@batijs/tailwindcss";
|
|
3
|
+
var private2 = true;
|
|
4
|
+
var version = "0.0.13";
|
|
5
|
+
var description = "";
|
|
6
|
+
var type = "module";
|
|
7
|
+
var scripts = {
|
|
8
|
+
build: "tsup"
|
|
9
|
+
};
|
|
10
|
+
var keywords = [];
|
|
11
|
+
var author = "";
|
|
12
|
+
var license = "MIT";
|
|
13
|
+
var devDependencies = {
|
|
14
|
+
"@batijs/tsup": "workspace:*",
|
|
15
|
+
"@types/node": "^16.18.27",
|
|
16
|
+
autoprefixer: "^10.4.14",
|
|
17
|
+
postcss: "^8.4.23",
|
|
18
|
+
tailwindcss: "^3.3.2",
|
|
19
|
+
vite: "^4.3.5",
|
|
20
|
+
"vite-plugin-ssr": "^0.4.123"
|
|
21
|
+
};
|
|
22
|
+
var dependencies = {
|
|
23
|
+
"@batijs/core": "workspace:*"
|
|
24
|
+
};
|
|
25
|
+
var files = [
|
|
26
|
+
"dist/"
|
|
27
|
+
];
|
|
28
|
+
var bati = {
|
|
29
|
+
flag: "tailwindcss",
|
|
30
|
+
boilerplate: "./dist/files"
|
|
31
|
+
};
|
|
32
|
+
var package_default = {
|
|
33
|
+
name,
|
|
34
|
+
private: private2,
|
|
35
|
+
version,
|
|
36
|
+
description,
|
|
37
|
+
type,
|
|
38
|
+
scripts,
|
|
39
|
+
keywords,
|
|
40
|
+
author,
|
|
41
|
+
license,
|
|
42
|
+
devDependencies,
|
|
43
|
+
dependencies,
|
|
44
|
+
files,
|
|
45
|
+
bati
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
author,
|
|
49
|
+
bati,
|
|
50
|
+
package_default as default,
|
|
51
|
+
dependencies,
|
|
52
|
+
description,
|
|
53
|
+
devDependencies,
|
|
54
|
+
files,
|
|
55
|
+
keywords,
|
|
56
|
+
license,
|
|
57
|
+
name,
|
|
58
|
+
private2 as private,
|
|
59
|
+
scripts,
|
|
60
|
+
type,
|
|
61
|
+
version
|
|
62
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { addDependency, loadAsJson } from "@batijs/core";
|
|
3
3
|
async function getPackageJson(currentContent) {
|
|
4
4
|
const packageJson = await loadAsJson(currentContent);
|
|
5
|
-
return addDependency(packageJson, await import("./chunk-package-
|
|
5
|
+
return addDependency(packageJson, await import("./chunk-package-ZIL4MEPW.js"), {
|
|
6
6
|
dependencies: ["telefunc"]
|
|
7
7
|
});
|
|
8
8
|
}
|
package/dist/boilerplates/@batijs/telefunc/{chunk-package-5GHBS6WD.js → chunk-package-ZIL4MEPW.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@batijs/telefunc";
|
|
3
|
-
var
|
|
3
|
+
var private2 = true;
|
|
4
|
+
var version = "0.0.13";
|
|
4
5
|
var description = "";
|
|
5
6
|
var type = "module";
|
|
6
7
|
var scripts = {
|
|
@@ -19,20 +20,6 @@ var devDependencies = {
|
|
|
19
20
|
var dependencies = {
|
|
20
21
|
"@batijs/core": "workspace:*"
|
|
21
22
|
};
|
|
22
|
-
var exports = {
|
|
23
|
-
".": "./dist/index.js",
|
|
24
|
-
"./files": "./dist/index.js"
|
|
25
|
-
};
|
|
26
|
-
var typesVersions = {
|
|
27
|
-
"*": {
|
|
28
|
-
".": [
|
|
29
|
-
"./dist/index.d.ts"
|
|
30
|
-
],
|
|
31
|
-
files: [
|
|
32
|
-
"./dist/index.d.ts"
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
23
|
var files = [
|
|
37
24
|
"dist/"
|
|
38
25
|
];
|
|
@@ -42,6 +29,7 @@ var bati = {
|
|
|
42
29
|
};
|
|
43
30
|
var package_default = {
|
|
44
31
|
name,
|
|
32
|
+
private: private2,
|
|
45
33
|
version,
|
|
46
34
|
description,
|
|
47
35
|
type,
|
|
@@ -51,8 +39,6 @@ var package_default = {
|
|
|
51
39
|
license,
|
|
52
40
|
devDependencies,
|
|
53
41
|
dependencies,
|
|
54
|
-
exports,
|
|
55
|
-
typesVersions,
|
|
56
42
|
files,
|
|
57
43
|
bati
|
|
58
44
|
};
|
|
@@ -63,13 +49,12 @@ export {
|
|
|
63
49
|
dependencies,
|
|
64
50
|
description,
|
|
65
51
|
devDependencies,
|
|
66
|
-
exports,
|
|
67
52
|
files,
|
|
68
53
|
keywords,
|
|
69
54
|
license,
|
|
70
55
|
name,
|
|
56
|
+
private2 as private,
|
|
71
57
|
scripts,
|
|
72
58
|
type,
|
|
73
|
-
typesVersions,
|
|
74
59
|
version
|
|
75
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"config":{"flag":"express","boilerplate":"./dist/files"},"folder":"@batijs/express"},{"config":{"flag":"hattip","boilerplate":"./dist/files"},"folder":"@batijs/hattip"},{"config":{"boilerplate":"./
|
|
1
|
+
[{"config":{"flag":"express","boilerplate":"./dist/files"},"folder":"@batijs/express"},{"config":{"flag":"hattip","boilerplate":"./dist/files"},"folder":"@batijs/hattip"},{"config":{"boilerplate":"./files"},"folder":"@batijs/shared"},{"config":{"flag":"solid","boilerplate":"./dist/files"},"folder":"@batijs/solid"},{"config":{"flag":"tailwindcss","boilerplate":"./dist/files"},"folder":"@batijs/tailwindcss"},{"config":{"flag":"telefunc","boilerplate":"./dist/files"},"folder":"@batijs/telefunc"}]
|
package/dist/index.js
CHANGED
|
@@ -586,6 +586,8 @@ function transformFileAfterExec(filepath, fileContent) {
|
|
|
586
586
|
switch (parsed.ext) {
|
|
587
587
|
case ".ts":
|
|
588
588
|
case ".js":
|
|
589
|
+
case ".tsx":
|
|
590
|
+
case ".jsx":
|
|
589
591
|
return fileContent;
|
|
590
592
|
case ".json":
|
|
591
593
|
return JSON.stringify(fileContent, null, 2);
|
|
@@ -593,6 +595,10 @@ function transformFileAfterExec(filepath, fileContent) {
|
|
|
593
595
|
throw new Error(`Unsupported extension ${parsed.ext} (${filepath})`);
|
|
594
596
|
}
|
|
595
597
|
}
|
|
598
|
+
async function fileContainsVikeMeta(filepath) {
|
|
599
|
+
const code = await readFile(filepath, { encoding: "utf-8" });
|
|
600
|
+
return code.includes("import.meta.VIKE_");
|
|
601
|
+
}
|
|
596
602
|
async function main(options, meta) {
|
|
597
603
|
const sources = Array.isArray(options.source) ? options.source : [options.source];
|
|
598
604
|
const targets = /* @__PURE__ */ new Map();
|
|
@@ -602,13 +608,6 @@ async function main(options, meta) {
|
|
|
602
608
|
const parsed = path.parse(p);
|
|
603
609
|
if (parsed.name.match(reIgnoreFile)) {
|
|
604
610
|
continue;
|
|
605
|
-
} else if (parsed.name.startsWith("$$") && parsed.ext.match(/\.[tj]sx?$/)) {
|
|
606
|
-
const mod = await loadFile(p);
|
|
607
|
-
const fileContent = await transformAndGenerate(mod.$ast, meta);
|
|
608
|
-
if (fileContent) {
|
|
609
|
-
await safeWriteFile(target, fileContent);
|
|
610
|
-
}
|
|
611
|
-
targets.set(target, () => fileContent);
|
|
612
611
|
} else if (parsed.name.startsWith("$") && parsed.ext.match(/\.tsx?$/)) {
|
|
613
612
|
throw new Error(`Typescript file needs to be compiled before it can be executed: '${p}'`);
|
|
614
613
|
} else if (parsed.name.startsWith("$") && parsed.ext.match(/\.jsx?$/)) {
|
|
@@ -618,6 +617,15 @@ async function main(options, meta) {
|
|
|
618
617
|
await safeWriteFile(target, fileContent);
|
|
619
618
|
}
|
|
620
619
|
targets.set(target, () => fileContent);
|
|
620
|
+
} else if (parsed.ext.match(/\.[tj]sx?$/) && await fileContainsVikeMeta(p)) {
|
|
621
|
+
const mod = await loadFile(p);
|
|
622
|
+
const fileContent = await transformAndGenerate(mod.$ast, meta, {
|
|
623
|
+
filepath: p
|
|
624
|
+
});
|
|
625
|
+
if (fileContent) {
|
|
626
|
+
await safeWriteFile(target, fileContent);
|
|
627
|
+
}
|
|
628
|
+
targets.set(target, () => fileContent);
|
|
621
629
|
} else {
|
|
622
630
|
await safeCopyFile(p, target);
|
|
623
631
|
targets.set(target, () => readFile(p, { encoding: "utf-8" }));
|
|
@@ -629,7 +637,7 @@ async function main(options, meta) {
|
|
|
629
637
|
// package.json
|
|
630
638
|
var package_default = {
|
|
631
639
|
name: "@batijs/cli",
|
|
632
|
-
version: "0.0.
|
|
640
|
+
version: "0.0.13",
|
|
633
641
|
description: "",
|
|
634
642
|
type: "module",
|
|
635
643
|
scripts: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"typescript": "^5.0.4",
|
|
19
19
|
"vitest": "^0.31.0",
|
|
20
20
|
"wait-for-localhost": "^4.0.1",
|
|
21
|
-
"@batijs/
|
|
22
|
-
"@batijs/
|
|
21
|
+
"@batijs/tsup": "0.0.13",
|
|
22
|
+
"@batijs/build": "0.0.13"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@batijs/core": "0.0.
|
|
25
|
+
"@batijs/core": "0.0.13"
|
|
26
26
|
},
|
|
27
27
|
"bin": "./dist/index.js",
|
|
28
28
|
"exports": {
|