@batijs/cli 0.0.87 → 0.0.90

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 (84) hide show
  1. package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +3 -3
  2. package/dist/boilerplates/@batijs/edgedb/{package-HMOHSPQH.js → package-GNDOJELP.js} +4 -4
  3. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +17 -0
  4. package/dist/boilerplates/@batijs/eslint/files/.eslintignore +7 -0
  5. package/dist/boilerplates/@batijs/eslint/files/.eslintrc.json +10 -0
  6. package/dist/boilerplates/@batijs/eslint/package-5LDRGH5F.js +61 -0
  7. package/dist/boilerplates/@batijs/express/files/$package.json.js +4 -4
  8. package/dist/boilerplates/@batijs/express/files/express-entry.ts +11 -11
  9. package/dist/boilerplates/@batijs/express/{package-LVAF3GMH.js → package-RZJTUW3J.js} +4 -4
  10. package/dist/boilerplates/@batijs/h3/files/$package.json.js +4 -4
  11. package/dist/boilerplates/@batijs/h3/files/h3-entry.ts +2 -2
  12. package/dist/boilerplates/@batijs/h3/{package-OCNH7HWJ.js → package-BKHMKPRT.js} +4 -4
  13. package/dist/boilerplates/@batijs/hattip/files/$package.json.js +4 -4
  14. package/dist/boilerplates/@batijs/hattip/files/$vite.config.ts.js +2 -2
  15. package/dist/boilerplates/@batijs/hattip/files/hattip-entry.ts +4 -4
  16. package/dist/boilerplates/@batijs/hattip/{package-FDRQH742.js → package-OYV3342B.js} +4 -4
  17. package/dist/boilerplates/@batijs/prisma/files/$.env.js +2 -2
  18. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +3 -3
  19. package/dist/boilerplates/@batijs/prisma/{package-JX35CIXF.js → package-ODDEEC2P.js} +4 -4
  20. package/dist/boilerplates/@batijs/react/files/$.eslintrc.json.js +16 -0
  21. package/dist/boilerplates/@batijs/react/files/$package.json.js +8 -3
  22. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +2 -2
  23. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +3 -3
  24. package/dist/boilerplates/@batijs/react/files/components/Link.tsx +8 -10
  25. package/dist/boilerplates/@batijs/react/files/layouts/HeadDefault.tsx +1 -1
  26. package/dist/boilerplates/@batijs/react/files/layouts/LayoutDefault.tsx +11 -11
  27. package/dist/boilerplates/@batijs/react/files/pages/_error/+Page.tsx +1 -3
  28. package/dist/boilerplates/@batijs/react/files/pages/index/+Page.tsx +1 -1
  29. package/dist/boilerplates/@batijs/react/files/pages/index/Counter.tsx +2 -4
  30. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+Page.tsx +1 -3
  31. package/dist/boilerplates/@batijs/react/files/pages/star-wars/@id/+onBeforeRender.ts +2 -4
  32. package/dist/boilerplates/@batijs/react/files/pages/star-wars/filterMovieData.ts +1 -5
  33. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+Page.tsx +1 -3
  34. package/dist/boilerplates/@batijs/react/files/pages/star-wars/index/+onBeforeRender.ts +2 -5
  35. package/dist/boilerplates/@batijs/react/{package-5YB3UKUO.js → package-EPEDDI5A.js} +10 -6
  36. package/dist/boilerplates/@batijs/react-telefunc/files/database/todoItems.ts +2 -5
  37. package/dist/boilerplates/@batijs/react-telefunc/files/pages/todo/+config.h.ts +3 -1
  38. package/dist/boilerplates/@batijs/react-telefunc/files/pages/todo/+onBeforeRender.ts +1 -3
  39. package/dist/boilerplates/@batijs/react-telefunc/files/pages/todo/TodoList.telefunc.ts +2 -4
  40. package/dist/boilerplates/@batijs/shared/files/$index.html.js +188 -2
  41. package/dist/boilerplates/@batijs/solid/files/$.eslintrc.json.js +13 -0
  42. package/dist/boilerplates/@batijs/solid/files/$package.json.js +8 -3
  43. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +2 -2
  44. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +3 -3
  45. package/dist/boilerplates/@batijs/solid/files/layouts/HeadDefault.tsx +2 -2
  46. package/dist/boilerplates/@batijs/solid/files/layouts/LayoutDefault.tsx +11 -11
  47. package/dist/boilerplates/@batijs/solid/files/pages/_error/+Page.tsx +17 -16
  48. package/dist/boilerplates/@batijs/solid/files/pages/index/+Page.tsx +1 -1
  49. package/dist/boilerplates/@batijs/solid/files/pages/index/Counter.tsx +1 -1
  50. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+Page.tsx +1 -1
  51. package/dist/boilerplates/@batijs/solid/files/pages/star-wars/index/+onBeforeRender.ts +3 -2
  52. package/dist/boilerplates/@batijs/solid/{package-BLWCB4NH.js → package-GTL3FIFH.js} +7 -6
  53. package/dist/boilerplates/@batijs/solid-telefunc/files/pages/todo/+Page.tsx +3 -4
  54. package/dist/boilerplates/@batijs/solid-telefunc/files/pages/todo/+onBeforeRender.ts +2 -2
  55. package/dist/boilerplates/@batijs/solid-telefunc/files/pages/todo/TodoList.tsx +3 -4
  56. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +3 -3
  57. package/dist/boilerplates/@batijs/tailwindcss/{package-34V34OFJ.js → package-2PEXROGS.js} +4 -4
  58. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +3 -3
  59. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +2 -2
  60. package/dist/boilerplates/@batijs/telefunc/{package-LPS6TFJV.js → package-YBU74HVR.js} +4 -4
  61. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +3 -3
  62. package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +2 -2
  63. package/dist/boilerplates/@batijs/vercel/{package-EAL6NF5P.js → package-75BTKTCC.js} +4 -4
  64. package/dist/boilerplates/@batijs/vue/files/$.eslintrc.json.js +16 -0
  65. package/dist/boilerplates/@batijs/vue/files/$package.json.js +15 -4
  66. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +2 -2
  67. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +2 -2
  68. package/dist/boilerplates/@batijs/vue/files/components/Content.vue +1 -1
  69. package/dist/boilerplates/@batijs/vue/files/components/Counter.vue +3 -3
  70. package/dist/boilerplates/@batijs/vue/files/components/Link.vue +13 -11
  71. package/dist/boilerplates/@batijs/vue/files/components/Logo.vue +6 -2
  72. package/dist/boilerplates/@batijs/vue/files/components/Sidebar.vue +1 -1
  73. package/dist/boilerplates/@batijs/vue/files/layouts/HeadDefault.vue +10 -3
  74. package/dist/boilerplates/@batijs/vue/files/layouts/LayoutDefault.vue +11 -5
  75. package/dist/boilerplates/@batijs/vue/files/pages/index/+Page.vue +1 -1
  76. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/@id/+Page.vue +8 -3
  77. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +10 -2
  78. package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+onBeforeRender.ts +3 -2
  79. package/dist/boilerplates/@batijs/vue/{package-HDC4A5UP.js → package-7JAOIAC3.js} +6 -5
  80. package/dist/boilerplates/@batijs/vue-telefunc/files/components/TodoList.vue +15 -4
  81. package/dist/boilerplates/@batijs/vue-telefunc/files/pages/todo/+Page.vue +3 -2
  82. package/dist/boilerplates/boilerplates.json +70 -80
  83. package/dist/index.js +901 -74
  84. package/package.json +6 -4
