@batijs/cli 0.0.505 → 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 (117) 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 +1 -1
  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 +1 -1
  7. package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
  8. package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
  9. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -1
  10. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  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 +1 -1
  14. package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
  15. package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
  16. package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
  17. package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
  18. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -1
  19. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
  20. package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
  21. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
  22. package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
  23. package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
  24. package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
  25. package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
  26. package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
  27. package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
  28. package/dist/boilerplates/@batijs/photon/files/$package.json.js +1 -1
  29. package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
  30. package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
  31. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
  32. package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
  33. package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
  34. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
  35. package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
  36. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
  37. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
  38. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
  39. package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionEnd.ts +1 -4
  40. package/dist/boilerplates/@batijs/react/files/pages/+onPageTransitionStart.ts +1 -1
  41. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+Page.tsx +1 -1
  42. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+data.ts +2 -3
  43. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+Page.tsx +1 -1
  44. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+data.ts +1 -1
  45. package/dist/boilerplates/@batijs/react/files/pages/todo/+Page.tsx +1 -4
  46. package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +21 -25
  47. package/dist/boilerplates/@batijs/react/types/pages/+onPageTransitionEnd.d.ts +1 -2
  48. package/dist/boilerplates/@batijs/react/types/pages/star-wars/@id/+data.d.ts +3 -1
  49. package/dist/boilerplates/@batijs/react/types/pages/star-wars/index/+data.d.ts +3 -1
  50. package/dist/boilerplates/@batijs/react/types/pages/todo/TodoList.d.ts +1 -5
  51. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -1
  52. package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
  53. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
  54. package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
  55. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -1
  56. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
  57. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
  58. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
  59. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -1
  60. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
  61. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
  62. package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
  63. package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
  64. package/dist/boilerplates/@batijs/shared/files/tsconfig.json +1 -1
  65. package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -1
  66. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +10 -9
  67. package/dist/boilerplates/@batijs/shared-todo/types/pages/todo/+data.d.ts +1 -1
  68. package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
  69. package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
  70. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
  71. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
  72. package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionEnd.ts +1 -4
  73. package/dist/boilerplates/@batijs/solid/files/pages/+onPageTransitionStart.ts +1 -1
  74. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+Page.tsx +1 -1
  75. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+data.ts +2 -3
  76. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+Page.tsx +1 -1
  77. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+data.ts +1 -1
  78. package/dist/boilerplates/@batijs/solid/files/pages/todo/+Page.tsx +1 -4
  79. package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +21 -25
  80. package/dist/boilerplates/@batijs/solid/types/pages/+onPageTransitionEnd.d.ts +1 -2
  81. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/@id/+data.d.ts +3 -1
  82. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/index/+data.d.ts +3 -1
  83. package/dist/boilerplates/@batijs/solid/types/pages/todo/TodoList.d.ts +1 -5
  84. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -1
  85. package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
  86. package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
  87. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -1
  88. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
  89. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
  90. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
  91. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
  92. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +3 -3
  93. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  94. package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
  95. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  96. package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
  97. package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
  98. package/dist/boilerplates/@batijs/vue/files/$package.json.js +2 -13
  99. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -3
  100. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +2 -10
  101. package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionEnd.ts +1 -4
  102. package/dist/boilerplates/@batijs/vue/files/pages/+onPageTransitionStart.ts +1 -1
  103. package/dist/boilerplates/@batijs/vue/files/pages/_error/+Page.vue +2 -2
  104. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+Page.vue +1 -1
  105. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+data.ts +2 -3
  106. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +2 -2
  107. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+data.ts +1 -1
  108. package/dist/boilerplates/@batijs/vue/files/pages/todo/+Page.vue +1 -5
  109. package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +35 -36
  110. package/dist/boilerplates/@batijs/vue/types/pages/+onPageTransitionEnd.d.ts +1 -2
  111. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/@id/+data.d.ts +3 -1
  112. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+data.d.ts +1 -1
  113. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -1
  114. package/dist/{chunk-PSSZWHMN.js → chunk-2Q4FGVFI.js} +1 -1
  115. package/dist/index.js +2 -2
  116. package/package.json +5 -5
  117. package/dist/boilerplates/@batijs/vue/files/vue-shim.d.ts +0 -11
