@batijs/cli 0.0.15 → 0.0.16

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 (22) hide show
  1. package/dist/boilerplates/@batijs/express/$package.json.js +2 -2
  2. package/dist/boilerplates/@batijs/express/{chunk-package-4Z6WSCOA.js → chunk-package-HRILG4TQ.js} +1 -1
  3. package/dist/boilerplates/@batijs/express/express-entry.ts +2 -2
  4. package/dist/boilerplates/@batijs/hattip/$package.json.js +2 -2
  5. package/dist/boilerplates/@batijs/hattip/{chunk-package-TWBPPJM3.js → chunk-package-KVSS22VL.js} +1 -1
  6. package/dist/boilerplates/@batijs/hattip/hattip-entry.ts +2 -2
  7. package/dist/boilerplates/@batijs/shared/package.json +1 -1
  8. package/dist/boilerplates/@batijs/solid/$package.json.js +1 -1
  9. package/dist/boilerplates/@batijs/solid/{chunk-package-HU2A6XJ4.js → chunk-package-2LOKPJ4I.js} +1 -1
  10. package/dist/boilerplates/@batijs/solid/layouts/LayoutDefault.tsx +9 -9
  11. package/dist/boilerplates/@batijs/solid/pages/index/+Page.tsx +1 -1
  12. package/dist/boilerplates/@batijs/solid/pages/index/Counter.tsx +1 -1
  13. package/dist/boilerplates/@batijs/tailwindcss/$package.json.js +1 -1
  14. package/dist/boilerplates/@batijs/tailwindcss/{chunk-package-L4PYFLEY.js → chunk-package-HDKLLEO4.js} +1 -1
  15. package/dist/boilerplates/@batijs/telefunc/$.env.js +24 -0
  16. package/dist/boilerplates/@batijs/telefunc/$package.json.js +1 -1
  17. package/dist/boilerplates/@batijs/telefunc/chunk-package-HXQQJK43.js +59 -0
  18. package/dist/boilerplates/@batijs/telefunc/{chunk-package-35435SXA.js → chunk-package-OY545CFU.js} +1 -1
  19. package/dist/boilerplates/@batijs/telefunc/prisma/schema.prisma +11 -0
  20. package/dist/boilerplates/boilerplates.json +1 -1
  21. package/dist/index.js +7 -5
  22. package/package.json +4 -4