@@ -1,10 +1,10 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
- async function getPackageJson(currentContent) {
4
- const packageJson = await loadAsJson(currentContent);
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
5
  packageJson.scripts["edgedb:generate-queries"] = "@edgedb/generate queries";
6
6
  packageJson.scripts["edgedb:generate-edgeql-js"] = "@edgedb/generate edgeql-js";
7
- return addDependency(packageJson, await import("../package-HMOHSPQH.js"), {
7
+ return addDependency(packageJson, await import("../package-GNDOJELP.js"), {
8
8
  devDependencies: ["@edgedb/generate"],
9
9
  dependencies: ["edgedb"]
10
10
  });
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/edgedb";
3
3
  var private2 = true;
4
- var version = "0.0.87";
4
+ var version = "0.0.90";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -26,9 +26,9 @@ var files = [
26
26
  "dist/"
27
27
  ];
28
28
  var bati = {
29
- flag: "edgedb",
30
- name: "EdgeDB",
31
- homepage: "https://www.edgedb.com"
29
+ if: {
30
+ flag: "edgedb"
31
+ }
32
32
  };
33
33
  var package_default = {
34
34
  name,
@@ -0,0 +1,17 @@
1
+ // files/$package.json.ts
2
+ import { addDependency, loadAsJson, setScripts } from "@batijs/core";
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
+ setScripts(packageJson, {
6
+ lint: {
7
+ value: "eslint --ext .js,.jsx,.ts,.tsx .",
8
+ precedence: 0
9
+ }
10
+ });
11
+ return addDependency(packageJson, await import("../package-5LDRGH5F.js"), {
12
+ devDependencies: ["eslint", "@typescript-eslint/parser", "@typescript-eslint/eslint-plugin"]
13
+ });
14
+ }
15
+ export {
16
+ getPackageJson as default
17
+ };
@@ -0,0 +1,7 @@
1
+ # Build artifacts
2
+ dist/**
3
+
4
+ # JS files at the root of the project
5
+ *.js
6
+ *.cjs
7
+ *.mjs
@@ -0,0 +1,10 @@
1
+ {
2
+ "root": true,
3
+ "parser": "@typescript-eslint/parser",
4
+ "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
5
+ "plugins": ["@typescript-eslint"],
6
+ "parserOptions": {
7
+ "sourceType": "module",
8
+ "ecmaVersion": "latest"
9
+ }
10
+ }
@@ -0,0 +1,61 @@
1
+ // package.json
2
+ var name = "@batijs/eslint";
3
+ var private2 = true;
4
+ var version = "0.0.90";
5
+ var description = "";
6
+ var type = "module";
7
+ var keywords = [];
8
+ var author = "";
9
+ var license = "MIT";
10
+ var scripts = {
11
+ build: "tsup"
12
+ };
13
+ var devDependencies = {
14
+ "@batijs/tsup": "workspace:^",
15
+ "@typescript-eslint/eslint-plugin": "^6.7.3",
16
+ "@typescript-eslint/parser": "^6.7.3",
17
+ eslint: "^8.50.0",
18
+ tsup: "^7.2.0"
19
+ };
20
+ var dependencies = {
21
+ "@batijs/core": "workspace:*"
22
+ };
23
+ var files = [
24
+ "dist/"
25
+ ];
26
+ var bati = {
27
+ if: {
28
+ flag: "eslint"
29
+ }
30
+ };
31
+ var package_default = {
32
+ name,
33
+ private: private2,
34
+ version,
35
+ description,
36
+ type,
37
+ keywords,
38
+ author,
39
+ license,
40
+ scripts,
41
+ devDependencies,
42
+ dependencies,
43
+ files,
44
+ bati
45
+ };
46
+ export {
47
+ author,
48
+ bati,
49
+ package_default as default,
50
+ dependencies,
51
+ description,
52
+ devDependencies,
53
+ files,
54
+ keywords,
55
+ license,
56
+ name,
57
+ private2 as private,
58
+ scripts,
59
+ type,
60
+ version
61
+ };
@@ -1,7 +1,7 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson, setScripts } from "@batijs/core";
3
- async function getPackageJson(currentContent, meta) {
4
- const packageJson = await loadAsJson(currentContent);
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
5
  setScripts(packageJson, {
6
6
  dev: {
7
7
  value: "esno ./express-entry.ts",
@@ -18,7 +18,7 @@ async function getPackageJson(currentContent, meta) {
18
18
  precedence: 20
19
19
  }
20
20
  });
21
- return addDependency(packageJson, await import("../package-LVAF3GMH.js"), {
21
+ return addDependency(packageJson, await import("../package-RZJTUW3J.js"), {
22
22
  devDependencies: ["@types/express"],
23
23
  dependencies: [
24
24
  "@hattip/adapter-node",
@@ -26,7 +26,7 @@ async function getPackageJson(currentContent, meta) {
26
26
  "esno",
27
27
  "vite",
28
28
  "vike",
29
- ...meta.BATI_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
29
+ ...props.meta.BATI_MODULES?.includes("authjs") ? ["@auth/core", "vike-authjs"] : []
30
30
  ]
31
31
  });
32
32
  }
@@ -1,11 +1,11 @@
1
- import { renderPage } from "vike/server";
2
- import { telefunc } from "telefunc";
3
- import { VikeAuth } from "vike-authjs";
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
4
3
  import CredentialsProvider from "@auth/core/providers/credentials";
5
- import express from "express";
6
4
  import { createMiddleware } from "@hattip/adapter-node";
7
- import { fileURLToPath } from "node:url";
8
- import { dirname } from "node:path";
5
+ import express from "express";
6
+ import { telefunc } from "telefunc";
7
+ import { VikeAuth } from "vike-authjs";
8
+ import { renderPage } from "vike/server";
9
9
 
10
10
  const __filename = fileURLToPath(import.meta.url);
11
11
  const __dirname = dirname(__filename);
@@ -33,7 +33,7 @@ async function startServer() {
33
33
  app.use(viteDevMiddleware);
34
34
  }
35
35
 
36
- if (import.meta.BATI_MODULES?.includes("auth:authjs")) {
36
+ if (import.meta.BATI_MODULES?.includes("authjs")) {
37
37
  /**
38
38
  * AuthJS
39
39
  *
@@ -68,11 +68,11 @@ async function startServer() {
68
68
  "/api/auth/*",
69
69
  createMiddleware(Auth, {
70
70
  alwaysCallNext: false,
71
- })
71
+ }),
72
72
  );
73
73
  }
74
74
 
75
- if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
75
+ if (import.meta.BATI_MODULES?.includes("telefunc")) {
76
76
  /**
77
77
  * Telefunc route
78
78
  *
@@ -98,8 +98,8 @@ async function startServer() {
98
98
  },
99
99
  {
100
100
  alwaysCallNext: false,
101
- }
102
- )
101
+ },
102
+ ),
103
103
  );
104
104
  }
105
105
 
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/express";
3
3
  var private2 = true;
4
- var version = "0.0.87";
4
+ var version = "0.0.90";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -31,9 +31,9 @@ var files = [
31
31
  "dist/"
32
32
  ];
33
33
  var bati = {
34
- flag: "express",
35
- name: "Express",
36
- homepage: "https://expressjs.com"
34
+ if: {
35
+ flag: "express"
36
+ }
37
37
  };
38
38
  var package_default = {
39
39
  name,
@@ -1,7 +1,7 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson, setScripts } from "@batijs/core";
3
- async function getPackageJson(currentContent, meta) {
4
- const packageJson = await loadAsJson(currentContent);
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
5
  setScripts(packageJson, {
6
6
  dev: {
7
7
  value: "esno ./h3-entry.ts",
@@ -18,7 +18,7 @@ async function getPackageJson(currentContent, meta) {
18
18
  precedence: 20
19
19
  }
20
20
  });
21
- return addDependency(packageJson, await import("../package-OCNH7HWJ.js"), {
21
+ return addDependency(packageJson, await import("../package-BKHMKPRT.js"), {
22
22
  devDependencies: ["@types/serve-static"],
23
23
  dependencies: [
24
24
  "@hattip/polyfills",
@@ -27,7 +27,7 @@ async function getPackageJson(currentContent, meta) {
27
27
  "esno",
28
28
  "vike",
29
29
  "vite",
30
- ...meta.BATI_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
30
+ ...props.meta.BATI_MODULES?.includes("authjs") ? ["@auth/core", "vike-authjs"] : []
31
31
  ]
32
32
  });
33
33
  }
@@ -52,7 +52,7 @@ async function startServer() {
52
52
 
53
53
  const router = createRouter();
54
54
 
55
- if (import.meta.BATI_MODULES?.includes("auth:authjs")) {
55
+ if (import.meta.BATI_MODULES?.includes("authjs")) {
56
56
  /**
57
57
  * AuthJS
58
58
  *
@@ -93,7 +93,7 @@ async function startServer() {
93
93
  );
94
94
  }
95
95
 
96
- if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
96
+ if (import.meta.BATI_MODULES?.includes("telefunc")) {
97
97
  /**
98
98
  * Telefunc route
99
99
  *
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/h3";
3
3
  var private2 = true;
4
- var version = "0.0.87";
4
+ var version = "0.0.90";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -32,9 +32,9 @@ var files = [
32
32
  "dist/"
33
33
  ];
34
34
  var bati = {
35
- flag: "h3",
36
- name: "H3",
37
- homepage: "https://github.com/unjs/h3"
35
+ if: {
36
+ flag: "h3"
37
+ }
38
38
  };
39
39
  var package_default = {
40
40
  name,
@@ -1,7 +1,7 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson, setScripts } from "@batijs/core";
3
- async function getPackageJson(currentContent, meta) {
4
- const packageJson = await loadAsJson(currentContent);
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
5
  setScripts(packageJson, {
6
6
  dev: {
7
7
  value: "hattip serve ./hattip-entry.ts --client",
@@ -17,14 +17,14 @@ async function getPackageJson(currentContent, meta) {
17
17
  if (packageJson.scripts.preview) {
18
18
  delete packageJson.scripts.preview;
19
19
  }
20
- return addDependency(packageJson, await import("../package-FDRQH742.js"), {
20
+ return addDependency(packageJson, await import("../package-OYV3342B.js"), {
21
21
  devDependencies: ["@hattip/vite", "@hattip/adapter-node"],
22
22
  dependencies: [
23
23
  "@hattip/router",
24
24
  "hattip",
25
25
  "vite",
26
26
  "vike",
27
- ...meta.BATI_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
27
+ ...props.meta.BATI_MODULES?.includes("authjs") ? ["@auth/core", "vike-authjs"] : []
28
28
  ]
29
29
  });
30
30
  }
@@ -1,7 +1,7 @@
1
1
  // files/$vite.config.ts.ts
2
2
  import { addVitePlugin, loadAsMagicast } from "@batijs/core";
3
- async function getViteConfig(currentContent) {
4
- const mod = await loadAsMagicast(currentContent);
3
+ async function getViteConfig(props) {
4
+ const mod = await loadAsMagicast(props);
5
5
  addVitePlugin(mod, {
6
6
  from: "@hattip/vite",
7
7
  imported: "hattip",
@@ -1,12 +1,12 @@
1
+ import CredentialsProvider from "@auth/core/providers/credentials";
1
2
  import { createRouter } from "@hattip/router";
2
- import { renderPage } from "vike/server";
3
3
  import { telefunc } from "telefunc";
4
4
  import { VikeAuth } from "vike-authjs";
5
- import CredentialsProvider from "@auth/core/providers/credentials";
5
+ import { renderPage } from "vike/server";
6
6
 
7
7
  const router = createRouter();
8
8
 
9
- if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
9
+ if (import.meta.BATI_MODULES?.includes("telefunc")) {
10
10
  /**
11
11
  * Telefunc route
12
12
  *
@@ -29,7 +29,7 @@ if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
29
29
  });
30
30
  }
31
31
 
32
- if (import.meta.BATI_MODULES?.includes("auth:authjs")) {
32
+ if (import.meta.BATI_MODULES?.includes("authjs")) {
33
33
  /**
34
34
  * AuthJS
35
35
  *
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/hattip";
3
3
  var private2 = true;
4
- var version = "0.0.87";
4
+ var version = "0.0.90";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -31,9 +31,9 @@ var files = [
31
31
  "dist/"
32
32
  ];
33
33
  var bati = {
34
- flag: "hattip",
35
- name: "Hattip",
36
- homepage: "https://github.com/hattipjs/hattip"
34
+ if: {
35
+ flag: "hattip"
36
+ }
37
37
  };
38
38
  var package_default = {
39
39
  name,
@@ -1,7 +1,7 @@
1
1
  // files/$.env.ts
2
2
  import "@batijs/core";
3
- async function getEnv(currentContent) {
4
- let envContent = await currentContent?.() ?? "";
3
+ async function getEnv(props) {
4
+ let envContent = await props.readfile?.() ?? "";
5
5
  if (envContent.endsWith("\n\n")) {
6
6
  } else if (envContent.endsWith("\n")) {
7
7
  envContent = envContent + "\n";
@@ -1,10 +1,10 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
- async function getPackageJson(currentContent) {
4
- const packageJson = await loadAsJson(currentContent);
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
5
  packageJson.scripts["prisma:studio"] = "prisma studio";
6
6
  packageJson.scripts["prisma:generate"] = "prisma generate";
7
- return addDependency(packageJson, await import("../package-JX35CIXF.js"), {
7
+ return addDependency(packageJson, await import("../package-ODDEEC2P.js"), {
8
8
  devDependencies: ["prisma"],
9
9
  dependencies: ["@prisma/client"]
10
10
  });
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/prisma";
3
3
  var private2 = true;
4
- var version = "0.0.87";
4
+ var version = "0.0.90";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -25,9 +25,9 @@ var files = [
25
25
  "dist/"
26
26
  ];
27
27
  var bati = {
28
- flag: "prisma",
29
- name: "Prisma",
30
- homepage: "https://www.prisma.io"
28
+ if: {
29
+ flag: "prisma"
30
+ }
31
31
  };
32
32
  var package_default = {
33
33
  name,
@@ -0,0 +1,16 @@
1
+ // files/$.eslintrc.json.ts
2
+ import { loadAsJson } from "@batijs/core";
3
+ async function getEslintConfig(props) {
4
+ if (!props.meta.BATI_MODULES?.includes("eslint"))
5
+ return;
6
+ const eslintConfig = await loadAsJson(props);
7
+ eslintConfig.extends = eslintConfig.extends.filter(
8
+ (p) => p !== "eslint:recommended" && p !== "plugin:@typescript-eslint/recommended"
9
+ );
10
+ eslintConfig.extends.push("react-app");
11
+ eslintConfig.plugins = eslintConfig.plugins.filter((p) => p !== "@typescript-eslint");
12
+ return eslintConfig;
13
+ }
14
+ export {
15
+ getEslintConfig as default
16
+ };
@@ -1,8 +1,13 @@
1
1
  // files/$package.json.ts
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
- async function getPackageJson(currentContent) {
4
- const packageJson = await loadAsJson(currentContent);
5
- return addDependency(packageJson, await import("../package-5YB3UKUO.js"), {
3
+ async function getPackageJson(props) {
4
+ const packageJson = await loadAsJson(props);
5
+ if (props.meta.BATI_MODULES?.includes("eslint")) {
6
+ addDependency(packageJson, await import("../package-EPEDDI5A.js"), {
7
+ devDependencies: ["eslint-config-react-app"]
8
+ });
9
+ }
10
+ return addDependency(packageJson, await import("../package-EPEDDI5A.js"), {
6
11
  devDependencies: ["vite", "@types/react", "@types/react-dom"],
7
12
  dependencies: ["@vitejs/plugin-react", "cross-fetch", "react", "react-dom", "vike", "vike-react"]
8
13
  });
@@ -1,7 +1,7 @@
1
1
  // files/$tsconfig.json.ts
2
2
  import { loadAsJson } from "@batijs/core";
3
- async function getTsConfig(currentContent) {
4
- const tsConfig = await loadAsJson(currentContent);
3
+ async function getTsConfig(props) {
4
+ const tsConfig = await loadAsJson(props);
5
5
  tsConfig.compilerOptions.jsx = "preserve";
6
6
  tsConfig.compilerOptions.jsxImportSource = "react";
7
7
  tsConfig.compilerOptions.types = [...tsConfig.compilerOptions.types ?? [], "vike-react"];
@@ -1,8 +1,8 @@
1
1
  // files/$vite.config.ts.ts
2
2
  import { addVitePlugin, loadAsMagicast } from "@batijs/core";
3
- async function getViteConfig(currentContent, meta) {
4
- const mod = await loadAsMagicast(currentContent);
5
- const options = meta.BATI_MODULES?.includes("hosting:vercel") ? {
3
+ async function getViteConfig(props) {
4
+ const mod = await loadAsMagicast(props);
5
+ const options = props.meta.BATI_MODULES?.includes("vercel") ? {
6
6
  prerender: true
7
7
  } : {};
8
8
  addVitePlugin(mod, {
@@ -1,15 +1,13 @@
1
- export { Link }
1
+ import React from "react";
2
+ import { usePageContext } from "vike-react/usePageContext";
2
3
 
3
- import { usePageContext } from 'vike-react/usePageContext'
4
- import React from 'react'
5
-
6
- function Link({ href, children }: { href: string; children: string }) {
7
- const pageContext = usePageContext()
8
- const { urlPathname } = pageContext
9
- const isActive = href === '/' ? urlPathname === href : urlPathname.startsWith(href)
4
+ export function Link({ href, children }: { href: string; children: string }) {
5
+ const pageContext = usePageContext();
6
+ const { urlPathname } = pageContext;
7
+ const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href);
10
8
  return (
11
- <a href={href} className={isActive ? 'is-active' : undefined}>
9
+ <a href={href} className={isActive ? "is-active" : undefined}>
12
10
  {children}
13
11
  </a>
14
- )
12
+ );
15
13
  }
@@ -3,7 +3,7 @@ import React from "react";
3
3
  // Default <head> (can be overridden by pages)
4
4
 
5
5
  export default function HeadDefault() {
6
- if (import.meta.BATI_MODULES?.includes("analytics:plausible.io")) {
6
+ if (import.meta.BATI_MODULES?.includes("plausible.io")) {
7
7
  return (
8
8
  <>
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -1,5 +1,5 @@
1
1
  import "./style.css";
2
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
2
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
3
3
  import "./tailwind.css";
4
4
  import React from "react";
5
5
  import logoUrl from "../assets/logo.svg";
@@ -8,9 +8,9 @@ import { Link } from "../components/Link";
8
8
  export default function LayoutDefault({ children }: { children: React.ReactNode }) {
9
9
  return (
10
10
  <div
11
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
11
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
12
12
  className="flex max-w-5xl m-auto"
13
- //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
13
+ //# !import.meta.BATI_MODULES?.includes("tailwindcss")
14
14
  style={{
15
15
  display: "flex",
16
16
  maxWidth: 900,
@@ -20,7 +20,7 @@ export default function LayoutDefault({ children }: { children: React.ReactNode
20
20
  <Sidebar>
21
21
  <Logo />
22
22
  <Link href="/">Welcome</Link>
23
- {import.meta.BATI_MODULES?.includes("rpc:telefunc") ? <Link href="/todo">Todo</Link> : undefined}
23
+ {import.meta.BATI_MODULES?.includes("telefunc") ? <Link href="/todo">Todo</Link> : undefined}
24
24
  <Link href="/star-wars">Data Fetching</Link>
25
25
  </Sidebar>
26
26
  <Content>{children}</Content>
@@ -32,9 +32,9 @@ function Sidebar({ children }: { children: React.ReactNode }) {
32
32
  return (
33
33
  <div
34
34
  id="sidebar"
35
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
35
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
36
36
  className="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"
37
- //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
37
+ //# !import.meta.BATI_MODULES?.includes("tailwindcss")
38
38
  style={{
39
39
  padding: 20,
40
40
  flexShrink: 0,
@@ -54,9 +54,9 @@ function Content({ children }: { children: React.ReactNode }) {
54
54
  <div id="page-container">
55
55
  <div
56
56
  id="page-content"
57
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
57
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
58
58
  className="p-5 pb-12 min-h-screen"
59
- //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
59
+ //# !import.meta.BATI_MODULES?.includes("tailwindcss")
60
60
  style={{
61
61
  padding: 20,
62
62
  paddingBottom: 50,
@@ -72,16 +72,16 @@ function Content({ children }: { children: React.ReactNode }) {
72
72
  function Logo() {
73
73
  return (
74
74
  <div
75
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
75
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
76
76
  className="p-5 mb-2"
77
- //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
77
+ //# !import.meta.BATI_MODULES?.includes("tailwindcss")
78
78
  style={{
79
79
  marginTop: 20,
80
80
  marginBottom: 10,
81
81
  }}
82
82
  >
83
83
  <a href="/">
84
- <img src={logoUrl} height={64} width={64} />
84
+ <img src={logoUrl} height={64} width={64} alt="logo" />
85
85
  </a>
86
86
  </div>
87
87
  );
@@ -1,8 +1,6 @@
1
- export default Page;
2
-
3
1
  import React from "react";
4
2
 
5
- function Page({ is404, errorInfo }: { is404: boolean; errorInfo?: string }) {
3
+ export default function Page({ is404, errorInfo }: { is404: boolean; errorInfo?: string }) {
6
4
  if (is404) {
7
5
  return (
8
6
  <>
@@ -5,7 +5,7 @@ export default function Page() {
5
5
  return (
6
6
  <>
7
7
  <h1
8
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
8
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
9
9
  className="font-bold text-3xl pb-4"
10
10
  >
11
11
  My Vike app
@@ -1,14 +1,12 @@
1
1
  import React, { useState } from "react";
2
2
 
3
- export { Counter };
4
-
5
- function Counter() {
3
+ export function Counter() {
6
4
  const [count, setCount] = useState(0);
7
5
 
8
6
  return (
9
7
  <button
10
8
  type="button"
11
- //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
9
+ //# import.meta.BATI_MODULES?.includes("tailwindcss")
12
10
  className="inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
13
11
  onClick={() => setCount((count) => count + 1)}
14
12
  >