@@ -7,7 +7,7 @@ import {
7
7
  PK,
8
8
  PR,
9
9
  Sme
10
- } from "../../../../../chunk-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.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
  YEs
7
- } from "../../../../chunk-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -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-PSSZWHMN.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -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,5 +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: any;
4
+ todoItemsInitial: any;
5
5
  }>;
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  zEs
7
- } from "../../../../chunk-PSSZWHMN.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-PSSZWHMN.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
  YEs
7
- } from "../../../../chunk-PSSZWHMN.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-PSSZWHMN.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
  }
@@ -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(props: { initialTodoItems: { text: string }[] }) {
7
- const [todoItems, setTodoItems] = createSignal(props.initialTodoItems);
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
- try {
23
- if (BATI.has("telefunc")) {
24
- await onNewTodo({ text: untrack(newTodo) });
25
- } else if (BATI.has("trpc")) {
26
- await trpc.onNewTodo.mutate(untrack(newTodo));
27
- } else if (BATI.has("ts-rest")) {
28
- await client.createTodo({ body: { text: untrack(newTodo) } });
29
- } else {
30
- const response = await fetch("/api/todo/create", {
31
- method: "POST",
32
- body: JSON.stringify({ text: untrack(newTodo) }),
33
- headers: {
34
- "Content-Type": "application/json",
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
- 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(props: {
2
- initialTodoItems: {
3
- text: string;
4
- }[];
5
- }): import("solid-js").JSX.Element;
1
+ export declare function TodoList(): import("solid-js").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-PSSZWHMN.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
  CBs
7
- } from "../../../../chunk-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.js";
8
+ } from "../../../../chunk-2Q4FGVFI.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-DHZ7AZKP.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  WEs
7
- } from "../../../../chunk-PSSZWHMN.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-PSSZWHMN.js";
8
+ } from "../../../../chunk-2Q4FGVFI.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-DHZ7AZKP.js";
11
11
 
@@ -1,4 +1,4 @@
1
- // We use Telefunc (https://telefunc.com) for data mutations. Being able to use Telefunc for fetching initial data is work-in-progress (https://vike.dev/data-fetching#tools).
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 to-do list isn't persisted, it's reset when the user navigates away.
20
- // Go to https://vike.dev/new and select a Database tool for an example of how to persist the to-do list.
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-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.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
  JEs
7
- } from "../../../../../chunk-PSSZWHMN.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-PSSZWHMN.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-PSSZWHMN.js";
7
+ } from "../../../../chunk-2Q4FGVFI.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-DHZ7AZKP.js";
10
10
 
@@ -54,11 +54,8 @@ var require_package = __commonJS({
54
54
  "@batijs/tailwindcss": "workspace:*",
55
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
- "unplugin-vue-markdown": "^29.2.0",
62
59
  vike: "^0.4.246",
63
60
  "vike-photon": "^0.1.16",
64
61
  "vike-vue": "^0.9.6",
@@ -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-PSSZWHMN.js";
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-PSSZWHMN.js";
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
- 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
  }
@@ -6,8 +6,8 @@
6
6
  <script lang="ts" setup>
7
7
  import { usePageContext } from "vike-vue/usePageContext";
8
8
 
9
- const ctx = usePageContext();
10
- let { is404, abortReason } = ctx;
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
  }
@@ -11,5 +11,5 @@
11
11
  import { useData } from "vike-vue/useData";
12
12
  import type { Data } from "./+data.js";
13
13
 
14
- const movie = useData<Data>();
14
+ const { movie } = useData<Data>();
15
15
  </script>