@@ -4,7 +4,7 @@ async function getPackageJson(currentContent, meta) {
4
4
  const packageJson = await loadAsJson(currentContent);
5
5
  packageJson.scripts.dev = "tsx ./express-entry.ts";
6
6
  packageJson.scripts.build = "vite build";
7
- return addDependency(packageJson, await import("./chunk-package-4Z6WSCOA.js"), {
7
+ return addDependency(packageJson, await import("./chunk-package-HRILG4TQ.js"), {
8
8
  devDependencies: ["@types/express"],
9
9
  dependencies: [
10
10
  "@hattip/adapter-node",
@@ -12,7 +12,7 @@ async function getPackageJson(currentContent, meta) {
12
12
  "tsx",
13
13
  "vite",
14
14
  "vite-plugin-ssr",
15
- ...meta.VIKE_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
15
+ ...meta.BATI_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
16
16
  ]
17
17
  });
18
18
  }
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/express";
3
3
  var private2 = true;
4
- var version = "0.0.15";
4
+ var version = "0.0.16";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -33,7 +33,7 @@ async function startServer() {
33
33
  app.use(viteDevMiddleware);
34
34
  }
35
35
 
36
- if (import.meta.VIKE_MODULES?.includes("auth:authjs")) {
36
+ if (import.meta.BATI_MODULES?.includes("auth:authjs")) {
37
37
  /**
38
38
  * AuthJS
39
39
  *
@@ -72,7 +72,7 @@ async function startServer() {
72
72
  );
73
73
  }
74
74
 
75
- if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
75
+ if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
76
76
  /**
77
77
  * Telefunc route
78
78
  *
@@ -7,14 +7,14 @@ async function getPackageJson(currentContent, meta) {
7
7
  if (packageJson.scripts.preview) {
8
8
  delete packageJson.scripts.preview;
9
9
  }
10
- return addDependency(packageJson, await import("./chunk-package-TWBPPJM3.js"), {
10
+ return addDependency(packageJson, await import("./chunk-package-KVSS22VL.js"), {
11
11
  devDependencies: ["@hattip/vite", "@hattip/adapter-node"],
12
12
  dependencies: [
13
13
  "@hattip/router",
14
14
  "hattip",
15
15
  "vite",
16
16
  "vite-plugin-ssr",
17
- ...meta.VIKE_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
17
+ ...meta.BATI_MODULES?.includes("auth:authjs") ? ["@auth/core", "vike-authjs"] : []
18
18
  ]
19
19
  });
20
20
  }
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/hattip";
3
3
  var private2 = true;
4
- var version = "0.0.15";
4
+ var version = "0.0.16";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -6,7 +6,7 @@ import CredentialsProvider from "@auth/core/providers/credentials";
6
6
 
7
7
  const router = createRouter();
8
8
 
9
- if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
9
+ if (import.meta.BATI_MODULES?.includes("rpc:telefunc")) {
10
10
  /**
11
11
  * Telefunc route
12
12
  *
@@ -29,7 +29,7 @@ if (import.meta.VIKE_MODULES?.includes("rpc:telefunc")) {
29
29
  });
30
30
  }
31
31
 
32
- if (import.meta.VIKE_MODULES?.includes("auth:authjs")) {
32
+ if (import.meta.BATI_MODULES?.includes("auth:authjs")) {
33
33
  /**
34
34
  * AuthJS
35
35
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-app",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -2,7 +2,7 @@
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
3
  async function getPackageJson(currentContent) {
4
4
  const packageJson = await loadAsJson(currentContent);
5
- return addDependency(packageJson, await import("./chunk-package-HU2A6XJ4.js"), {
5
+ return addDependency(packageJson, await import("./chunk-package-2LOKPJ4I.js"), {
6
6
  devDependencies: ["vite"],
7
7
  dependencies: ["cross-fetch", "solid-js", "vike-solid"]
8
8
  });
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/solid";
3
3
  var private2 = true;
4
- var version = "0.0.15";
4
+ var version = "0.0.16";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -1,5 +1,5 @@
1
1
  import "./style.css";
2
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
2
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
3
3
  import "./tailwind.css";
4
4
  import logoUrl from "../assets/logo.svg";
5
5
  import { Link } from "../components/Link";
@@ -8,9 +8,9 @@ import type { JSX } from "solid-js";
8
8
  export default function LayoutDefault(props: { children?: JSX.Element }) {
9
9
  return (
10
10
  <div
11
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
11
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
12
12
  class="flex max-w-5xl m-auto"
13
- //# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
13
+ //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
14
14
  style={{
15
15
  display: "flex",
16
16
  "max-width": "900px",
@@ -31,9 +31,9 @@ function Sidebar(props: { children: JSX.Element }) {
31
31
  return (
32
32
  <div
33
33
  id="sidebar"
34
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
34
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
35
35
  class="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"
36
- //# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
36
+ //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
37
37
  style={{
38
38
  padding: "20px",
39
39
  "flex-shrink": 0,
@@ -53,9 +53,9 @@ function Content(props: { children: JSX.Element }) {
53
53
  <div id="page-container">
54
54
  <div
55
55
  id="page-content"
56
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
56
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
57
57
  class="p-5 pb-12 min-h-screen"
58
- //# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
58
+ //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
59
59
  style={{
60
60
  padding: "20px",
61
61
  "padding-bottom": "50px",
@@ -71,9 +71,9 @@ function Content(props: { children: JSX.Element }) {
71
71
  function Logo() {
72
72
  return (
73
73
  <div
74
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
74
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
75
75
  class="p-5 mb-2"
76
- //# !import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
76
+ //# !import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
77
77
  style={{
78
78
  "margin-top": "20px",
79
79
  "margin-bottom": "10px",
@@ -4,7 +4,7 @@ export default function Page() {
4
4
  return (
5
5
  <>
6
6
  <h1
7
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
7
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
8
8
  class="font-bold text-3xl pb-4"
9
9
  >
10
10
  My Vike app
@@ -8,7 +8,7 @@ function Counter() {
8
8
  return (
9
9
  <button
10
10
  type="button"
11
- //# import.meta.VIKE_MODULES?.includes("uikit:tailwindcss")
11
+ //# import.meta.BATI_MODULES?.includes("uikit:tailwindcss")
12
12
  class="inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
13
13
  onClick={() => setCount((count) => count + 1)}
14
14
  >
@@ -2,7 +2,7 @@
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
3
  async function getPackageJson(currentContent, meta) {
4
4
  const packageJson = await loadAsJson(currentContent);
5
- return addDependency(packageJson, await import("./chunk-package-L4PYFLEY.js"), {
5
+ return addDependency(packageJson, await import("./chunk-package-HDKLLEO4.js"), {
6
6
  devDependencies: ["tailwindcss", "postcss", "autoprefixer"]
7
7
  });
8
8
  }
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/tailwindcss";
3
3
  var private2 = true;
4
- var version = "0.0.15";
4
+ var version = "0.0.16";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -0,0 +1,24 @@
1
+ // files/$.env.ts
2
+ async function getEnv(currentContent) {
3
+ let envContent = await currentContent?.() ?? "";
4
+ if (envContent.endsWith("\n\n")) {
5
+ } else if (envContent.endsWith("\n")) {
6
+ envContent = envContent + "\n";
7
+ } else if (envContent) {
8
+ envContent = envContent + "\n\n";
9
+ }
10
+ const prismaContent = `# Prisma
11
+
12
+ # Environment variables declared in this file are automatically made available to Prisma.
13
+ # See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
14
+
15
+ # Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
16
+ # See the documentation for all the connection string options: https://pris.ly/d/connection-strings
17
+
18
+ DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
19
+ `;
20
+ return envContent + prismaContent;
21
+ }
22
+ export {
23
+ getEnv as default
24
+ };
@@ -2,7 +2,7 @@
2
2
  import { addDependency, loadAsJson } from "@batijs/core";
3
3
  async function getPackageJson(currentContent) {
4
4
  const packageJson = await loadAsJson(currentContent);
5
- return addDependency(packageJson, await import("./chunk-package-35435SXA.js"), {
5
+ return addDependency(packageJson, await import("./chunk-package-OY545CFU.js"), {
6
6
  dependencies: ["telefunc"]
7
7
  });
8
8
  }
@@ -0,0 +1,59 @@
1
+ // package.json
2
+ var name = "@batijs/telefunc";
3
+ var private2 = true;
4
+ var version = "0.0.16";
5
+ var description = "";
6
+ var type = "module";
7
+ var scripts = {
8
+ build: "tsup"
9
+ };
10
+ var keywords = [];
11
+ var author = "";
12
+ var license = "MIT";
13
+ var devDependencies = {
14
+ "@batijs/tsup": "workspace:*",
15
+ "@prisma/client": "^4.14.0",
16
+ "@types/node": "^16.18.27",
17
+ prisma: "^4.14.0"
18
+ };
19
+ var dependencies = {
20
+ "@batijs/core": "workspace:*"
21
+ };
22
+ var files = [
23
+ "dist/"
24
+ ];
25
+ var bati = {
26
+ flag: "prisma",
27
+ boilerplate: "./dist/files"
28
+ };
29
+ var package_default = {
30
+ name,
31
+ private: private2,
32
+ version,
33
+ description,
34
+ type,
35
+ scripts,
36
+ keywords,
37
+ author,
38
+ license,
39
+ devDependencies,
40
+ dependencies,
41
+ files,
42
+ bati
43
+ };
44
+ export {
45
+ author,
46
+ bati,
47
+ package_default as default,
48
+ dependencies,
49
+ description,
50
+ devDependencies,
51
+ files,
52
+ keywords,
53
+ license,
54
+ name,
55
+ private2 as private,
56
+ scripts,
57
+ type,
58
+ version
59
+ };
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@batijs/telefunc";
3
3
  var private2 = true;
4
- var version = "0.0.15";
4
+ var version = "0.0.16";
5
5
  var description = "";
6
6
  var type = "module";
7
7
  var scripts = {
@@ -0,0 +1,11 @@
1
+ // This is your Prisma schema file,
2
+ // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client-js"
6
+ }
7
+
8
+ datasource db {
9
+ provider = "postgresql"
10
+ url = env("DATABASE_URL")
11
+ }
@@ -1 +1 @@
1
- [{"config":{"flag":"express","boilerplate":"./dist/files"},"folder":"@batijs/express"},{"config":{"flag":"hattip","boilerplate":"./dist/files"},"folder":"@batijs/hattip"},{"config":{"boilerplate":"./files"},"folder":"@batijs/shared"},{"config":{"flag":"solid","boilerplate":"./dist/files"},"folder":"@batijs/solid"},{"config":{"flag":"tailwindcss","boilerplate":"./dist/files"},"folder":"@batijs/tailwindcss"},{"config":{"flag":"telefunc","boilerplate":"./dist/files"},"folder":"@batijs/telefunc"}]
1
+ [{"config":{"flag":"express","boilerplate":"./dist/files"},"folder":"@batijs/express"},{"config":{"flag":"hattip","boilerplate":"./dist/files"},"folder":"@batijs/hattip"},{"config":{"flag":"prisma","boilerplate":"./dist/files"},"folder":"@batijs/telefunc"},{"config":{"boilerplate":"./files"},"folder":"@batijs/shared"},{"config":{"flag":"solid","boilerplate":"./dist/files"},"folder":"@batijs/solid"},{"config":{"flag":"tailwindcss","boilerplate":"./dist/files"},"folder":"@batijs/tailwindcss"},{"config":{"flag":"telefunc","boilerplate":"./dist/files"},"folder":"@batijs/telefunc"}]
package/dist/index.js CHANGED
@@ -583,21 +583,23 @@ async function* walk(dir, meta) {
583
583
  }
584
584
  function transformFileAfterExec(filepath, fileContent) {
585
585
  const parsed = path.parse(filepath);
586
- switch (parsed.ext) {
586
+ const ext = parsed.ext || parsed.name;
587
+ switch (ext) {
587
588
  case ".ts":
588
589
  case ".js":
589
590
  case ".tsx":
590
591
  case ".jsx":
592
+ case ".env":
591
593
  return fileContent;
592
594
  case ".json":
593
595
  return JSON.stringify(fileContent, null, 2);
594
596
  default:
595
- throw new Error(`Unsupported extension ${parsed.ext} (${filepath})`);
597
+ throw new Error(`Unsupported extension ${ext} (${filepath})`);
596
598
  }
597
599
  }
598
600
  async function fileContainsVikeMeta(filepath) {
599
601
  const code = await readFile(filepath, { encoding: "utf-8" });
600
- return code.includes("import.meta.VIKE_");
602
+ return code.includes("import.meta.BATI_");
601
603
  }
602
604
  async function main(options, meta) {
603
605
  const sources = Array.isArray(options.source) ? options.source : [options.source];
@@ -637,7 +639,7 @@ async function main(options, meta) {
637
639
  // package.json
638
640
  var package_default = {
639
641
  name: "@batijs/cli",
640
- version: "0.0.15",
642
+ version: "0.0.16",
641
643
  description: "",
642
644
  type: "module",
643
645
  scripts: {
@@ -752,7 +754,7 @@ async function run() {
752
754
  dist: args.dist
753
755
  },
754
756
  {
755
- VIKE_MODULES: features
757
+ BATI_MODULES: features
756
758
  }
757
759
  );
758
760
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -18,11 +18,11 @@
18
18
  "typescript": "^5.0.4",
19
19
  "vitest": "^0.31.0",
20
20
  "wait-for-localhost": "^4.0.1",
21
- "@batijs/build": "0.0.15",
22
- "@batijs/tsup": "0.0.15"
21
+ "@batijs/build": "0.0.16",
22
+ "@batijs/tsup": "0.0.16"
23
23
  },
24
24
  "dependencies": {
25
- "@batijs/core": "0.0.15"
25
+ "@batijs/core": "0.0.16"
26
26
  },
27
27
  "bin": "./dist/index.js",
28
28
  "exports": {