@vertz/cli 0.2.10 → 0.2.11

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 (3) hide show
  1. package/dist/index.js +18 -26
  2. package/dist/vertz.js +18 -26
  3. package/package.json +9 -11
package/dist/index.js CHANGED
@@ -754,23 +754,15 @@ class BuildOrchestrator {
754
754
  }
755
755
  }
756
756
  // src/production-build/ui-build-pipeline.ts
757
- import { cpSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
758
- import { basename, resolve } from "node:path";
757
+ import { cpSync, existsSync as existsSync3, mkdirSync as mkdirSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
758
+ import { resolve } from "node:path";
759
759
  async function buildUI(config) {
760
760
  const startTime = performance.now();
761
- const { projectRoot, clientEntry, serverEntry, outputDir, minify, sourcemap } = config;
761
+ const { projectRoot, clientEntry, serverEntry, outputDir, minify, sourcemap, title = "Vertz App" } = config;
762
762
  const distDir = resolve(projectRoot, outputDir);
763
763
  const distClient = resolve(distDir, "client");
764
764
  const distServer = resolve(distDir, "server");
765
765
  try {
766
- const indexHtmlPath = resolve(projectRoot, "index.html");
767
- if (!existsSync3(indexHtmlPath)) {
768
- return {
769
- success: false,
770
- error: `index.html not found at ${indexHtmlPath}. UI apps require an index.html in the project root.`,
771
- durationMs: performance.now() - startTime
772
- };
773
- }
774
766
  rmSync(distDir, { recursive: true, force: true });
775
767
  mkdirSync2(resolve(distClient, "assets"), { recursive: true });
776
768
  mkdirSync2(distServer, { recursive: true });
@@ -827,19 +819,22 @@ ${errors}`,
827
819
  clientCssPaths.push("/assets/vertz.css");
828
820
  console.log(" CSS (extracted): /assets/vertz.css");
829
821
  }
830
- console.log("\uD83D\uDCC4 Processing HTML template...");
831
- let html = readFileSync(indexHtmlPath, "utf-8");
832
- const entryBasename = basename(clientEntry);
833
- const scriptRegex = new RegExp(`<script[^>]*\\bsrc=["'][^"']*${escapeRegex(entryBasename)}["'][^>]*><\\/script>`);
834
- html = html.replace(scriptRegex, `<script type="module" crossorigin src="${clientJsPath}"></script>`);
835
- html = html.replace(/\s*<!-- Fast Refresh runtime.*?-->\s*<script[^>]*fast-refresh-runtime[^>]*><\/script>/s, "");
836
- if (clientCssPaths.length > 0) {
837
- const cssLinks = clientCssPaths.map((path) => ` <link rel="stylesheet" href="${path}">`).join(`
822
+ console.log("\uD83D\uDCC4 Generating HTML...");
823
+ const cssLinks = clientCssPaths.map((path) => ` <link rel="stylesheet" href="${path}">`).join(`
838
824
  `);
839
- html = html.replace("</head>", `${cssLinks}
840
- </head>`);
841
- }
842
- html = html.replace(/(['"])\.\/public\//g, "$1/");
825
+ const html = `<!doctype html>
826
+ <html lang="en">
827
+ <head>
828
+ <meta charset="UTF-8" />
829
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
830
+ <title>${title}</title>
831
+ ${cssLinks}
832
+ </head>
833
+ <body>
834
+ <div id="app"></div>
835
+ <script type="module" crossorigin src="${clientJsPath}"></script>
836
+ </body>
837
+ </html>`;
843
838
  writeFileSync2(resolve(distClient, "index.html"), html);
844
839
  const publicDir = resolve(projectRoot, "public");
845
840
  if (existsSync3(publicDir)) {
@@ -896,9 +891,6 @@ ${errors}`,
896
891
  };
897
892
  }
898
893
  }
899
- function escapeRegex(str) {
900
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
901
- }
902
894
  // src/utils/paths.ts
903
895
  import { existsSync as existsSync4 } from "node:fs";
904
896
  import { dirname, join as join3, resolve as resolve2 } from "node:path";
package/dist/vertz.js CHANGED
@@ -730,23 +730,15 @@ class BuildOrchestrator {
730
730
  }
731
731
  }
732
732
  // src/production-build/ui-build-pipeline.ts
733
- import { cpSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
734
- import { basename, resolve } from "node:path";
733
+ import { cpSync, existsSync as existsSync3, mkdirSync as mkdirSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
734
+ import { resolve } from "node:path";
735
735
  async function buildUI(config) {
736
736
  const startTime = performance.now();
737
- const { projectRoot, clientEntry, serverEntry, outputDir, minify, sourcemap } = config;
737
+ const { projectRoot, clientEntry, serverEntry, outputDir, minify, sourcemap, title = "Vertz App" } = config;
738
738
  const distDir = resolve(projectRoot, outputDir);
739
739
  const distClient = resolve(distDir, "client");
740
740
  const distServer = resolve(distDir, "server");
741
741
  try {
742
- const indexHtmlPath = resolve(projectRoot, "index.html");
743
- if (!existsSync3(indexHtmlPath)) {
744
- return {
745
- success: false,
746
- error: `index.html not found at ${indexHtmlPath}. UI apps require an index.html in the project root.`,
747
- durationMs: performance.now() - startTime
748
- };
749
- }
750
742
  rmSync(distDir, { recursive: true, force: true });
751
743
  mkdirSync2(resolve(distClient, "assets"), { recursive: true });
752
744
  mkdirSync2(distServer, { recursive: true });
@@ -803,19 +795,22 @@ ${errors}`,
803
795
  clientCssPaths.push("/assets/vertz.css");
804
796
  console.log(" CSS (extracted): /assets/vertz.css");
805
797
  }
806
- console.log("\uD83D\uDCC4 Processing HTML template...");
807
- let html = readFileSync(indexHtmlPath, "utf-8");
808
- const entryBasename = basename(clientEntry);
809
- const scriptRegex = new RegExp(`<script[^>]*\\bsrc=["'][^"']*${escapeRegex(entryBasename)}["'][^>]*><\\/script>`);
810
- html = html.replace(scriptRegex, `<script type="module" crossorigin src="${clientJsPath}"></script>`);
811
- html = html.replace(/\s*<!-- Fast Refresh runtime.*?-->\s*<script[^>]*fast-refresh-runtime[^>]*><\/script>/s, "");
812
- if (clientCssPaths.length > 0) {
813
- const cssLinks = clientCssPaths.map((path) => ` <link rel="stylesheet" href="${path}">`).join(`
798
+ console.log("\uD83D\uDCC4 Generating HTML...");
799
+ const cssLinks = clientCssPaths.map((path) => ` <link rel="stylesheet" href="${path}">`).join(`
814
800
  `);
815
- html = html.replace("</head>", `${cssLinks}
816
- </head>`);
817
- }
818
- html = html.replace(/(['"])\.\/public\//g, "$1/");
801
+ const html = `<!doctype html>
802
+ <html lang="en">
803
+ <head>
804
+ <meta charset="UTF-8" />
805
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
806
+ <title>${title}</title>
807
+ ${cssLinks}
808
+ </head>
809
+ <body>
810
+ <div id="app"></div>
811
+ <script type="module" crossorigin src="${clientJsPath}"></script>
812
+ </body>
813
+ </html>`;
819
814
  writeFileSync2(resolve(distClient, "index.html"), html);
820
815
  const publicDir = resolve(projectRoot, "public");
821
816
  if (existsSync3(publicDir)) {
@@ -872,9 +867,6 @@ ${errors}`,
872
867
  };
873
868
  }
874
869
  }
875
- function escapeRegex(str) {
876
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
877
- }
878
870
  // src/utils/paths.ts
879
871
  import { existsSync as existsSync4 } from "node:fs";
880
872
  import { dirname, join as join3, resolve as resolve2 } from "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertz/cli",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Vertz CLI — dev, build, create, and deploy commands",
@@ -34,13 +34,13 @@
34
34
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
35
35
  },
36
36
  "dependencies": {
37
- "@vertz/codegen": "^0.2.4",
38
- "@vertz/errors": "^0.2.1",
39
- "@vertz/tui": "^0.2.3",
40
- "@vertz/compiler": "^0.2.4",
41
- "@vertz/create-vertz-app": "^0.2.2",
42
- "@vertz/db": "^0.2.4",
43
- "@vertz/ui-server": "^0.2.4",
37
+ "@vertz/codegen": "^0.2.11",
38
+ "@vertz/errors": "^0.2.11",
39
+ "@vertz/tui": "^0.2.11",
40
+ "@vertz/compiler": "^0.2.11",
41
+ "@vertz/create-vertz-app": "^0.2.11",
42
+ "@vertz/db": "^0.2.11",
43
+ "@vertz/ui-server": "^0.2.11",
44
44
  "esbuild": "^0.25.0",
45
45
  "commander": "^14.0.0",
46
46
  "jiti": "^2.4.2"
@@ -48,10 +48,8 @@
48
48
  "devDependencies": {
49
49
  "@electric-sql/pglite": "^0.3.14",
50
50
  "@types/node": "^25.3.1",
51
- "@vitest/coverage-v8": "^4.0.18",
52
51
  "bunup": "^0.16.23",
53
- "typescript": "^5.9.3",
54
- "vitest": "^4.0.18"
52
+ "typescript": "^5.9.3"
55
53
  },
56
54
  "optionalDependencies": {
57
55
  "postgres": "^3.4.0"