@batijs/cli 0.0.176 → 0.0.178

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 (92) hide show
  1. package/dist/boilerplates/@batijs/auth0/files/$.env.js +19 -0
  2. package/dist/boilerplates/@batijs/auth0/files/$README.md.js +43 -0
  3. package/dist/boilerplates/@batijs/auth0/files/vike.d.ts +11 -0
  4. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  5. package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +1 -1
  6. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
  7. package/dist/boilerplates/@batijs/express/files/$package.json.js +7 -3
  8. package/dist/boilerplates/@batijs/express/files/express-entry.ts +33 -11
  9. package/dist/boilerplates/@batijs/express/files/vike.d.ts +10 -0
  10. package/dist/boilerplates/@batijs/express/types/express-entry.d.ts +1 -1
  11. package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +1 -7
  12. package/dist/boilerplates/@batijs/firebase-auth/files/firebase/$service-account.json.js +20 -0
  13. package/dist/boilerplates/@batijs/firebase-auth/files/libs/firebaseAdmin.ts +6 -6
  14. package/dist/boilerplates/@batijs/firebase-auth/files/libs/firebaseUI.ts +26 -26
  15. package/dist/boilerplates/@batijs/firebase-auth/files/pages/+firebaseApp.ts +2 -1
  16. package/dist/boilerplates/@batijs/firebase-auth/files/pages/login/+guard.ts +5 -5
  17. package/dist/boilerplates/@batijs/firebase-auth/files/{types.ts → vike.d.ts} +0 -9
  18. package/dist/boilerplates/@batijs/firebase-auth/types/pages/login/+guard.d.ts +1 -1
  19. package/dist/boilerplates/@batijs/h3/files/$package.json.js +11 -3
  20. package/dist/boilerplates/@batijs/h3/files/h3-entry.ts +37 -16
  21. package/dist/boilerplates/@batijs/h3/files/vike.d.ts +22 -0
  22. package/dist/boilerplates/@batijs/h3/types/h3-entry.d.ts +1 -6
  23. package/dist/boilerplates/@batijs/hattip/files/$package.json.js +1 -1
  24. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
  25. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
  26. package/dist/boilerplates/@batijs/react/files/$package.json.js +2 -2
  27. package/dist/boilerplates/@batijs/react/files/layouts/LayoutDefault.tsx +1 -1
  28. package/dist/boilerplates/@batijs/react/files/pages/+config.ts +3 -3
  29. package/dist/boilerplates/@batijs/react/files/pages/_error/+Page.tsx +1 -1
  30. package/dist/boilerplates/@batijs/react/files/pages/index/+Page.tsx +1 -1
  31. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+Page.tsx +1 -1
  32. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+data.ts +1 -1
  33. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+title.ts +1 -1
  34. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+Page.tsx +1 -1
  35. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+data.ts +1 -1
  36. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+title.ts +1 -1
  37. package/dist/boilerplates/@batijs/react/types/pages/+config.d.ts +3 -3
  38. package/dist/boilerplates/@batijs/react/types/pages/star-wars/@id/+data.d.ts +1 -1
  39. package/dist/boilerplates/@batijs/react/types/pages/star-wars/@id/+title.d.ts +1 -1
  40. package/dist/boilerplates/@batijs/react/types/pages/star-wars/index/+data.d.ts +1 -1
  41. package/dist/boilerplates/@batijs/react/types/pages/star-wars/index/+title.d.ts +1 -1
  42. package/dist/boilerplates/@batijs/react-firebase-auth/files/pages/login/+Page.tsx +44 -44
  43. package/dist/boilerplates/@batijs/react-telefunc/files/pages/todo/+Page.tsx +2 -2
  44. package/dist/boilerplates/@batijs/react-telefunc/types/pages/todo/TodoList.d.ts +1 -1
  45. package/dist/boilerplates/@batijs/react-trpc/files/pages/todo-trpc/+Page.tsx +2 -2
  46. package/dist/boilerplates/@batijs/shared/files/tsconfig.json +2 -2
  47. package/dist/boilerplates/@batijs/solid/files/$package.json.js +3 -3
  48. package/dist/boilerplates/@batijs/solid/files/components/Link.tsx +1 -1
  49. package/dist/boilerplates/@batijs/solid/files/layouts/LayoutDefault.tsx +1 -1
  50. package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +3 -3
  51. package/dist/boilerplates/@batijs/solid/files/pages/index/+Page.tsx +1 -1
  52. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+Page.tsx +1 -1
  53. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+data.ts +1 -1
  54. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/@id/+title.ts +1 -1
  55. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+Page.tsx +1 -1
  56. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+data.ts +1 -1
  57. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+title.ts +1 -1
  58. package/dist/boilerplates/@batijs/solid/types/pages/+config.d.ts +2 -2
  59. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/@id/+data.d.ts +1 -1
  60. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/@id/+title.d.ts +1 -1
  61. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/index/+data.d.ts +1 -1
  62. package/dist/boilerplates/@batijs/solid/types/pages/star-wars/index/+title.d.ts +1 -1
  63. package/dist/boilerplates/@batijs/solid-firebase-auth/files/pages/login/+Page.tsx +43 -43
  64. package/dist/boilerplates/@batijs/solid-telefunc/files/pages/todo/+Page.tsx +1 -1
  65. package/dist/boilerplates/@batijs/solid-trpc/files/pages/todo-trpc/+Page.tsx +1 -1
  66. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +7 -2
  67. package/dist/boilerplates/@batijs/tailwindcss/files/postcss.config.js +1 -1
  68. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
  69. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  70. package/dist/boilerplates/@batijs/trpc/files/trpc/client.ts +1 -1
  71. package/dist/boilerplates/@batijs/trpc/files/trpc/vite-plugin.ts +1 -1
  72. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  73. package/dist/boilerplates/@batijs/vue/files/$package.json.js +4 -4
  74. package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -1
  75. package/dist/boilerplates/@batijs/vue/files/pages/index/+Page.vue +5 -11
  76. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+Page.vue +1 -1
  77. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+data.ts +1 -1
  78. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+title.ts +1 -1
  79. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +1 -1
  80. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+data.ts +1 -1
  81. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+title.ts +1 -1
  82. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/@id/+data.d.ts +1 -1
  83. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/@id/+title.d.ts +1 -1
  84. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+data.d.ts +1 -1
  85. package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+title.d.ts +1 -1
  86. package/dist/boilerplates/@batijs/vue-telefunc/files/pages/todo/+Page.vue +1 -1
  87. package/dist/boilerplates/@batijs/vue-trpc/files/pages/todo-trpc/+Page.vue +1 -1
  88. package/dist/boilerplates/boilerplates.json +11 -0
  89. package/dist/index.js +257 -217
  90. package/package.json +5 -5
  91. package/dist/boilerplates/@batijs/firebase-auth/files/firebase/service-account-example.json +0 -13
  92. package/dist/boilerplates/@batijs/firebase-auth/types/types.d.ts +0 -18
