@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.
- 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 +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/photon/files/$package.json.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/tsconfig.json +1 -1
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -1
- 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 -1
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
- 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 +1 -1
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
- 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 +2 -13
- 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 +1 -1
- package/dist/{chunk-PSSZWHMN.js → chunk-2Q4FGVFI.js} +1 -1
- package/dist/index.js +2 -2
- package/package.json +5 -5
- package/dist/boilerplates/@batijs/vue/files/vue-shim.d.ts +0 -11
|
@@ -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
|
|
12
|
+
const todoItemsInitial = await drizzleQueries.getAllTodos(_pageContext.db);
|
|
13
13
|
|
|
14
|
-
return {
|
|
14
|
+
return { todoItemsInitial };
|
|
15
15
|
} else if (BATI.has("sqlite") && !BATI.hasD1) {
|
|
16
|
-
const
|
|
16
|
+
const todoItemsInitial = sqliteQueries.getAllTodos(_pageContext.db);
|
|
17
17
|
|
|
18
|
-
return {
|
|
18
|
+
return { todoItemsInitial };
|
|
19
19
|
} else if (BATI.hasD1) {
|
|
20
|
-
const
|
|
20
|
+
const todoItemsInitial = await d1Queries.getAllTodos(_pageContext.db);
|
|
21
21
|
|
|
22
|
-
return {
|
|
22
|
+
return { todoItemsInitial };
|
|
23
23
|
} else {
|
|
24
|
-
// NOTE: This
|
|
25
|
-
// Go to https://vike.dev/new and select a
|
|
26
|
-
|
|
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,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
|
}
|
|
@@ -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,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
|
|
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(
|
|
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
|
+
}>;
|
|
@@ -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
|
|
|
@@ -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-
|
|
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
|
}
|