@batijs/cli 0.0.504 → 0.0.506
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/auth0/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/database/d1/helpers.ts +8 -2
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/express/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/h3/files/server/entry.ts +1 -1
- package/dist/boilerplates/@batijs/h3/types/server/entry.d.ts +1 -1
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/photon/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionEnd.ts +1 -4
- package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionStart.ts +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+data.ts +2 -3
- package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+data.ts +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/todo/+Page.tsx +1 -4
- package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +21 -25
- package/dist/boilerplates/@batijs/react/types/pages/+onPageTransitionEnd.d.ts +1 -2
- package/dist/boilerplates/@batijs/react/types/pages/star-wars/@id/+data.d.ts +3 -1
- package/dist/boilerplates/@batijs/react/types/pages/star-wars/index/+data.d.ts +3 -1
- package/dist/boilerplates/@batijs/react/types/pages/todo/TodoList.d.ts +1 -5
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
- package/dist/boilerplates/@batijs/shared/files/tsconfig.json +1 -1
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +10 -9
- package/dist/boilerplates/@batijs/shared-todo/types/pages/todo/+data.d.ts +1 -8
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionEnd.ts +1 -4
- package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionStart.ts +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+data.ts +2 -3
- package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+data.ts +1 -1
- package/dist/boilerplates/@batijs/solid/files/pages/todo/+Page.tsx +1 -4
- package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +21 -25
- package/dist/boilerplates/@batijs/solid/types/pages/+onPageTransitionEnd.d.ts +1 -2
- package/dist/boilerplates/@batijs/solid/types/pages/star-wars/@id/+data.d.ts +3 -1
- package/dist/boilerplates/@batijs/solid/types/pages/star-wars/index/+data.d.ts +3 -1
- package/dist/boilerplates/@batijs/solid/types/pages/todo/TodoList.d.ts +1 -5
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +3 -3
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +5 -16
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -3
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +2 -10
- package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionEnd.ts +1 -4
- package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionStart.ts +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/_error/+Page.vue +2 -2
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+Page.vue +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+data.ts +2 -3
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +2 -2
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+data.ts +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/todo/+Page.vue +1 -5
- package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +35 -36
- package/dist/boilerplates/@batijs/vue/types/pages/+onPageTransitionEnd.d.ts +1 -2
- package/dist/boilerplates/@batijs/vue/types/pages/star-wars/@id/+data.d.ts +3 -1
- package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+data.d.ts +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +3 -3
- package/dist/{chunk-65FUIWXL.js → chunk-2Q4FGVFI.js} +2563 -2562
- package/dist/index.js +40 -40
- package/package.json +6 -6
- package/dist/boilerplates/@batijs/prettier/files/.prettierrc +0 -3
- package/dist/boilerplates/@batijs/vue/files/vue-shim.d.ts +0 -11
|
@@ -2,9 +2,12 @@ import { onNewTodo } from "@batijs/telefunc/pages/todo/TodoList.telefunc";
|
|
|
2
2
|
import { trpc } from "@batijs/trpc/trpc/client";
|
|
3
3
|
import { client } from "@batijs/ts-rest/ts-rest/client";
|
|
4
4
|
import { createSignal, For, untrack } from "solid-js";
|
|
5
|
+
import { useData } from "vike-solid/useData";
|
|
6
|
+
import type { Data } from "@batijs/shared-todo/pages/todo/+data";
|
|
5
7
|
|
|
6
|
-
export function TodoList(
|
|
7
|
-
const
|
|
8
|
+
export function TodoList() {
|
|
9
|
+
const { todoItemsInitial } = useData<Data>();
|
|
10
|
+
const [todoItems, setTodoItems] = createSignal<{ text: string }[]>(todoItemsInitial);
|
|
8
11
|
const [newTodo, setNewTodo] = createSignal("");
|
|
9
12
|
return (
|
|
10
13
|
<>
|
|
@@ -16,31 +19,24 @@ export function TodoList(props: { initialTodoItems: { text: string }[] }) {
|
|
|
16
19
|
onSubmit={async (ev) => {
|
|
17
20
|
ev.preventDefault();
|
|
18
21
|
|
|
19
|
-
// Optimistic UI update
|
|
20
22
|
setTodoItems((prev) => [...prev, { text: untrack(newTodo) }]);
|
|
23
|
+
setNewTodo("");
|
|
21
24
|
if (BATI.hasServer) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await response.blob();
|
|
38
|
-
}
|
|
39
|
-
setNewTodo("");
|
|
40
|
-
} catch (e) {
|
|
41
|
-
console.error(e);
|
|
42
|
-
// rollback
|
|
43
|
-
setTodoItems((prev) => prev.slice(0, -1));
|
|
25
|
+
if (BATI.has("telefunc")) {
|
|
26
|
+
await onNewTodo({ text: untrack(newTodo) });
|
|
27
|
+
} else if (BATI.has("trpc")) {
|
|
28
|
+
await trpc.onNewTodo.mutate(untrack(newTodo));
|
|
29
|
+
} else if (BATI.has("ts-rest")) {
|
|
30
|
+
await client.createTodo({ body: { text: untrack(newTodo) } });
|
|
31
|
+
} else {
|
|
32
|
+
const response = await fetch("/api/todo/create", {
|
|
33
|
+
method: "POST",
|
|
34
|
+
body: JSON.stringify({ text: untrack(newTodo) }),
|
|
35
|
+
headers: {
|
|
36
|
+
"Content-Type": "application/json",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
await response.blob();
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
}}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function onPageTransitionEnd(pageContext: PageContextClient): Promise<void>;
|
|
1
|
+
export declare function onPageTransitionEnd(): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PageContextServer } from "vike/types";
|
|
2
2
|
import type { MovieDetails } from "../types.js";
|
|
3
3
|
export type Data = Awaited<ReturnType<typeof data>>;
|
|
4
|
-
export declare function data(pageContext: PageContextServer): Promise<
|
|
4
|
+
export declare function data(pageContext: PageContextServer): Promise<{
|
|
5
|
+
movie: MovieDetails;
|
|
6
|
+
}>;
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -51,8 +51,8 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@sentry/solid": "^10.
|
|
55
|
-
"@types/node": "^20.19.
|
|
54
|
+
"@sentry/solid": "^10.25.0",
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
56
|
"solid-js": "^1.9.10",
|
|
57
57
|
"vike-solid": "^0.7.13",
|
|
58
58
|
vite: "^7.2.2"
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -52,7 +52,7 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
54
|
"@types/better-sqlite3": "^7.6.13",
|
|
55
|
-
"@types/node": "^20.19.
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
56
|
"better-sqlite3": "^12.4.1",
|
|
57
57
|
dotenv: "^17.2.3",
|
|
58
58
|
tsx: "^4.20.6"
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -52,11 +52,11 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
54
|
"@tailwindcss/vite": "^4.1.17",
|
|
55
|
-
"@types/node": "^20.19.
|
|
56
|
-
autoprefixer: "^10.4.
|
|
57
|
-
daisyui: "^5.
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
|
+
autoprefixer: "^10.4.22",
|
|
57
|
+
daisyui: "^5.5.0",
|
|
58
58
|
tailwindcss: "^4.1.17",
|
|
59
|
-
vike: "^0.4.
|
|
59
|
+
vike: "^0.4.246",
|
|
60
60
|
vite: "^7.2.2"
|
|
61
61
|
},
|
|
62
62
|
dependencies: {
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -51,11 +51,11 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@cloudflare/workers-types": "^4.
|
|
55
|
-
"@types/node": "^20.19.
|
|
54
|
+
"@cloudflare/workers-types": "^4.20251111.0",
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
56
|
"@universal-middleware/core": "^0.4.13",
|
|
57
|
-
telefunc: "^0.2.
|
|
58
|
-
vike: "^0.4.
|
|
57
|
+
telefunc: "^0.2.16",
|
|
58
|
+
vike: "^0.4.246",
|
|
59
59
|
vite: "^7.2.2"
|
|
60
60
|
},
|
|
61
61
|
dependencies: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// We use Telefunc (https://telefunc.com) for data mutations.
|
|
1
|
+
// We use Telefunc (https://telefunc.com) for data mutations.
|
|
2
2
|
|
|
3
3
|
import * as d1Queries from "@batijs/d1-sqlite/database/d1/queries/todos";
|
|
4
4
|
import * as drizzleQueries from "@batijs/drizzle/database/drizzle/queries/todos";
|
|
@@ -16,8 +16,8 @@ export async function onNewTodo({ text }: { text: string }) {
|
|
|
16
16
|
const context = getContext();
|
|
17
17
|
await d1Queries.insertTodo(context.db, text);
|
|
18
18
|
} else {
|
|
19
|
-
// NOTE: This
|
|
20
|
-
// Go to https://vike.dev/new and select a
|
|
19
|
+
// NOTE: This telefunction is only for demonstration — it doesn't actually save changes to a database.
|
|
20
|
+
// Go to https://vike.dev/new and select a database to scaffold an app with a persisted to-do list.
|
|
21
21
|
console.log(`Received ${text}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -51,10 +51,10 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@cloudflare/workers-types": "^4.
|
|
54
|
+
"@cloudflare/workers-types": "^4.20251111.0",
|
|
55
55
|
"@trpc/client": "^11.7.1",
|
|
56
56
|
"@trpc/server": "^11.7.1",
|
|
57
|
-
"@types/node": "^20.19.
|
|
57
|
+
"@types/node": "^20.19.24",
|
|
58
58
|
"@universal-middleware/core": "^0.4.13",
|
|
59
59
|
vite: "^7.2.2"
|
|
60
60
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const trpc: import("@trpc/client").TRPCClient<import("@trpc/server").TRPCBuiltRouter<{
|
|
2
2
|
ctx: object & {
|
|
3
|
-
db: ReturnType<
|
|
3
|
+
db: ReturnType<any>;
|
|
4
4
|
} & {
|
|
5
|
-
db: ReturnType<
|
|
5
|
+
db: ReturnType<any>;
|
|
6
6
|
} & {
|
|
7
|
-
db: ReturnType<
|
|
7
|
+
db: ReturnType<any>;
|
|
8
8
|
} & {
|
|
9
9
|
db: import("@cloudflare/workers-types").D1Database;
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -51,10 +51,10 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@cloudflare/workers-types": "^4.
|
|
54
|
+
"@cloudflare/workers-types": "^4.20251111.0",
|
|
55
55
|
"@ts-rest/core": "^3.52.1",
|
|
56
56
|
"@ts-rest/serverless": "^3.52.1",
|
|
57
|
-
"@types/node": "^20.19.
|
|
57
|
+
"@types/node": "^20.19.24",
|
|
58
58
|
"@universal-middleware/core": "^0.4.13",
|
|
59
59
|
zod: "^3.25.76"
|
|
60
60
|
},
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -51,9 +51,9 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@photonjs/vercel": "^0.1.
|
|
55
|
-
"@types/node": "^20.19.
|
|
56
|
-
vike: "^0.4.
|
|
54
|
+
"@photonjs/vercel": "^0.1.7",
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
|
+
vike: "^0.4.246",
|
|
57
57
|
vite: "^7.2.2"
|
|
58
58
|
},
|
|
59
59
|
dependencies: {
|
|
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
WEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
@@ -52,15 +52,12 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
54
|
"@batijs/tailwindcss": "workspace:*",
|
|
55
|
-
"@types/node": "^20.19.
|
|
55
|
+
"@types/node": "^20.19.24",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
57
|
-
"@vue/compiler-sfc": "^3.5.24",
|
|
58
|
-
"@vue/server-renderer": "^3.5.24",
|
|
59
57
|
tailwindcss: "^4.1.17",
|
|
60
58
|
typescript: "^5.9.3",
|
|
61
|
-
|
|
62
|
-
vike: "^0.
|
|
63
|
-
"vike-photon": "^0.1.14",
|
|
59
|
+
vike: "^0.4.246",
|
|
60
|
+
"vike-photon": "^0.1.16",
|
|
64
61
|
"vike-vue": "^0.9.6",
|
|
65
62
|
vite: "^7.2.2",
|
|
66
63
|
vue: "^3.5.24",
|
|
@@ -130,15 +127,7 @@ var require_package = __commonJS({
|
|
|
130
127
|
});
|
|
131
128
|
async function getPackageJson(props) {
|
|
132
129
|
const packageJson = await WEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
133
|
-
return packageJson.addDevDependencies(["vite"]).addDependencies([
|
|
134
|
-
"@vitejs/plugin-vue",
|
|
135
|
-
"@vue/compiler-sfc",
|
|
136
|
-
"@vue/server-renderer",
|
|
137
|
-
"unplugin-vue-markdown",
|
|
138
|
-
"vike-vue",
|
|
139
|
-
"vike",
|
|
140
|
-
"vue"
|
|
141
|
-
]).addDependencies(["vue-gtag"], props.meta.BATI.has("google-analytics"));
|
|
130
|
+
return packageJson.addDevDependencies(["vite", "@vitejs/plugin-vue"]).addDependencies(["vike-vue", "vike", "vue"]).addDependencies(["vue-gtag"], props.meta.BATI.has("google-analytics"));
|
|
142
131
|
}
|
|
143
132
|
export {
|
|
144
133
|
getPackageJson as default
|
|
@@ -4,15 +4,13 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
YEs
|
|
7
|
-
} from "../../../../chunk-
|
|
7
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
10
|
|
|
11
11
|
// ../../boilerplates/vue/dist/files/$tsconfig.json.js
|
|
12
12
|
async function getTsConfig(props) {
|
|
13
13
|
const tsConfig = await YEs(props);
|
|
14
|
-
tsConfig.compilerOptions.jsx = "react-jsx";
|
|
15
|
-
tsConfig.compilerOptions.jsxImportSource = "vue";
|
|
16
14
|
return tsConfig;
|
|
17
15
|
}
|
|
18
16
|
export {
|
|
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
|
|
|
5
5
|
import {
|
|
6
6
|
JEs,
|
|
7
7
|
Zti
|
|
8
|
-
} from "../../../../chunk-
|
|
8
|
+
} from "../../../../chunk-2Q4FGVFI.js";
|
|
9
9
|
import "../../../../chunk-IAWYWZSL.js";
|
|
10
10
|
import "../../../../chunk-DHZ7AZKP.js";
|
|
11
11
|
|
|
@@ -14,15 +14,7 @@ async function getViteConfig(props) {
|
|
|
14
14
|
const mod = await JEs(props);
|
|
15
15
|
Zti(mod, {
|
|
16
16
|
from: "@vitejs/plugin-vue",
|
|
17
|
-
constructor: "vue"
|
|
18
|
-
options: {
|
|
19
|
-
include: [/\.vue$/, /\.md$/]
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
Zti(mod, {
|
|
23
|
-
from: "unplugin-vue-markdown/vite",
|
|
24
|
-
constructor: "md",
|
|
25
|
-
options: {}
|
|
17
|
+
constructor: "vue"
|
|
26
18
|
});
|
|
27
19
|
return mod.generate().code;
|
|
28
20
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export async function onPageTransitionEnd(pageContext: PageContextClient) {
|
|
1
|
+
export async function onPageTransitionEnd() {
|
|
4
2
|
console.log("Page transition end");
|
|
5
|
-
console.log("Is backwards navigation?", pageContext.isBackwardNavigation);
|
|
6
3
|
document.body.classList.remove("page-transition");
|
|
7
4
|
}
|
|
@@ -2,6 +2,6 @@ import type { PageContextClient } from "vike/types";
|
|
|
2
2
|
|
|
3
3
|
export async function onPageTransitionStart(pageContext: Partial<PageContextClient>) {
|
|
4
4
|
console.log("Page transition start");
|
|
5
|
-
console.log("
|
|
5
|
+
console.log("pageContext.isBackwardNavigation", pageContext.isBackwardNavigation);
|
|
6
6
|
document.body.classList.add("page-transition");
|
|
7
7
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<script lang="ts" setup>
|
|
7
7
|
import { usePageContext } from "vike-vue/usePageContext";
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
let { is404, abortReason } =
|
|
9
|
+
const pageContext = usePageContext();
|
|
10
|
+
let { is404, abortReason } = pageContext;
|
|
11
11
|
if (!abortReason) {
|
|
12
12
|
abortReason = is404 ? "This page could not be found." : "Something went wrong.";
|
|
13
13
|
}
|
|
@@ -22,11 +22,10 @@ export async function data(pageContext: PageContextServer) {
|
|
|
22
22
|
// the client; we should minimize what is sent over the network.
|
|
23
23
|
movie = minimize(movie);
|
|
24
24
|
|
|
25
|
-
return movie;
|
|
25
|
+
return { movie };
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function minimize(movie: MovieDetails): MovieDetails {
|
|
29
29
|
const { id, title, release_date, director, producer } = movie;
|
|
30
|
-
|
|
31
|
-
return minimizedMovie;
|
|
30
|
+
return { id, title, release_date, director, producer };
|
|
32
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<h1>Star Wars Movies</h1>
|
|
3
3
|
<ol>
|
|
4
|
-
<li v-for="item in movies
|
|
4
|
+
<li v-for="item in movies" :key="item.id">
|
|
5
5
|
<a :href="'/star-wars/' + item.id">{{ item.title }}</a> ({{ item.release_date }})
|
|
6
6
|
</li>
|
|
7
7
|
</ol>
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
import { useData } from "vike-vue/useData";
|
|
13
13
|
import type { Data } from "./+data.js";
|
|
14
14
|
|
|
15
|
-
const movies = useData<Data>();
|
|
15
|
+
const { movies } = useData<Data>();
|
|
16
16
|
</script>
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<h1>To-do List</h1>
|
|
4
|
-
<TodoList
|
|
4
|
+
<TodoList />
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script lang="ts" setup>
|
|
9
|
-
import type { Data } from "@batijs/shared-todo/pages/todo/+data";
|
|
10
|
-
import { useData } from "vike-vue/useData";
|
|
11
9
|
import TodoList from "./TodoList.vue";
|
|
12
|
-
|
|
13
|
-
const data = useData<Data>();
|
|
14
10
|
</script>
|
|
@@ -5,8 +5,14 @@
|
|
|
5
5
|
</li>
|
|
6
6
|
<li>
|
|
7
7
|
<form @submit.prevent="submitNewTodo()">
|
|
8
|
+
<!-- BATI.has("tailwindcss") -->
|
|
8
9
|
<input v-model="newTodo" type="text" :class="[inputClass]" />
|
|
10
|
+
<!-- !BATI.has("tailwindcss") -->
|
|
11
|
+
<input v-model="newTodo" type="text" />
|
|
12
|
+
<!-- BATI.has("tailwindcss") -->
|
|
9
13
|
<button type="submit" :class="[buttonClass]">Add to-do</button>
|
|
14
|
+
<!-- !BATI.has("tailwindcss") -->
|
|
15
|
+
<button type="submit">Add to-do</button>
|
|
10
16
|
</form>
|
|
11
17
|
</li>
|
|
12
18
|
</ul>
|
|
@@ -17,48 +23,41 @@ import { onNewTodo } from "@batijs/telefunc/pages/todo/TodoList.telefunc";
|
|
|
17
23
|
import { trpc } from "@batijs/trpc/trpc/client";
|
|
18
24
|
import { client } from "@batijs/ts-rest/ts-rest/client";
|
|
19
25
|
import { ref } from "vue";
|
|
26
|
+
import { useData } from "vike-vue/useData";
|
|
27
|
+
import type { Data } from "@batijs/shared-todo/pages/todo/+data";
|
|
20
28
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
? "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
24
|
-
: "",
|
|
25
|
-
);
|
|
26
|
-
const buttonClass = ref(
|
|
27
|
-
BATI.has("tailwindcss")
|
|
28
|
-
? "text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
29
|
-
: "",
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const props = defineProps<{ initialTodoItems: { text: string }[] }>();
|
|
33
|
-
const todoItems = ref(props.initialTodoItems);
|
|
29
|
+
const { todoItemsInitial } = useData<Data>();
|
|
30
|
+
const todoItems = ref<{ text: string }[]>(todoItemsInitial);
|
|
34
31
|
const newTodo = ref("");
|
|
35
32
|
|
|
33
|
+
if (BATI.has("tailwindcss")) {
|
|
34
|
+
const inputClass = ref(
|
|
35
|
+
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1",
|
|
36
|
+
);
|
|
37
|
+
const buttonClass = ref(
|
|
38
|
+
"text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2",
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
const submitNewTodo = async () => {
|
|
37
|
-
// Optimistic UI update
|
|
38
43
|
todoItems.value.push({ text: newTodo.value });
|
|
44
|
+
newTodo.value = "";
|
|
39
45
|
if (BATI.hasServer) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
await response.blob();
|
|
56
|
-
}
|
|
57
|
-
newTodo.value = "";
|
|
58
|
-
} catch (e) {
|
|
59
|
-
console.error(e);
|
|
60
|
-
// rollback
|
|
61
|
-
todoItems.value.slice(0, -1);
|
|
46
|
+
if (BATI.has("telefunc")) {
|
|
47
|
+
await onNewTodo({ text: newTodo.value });
|
|
48
|
+
} else if (BATI.has("trpc")) {
|
|
49
|
+
await trpc.onNewTodo.mutate(newTodo.value);
|
|
50
|
+
} else if (BATI.has("ts-rest")) {
|
|
51
|
+
await client.createTodo({ body: { text: newTodo.value } });
|
|
52
|
+
} else {
|
|
53
|
+
const response = await fetch("/api/todo/create", {
|
|
54
|
+
method: "POST",
|
|
55
|
+
body: JSON.stringify({ text: newTodo.value }),
|
|
56
|
+
headers: {
|
|
57
|
+
"Content-Type": "application/json",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
await response.blob();
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function onPageTransitionEnd(pageContext: PageContextClient): Promise<void>;
|
|
1
|
+
export declare function onPageTransitionEnd(): Promise<void>;
|