@batijs/cli 0.0.235 → 0.0.237
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/eslint/files/$package.json.js +42 -7
- package/dist/boilerplates/@batijs/eslint/files/eslint.config.js +112 -0
- package/dist/boilerplates/@batijs/eslint/types/eslint.config.d.ts +2 -0
- package/dist/boilerplates/@batijs/firebase-auth/files/vike.d.ts +0 -1
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -2
- package/dist/boilerplates/@batijs/prettier/files/.prettierrc +3 -0
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -7
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -7
- package/dist/boilerplates/@batijs/trpc/types/trpc/server.d.ts +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/ts-rest/types/ts-rest/client.d.ts +20 -20
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +2 -14
- package/dist/boilerplates/@batijs/vue/files/components/Content.vue +3 -15
- package/dist/boilerplates/@batijs/vue/files/components/Counter.vue +6 -11
- package/dist/boilerplates/@batijs/vue/files/components/Logo.vue +5 -21
- package/dist/boilerplates/@batijs/vue/files/components/Sidebar.vue +2 -6
- package/dist/boilerplates/@batijs/vue/files/pages/_error/+Page.vue +5 -5
- package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +2 -8
- package/dist/boilerplates/@batijs/vue-firebase-auth/files/pages/login/+Page.vue +33 -33
- package/dist/index.js +9 -6
- package/package.json +6 -6
- package/dist/boilerplates/@batijs/compiled/files/$.eslintrc.json.js +0 -17
- package/dist/boilerplates/@batijs/eslint/files/.eslintignore +0 -7
- package/dist/boilerplates/@batijs/eslint/files/.eslintrc.json +0 -23
- package/dist/boilerplates/@batijs/prettier/files/$.eslintrc.json.js +0 -11
- package/dist/boilerplates/@batijs/react/files/$.eslintrc.json.js +0 -17
- package/dist/boilerplates/@batijs/solid/files/$.eslintrc.json.js +0 -12
- package/dist/boilerplates/@batijs/vue/files/$.eslintrc.json.js +0 -18
|
@@ -42,9 +42,16 @@ var require_package = __commonJS({
|
|
|
42
42
|
},
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:^",
|
|
45
|
-
"@
|
|
46
|
-
|
|
47
|
-
eslint: "^
|
|
45
|
+
"@eslint/js": "^9.7.0",
|
|
46
|
+
eslint: "^9.7.0",
|
|
47
|
+
"eslint-config-prettier": "^9.1.0",
|
|
48
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
49
|
+
"eslint-plugin-react": "^7.35.0",
|
|
50
|
+
"eslint-plugin-solid": "^0.14.1",
|
|
51
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
52
|
+
globals: "^15.8.0",
|
|
53
|
+
"typescript-eslint": "^7.17.0",
|
|
54
|
+
"vue-eslint-parser": "^9.4.3"
|
|
48
55
|
},
|
|
49
56
|
dependencies: {
|
|
50
57
|
"@batijs/core": "workspace:*"
|
|
@@ -57,9 +64,17 @@ var require_package = __commonJS({
|
|
|
57
64
|
flag: "eslint"
|
|
58
65
|
}
|
|
59
66
|
},
|
|
60
|
-
exports: {
|
|
67
|
+
exports: {
|
|
68
|
+
"./eslint.config": {
|
|
69
|
+
types: "./dist/types/eslint.config.d.ts"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
61
72
|
typesVersions: {
|
|
62
|
-
"*": {
|
|
73
|
+
"*": {
|
|
74
|
+
"eslint.config": [
|
|
75
|
+
"./dist/types/eslint.config.d.ts"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
63
78
|
}
|
|
64
79
|
};
|
|
65
80
|
}
|
|
@@ -71,12 +86,32 @@ async function getPackageJson(props) {
|
|
|
71
86
|
const packageJson = await loadAsJson(props);
|
|
72
87
|
setScripts(packageJson, {
|
|
73
88
|
lint: {
|
|
74
|
-
value: "eslint
|
|
89
|
+
value: "eslint .",
|
|
75
90
|
precedence: 0
|
|
76
91
|
}
|
|
77
92
|
});
|
|
93
|
+
if (props.meta.BATI.has("prettier")) {
|
|
94
|
+
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
95
|
+
devDependencies: ["eslint-plugin-prettier", "eslint-config-prettier"]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (props.meta.BATI.has("react")) {
|
|
99
|
+
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
100
|
+
devDependencies: ["eslint-plugin-react", "globals"]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (props.meta.BATI.has("vue")) {
|
|
104
|
+
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
105
|
+
devDependencies: ["eslint-plugin-vue", "vue-eslint-parser"]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (props.meta.BATI.has("solid")) {
|
|
109
|
+
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
110
|
+
devDependencies: ["eslint-plugin-solid", "globals"]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
78
113
|
return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
79
|
-
devDependencies: ["eslint", "@
|
|
114
|
+
devDependencies: ["eslint", "@eslint/js", "typescript-eslint"]
|
|
80
115
|
});
|
|
81
116
|
}
|
|
82
117
|
export {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import eslint from "@eslint/js";
|
|
4
|
+
import prettier from "eslint-plugin-prettier/recommended";
|
|
5
|
+
import react from "eslint-plugin-react/configs/recommended.js";
|
|
6
|
+
import solid from "eslint-plugin-solid/dist/configs/typescript.js";
|
|
7
|
+
import pluginVue from "eslint-plugin-vue";
|
|
8
|
+
import globals from "globals";
|
|
9
|
+
import tseslint from "typescript-eslint";
|
|
10
|
+
import vueParser from "vue-eslint-parser";
|
|
11
|
+
|
|
12
|
+
export default tseslint.config(
|
|
13
|
+
{
|
|
14
|
+
ignores: [
|
|
15
|
+
"dist/*",
|
|
16
|
+
// Temporary compiled files
|
|
17
|
+
"**/*.ts.build-*.mjs",
|
|
18
|
+
//# BATI.has("vercel")
|
|
19
|
+
".vercel/*",
|
|
20
|
+
// JS files at the root of the project
|
|
21
|
+
"*.js",
|
|
22
|
+
"*.cjs",
|
|
23
|
+
"*.mjs",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
eslint.configs.recommended,
|
|
27
|
+
...tseslint.configs.recommended,
|
|
28
|
+
{
|
|
29
|
+
languageOptions: {
|
|
30
|
+
parserOptions: {
|
|
31
|
+
sourceType: "module",
|
|
32
|
+
ecmaVersion: "latest",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
rules: {
|
|
38
|
+
"@typescript-eslint/no-unused-vars": [
|
|
39
|
+
1,
|
|
40
|
+
{
|
|
41
|
+
argsIgnorePattern: "^_",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
//# BATI.has("vue")
|
|
47
|
+
{
|
|
48
|
+
files: ["**/*.vue"],
|
|
49
|
+
languageOptions: {
|
|
50
|
+
parser: vueParser,
|
|
51
|
+
parserOptions: {
|
|
52
|
+
parser: tseslint.parser,
|
|
53
|
+
sourceType: "module",
|
|
54
|
+
ecmaVersion: "latest",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
//# BATI.has("react")
|
|
59
|
+
{
|
|
60
|
+
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
|
|
61
|
+
...react,
|
|
62
|
+
languageOptions: {
|
|
63
|
+
...react.languageOptions,
|
|
64
|
+
globals: {
|
|
65
|
+
...globals.serviceworker,
|
|
66
|
+
...globals.browser,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
settings: {
|
|
71
|
+
react: {
|
|
72
|
+
version: "detect",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
//# BATI.has("solid")
|
|
77
|
+
{
|
|
78
|
+
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
79
|
+
...solid,
|
|
80
|
+
languageOptions: {
|
|
81
|
+
parser: tseslint.parser,
|
|
82
|
+
globals: {
|
|
83
|
+
...globals.serviceworker,
|
|
84
|
+
...globals.browser,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
//# BATI.has("vue")
|
|
89
|
+
...pluginVue.configs["flat/recommended"],
|
|
90
|
+
//# BATI.has("vue")
|
|
91
|
+
{
|
|
92
|
+
rules: {
|
|
93
|
+
"vue/multi-word-component-names": "off",
|
|
94
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
95
|
+
"vue/max-attributes-per-line": "off",
|
|
96
|
+
"vue/html-self-closing": "off",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
//# BATI.has("compiled-css")
|
|
100
|
+
{
|
|
101
|
+
rules: {
|
|
102
|
+
"react/no-unknown-property": [
|
|
103
|
+
"error",
|
|
104
|
+
{
|
|
105
|
+
ignore: ["css"],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
//# BATI.has("prettier")
|
|
111
|
+
prettier,
|
|
112
|
+
);
|
|
@@ -43,7 +43,6 @@ var require_package = __commonJS({
|
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
45
|
"@types/node": "^18.19.14",
|
|
46
|
-
"eslint-config-prettier": "^9.1.0",
|
|
47
46
|
prettier: "^3.3.3"
|
|
48
47
|
},
|
|
49
48
|
dependencies: {
|
|
@@ -66,7 +65,7 @@ import { addDependency, loadAsJson } from "@batijs/core";
|
|
|
66
65
|
async function getPackageJson(props) {
|
|
67
66
|
const packageJson = await loadAsJson(props);
|
|
68
67
|
return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
69
|
-
devDependencies: ["prettier"
|
|
68
|
+
devDependencies: ["prettier"]
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
export {
|
|
@@ -55,11 +55,10 @@ var require_package = __commonJS({
|
|
|
55
55
|
"@types/react-dom": "^18.3.0",
|
|
56
56
|
"@vitejs/plugin-react": "^4.3.1",
|
|
57
57
|
"cross-fetch": "^4.0.0",
|
|
58
|
-
"eslint-plugin-react": "^7.35.0",
|
|
59
58
|
react: "^18.3.1",
|
|
60
59
|
"react-dom": "^18.3.1",
|
|
61
60
|
tailwindcss: "^3.4.6",
|
|
62
|
-
typescript: "^5.5.
|
|
61
|
+
typescript: "^5.5.4",
|
|
63
62
|
vike: "^0.4.181",
|
|
64
63
|
"vike-react": "^0.4.18",
|
|
65
64
|
vite: "^5.3.4",
|
|
@@ -198,11 +197,6 @@ var require_package = __commonJS({
|
|
|
198
197
|
import { addDependency, loadAsJson } from "@batijs/core";
|
|
199
198
|
async function getPackageJson(props) {
|
|
200
199
|
const packageJson = await loadAsJson(props);
|
|
201
|
-
if (props.meta.BATI.has("eslint")) {
|
|
202
|
-
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
203
|
-
devDependencies: ["eslint-plugin-react"]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
200
|
return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
207
201
|
devDependencies: ["vite", "@types/react", "@types/react-dom"],
|
|
208
202
|
dependencies: ["@vitejs/plugin-react", "cross-fetch", "react", "react-dom", "vike", "vike-react"]
|
|
@@ -49,10 +49,9 @@ var require_package = __commonJS({
|
|
|
49
49
|
"@batijs/ts-rest": "workspace:*",
|
|
50
50
|
"@types/node": "^18.19.14",
|
|
51
51
|
"cross-fetch": "^4.0.0",
|
|
52
|
-
"eslint-plugin-solid": "^0.14.1",
|
|
53
52
|
"solid-js": "^1.8.18",
|
|
54
53
|
tailwindcss: "^3.4.6",
|
|
55
|
-
typescript: "^5.5.
|
|
54
|
+
typescript: "^5.5.4",
|
|
56
55
|
vike: "^0.4.181",
|
|
57
56
|
"vike-solid": "^0.6.2",
|
|
58
57
|
vite: "^5.3.4",
|
|
@@ -191,11 +190,6 @@ var require_package = __commonJS({
|
|
|
191
190
|
import { addDependency, loadAsJson } from "@batijs/core";
|
|
192
191
|
async function getPackageJson(props) {
|
|
193
192
|
const packageJson = await loadAsJson(props);
|
|
194
|
-
if (props.meta.BATI.has("eslint")) {
|
|
195
|
-
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
196
|
-
devDependencies: ["eslint-plugin-solid"]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
193
|
return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
200
194
|
devDependencies: ["vite"],
|
|
201
195
|
dependencies: ["cross-fetch", "solid-js", "vike-solid", "vike"]
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* that can be used throughout the router
|
|
4
4
|
*/
|
|
5
5
|
export declare const router: <TProcRouterRecord extends import("@trpc/server").ProcedureRouterRecord>(procedures: TProcRouterRecord) => import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
6
|
-
ctx:
|
|
7
|
-
meta:
|
|
6
|
+
ctx: object;
|
|
7
|
+
meta: object;
|
|
8
8
|
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
9
|
-
transformer: import("@trpc/server").
|
|
9
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
10
10
|
}>, TProcRouterRecord>;
|
|
11
11
|
export declare const publicProcedure: import("@trpc/server").ProcedureBuilder<{
|
|
12
12
|
_config: import("@trpc/server").RootConfig<{
|
|
@@ -44,8 +44,8 @@ var require_package = __commonJS({
|
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
45
|
"@batijs/drizzle": "workspace:*",
|
|
46
46
|
"@batijs/shared-no-db": "workspace:*",
|
|
47
|
-
"@ts-rest/core": "^3.
|
|
48
|
-
"@ts-rest/serverless": "^3.
|
|
47
|
+
"@ts-rest/core": "^3.47.0",
|
|
48
|
+
"@ts-rest/serverless": "^3.47.0",
|
|
49
49
|
"@types/node": "^18.19.14"
|
|
50
50
|
},
|
|
51
51
|
dependencies: {
|
|
@@ -10,15 +10,17 @@ export declare const client: {
|
|
|
10
10
|
fetchOptions?: import("@ts-rest/core").FetchOptions;
|
|
11
11
|
extraHeaders?: Record<string, string>;
|
|
12
12
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs>;
|
|
13
|
-
}) => Promise<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
200: import("@ts-rest/core").ContractPlainType<{
|
|
18
|
-
demo: boolean;
|
|
19
|
-
}>;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
status: 200;
|
|
15
|
+
body: {
|
|
16
|
+
demo: boolean;
|
|
20
17
|
};
|
|
21
|
-
|
|
18
|
+
headers: Headers;
|
|
19
|
+
} | {
|
|
20
|
+
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
21
|
+
body: unknown;
|
|
22
|
+
headers: Headers;
|
|
23
|
+
}>;
|
|
22
24
|
createTodo: (args?: {
|
|
23
25
|
cache?: RequestCache;
|
|
24
26
|
body?: {
|
|
@@ -27,17 +29,15 @@ export declare const client: {
|
|
|
27
29
|
fetchOptions?: import("@ts-rest/core").FetchOptions;
|
|
28
30
|
extraHeaders?: Record<string, string>;
|
|
29
31
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs>;
|
|
30
|
-
}) => Promise<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
text: string;
|
|
35
|
-
}>;
|
|
36
|
-
path: "/api/todo/create";
|
|
37
|
-
responses: {
|
|
38
|
-
200: import("@ts-rest/core").ContractPlainType<{
|
|
39
|
-
status: string;
|
|
40
|
-
}>;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
status: 200;
|
|
34
|
+
body: {
|
|
35
|
+
status: string;
|
|
41
36
|
};
|
|
42
|
-
|
|
37
|
+
headers: Headers;
|
|
38
|
+
} | {
|
|
39
|
+
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
40
|
+
body: unknown;
|
|
41
|
+
headers: Headers;
|
|
42
|
+
}>;
|
|
43
43
|
};
|
|
@@ -52,9 +52,8 @@ var require_package = __commonJS({
|
|
|
52
52
|
"@vue/compiler-sfc": "^3.4.33",
|
|
53
53
|
"@vue/server-renderer": "^3.4.33",
|
|
54
54
|
"cross-fetch": "^4.0.0",
|
|
55
|
-
"eslint-plugin-vue": "^9.27.0",
|
|
56
55
|
tailwindcss: "^3.4.6",
|
|
57
|
-
typescript: "^5.5.
|
|
56
|
+
typescript: "^5.5.4",
|
|
58
57
|
"unplugin-vue-markdown": "^0.26.2",
|
|
59
58
|
vike: "^0.4.181",
|
|
60
59
|
"vike-vue": "^0.7.6",
|
|
@@ -138,20 +137,9 @@ var require_package = __commonJS({
|
|
|
138
137
|
});
|
|
139
138
|
|
|
140
139
|
// files/$package.json.ts
|
|
141
|
-
import { addDependency, loadAsJson
|
|
140
|
+
import { addDependency, loadAsJson } from "@batijs/core";
|
|
142
141
|
async function getPackageJson(props) {
|
|
143
142
|
const packageJson = await loadAsJson(props);
|
|
144
|
-
if (props.meta.BATI.has("eslint")) {
|
|
145
|
-
setScripts(packageJson, {
|
|
146
|
-
lint: {
|
|
147
|
-
value: "eslint --ext .js,.jsx,.ts,.tsx,.vue .",
|
|
148
|
-
precedence: 20
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
152
|
-
devDependencies: ["eslint-plugin-vue"]
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
143
|
if (props.meta.BATI.has("google-analytics")) {
|
|
156
144
|
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
157
145
|
dependencies: ["vue-gtag"]
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="page-container">
|
|
3
3
|
<!-- BATI.has("tailwindcss") -->
|
|
4
|
-
<div
|
|
5
|
-
id="page-content"
|
|
6
|
-
class="p-5 pb-12 min-h-screen"
|
|
7
|
-
>
|
|
4
|
+
<div id="page-content" class="p-5 pb-12 min-h-screen">
|
|
8
5
|
<slot />
|
|
9
6
|
</div>
|
|
10
7
|
<!-- !BATI.has("tailwindcss") -->
|
|
11
|
-
<div
|
|
12
|
-
id="page-content"
|
|
13
|
-
style="
|
|
14
|
-
padding: 20px;
|
|
15
|
-
padding-bottom: 50px;
|
|
16
|
-
min-height: 100vh;
|
|
17
|
-
"
|
|
18
|
-
>
|
|
8
|
+
<div id="page-content" style="padding: 20px; padding-bottom: 50px; min-height: 100vh">
|
|
19
9
|
<slot />
|
|
20
10
|
</div>
|
|
21
11
|
</div>
|
|
22
12
|
</template>
|
|
23
13
|
|
|
24
|
-
<script setup lang="ts">
|
|
25
|
-
</script>
|
|
14
|
+
<script setup lang="ts"></script>
|
|
26
15
|
|
|
27
16
|
<style>
|
|
28
17
|
/* Page Transition Animation */
|
|
@@ -38,4 +27,3 @@ body.page-is-transitioning #page-content {
|
|
|
38
27
|
transition: opacity 0.3s ease-in-out;
|
|
39
28
|
}
|
|
40
29
|
</style>
|
|
41
|
-
|
|
@@ -8,12 +8,7 @@
|
|
|
8
8
|
Counter {{ state.count }}
|
|
9
9
|
</button>
|
|
10
10
|
<!-- !BATI.has("tailwindcss") -->
|
|
11
|
-
<button
|
|
12
|
-
type="button"
|
|
13
|
-
@click="state.count++"
|
|
14
|
-
>
|
|
15
|
-
Counter {{ state.count }}
|
|
16
|
-
</button>
|
|
11
|
+
<button type="button" @click="state.count++">Counter {{ state.count }}</button>
|
|
17
12
|
</template>
|
|
18
13
|
|
|
19
14
|
<script lang="ts">
|
|
@@ -21,10 +16,10 @@ import { reactive } from "vue";
|
|
|
21
16
|
|
|
22
17
|
export default {
|
|
23
18
|
setup() {
|
|
24
|
-
const state = reactive({ count: 0 })
|
|
19
|
+
const state = reactive({ count: 0 });
|
|
25
20
|
return {
|
|
26
|
-
state
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
21
|
+
state,
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
};
|
|
30
25
|
</script>
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- BATI.has("tailwindcss") -->
|
|
3
|
-
<div
|
|
4
|
-
class="p-5 mb-2"
|
|
5
|
-
>
|
|
3
|
+
<div class="p-5 mb-2">
|
|
6
4
|
<a href="/">
|
|
7
|
-
<img
|
|
8
|
-
src="../assets/logo.svg"
|
|
9
|
-
height="64"
|
|
10
|
-
width="64"
|
|
11
|
-
>
|
|
5
|
+
<img src="../assets/logo.svg" height="64" width="64" />
|
|
12
6
|
</a>
|
|
13
7
|
</div>
|
|
14
8
|
<!-- !BATI.has("tailwindcss") -->
|
|
15
|
-
<div
|
|
16
|
-
style="
|
|
17
|
-
margin-top: 20px;
|
|
18
|
-
margin-bottom: 10px;
|
|
19
|
-
"
|
|
20
|
-
>
|
|
9
|
+
<div style="margin-top: 20px; margin-bottom: 10px">
|
|
21
10
|
<a href="/">
|
|
22
|
-
<img
|
|
23
|
-
src="../assets/logo.svg"
|
|
24
|
-
height="64"
|
|
25
|
-
width="64"
|
|
26
|
-
>
|
|
11
|
+
<img src="../assets/logo.svg" height="64" width="64" />
|
|
27
12
|
</a>
|
|
28
13
|
</div>
|
|
29
14
|
</template>
|
|
30
|
-
<script setup lang="ts">
|
|
31
|
-
</script>
|
|
15
|
+
<script setup lang="ts"></script>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- BATI.has("tailwindcss") -->
|
|
3
|
-
<div
|
|
4
|
-
id="sidebar"
|
|
5
|
-
class="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"
|
|
6
|
-
>
|
|
3
|
+
<div id="sidebar" class="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200">
|
|
7
4
|
<slot />
|
|
8
5
|
</div>
|
|
9
6
|
<!-- !BATI.has("tailwindcss") -->
|
|
@@ -21,5 +18,4 @@
|
|
|
21
18
|
<slot />
|
|
22
19
|
</div>
|
|
23
20
|
</template>
|
|
24
|
-
<script setup lang="ts">
|
|
25
|
-
</script>
|
|
21
|
+
<script setup lang="ts"></script>
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
6
|
<script lang="ts" setup>
|
|
7
|
-
import { usePageContext } from
|
|
7
|
+
import { usePageContext } from "vike-vue/usePageContext";
|
|
8
8
|
|
|
9
|
-
const ctx = usePageContext()
|
|
10
|
-
let { is404, abortReason } = ctx
|
|
9
|
+
const ctx = usePageContext();
|
|
10
|
+
let { is404, abortReason } = ctx;
|
|
11
11
|
if (!abortReason) {
|
|
12
|
-
abortReason = is404 ?
|
|
12
|
+
abortReason = is404 ? "This page could not be found." : "Something went wrong.";
|
|
13
13
|
}
|
|
14
|
-
const heading = is404 ?
|
|
14
|
+
const heading = is404 ? "404 Page Not Found" : "500 Internal Server Error";
|
|
15
15
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul>
|
|
3
|
-
<li v-for="
|
|
3
|
+
<li v-for="item in todoItems" :key="item.text">
|
|
4
4
|
{{ item.text }}
|
|
5
5
|
</li>
|
|
6
6
|
<li>
|
|
@@ -25,13 +25,7 @@ const newTodo = ref("");
|
|
|
25
25
|
const submitNewTodo = async () => {
|
|
26
26
|
// Optimistic UI update
|
|
27
27
|
todoItems.value.push({ text: newTodo.value });
|
|
28
|
-
if (
|
|
29
|
-
BATI.has("express") ||
|
|
30
|
-
BATI.has("fastify") ||
|
|
31
|
-
BATI.has("h3") ||
|
|
32
|
-
BATI.has("hattip") ||
|
|
33
|
-
BATI.has("hono")
|
|
34
|
-
) {
|
|
28
|
+
if (BATI.has("express") || BATI.has("fastify") || BATI.has("h3") || BATI.has("hattip") || BATI.has("hono")) {
|
|
35
29
|
try {
|
|
36
30
|
if (BATI.has("telefunc")) {
|
|
37
31
|
await onNewTodo({ text: newTodo.value });
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="firebaseui-auth-container"></div>
|
|
3
3
|
<div v-if="error">
|
|
4
|
-
<div style="color:red">There is an error occured : {{ error }}</div>
|
|
4
|
+
<div style="color: red">There is an error occured : {{ error }}</div>
|
|
5
5
|
<button @click="clearError">Try Again</button>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup lang="ts">
|
|
10
|
-
import "firebaseui/dist/firebaseui.css"
|
|
11
|
-
import {
|
|
12
|
-
import * as firebaseui from "firebaseui"
|
|
13
|
-
import { getAuth, type UserCredential } from
|
|
14
|
-
import { reload } from "vike/client/router"
|
|
15
|
-
import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI"
|
|
10
|
+
import "firebaseui/dist/firebaseui.css";
|
|
11
|
+
import { onMounted, onUpdated, ref } from "vue";
|
|
12
|
+
import * as firebaseui from "firebaseui";
|
|
13
|
+
import { getAuth, type UserCredential } from "firebase/auth";
|
|
14
|
+
import { reload } from "vike/client/router";
|
|
15
|
+
import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI";
|
|
16
16
|
|
|
17
|
-
const error = ref("")
|
|
18
|
-
const clearError = () => error.value = ""
|
|
19
|
-
const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth())
|
|
17
|
+
const error = ref("");
|
|
18
|
+
const clearError = () => (error.value = "");
|
|
19
|
+
const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth());
|
|
20
20
|
|
|
21
21
|
async function sessionLogin(authResult: UserCredential) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
await getAuth().signOut()
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.log('error :', err)
|
|
22
|
+
const idToken = (await authResult.user.getIdToken()) || "";
|
|
23
|
+
try {
|
|
24
|
+
const response = await fetch("/api/sessionLogin", {
|
|
25
|
+
method: "POST",
|
|
26
|
+
body: JSON.stringify({ idToken }),
|
|
27
|
+
headers: {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
if (response.ok) {
|
|
32
|
+
await reload();
|
|
33
|
+
} else {
|
|
34
|
+
error.value = response.statusText;
|
|
39
35
|
}
|
|
36
|
+
await getAuth().signOut();
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.log("error :", err);
|
|
39
|
+
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
onMounted(() => {
|
|
43
|
-
|
|
44
|
-
})
|
|
43
|
+
startFirebaseUI(ui, sessionLogin);
|
|
44
|
+
});
|
|
45
45
|
|
|
46
46
|
onUpdated(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
47
|
+
if (!error.value) {
|
|
48
|
+
startFirebaseUI(ui, sessionLogin);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
51
|
</script>
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { fileURLToPath } from "url";
|
|
|
15
15
|
import { existsSync } from "fs";
|
|
16
16
|
import { mkdir, opendir, readFile as readFile2, writeFile } from "fs/promises";
|
|
17
17
|
import path from "path";
|
|
18
|
-
import { transformAndFormat as transformAndFormat2 } from "@batijs/core";
|
|
18
|
+
import { formatCode, transformAndFormat as transformAndFormat2 } from "@batijs/core";
|
|
19
19
|
import { readFile } from "fs/promises";
|
|
20
20
|
import { parseModule, transformAndFormat } from "@batijs/core";
|
|
21
21
|
async function mergeDts({
|
|
@@ -85,7 +85,7 @@ async function* walk(dir) {
|
|
|
85
85
|
} else if (d.isFile()) yield entry;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function transformFileAfterExec(filepath, fileContent) {
|
|
88
|
+
async function transformFileAfterExec(filepath, fileContent) {
|
|
89
89
|
if (fileContent === void 0 || fileContent === null) return null;
|
|
90
90
|
const parsed = path.parse(filepath);
|
|
91
91
|
const toTest = [parsed.base, parsed.ext, parsed.name].filter(Boolean);
|
|
@@ -95,6 +95,9 @@ function transformFileAfterExec(filepath, fileContent) {
|
|
|
95
95
|
case ".js":
|
|
96
96
|
case ".tsx":
|
|
97
97
|
case ".jsx":
|
|
98
|
+
return formatCode(fileContent, {
|
|
99
|
+
filepath
|
|
100
|
+
});
|
|
98
101
|
case ".env":
|
|
99
102
|
case ".env.local":
|
|
100
103
|
case ".env.development":
|
|
@@ -181,7 +184,7 @@ Please report this issue to https://github.com/vikejs/bati`
|
|
|
181
184
|
const rf = () => {
|
|
182
185
|
return readFile2(target, { encoding: "utf-8" });
|
|
183
186
|
};
|
|
184
|
-
const fileContent = transformFileAfterExec(
|
|
187
|
+
const fileContent = await transformFileAfterExec(
|
|
185
188
|
target,
|
|
186
189
|
await transformer({
|
|
187
190
|
readfile: targets.has(target) ? rf : void 0,
|
|
@@ -1588,7 +1591,7 @@ var createDefaultQueryTester = function(query, options) {
|
|
|
1588
1591
|
// package.json
|
|
1589
1592
|
var package_default = {
|
|
1590
1593
|
name: "@batijs/cli",
|
|
1591
|
-
version: "0.0.
|
|
1594
|
+
version: "0.0.237",
|
|
1592
1595
|
type: "module",
|
|
1593
1596
|
scripts: {
|
|
1594
1597
|
"check-types": "tsc --noEmit",
|
|
@@ -1613,7 +1616,7 @@ var package_default = {
|
|
|
1613
1616
|
rimraf: "^6.0.1",
|
|
1614
1617
|
sift: "^17.1.3",
|
|
1615
1618
|
tsup: "^8.2.2",
|
|
1616
|
-
typescript: "^5.5.
|
|
1619
|
+
typescript: "^5.5.4",
|
|
1617
1620
|
"unplugin-purge-polyfills": "^0.0.4",
|
|
1618
1621
|
vite: "^5.3.4"
|
|
1619
1622
|
},
|
|
@@ -1960,7 +1963,7 @@ async function run() {
|
|
|
1960
1963
|
meta
|
|
1961
1964
|
);
|
|
1962
1965
|
if (!args["skip-git"]) {
|
|
1963
|
-
|
|
1966
|
+
gitInit(args.project);
|
|
1964
1967
|
}
|
|
1965
1968
|
printOK(args.project, flags);
|
|
1966
1969
|
for (const onafter of hooksMap.get("after") ?? []) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.237",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"rimraf": "^6.0.1",
|
|
18
18
|
"sift": "^17.1.3",
|
|
19
19
|
"tsup": "^8.2.2",
|
|
20
|
-
"typescript": "^5.5.
|
|
20
|
+
"typescript": "^5.5.4",
|
|
21
21
|
"unplugin-purge-polyfills": "^0.0.4",
|
|
22
22
|
"vite": "^5.3.4",
|
|
23
|
-
"@batijs/
|
|
24
|
-
"@batijs/
|
|
23
|
+
"@batijs/build": "0.0.237",
|
|
24
|
+
"@batijs/compile": "0.0.237"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@batijs/core": "0.0.
|
|
28
|
-
"@batijs/features": "0.0.
|
|
27
|
+
"@batijs/core": "0.0.237",
|
|
28
|
+
"@batijs/features": "0.0.237"
|
|
29
29
|
},
|
|
30
30
|
"bin": "./dist/index.js",
|
|
31
31
|
"exports": {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// files/$.eslintrc.json.ts
|
|
2
|
-
import { loadAsJson } from "@batijs/core";
|
|
3
|
-
async function getEslintConfig(props) {
|
|
4
|
-
if (!props.meta.BATI.has("eslint")) return;
|
|
5
|
-
const eslintConfig = await loadAsJson(props);
|
|
6
|
-
eslintConfig.rules ??= {};
|
|
7
|
-
eslintConfig.rules["react/no-unknown-property"] = [
|
|
8
|
-
"error",
|
|
9
|
-
{
|
|
10
|
-
ignore: ["css"]
|
|
11
|
-
}
|
|
12
|
-
];
|
|
13
|
-
return eslintConfig;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
getEslintConfig as default
|
|
17
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"extends": [
|
|
5
|
-
"eslint:recommended",
|
|
6
|
-
"plugin:@typescript-eslint/recommended"
|
|
7
|
-
],
|
|
8
|
-
"plugins": [
|
|
9
|
-
"@typescript-eslint"
|
|
10
|
-
],
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"sourceType": "module",
|
|
13
|
-
"ecmaVersion": "latest"
|
|
14
|
-
},
|
|
15
|
-
"rules": {
|
|
16
|
-
"@typescript-eslint/no-unused-vars": [
|
|
17
|
-
1,
|
|
18
|
-
{
|
|
19
|
-
"argsIgnorePattern": "^_"
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// files/$.eslintrc.json.ts
|
|
2
|
-
import { loadAsJson } from "@batijs/core";
|
|
3
|
-
async function getEslintConfig(props) {
|
|
4
|
-
if (!props.meta.BATI.has("eslint")) return;
|
|
5
|
-
const eslintConfig = await loadAsJson(props);
|
|
6
|
-
eslintConfig.extends.push("prettier");
|
|
7
|
-
return eslintConfig;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
getEslintConfig as default
|
|
11
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// files/$.eslintrc.json.ts
|
|
2
|
-
import { loadAsJson } from "@batijs/core";
|
|
3
|
-
async function getEslintConfig(props) {
|
|
4
|
-
if (!props.meta.BATI.has("eslint")) return;
|
|
5
|
-
const eslintConfig = await loadAsJson(props);
|
|
6
|
-
eslintConfig.extends.push("plugin:react/recommended");
|
|
7
|
-
eslintConfig.plugins.push("react");
|
|
8
|
-
eslintConfig.settings ??= {};
|
|
9
|
-
eslintConfig.settings.react = { version: "detect" };
|
|
10
|
-
eslintConfig.parserOptions ??= {};
|
|
11
|
-
eslintConfig.parserOptions.ecmaFeatures ??= {};
|
|
12
|
-
eslintConfig.parserOptions.ecmaFeatures.jsx = true;
|
|
13
|
-
return eslintConfig;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
getEslintConfig as default
|
|
17
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// files/$.eslintrc.json.ts
|
|
2
|
-
import { loadAsJson } from "@batijs/core";
|
|
3
|
-
async function getEslintConfig(props) {
|
|
4
|
-
if (!props.meta.BATI.has("eslint")) return;
|
|
5
|
-
const eslintConfig = await loadAsJson(props);
|
|
6
|
-
eslintConfig.extends.push("plugin:solid/typescript");
|
|
7
|
-
eslintConfig.plugins.push("solid");
|
|
8
|
-
return eslintConfig;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
getEslintConfig as default
|
|
12
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// files/$.eslintrc.json.ts
|
|
2
|
-
import { loadAsJson } from "@batijs/core";
|
|
3
|
-
async function getEslintConfig(props) {
|
|
4
|
-
if (!props.meta.BATI.has("eslint")) return;
|
|
5
|
-
const eslintConfig = await loadAsJson(props);
|
|
6
|
-
eslintConfig.extends.push("plugin:vue/vue3-recommended");
|
|
7
|
-
eslintConfig.parser = "vue-eslint-parser";
|
|
8
|
-
eslintConfig.parserOptions.parser = "@typescript-eslint/parser";
|
|
9
|
-
eslintConfig.rules ??= {};
|
|
10
|
-
eslintConfig.rules["vue/multi-word-component-names"] = "off";
|
|
11
|
-
eslintConfig.rules["vue/singleline-html-element-content-newline"] = "off";
|
|
12
|
-
eslintConfig.rules["vue/max-attributes-per-line"] = "off";
|
|
13
|
-
eslintConfig.rules["vue/html-self-closing"] = "off";
|
|
14
|
-
return eslintConfig;
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
getEslintConfig as default
|
|
18
|
-
};
|