@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.
Files changed (123) hide show
  1. package/dist/boilerplates/@batijs/auth0/files/$.env.js +1 -1
  2. package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +1 -1
  3. package/dist/boilerplates/@batijs/authjs/files/$package.json.js +3 -3
  4. package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
  5. package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +1 -1
  6. package/dist/boilerplates/@batijs/aws/files/$package.json.js +4 -4
  7. package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
  8. package/dist/boilerplates/@batijs/biome/files/$package.json.js +3 -3
  9. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +5 -5
  10. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +2 -2
  11. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
  12. package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +1 -1
  13. package/dist/boilerplates/@batijs/d1/files/$package.json.js +5 -5
  14. package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
  15. package/dist/boilerplates/@batijs/d1/files/database/d1/helpers.ts +8 -2
  16. package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +4 -4
  17. package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
  18. package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
  19. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +2 -2
  20. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +2 -2
  21. package/dist/boilerplates/@batijs/express/files/$package.json.js +5 -5
  22. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +5 -5
  23. package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
  24. package/dist/boilerplates/@batijs/h3/files/$package.json.js +6 -6
  25. package/dist/boilerplates/@batijs/h3/files/server/entry.ts +1 -1
  26. package/dist/boilerplates/@batijs/h3/types/server/entry.d.ts +1 -1
  27. package/dist/boilerplates/@batijs/hono/files/$package.json.js +8 -8
  28. package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
  29. package/dist/boilerplates/@batijs/mantine/files/$package.json.js +3 -3
  30. package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
  31. package/dist/boilerplates/@batijs/photon/files/$package.json.js +3 -3
  32. package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
  33. package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
  34. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +2 -2
  35. package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
  36. package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
  37. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
  38. package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
  39. package/dist/boilerplates/@batijs/react/files/$package.json.js +5 -5
  40. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
  41. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
  42. package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionEnd.ts +1 -4
  43. package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionStart.ts +1 -1
  44. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+Page.tsx +1 -1
  45. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+data.ts +2 -3
  46. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+Page.tsx +1 -1
  47. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+data.ts +1 -1
  48. package/dist/boilerplates/@batijs/react/files/pages/todo/+Page.tsx +1 -4
  49. package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +21 -25
  50. package/dist/boilerplates/@batijs/react/types/pages/+onPageTransitionEnd.d.ts +1 -2
  51. package/dist/boilerplates/@batijs/react/types/pages/star-wars/@id/+data.d.ts +3 -1
  52. package/dist/boilerplates/@batijs/react/types/pages/star-wars/index/+data.d.ts +3 -1
  53. package/dist/boilerplates/@batijs/react/types/pages/todo/TodoList.d.ts +1 -5
  54. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +4 -4
  55. package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
  56. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
  57. package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
  58. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +2 -2
  59. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
  60. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
  61. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
  62. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +3 -3
  63. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
  64. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
  65. package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
  66. package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
  67. package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
  68. package/dist/boilerplates/@batijs/shared/files/tsconfig.json +1 -1
  69. package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +4 -4
  70. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +10 -9
  71. package/dist/boilerplates/@batijs/shared-todo/types/pages/todo/+data.d.ts +1 -8
  72. package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
  73. package/dist/boilerplates/@batijs/solid/files/$package.json.js +4 -4
  74. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
  75. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
  76. package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionEnd.ts +1 -4
  77. package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionStart.ts +1 -1
  78. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+Page.tsx +1 -1
  79. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+data.ts +2 -3
  80. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+Page.tsx +1 -1
  81. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+data.ts +1 -1
  82. package/dist/boilerplates/@batijs/solid/files/pages/todo/+Page.tsx +1 -4
  83. package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +21 -25
  84. package/dist/boilerplates/@batijs/solid/types/pages/+onPageTransitionEnd.d.ts +1 -2
  85. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/@id/+data.d.ts +3 -1
  86. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/index/+data.d.ts +3 -1
  87. package/dist/boilerplates/@batijs/solid/types/pages/todo/TodoList.d.ts +1 -5
  88. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +3 -3
  89. package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
  90. package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
  91. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +2 -2
  92. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +5 -5
  93. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
  94. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +5 -5
  95. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
  96. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +3 -3
  97. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +3 -3
  98. package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
  99. package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +3 -3
  100. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +4 -4
  101. package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
  102. package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
  103. package/dist/boilerplates/@batijs/vue/files/$package.json.js +5 -16
  104. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -3
  105. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +2 -10
  106. package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionEnd.ts +1 -4
  107. package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionStart.ts +1 -1
  108. package/dist/boilerplates/@batijs/vue/files/pages/_error/+Page.vue +2 -2
  109. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+Page.vue +1 -1
  110. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+data.ts +2 -3
  111. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +2 -2
  112. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+data.ts +1 -1
  113. package/dist/boilerplates/@batijs/vue/files/pages/todo/+Page.vue +1 -5
  114. package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +35 -36
  115. package/dist/boilerplates/@batijs/vue/types/pages/+onPageTransitionEnd.d.ts +1 -2
  116. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/@id/+data.d.ts +3 -1
  117. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+data.d.ts +1 -1
  118. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +3 -3
  119. package/dist/{chunk-65FUIWXL.js → chunk-2Q4FGVFI.js} +2563 -2562
  120. package/dist/index.js +40 -40
  121. package/package.json +6 -6
  122. package/dist/boilerplates/@batijs/prettier/files/.prettierrc +0 -3
  123. package/dist/boilerplates/@batijs/vue/files/vue-shim.d.ts +0 -11
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  WEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -55,16 +55,16 @@ var require_package = __commonJS({
55
55
  "@babel/plugin-transform-react-jsx": "^7.27.1",
56
56
  "@batijs/compile": "workspace:*",
57
57
  "@mantine/core": "^8.3.7",
58
- "@types/node": "^20.19.21",
59
- "@types/react": "^19.2.2",
58
+ "@types/node": "^20.19.24",
59
+ "@types/react": "^19.2.3",
60
60
  "@types/react-dom": "^19.2.2",
61
61
  "@vitejs/plugin-react": "^5.1.0",
62
62
  react: "^19.2.0",
63
63
  "react-dom": "^19.2.0",
64
64
  tailwindcss: "^4.1.17",
65
65
  typescript: "^5.9.3",
66
- vike: "^0.4.245",
67
- "vike-photon": "^0.1.14",
66
+ vike: "^0.4.246",
67
+ "vike-photon": "^0.1.16",
68
68
  "vike-react": "^0.6.12",
69
69
  vite: "^7.2.2",
70
70
  "vite-plugin-compiled-react": "^1.3.1"
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  YEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  JEs,
7
7
  Zti
8
- } from "../../../../chunk-65FUIWXL.js";
8
+ } from "../../../../chunk-2Q4FGVFI.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-DHZ7AZKP.js";
11
11
 