@@ -181,11 +181,11 @@ import { addDependency, loadAsJson } from "@batijs/core";
181
181
  async function getPackageJson(props) {
182
182
  const packageJson = await loadAsJson(props);
183
183
  if (props.meta.BATI.has("eslint")) {
184
- addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
184
+ addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
185
185
  devDependencies: ["eslint-plugin-react"]
186
186
  });
187
187
  }
188
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
188
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
189
189
  devDependencies: ["vite", "@types/react", "@types/react-dom"],
190
190
  dependencies: ["@vitejs/plugin-react", "cross-fetch", "react", "react-dom", "vike", "vike-react"]
191
191
  });
@@ -3,7 +3,7 @@ import "./style.css";
3
3
  import "./tailwind.css";
4
4
  import React from "react";
5
5
  import logoUrl from "../assets/logo.svg";
6
- import { Link } from "../components/Link";
6
+ import { Link } from "../components/Link.js";
7
7
 
8
8
  export default function LayoutDefault({ children }: { children: React.ReactNode }) {
9
9
  return (
@@ -1,13 +1,13 @@
1
1
  import vikeReact from "vike-react/config";
2
2
  import type { Config } from "vike/types";
3
- import Head from "../layouts/HeadDefault";
4
- import Layout from "../layouts/LayoutDefault";
3
+ import Head from "../layouts/HeadDefault.js";
4
+ import Layout from "../layouts/LayoutDefault.js";
5
5
 
6
6
  // Default config (can be overridden by pages)
7
7
  export default {
8
8
  Layout,
9
9
  Head,
10
- /*{ @if (it.BATI.has("firebase-auth")) }*/
10
+ /*{ @if (it.BATI.has("auth0") || it.BATI.has("firebase-auth")) }*/
11
11
  passToClient: ["user"],
12
12
  /*{ /if }*/
13
13
  // <title>
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { usePageContext } from 'vike-react/usePageContext';
2
+ import { usePageContext } from "vike-react/usePageContext";
3
3
 
4
4
  export default function Page() {
5
5
  const { is404 } = usePageContext();
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Counter } from "./Counter";
2
+ import { Counter } from "./Counter.js";
3
3
 
4
4
  export default function Page() {
5
5
  return (
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useData } from "vike-react/useData";
3
- import type { Data } from "./+data";
3
+ import type { Data } from "./+data.js";
4
4
 
5
5
  export default function Page() {
6
6
  const movie = useData<Data>();
@@ -2,7 +2,7 @@
2
2
 
3
3
  import fetch from "cross-fetch";
4
4
  import type { PageContextServer } from "vike/types";
5
- import type { MovieDetails } from "../types";
5
+ import type { MovieDetails } from "../types.js";
6
6
 
7
7
  export type Data = Awaited<ReturnType<typeof data>>;
8
8
 
@@ -1,5 +1,5 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
 
4
4
  export function title(pageContext: PageContext<Data>) {
5
5
  const movie = pageContext.data;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useData } from "vike-react/useData";
3
- import type { Data } from "./+data";
3
+ import type { Data } from "./+data.js";
4
4
 
5
5
  export default function Page() {
6
6
  const movies = useData<Data>();
@@ -1,7 +1,7 @@
1
1
  // https://vike.dev/data
2
2
 
3
3
  import fetch from "cross-fetch";
4
- import type { Movie, MovieDetails } from "../types";
4
+ import type { Movie, MovieDetails } from "../types.js";
5
5
 
6
6
  export type Data = Awaited<ReturnType<typeof data>>;
7
7
 
@@ -1,5 +1,5 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
 
4
4
  export function title(pageContext: PageContext<Data>) {
5
5
  const movies = pageContext.data;
@@ -1,5 +1,5 @@
1
- import Head from "../layouts/HeadDefault";
2
- import Layout from "../layouts/LayoutDefault";
1
+ import Head from "../layouts/HeadDefault.js";
2
+ import Layout from "../layouts/LayoutDefault.js";
3
3
  declare const _default: {
4
4
  Layout: typeof Layout;
5
5
  Head: typeof Head;
@@ -46,7 +46,7 @@ declare const _default: {
46
46
  env: {
47
47
  config: true;
48
48
  };
49
- effect: typeof import("vike-react/dist/renderer/ssrEffect").ssrEffect;
49
+ effect: typeof import("node_modules/vike-react/dist/renderer/ssrEffect.js").ssrEffect;
50
50
  };
51
51
  stream: {
52
52
  env: {
@@ -1,4 +1,4 @@
1
1
  import type { PageContextServer } from "vike/types";
2
- import type { MovieDetails } from "../types";
2
+ import type { MovieDetails } from "../types.js";
3
3
  export type Data = Awaited<ReturnType<typeof data>>;
4
4
  export declare const data: (pageContext: PageContextServer) => Promise<MovieDetails>;
@@ -1,3 +1,3 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
  export declare function title(pageContext: PageContext<Data>): string;
@@ -1,3 +1,3 @@
1
- import type { Movie } from "../types";
1
+ import type { Movie } from "../types.js";
2
2
  export type Data = Awaited<ReturnType<typeof data>>;
3
3
  export declare const data: () => Promise<Movie[]>;
@@ -1,3 +1,3 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
  export declare function title(pageContext: PageContext<Data>): string;
@@ -1,52 +1,52 @@
1
- import "firebaseui/dist/firebaseui.css"
2
- import React, { useEffect, useState } from 'react'
3
- import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI"
4
- import * as firebaseui from "firebaseui"
5
- import { getAuth, type UserCredential } from 'firebase/auth'
6
- import { reload } from "vike/client/router"
1
+ import "firebaseui/dist/firebaseui.css";
2
+ import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI";
3
+ import { getAuth, type UserCredential } from "firebase/auth";
4
+ import * as firebaseui from "firebaseui";
5
+ import React, { useEffect, useState } from "react";
6
+ import { reload } from "vike/client/router";
7
7
 
8
- export default Page
8
+ export default Page;
9
9
 
10
10
  function Page() {
11
- const [error, setError] = useState("")
11
+ const [error, setError] = useState("");
12
12
 
13
- async function sessionLogin(authResult: UserCredential) {
14
- const idToken = await authResult.user.getIdToken() || ""
15
- try {
16
- const response = await fetch("/api/sessionLogin", {
17
- method: "POST",
18
- body: JSON.stringify({ idToken }),
19
- headers: {
20
- "Content-Type": "application/json",
21
- },
22
- })
23
- if (response.ok) {
24
- await reload()
25
- } else {
26
- setError(response.statusText)
27
- }
28
- await getAuth().signOut()
29
- } catch (err) {
30
- console.log('error :', err)
31
- }
13
+ async function sessionLogin(authResult: UserCredential) {
14
+ const idToken = (await authResult.user.getIdToken()) || "";
15
+ try {
16
+ const response = await fetch("/api/sessionLogin", {
17
+ method: "POST",
18
+ body: JSON.stringify({ idToken }),
19
+ headers: {
20
+ "Content-Type": "application/json",
21
+ },
22
+ });
23
+ if (response.ok) {
24
+ await reload();
25
+ } else {
26
+ setError(response.statusText);
27
+ }
28
+ await getAuth().signOut();
29
+ } catch (err) {
30
+ console.log("error :", err);
32
31
  }
33
-
34
- useEffect(() => {
35
- const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth())
36
- if (!error) {
37
- startFirebaseUI(ui, sessionLogin)
38
- }
39
- }, [error])
32
+ }
40
33
 
41
- return (
34
+ useEffect(() => {
35
+ const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth());
36
+ if (!error) {
37
+ startFirebaseUI(ui, sessionLogin);
38
+ }
39
+ }, [error]);
40
+
41
+ return (
42
+ <>
43
+ <div id="firebaseui-auth-container"></div>
44
+ {error && (
42
45
  <>
43
- <div id="firebaseui-auth-container"></div>
44
- {error && (
45
- <>
46
- <div style={{ color: "red" }}>There is an error occured : {error}</div>
47
- <button onClick={() => setError("")}>Try Again</button>
48
- </>
49
- )}
46
+ <div style={{ color: "red" }}>There is an error occured : {error}</div>
47
+ <button onClick={() => setError("")}>Try Again</button>
50
48
  </>
51
- )
52
- }
49
+ )}
50
+ </>
51
+ );
52
+ }
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { useData } from "vike-react/useData";
3
- import type { Data } from "./+data";
4
- import { TodoList } from "./TodoList";
3
+ import type { Data } from "./+data.js";
4
+ import { TodoList } from "./TodoList.js";
5
5
 
6
6
  export default function Page() {
7
7
  const todoItemsInitial = useData<Data>();
@@ -1,4 +1,4 @@
1
1
  import type { TodoItem } from "@batijs/shared-db/database/todoItems";
2
2
  export declare function TodoList({ todoItemsInitial }: {
3
3
  todoItemsInitial: TodoItem[];
4
- }): import("react/jsx-runtime.js").JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { useData } from "vike-react/useData";
3
- import type { Data } from "./+data";
4
- import { TodoList } from "./TodoList";
3
+ import type { Data } from "./+data.js";
4
+ import { TodoList } from "./TodoList.js";
5
5
 
6
6
  export default function Page() {
7
7
  const todoItemsInitial = useData<Data>();
@@ -10,8 +10,8 @@
10
10
  "sourceMap": true,
11
11
  "module": "ESNext",
12
12
  "noEmit": true,
13
- "moduleResolution": "node",
14
- "target": "ES2020",
13
+ "moduleResolution": "Bundler",
14
+ "target": "ES2021",
15
15
  "lib": ["DOM", "DOM.Iterable", "ESNext"],
16
16
  "types": ["vite/client"]
17
17
  },
@@ -49,7 +49,7 @@ var require_package = __commonJS({
49
49
  tailwindcss: "^3.4.3",
50
50
  typescript: "^5.4.5",
51
51
  vike: "^0.4.168",
52
- "vike-solid": "^0.4.3",
52
+ "vike-solid": "^0.4.5",
53
53
  vite: "^5.2.8",
54
54
  "vite-plugin-solid": "^2.10.2"
55
55
  },
@@ -175,11 +175,11 @@ import { addDependency, loadAsJson } from "@batijs/core";
175
175
  async function getPackageJson(props) {
176
176
  const packageJson = await loadAsJson(props);
177
177
  if (props.meta.BATI.has("eslint")) {
178
- addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
178
+ addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
179
179
  devDependencies: ["eslint-plugin-solid"]
180
180
  });
181
181
  }
182
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
182
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
183
183
  devDependencies: ["vite"],
184
184
  dependencies: ["cross-fetch", "solid-js", "vike-solid", "vike"]
185
185
  });
@@ -4,7 +4,7 @@ import { usePageContext } from "vike-solid/usePageContext";
4
4
  export function Link(props: { href: string; children: string }) {
5
5
  const pageContext = usePageContext();
6
6
  const isActive = createMemo(() =>
7
- props.href === "/" ? pageContext.urlPathname === props.href : pageContext.urlPathname.startsWith(props.href)
7
+ props.href === "/" ? pageContext.urlPathname === props.href : pageContext.urlPathname.startsWith(props.href),
8
8
  );
9
9
  return (
10
10
  <a href={props.href} class={isActive() ? "is-active" : undefined}>
@@ -3,7 +3,7 @@ import "./style.css";
3
3
  import "./tailwind.css";
4
4
  import type { JSX } from "solid-js";
5
5
  import logoUrl from "../assets/logo.svg";
6
- import { Link } from "../components/Link";
6
+ import { Link } from "../components/Link.js";
7
7
 
8
8
  export default function LayoutDefault(props: { children?: JSX.Element }) {
9
9
  return (
@@ -1,14 +1,14 @@
1
1
  import vikeSolid from "vike-solid/config";
2
2
  import type { Config } from "vike/types";
3
- import Head from "../layouts/HeadDefault";
4
- import Layout from "../layouts/LayoutDefault";
3
+ import Head from "../layouts/HeadDefault.js";
4
+ import Layout from "../layouts/LayoutDefault.js";
5
5
 
6
6
  // Default config (can be overridden by pages)
7
7
  export default {
8
8
  Layout,
9
9
  Head,
10
10
  // <title>
11
- /*{ @if (it.BATI.has("firebase-auth")) }*/
11
+ /*{ @if (it.BATI.has("auth0") || it.BATI.has("firebase-auth")) }*/
12
12
  passToClient: ["user"],
13
13
  /*{ /if }*/
14
14
  title: "My Vike App",
@@ -1,4 +1,4 @@
1
- import { Counter } from "./Counter";
1
+ import { Counter } from "./Counter.js";
2
2
 
3
3
  export default function Page() {
4
4
  return (
@@ -1,5 +1,5 @@
1
1
  import { useData } from "vike-solid/useData";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
 
4
4
  export default function Page() {
5
5
  const movie = useData<Data>();
@@ -2,7 +2,7 @@
2
2
 
3
3
  import fetch from "cross-fetch";
4
4
  import type { PageContextServer } from "vike/types";
5
- import type { MovieDetails } from "../types";
5
+ import type { MovieDetails } from "../types.js";
6
6
 
7
7
  export type Data = Awaited<ReturnType<typeof data>>;
8
8
 
@@ -1,5 +1,5 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
 
4
4
  export function title(pageContext: PageContext<Data>) {
5
5
  const movie = pageContext.data;
@@ -1,6 +1,6 @@
1
1
  import { For } from "solid-js";
2
2
  import { useData } from "vike-solid/useData";
3
- import type { Data } from "./+data";
3
+ import type { Data } from "./+data.js";
4
4
 
5
5
  export default function Page() {
6
6
  const movies = useData<Data>();
@@ -1,7 +1,7 @@
1
1
  // https://vike.dev/data
2
2
 
3
3
  import fetch from "cross-fetch";
4
- import type { Movie, MovieDetails } from "../types";
4
+ import type { Movie, MovieDetails } from "../types.js";
5
5
 
6
6
  export type Data = Awaited<ReturnType<typeof data>>;
7
7
 
@@ -1,5 +1,5 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
 
4
4
  export function title(pageContext: PageContext<Data>) {
5
5
  const movies = pageContext.data;
@@ -1,6 +1,6 @@
1
1
  import vikeSolid from "vike-solid/config";
2
- import Head from "../layouts/HeadDefault";
3
- import Layout from "../layouts/LayoutDefault";
2
+ import Head from "../layouts/HeadDefault.js";
3
+ import Layout from "../layouts/LayoutDefault.js";
4
4
  declare const _default: {
5
5
  Layout: typeof Layout;
6
6
  Head: typeof Head;
@@ -1,4 +1,4 @@
1
1
  import type { PageContextServer } from "vike/types";
2
- import type { MovieDetails } from "../types";
2
+ import type { MovieDetails } from "../types.js";
3
3
  export type Data = Awaited<ReturnType<typeof data>>;
4
4
  export declare const data: (pageContext: PageContextServer) => Promise<MovieDetails>;
@@ -1,3 +1,3 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
  export declare function title(pageContext: PageContext<Data>): string;
@@ -1,3 +1,3 @@
1
- import type { Movie } from "../types";
1
+ import type { Movie } from "../types.js";
2
2
  export type Data = Awaited<ReturnType<typeof data>>;
3
3
  export declare const data: () => Promise<Movie[]>;
@@ -1,3 +1,3 @@
1
1
  import type { PageContext } from "vike/types";
2
- import type { Data } from "./+data";
2
+ import type { Data } from "./+data.js";
3
3
  export declare function title(pageContext: PageContext<Data>): string;
@@ -1,52 +1,52 @@
1
- import "firebaseui/dist/firebaseui.css"
2
- import { createEffect, createSignal } from "solid-js"
3
- import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI"
4
- import * as firebaseui from "firebaseui"
5
- import { getAuth, type UserCredential } from 'firebase/auth'
6
- import { reload } from "vike/client/router"
1
+ import "firebaseui/dist/firebaseui.css";
2
+ import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI";
3
+ import { getAuth, type UserCredential } from "firebase/auth";
4
+ import * as firebaseui from "firebaseui";
5
+ import { createEffect, createSignal } from "solid-js";
6
+ import { reload } from "vike/client/router";
7
7
 
8
- export default Page
8
+ export default Page;
9
9
 
10
10
  function Page() {
11
- const [error, setError] = createSignal("")
11
+ const [error, setError] = createSignal("");
12
12
 
13
- async function sessionLogin(authResult: UserCredential) {
14
- const idToken = await authResult.user.getIdToken() || ""
15
- try {
16
- const response = await fetch("/api/sessionLogin", {
17
- method: "POST",
18
- body: JSON.stringify({ idToken }),
19
- headers: {
20
- "Content-Type": "application/json",
21
- },
22
- })
23
- if (response.ok) {
24
- await reload()
25
- } else {
26
- setError(response.statusText)
27
- }
28
- await getAuth().signOut()
29
- } catch (err) {
30
- console.log('error :', err)
31
- }
13
+ async function sessionLogin(authResult: UserCredential) {
14
+ const idToken = (await authResult.user.getIdToken()) || "";
15
+ try {
16
+ const response = await fetch("/api/sessionLogin", {
17
+ method: "POST",
18
+ body: JSON.stringify({ idToken }),
19
+ headers: {
20
+ "Content-Type": "application/json",
21
+ },
22
+ });
23
+ if (response.ok) {
24
+ await reload();
25
+ } else {
26
+ setError(response.statusText);
27
+ }
28
+ await getAuth().signOut();
29
+ } catch (err) {
30
+ console.log("error :", err);
32
31
  }
32
+ }
33
33
 
34
- createEffect(() => {
35
- const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth())
36
- if (!error()) {
37
- startFirebaseUI(ui, sessionLogin)
38
- }
39
- })
34
+ createEffect(() => {
35
+ const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth());
36
+ if (!error()) {
37
+ startFirebaseUI(ui, sessionLogin);
38
+ }
39
+ });
40
40
 
41
- return (
41
+ return (
42
+ <>
43
+ <div id="firebaseui-auth-container" />
44
+ {error() && (
42
45
  <>
43
- <div id="firebaseui-auth-container" />
44
- {error() && (
45
- <>
46
- <div style={{ color: "red" }}>There is an error occured : {error()}</div>
47
- <button onClick={() => setError("")}>Try Again</button>
48
- </>
49
- )}
46
+ <div style={{ color: "red" }}>There is an error occured : {error()}</div>
47
+ <button onClick={() => setError("")}>Try Again</button>
50
48
  </>
51
- )
52
- }
49
+ )}
50
+ </>
51
+ );
52
+ }
@@ -1,6 +1,6 @@
1
1
  import type { TodoItem } from "@batijs/shared-db/database/todoItems";
2
2
  import { createSignal } from "solid-js";
3
- import { TodoList } from "./TodoList";
3
+ import { TodoList } from "./TodoList.js";
4
4
 
5
5
  export default function Page(props: { initialTodoItems: TodoItem[] }) {
6
6
  return (
@@ -1,6 +1,6 @@
1
1
  import type { TodoItem } from "@batijs/shared-db/database/todoItems";
2
2
  import { createSignal } from "solid-js";
3
- import { TodoList } from "./TodoList";
3
+ import { TodoList } from "./TodoList.js";
4
4
 
5
5
  export default function Page(props: { initialTodoItems: TodoItem[] }) {
6
6
  return (
@@ -87,8 +87,13 @@ var require_package = __commonJS({
87
87
  import { addDependency, loadAsJson } from "@batijs/core";
88
88
  async function getPackageJson(props) {
89
89
  const packageJson = await loadAsJson(props);
90
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
91
- devDependencies: ["tailwindcss", "postcss", "autoprefixer", ...props.meta.BATI.has("daisyui") ? ["daisyui"] : []]
90
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
91
+ devDependencies: [
92
+ "tailwindcss",
93
+ "postcss",
94
+ "autoprefixer",
95
+ ...props.meta.BATI.has("daisyui") ? ["daisyui"] : []
96
+ ]
92
97
  });
93
98
  }
94
99
  export {
@@ -3,4 +3,4 @@ export default {
3
3
  tailwindcss: {},
4
4
  autoprefixer: {},
5
5
  },
6
- }
6
+ };
@@ -66,7 +66,7 @@ var require_package = __commonJS({
66
66
  import { addDependency, loadAsJson } from "@batijs/core";
67
67
  async function getPackageJson(props) {
68
68
  const packageJson = await loadAsJson(props);
69
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
69
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
70
70
  dependencies: ["telefunc"]
71
71
  });
72
72
  }
@@ -91,7 +91,7 @@ var require_package = __commonJS({
91
91
  import { addDependency, loadAsJson } from "@batijs/core";
92
92
  async function getPackageJson(props) {
93
93
  const packageJson = await loadAsJson(props);
94
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)), {
94
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
95
95
  dependencies: ["@trpc/server", "@trpc/client"]
96
96
  });
97
97
  }
@@ -1,5 +1,5 @@
1
1
  import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
2
- import type { AppRouter } from "./server";
2
+ import type { AppRouter } from "./server.js";
3
3
 
4
4
  export const trpc = createTRPCProxyClient<AppRouter>({
5
5
  links: [