@@ -1,7 +1,4 @@
1
- import type { PageContextClient } from "vike/types";
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("Is backwards navigation?", pageContext.isBackwardNavigation);
5
+ console.log("pageContext.isBackwardNavigation", pageContext.isBackwardNavigation);
6
6
  document.body.classList.add("page-transition");
7
7
  }
@@ -2,7 +2,7 @@ import { useData } from "vike-react/useData";
2
2
  import type { Data } from "./+data.js";
3
3
 
4
4
  export default function Page() {
5
- const movie = useData<Data>();
5
+ const { movie } = useData<Data>();
6
6
  return (
7
7
  <>
8
8
  <h1>{movie.title}</h1>
@@ -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
- const minimizedMovie = { id, title, release_date, director, producer };
31
- return minimizedMovie;
30
+ return { id, title, release_date, director, producer };
32
31
  }
@@ -2,7 +2,7 @@ import { useData } from "vike-react/useData";
2
2
  import type { Data } from "./+data.js";
3
3
 
4
4
  export default function Page() {
5
- const movies = useData<Data>();
5
+ const { movies } = useData<Data>();
6
6
  return (
7
7
  <>
8
8
  <h1>Star Wars Movies</h1>
@@ -21,7 +21,7 @@ export async function data() {
21
21
  // minimize what is sent over the network.
22
22
  const movies = minimize(moviesData);
23
23
 
24
- return movies;
24
+ return { movies };
25
25
  }
26
26
 
27
27
  function minimize(movies: MovieDetails[]): Movie[] {
@@ -1,13 +1,10 @@
1
- import type { Data } from "@batijs/shared-todo/pages/todo/+data";
2
- import { useData } from "vike-react/useData";
3
1
  import { TodoList } from "./TodoList.js";
4
2
 
5
3
  export default function Page() {
6
- const data = useData<Data>();
7
4
  return (
8
5
  <>
9
6
  <h1>To-do List</h1>
10
- <TodoList initialTodoItems={data.todo} />
7
+ <TodoList />
11
8
  </>
12
9
  );
13
10
  }
@@ -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 { useState } from "react";
5
+ import { useData } from "vike-react/useData";
6
+ import type { Data } from "@batijs/shared-todo/pages/todo/+data";
5
7
 
6
- export function TodoList({ initialTodoItems }: { initialTodoItems: { text: string }[] }) {
7
- const [todoItems, setTodoItems] = useState(initialTodoItems);
8
+ export function TodoList() {
9
+ const { todoItemsInitial } = useData<Data>();
10
+ const [todoItems, setTodoItems] = useState<{ text: string }[]>(todoItemsInitial);
8
11
  const [newTodo, setNewTodo] = useState("");
9
12
  return (
10
13
  <>
@@ -19,31 +22,24 @@ export function TodoList({ initialTodoItems }: { initialTodoItems: { text: strin
19
22
  onSubmit={async (ev) => {
20
23
  ev.preventDefault();
21
24
 
22
- // Optimistic UI update
23
25
  setTodoItems((prev) => [...prev, { text: newTodo }]);
26
+ setNewTodo("");
24
27
  if (BATI.hasServer) {
25
- try {
26
- if (BATI.has("telefunc")) {
27
- await onNewTodo({ text: newTodo });
28
- } else if (BATI.has("trpc")) {
29
- await trpc.onNewTodo.mutate(newTodo);
30
- } else if (BATI.has("ts-rest")) {
31
- await client.createTodo({ body: { text: newTodo } });
32
- } else {
33
- const response = await fetch("/api/todo/create", {
34
- method: "POST",
35
- body: JSON.stringify({ text: newTodo }),
36
- headers: {
37
- "Content-Type": "application/json",
38
- },
39
- });
40
- await response.blob();
41
- }
42
- setNewTodo("");
43
- } catch (e) {
44
- console.error(e);
45
- // rollback
46
- setTodoItems((prev) => prev.slice(0, -1));
28
+ if (BATI.has("telefunc")) {
29
+ await onNewTodo({ text: newTodo });
30
+ } else if (BATI.has("trpc")) {
31
+ await trpc.onNewTodo.mutate(newTodo);
32
+ } else if (BATI.has("ts-rest")) {
33
+ await client.createTodo({ body: { text: newTodo } });
34
+ } else {
35
+ const response = await fetch("/api/todo/create", {
36
+ method: "POST",
37
+ body: JSON.stringify({ text: newTodo }),
38
+ headers: {
39
+ "Content-Type": "application/json",
40
+ },
41
+ });
42
+ await response.blob();
47
43
  }
48
44
  }
49
45
  }}
@@ -1,2 +1 @@
1
- import type { PageContextClient } from "vike/types";
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<MovieDetails>;
4
+ export declare function data(pageContext: PageContextServer): Promise<{
5
+ movie: MovieDetails;
6
+ }>;
@@ -1,3 +1,5 @@
1
1
  import type { Movie } from "../types.js";
2
2
  export type Data = Awaited<ReturnType<typeof data>>;
3
- export declare function data(): Promise<Movie[]>;
3
+ export declare function data(): Promise<{
4
+ movies: Movie[];
5
+ }>;
@@ -1,5 +1 @@
1
- export declare function TodoList({ initialTodoItems }: {
2
- initialTodoItems: {
3
- text: string;
4
- }[];
5
- }): import("react/jsx-runtime").JSX.Element;
1
+ export declare function TodoList(): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  WEs
7
- } from "../../../../chunk-65FUIWXL.js";
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
- "@sentry/react": "^10.23.0",
55
- "@types/node": "^20.19.21",
56
- "@types/react": "^19.2.2",
54
+ "@sentry/react": "^10.25.0",
55
+ "@types/node": "^20.19.24",
56
+ "@types/react": "^19.2.3",
57
57
  "@types/react-dom": "^19.2.2",
58
58
  react: "^19.2.0",
59
59
  "react-dom": "^19.2.0",
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  CBs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
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-65FUIWXL.js";
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
  "@sentry/vite-plugin": "^4.6.0",
55
- "@types/node": "^20.19.21",
55
+ "@types/node": "^20.19.24",
56
56
  vite: "^7.2.2"
57
57
  },
58
58
  dependencies: {
@@ -6,7 +6,7 @@ import {
6
6
  JEs,
7
7
  Tir,
8
8
  Zti
9
- } from "../../../../chunk-65FUIWXL.js";
9
+ } from "../../../../chunk-2Q4FGVFI.js";
10
10
  import "../../../../chunk-IAWYWZSL.js";
11
11
  import "../../../../chunk-DHZ7AZKP.js";
12
12
 
@@ -7,7 +7,7 @@ import {
7
7
  PK,
8
8
  PR,
9
9
  Sme
10
- } from "../../../../../chunk-65FUIWXL.js";
10
+ } from "../../../../../chunk-2Q4FGVFI.js";
11
11
  import "../../../../../chunk-IAWYWZSL.js";
12
12
  import "../../../../../chunk-DHZ7AZKP.js";
13
13
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
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-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -52,8 +52,8 @@ var require_package = __commonJS({
52
52
  devDependencies: {
53
53
  "@batijs/compile": "workspace:*",
54
54
  "@radix-ui/react-icons": "^1.3.2",
55
- "@types/node": "^20.19.21",
56
- autoprefixer: "^10.4.21",
55
+ "@types/node": "^20.19.24",
56
+ autoprefixer: "^10.4.22",
57
57
  "class-variance-authority": "^0.7.1",
58
58
  clsx: "^2.1.1",
59
59
  "lucide-react": "^0.553.0",
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  YEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  JEs,
7
7
  hir
8
- } from "../../../../chunk-65FUIWXL.js";
8
+ } from "../../../../chunk-2Q4FGVFI.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-DHZ7AZKP.js";
11
11
 
@@ -6,7 +6,7 @@ import {
6
6
  EBs,
7
7
  SBs,
8
8
  zEs
9
- } from "../../../../chunk-65FUIWXL.js";
9
+ } from "../../../../chunk-2Q4FGVFI.js";
10
10
  import "../../../../chunk-IAWYWZSL.js";
11
11
  import "../../../../chunk-DHZ7AZKP.js";
12
12
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -5,7 +5,7 @@
5
5
  "preview": "vike preview"
6
6
  },
7
7
  "dependencies": {
8
- "vike": "^0.4.245"
8
+ "vike": "^0.4.246"
9
9
  },
10
10
  "devDependencies": {
11
11
  "typescript": "^5.9.3",
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "strict": true,
4
4
  "target": "ES2022",
5
- "module": "ESNext",
5
+ "module": "ES2022",
6
6
  "moduleResolution": "Bundler",
7
7
  "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
8
  "types": ["vite/client"],
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  WEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -52,10 +52,10 @@ var require_package = __commonJS({
52
52
  license: "MIT",
53
53
  devDependencies: {
54
54
  "@batijs/compile": "workspace:*",
55
- "@cloudflare/workers-types": "^4.20251109.0",
56
- "@types/node": "^20.19.21",
55
+ "@cloudflare/workers-types": "^4.20251111.0",
56
+ "@types/node": "^20.19.24",
57
57
  "@universal-middleware/core": "^0.4.13",
58
- vike: "^0.4.245",
58
+ vike: "^0.4.246",
59
59
  vite: "^7.2.2"
60
60
  },
61
61
  files: [
@@ -9,20 +9,21 @@ export type Data = Awaited<ReturnType<typeof data>>;
9
9
 
10
10
  export async function data(_pageContext: PageContextServer) {
11
11
  if (BATI.has("drizzle")) {
12
- const todo = await drizzleQueries.getAllTodos(_pageContext.db);
12
+ const todoItemsInitial = await drizzleQueries.getAllTodos(_pageContext.db);
13
13
 
14
- return { todo };
14
+ return { todoItemsInitial };
15
15
  } else if (BATI.has("sqlite") && !BATI.hasD1) {
16
- const todo = sqliteQueries.getAllTodos(_pageContext.db);
16
+ const todoItemsInitial = sqliteQueries.getAllTodos(_pageContext.db);
17
17
 
18
- return { todo };
18
+ return { todoItemsInitial };
19
19
  } else if (BATI.hasD1) {
20
- const todo = await d1Queries.getAllTodos(_pageContext.db);
20
+ const todoItemsInitial = await d1Queries.getAllTodos(_pageContext.db);
21
21
 
22
- return { todo };
22
+ return { todoItemsInitial };
23
23
  } else {
24
- // NOTE: This to-do list is only for demonstration — it doesnt save your changes.
25
- // Go to https://vike.dev/new and select a Database tool for an example of how to persist the to-do list.
26
- return { todo: [{ text: "Buy milk" }, { text: "Buy strawberries" }] };
24
+ // NOTE: This +data hook is only for demonstration — it doesn't actually retrieve data from a database.
25
+ // Go to https://vike.dev/new and select a database to scaffold an app with a persisted to-do list.
26
+ const todoItemsInitial = [{ text: "Buy milk" }, { text: "Buy strawberries" }];
27
+ return { todoItemsInitial };
27
28
  }
28
29
  }
@@ -1,12 +1,5 @@
1
1
  import type { PageContextServer } from "vike/types";
2
2
  export type Data = Awaited<ReturnType<typeof data>>;
3
3
  export declare function data(_pageContext: PageContextServer): Promise<{
4
- todo: {
5
- id: number;
6
- text: string;
7
- }[];
8
- } | {
9
- todo: {
10
- text: string;
11
- }[];
4
+ todoItemsInitial: any;
12
5
  }>;
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
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-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -51,12 +51,12 @@ var require_package = __commonJS({
51
51
  license: "MIT",
52
52
  devDependencies: {
53
53
  "@batijs/compile": "workspace:*",
54
- "@types/node": "^20.19.21",
54
+ "@types/node": "^20.19.24",
55
55
  "solid-js": "^1.9.10",
56
56
  tailwindcss: "^4.1.17",
57
57
  typescript: "^5.9.3",
58
- vike: "^0.4.245",
59
- "vike-photon": "^0.1.14",
58
+ vike: "^0.4.246",
59
+ "vike-photon": "^0.1.16",
60
60
  "vike-solid": "^0.7.13",
61
61
  vite: "^7.2.2",
62
62
  "vite-plugin-solid": "^2.11.10"
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  YEs
7
- } from "../../../../chunk-65FUIWXL.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  JEs,
7
7
  Zti
8
- } from "../../../../chunk-65FUIWXL.js";
8
+ } from "../../../../chunk-2Q4FGVFI.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-DHZ7AZKP.js";
11
11
 
@@ -1,7 +1,4 @@
1
- import type { PageContextClient } from "vike/types";
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("Is backwards navigation?", pageContext.isBackwardNavigation);
5
+ console.log("pageContext.isBackwardNavigation", pageContext.isBackwardNavigation);
6
6
  document.body.classList.add("page-transition");
7
7
  }
@@ -2,7 +2,7 @@ import { useData } from "vike-solid/useData";
2
2
  import type { Data } from "./+data.js";
3
3
 
4
4
  export default function Page() {
5
- const movie = useData<Data>();
5
+ const { movie } = useData<Data>();
6
6
  return (
7
7
  <>
8
8
  <h1>{movie.title}</h1>
@@ -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
- const minimizedMovie = { id, title, release_date, director, producer };
31
- return minimizedMovie;
30
+ return { id, title, release_date, director, producer };
32
31
  }
@@ -3,7 +3,7 @@ import { useData } from "vike-solid/useData";
3
3
  import type { Data } from "./+data.js";
4
4
 
5
5
  export default function Page() {
6
- const movies = useData<Data>();
6
+ const { movies } = useData<Data>();
7
7
  return (
8
8
  <>
9
9
  <h1>Star Wars Movies</h1>
@@ -21,7 +21,7 @@ export async function data() {
21
21
  // minimize what is sent over the network.
22
22
  const movies = minimize(moviesData);
23
23
 
24
- return movies;
24
+ return { movies };
25
25
  }
26
26
 
27
27
  function minimize(movies: MovieDetails[]): Movie[] {
@@ -1,13 +1,10 @@
1
- import type { Data } from "@batijs/shared-todo/pages/todo/+data";
2
- import { useData } from "vike-solid/useData";
3
1
  import { TodoList } from "./TodoList.js";
4
2
 
5
3
  export default function Page() {
6
- const data = useData<Data>();
7
4
  return (
8
5
  <>
9
6
  <h1>To-do List</h1>
10
- <TodoList initialTodoItems={data.todo} />
7
+ <TodoList />
11
8
  </>
12
9
  );
13
10
  }