@teamvelix/cli 5.3.4 → 5.3.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-2030 Velix Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,62 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ log,
4
+ showBanner
5
+ } from "./chunk-5YFLZUDY.js";
6
+
7
+ // commands/analyze.ts
8
+ import fs from "fs";
9
+ import path from "path";
10
+ import pc from "picocolors";
11
+ async function analyzeCommand() {
12
+ showBanner();
13
+ log.info("Analyzing project build bundles...");
14
+ const projectRoot = process.cwd();
15
+ const distDir = path.join(projectRoot, "dist");
16
+ const velixDir = path.join(projectRoot, ".velix");
17
+ const targetDir = fs.existsSync(distDir) ? distDir : fs.existsSync(velixDir) ? velixDir : null;
18
+ if (!targetDir) {
19
+ log.error("No build output found. Please run `velix build` before analyzing.");
20
+ process.exit(1);
21
+ }
22
+ const files = [];
23
+ function scan(dir) {
24
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
25
+ for (const entry of entries) {
26
+ const full = path.join(dir, entry.name);
27
+ if (entry.isDirectory()) {
28
+ scan(full);
29
+ } else if (entry.isFile()) {
30
+ const stats = fs.statSync(full);
31
+ files.push({
32
+ path: path.relative(projectRoot, full),
33
+ size: stats.size,
34
+ isJs: /\.(mjs|js|cjs)$/.test(entry.name)
35
+ });
36
+ }
37
+ }
38
+ }
39
+ scan(targetDir);
40
+ const jsFiles = files.filter((f) => f.isJs).sort((a, b) => b.size - a.size);
41
+ const totalJsSize = jsFiles.reduce((acc, f) => acc + f.size, 0);
42
+ console.log("\n" + pc.bold("=== Bundle Analysis Report ===") + "\n");
43
+ console.log(` ${pc.bold("Target Directory:")} ${path.relative(projectRoot, targetDir)}`);
44
+ console.log(` ${pc.bold("Total JS Bundle Size:")} ${(totalJsSize / 1024).toFixed(2)} KB
45
+ `);
46
+ console.log(pc.bold(" Top JavaScript Assets:"));
47
+ jsFiles.slice(0, 10).forEach((file) => {
48
+ const kb = (file.size / 1024).toFixed(2);
49
+ console.log(` ${pc.cyan(file.path.padEnd(45))} ${pc.yellow(kb + " KB")}`);
50
+ });
51
+ console.log("\n" + pc.bold("=== Optimization Recommendations ==="));
52
+ if (totalJsSize > 500 * 1024) {
53
+ console.log(` ${pc.yellow("\u26A0 Total bundle exceeds 500 KB.")} Consider using dynamic imports or Islands for heavy components.`);
54
+ } else {
55
+ console.log(` ${pc.green("\u2713 Bundle size is within recommended limits.")}`);
56
+ }
57
+ console.log("");
58
+ }
59
+ export {
60
+ analyzeCommand
61
+ };
62
+ //# sourceMappingURL=analyze-J4ZXR6SK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../commands/analyze.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport pc from 'picocolors';\nimport { showBanner, log } from './shared.js';\n\nexport async function analyzeCommand() {\n showBanner();\n log.info('Analyzing project build bundles...');\n\n const projectRoot = process.cwd();\n const distDir = path.join(projectRoot, 'dist');\n const velixDir = path.join(projectRoot, '.velix');\n\n const targetDir = fs.existsSync(distDir) ? distDir : (fs.existsSync(velixDir) ? velixDir : null);\n\n if (!targetDir) {\n log.error('No build output found. Please run `velix build` before analyzing.');\n process.exit(1);\n }\n\n const files: { path: string; size: number; isJs: boolean }[] = [];\n\n function scan(dir: string) {\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n scan(full);\n } else if (entry.isFile()) {\n const stats = fs.statSync(full);\n files.push({\n path: path.relative(projectRoot, full),\n size: stats.size,\n isJs: /\\.(mjs|js|cjs)$/.test(entry.name),\n });\n }\n }\n }\n\n scan(targetDir);\n\n const jsFiles = files.filter(f => f.isJs).sort((a, b) => b.size - a.size);\n const totalJsSize = jsFiles.reduce((acc, f) => acc + f.size, 0);\n\n console.log('\\n' + pc.bold('=== Bundle Analysis Report ===') + '\\n');\n console.log(` ${pc.bold('Target Directory:')} ${path.relative(projectRoot, targetDir)}`);\n console.log(` ${pc.bold('Total JS Bundle Size:')} ${(totalJsSize / 1024).toFixed(2)} KB\\n`);\n\n console.log(pc.bold(' Top JavaScript Assets:'));\n jsFiles.slice(0, 10).forEach(file => {\n const kb = (file.size / 1024).toFixed(2);\n console.log(` ${pc.cyan(file.path.padEnd(45))} ${pc.yellow(kb + ' KB')}`);\n });\n\n console.log('\\n' + pc.bold('=== Optimization Recommendations ==='));\n if (totalJsSize > 500 * 1024) {\n console.log(` ${pc.yellow('⚠ Total bundle exceeds 500 KB.')} Consider using dynamic imports or Islands for heavy components.`);\n } else {\n console.log(` ${pc.green('✓ Bundle size is within recommended limits.')}`);\n }\n console.log('');\n}\n"],"mappings":";;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;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AK,uBAAuB,CAAC,KAAK,cAAc,MAAM,QAAQ,CAAC,CAAC;AAAA,CAAO;AAE3F,UAAQ,IAAI,GAAG,KAAK,0BAA0B,CAAC;AAC/C,UAAQ,MAAM,GAAG,EAAE,EAAE,QAAQ,UAAQ;AACnC,UAAM,MAAM,KAAK,OAAO,MAAM,QAAQ,CAAC;AACvC,YAAQ,IAAI,OAAO,GAAG,KAAK,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC,IAAI,GAAG,OAAO,KAAK,KAAK,CAAC,EAAE;AAAA,EAC7E,CAAC;AAED,UAAQ,IAAI,OAAO,GAAG,KAAK,sCAAsC,CAAC;AAClE,MAAI,cAAc,MAAM,MAAM;AAC5B,YAAQ,IAAI,KAAK,GAAG,OAAO,qCAAgC,CAAC,kEAAkE;AAAA,EAChI,OAAO;AACL,YAAQ,IAAI,KAAK,GAAG,MAAM,kDAA6C,CAAC,EAAE;AAAA,EAC5E;AACA,UAAQ,IAAI,EAAE;AAChB;","names":[]}
@@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.met
2
2
  import {
3
3
  log,
4
4
  showBanner
5
- } from "./chunk-LCJYRHLH.js";
5
+ } from "./chunk-5YFLZUDY.js";
6
6
 
7
7
  // commands/build.ts
8
8
  import fs from "fs";
@@ -64,4 +64,4 @@ export {
64
64
  buildCommand,
65
65
  startCommand
66
66
  };
67
- //# sourceMappingURL=build-RRUAQI7O.js.map
67
+ //# sourceMappingURL=build-2OFZZO7B.js.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
 
3
3
  // version.ts
4
- var VERSION = "5.3.4";
4
+ var VERSION = "5.3.6";
5
5
 
6
6
  // commands/shared.ts
7
7
  import pc from "picocolors";
@@ -44,4 +44,4 @@ export {
44
44
  pascalCase,
45
45
  camelCase
46
46
  };
47
- //# sourceMappingURL=chunk-LCJYRHLH.js.map
47
+ //# sourceMappingURL=chunk-5YFLZUDY.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../version.ts","../commands/shared.ts"],"sourcesContent":["/**\r\n * Velix CLI version — single source of truth.\r\n * Keep in sync with packages/velix/version.ts.\r\n */\r\nexport const VERSION = '5.3.4';\r\n\r\n","/**\n * Shared CLI utilities — logger, banner, helpers\n */\nimport pc from 'picocolors';\nimport fs from 'fs';\nimport path from 'path';\nimport { VERSION } from '../version.js';\n\nexport const log = {\n info: (msg: string) => console.log(` ${pc.cyan('ℹ')} ${msg}`),\n success: (msg: string) => console.log(` ${pc.green('✔')} ${msg}`),\n warn: (msg: string) => console.log(` ${pc.yellow('⚠')} ${pc.yellow(msg)}`),\n error: (msg: string) => console.log(` ${pc.red('✖')} ${pc.red(msg)}`),\n blank: () => console.log(''),\n};\n\nexport function showBanner() {\n console.log('');\n console.log(` ${pc.cyan('▲')} ${pc.bold('Velix')} ${pc.dim(`v${VERSION}`)}`);\n console.log(` ${pc.dim('──────────────────────────────────────────────')}`);\n console.log('');\n}\n\nexport function writeFile(filePath: string, content: string) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, content);\n}\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function pascalCase(str: string): string {\n return str.split(/[-_\\/]/).map(s => capitalize(s)).join('');\n}\n\nexport function camelCase(str: string): string {\n const pascal = pascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n"],"mappings":";;;AAIO,IAAM,UAAU;;;ACDvB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AAGV,IAAM,MAAM;AAAA,EACjB,MAAM,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,KAAK,QAAG,CAAC,IAAI,GAAG,EAAE;AAAA,EAC7D,SAAS,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,MAAM,QAAG,CAAC,IAAI,GAAG,EAAE;AAAA,EACjE,MAAM,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,OAAO,QAAG,CAAC,IAAI,GAAG,OAAO,GAAG,CAAC,EAAE;AAAA,EAC1E,OAAO,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,IAAI,QAAG,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,EAAE;AAAA,EACrE,OAAO,MAAM,QAAQ,IAAI,EAAE;AAC7B;AAEO,SAAS,aAAa;AAC3B,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,KAAK,GAAG,KAAK,QAAG,CAAC,IAAI,GAAG,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,EAAE;AAC5E,UAAQ,IAAI,KAAK,GAAG,IAAI,sRAAgD,CAAC,EAAE;AAC3E,UAAQ,IAAI,EAAE;AAChB;AAEO,SAAS,UAAU,UAAkB,SAAiB;AAC3D,KAAG,UAAU,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACxD,KAAG,cAAc,UAAU,OAAO;AACpC;AAEO,SAAS,WAAW,KAAqB;AAC9C,SAAO,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC;AAClD;AAEO,SAAS,WAAW,KAAqB;AAC9C,SAAO,IAAI,MAAM,QAAQ,EAAE,IAAI,OAAK,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE;AAC5D;AAEO,SAAS,UAAU,KAAqB;AAC7C,QAAM,SAAS,WAAW,GAAG;AAC7B,SAAO,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AACxD;","names":[]}
1
+ {"version":3,"sources":["../version.ts","../commands/shared.ts"],"sourcesContent":["/**\r\n * Velix CLI version — single source of truth.\r\n * Keep in sync with packages/velix/version.ts.\r\n */\r\nexport const VERSION = '5.3.6';\r\n\r\n","/**\n * Shared CLI utilities — logger, banner, helpers\n */\nimport pc from 'picocolors';\nimport fs from 'fs';\nimport path from 'path';\nimport { VERSION } from '../version.js';\n\nexport const log = {\n info: (msg: string) => console.log(` ${pc.cyan('ℹ')} ${msg}`),\n success: (msg: string) => console.log(` ${pc.green('✔')} ${msg}`),\n warn: (msg: string) => console.log(` ${pc.yellow('⚠')} ${pc.yellow(msg)}`),\n error: (msg: string) => console.log(` ${pc.red('✖')} ${pc.red(msg)}`),\n blank: () => console.log(''),\n};\n\nexport function showBanner() {\n console.log('');\n console.log(` ${pc.cyan('▲')} ${pc.bold('Velix')} ${pc.dim(`v${VERSION}`)}`);\n console.log(` ${pc.dim('──────────────────────────────────────────────')}`);\n console.log('');\n}\n\nexport function writeFile(filePath: string, content: string) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, content);\n}\n\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function pascalCase(str: string): string {\n return str.split(/[-_\\/]/).map(s => capitalize(s)).join('');\n}\n\nexport function camelCase(str: string): string {\n const pascal = pascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n"],"mappings":";;;AAIO,IAAM,UAAU;;;ACDvB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AAGV,IAAM,MAAM;AAAA,EACjB,MAAM,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,KAAK,QAAG,CAAC,IAAI,GAAG,EAAE;AAAA,EAC7D,SAAS,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,MAAM,QAAG,CAAC,IAAI,GAAG,EAAE;AAAA,EACjE,MAAM,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,OAAO,QAAG,CAAC,IAAI,GAAG,OAAO,GAAG,CAAC,EAAE;AAAA,EAC1E,OAAO,CAAC,QAAgB,QAAQ,IAAI,KAAK,GAAG,IAAI,QAAG,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,EAAE;AAAA,EACrE,OAAO,MAAM,QAAQ,IAAI,EAAE;AAC7B;AAEO,SAAS,aAAa;AAC3B,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,KAAK,GAAG,KAAK,QAAG,CAAC,IAAI,GAAG,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,EAAE;AAC5E,UAAQ,IAAI,KAAK,GAAG,IAAI,sRAAgD,CAAC,EAAE;AAC3E,UAAQ,IAAI,EAAE;AAChB;AAEO,SAAS,UAAU,UAAkB,SAAiB;AAC3D,KAAG,UAAU,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACxD,KAAG,cAAc,UAAU,OAAO;AACpC;AAEO,SAAS,WAAW,KAAqB;AAC9C,SAAO,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC;AAClD;AAEO,SAAS,WAAW,KAAqB;AAC9C,SAAO,IAAI,MAAM,QAAQ,EAAE,IAAI,OAAK,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE;AAC5D;AAEO,SAAS,UAAU,KAAqB;AAC7C,QAAM,SAAS,WAAW,GAAG;AAC7B,SAAO,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AACxD;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  log,
5
5
  showBanner,
6
6
  writeFile
7
- } from "./chunk-LCJYRHLH.js";
7
+ } from "./chunk-5YFLZUDY.js";
8
8
 
9
9
  // commands/create.ts
10
10
  import fs from "fs";
@@ -379,4 +379,4 @@ export function POST(_request: Request) {
379
379
  export {
380
380
  createCommand
381
381
  };
382
- //# sourceMappingURL=create-QOS2IG5A.js.map
382
+ //# sourceMappingURL=create-4GTVO2DS.js.map
@@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.met
2
2
  import {
3
3
  log,
4
4
  showBanner
5
- } from "./chunk-LCJYRHLH.js";
5
+ } from "./chunk-5YFLZUDY.js";
6
6
 
7
7
  // commands/dev.ts
8
8
  import fs from "fs";
@@ -38,4 +38,4 @@ async function devCommand() {
38
38
  export {
39
39
  devCommand
40
40
  };
41
- //# sourceMappingURL=dev-DDIMJLGZ.js.map
41
+ //# sourceMappingURL=dev-UAICBXU7.js.map
@@ -3,7 +3,7 @@ import {
3
3
  VERSION,
4
4
  log,
5
5
  showBanner
6
- } from "./chunk-LCJYRHLH.js";
6
+ } from "./chunk-5YFLZUDY.js";
7
7
 
8
8
  // commands/doctor.ts
9
9
  import fs from "fs";
@@ -45,4 +45,4 @@ export {
45
45
  doctorCommand,
46
46
  infoCommand
47
47
  };
48
- //# sourceMappingURL=doctor-3ZDV25A2.js.map
48
+ //# sourceMappingURL=doctor-3ULSDUPS.js.map
@@ -4,7 +4,7 @@ import {
4
4
  capitalize,
5
5
  log,
6
6
  pascalCase
7
- } from "./chunk-LCJYRHLH.js";
7
+ } from "./chunk-5YFLZUDY.js";
8
8
 
9
9
  // commands/generate.ts
10
10
  import fs from "fs";
@@ -199,4 +199,4 @@ export function use${pascalCase(n)}() {
199
199
  export {
200
200
  generateCommand
201
201
  };
202
- //# sourceMappingURL=generate-GVG7FJDW.js.map
202
+ //# sourceMappingURL=generate-U3OAQ6BI.js.map
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  VERSION,
5
5
  log,
6
6
  showBanner
7
- } from "./chunk-LCJYRHLH.js";
7
+ } from "./chunk-5YFLZUDY.js";
8
8
 
9
9
  // index.ts
10
10
  import pc from "picocolors";
@@ -47,51 +47,53 @@ async function main() {
47
47
  }
48
48
  switch (command) {
49
49
  case "create": {
50
- const { createCommand } = await import("./create-QOS2IG5A.js");
50
+ const { createCommand } = await import("./create-4GTVO2DS.js");
51
51
  await createCommand(args[1]);
52
52
  break;
53
53
  }
54
54
  case "dev": {
55
- const { devCommand } = await import("./dev-DDIMJLGZ.js");
55
+ const { devCommand } = await import("./dev-UAICBXU7.js");
56
56
  await devCommand();
57
57
  break;
58
58
  }
59
59
  case "build": {
60
- const { buildCommand } = await import("./build-RRUAQI7O.js");
60
+ const { buildCommand } = await import("./build-2OFZZO7B.js");
61
61
  await buildCommand();
62
62
  break;
63
63
  }
64
64
  case "start": {
65
- const { startCommand } = await import("./build-RRUAQI7O.js");
65
+ const { startCommand } = await import("./build-2OFZZO7B.js");
66
66
  await startCommand();
67
67
  break;
68
68
  }
69
69
  case "g":
70
70
  case "generate": {
71
- const { generateCommand } = await import("./generate-GVG7FJDW.js");
71
+ const { generateCommand } = await import("./generate-U3OAQ6BI.js");
72
72
  await generateCommand(args[1], args[2]);
73
73
  break;
74
74
  }
75
75
  case "doctor": {
76
- const { doctorCommand } = await import("./doctor-3ZDV25A2.js");
76
+ const { doctorCommand } = await import("./doctor-3ULSDUPS.js");
77
77
  await doctorCommand();
78
78
  break;
79
79
  }
80
80
  case "info": {
81
- const { infoCommand } = await import("./doctor-3ZDV25A2.js");
81
+ const { infoCommand } = await import("./doctor-3ULSDUPS.js");
82
82
  await infoCommand();
83
83
  break;
84
84
  }
85
- case "analyze":
86
- log.info("Bundle analysis coming soon...");
85
+ case "analyze": {
86
+ const { analyzeCommand } = await import("./analyze-J4ZXR6SK.js");
87
+ await analyzeCommand();
87
88
  break;
89
+ }
88
90
  case "pack": {
89
- const { packCommand } = await import("./pack-DHCJCDBT.js");
91
+ const { packCommand } = await import("./pack-OTG6XUQ6.js");
90
92
  await packCommand(args.slice(1));
91
93
  break;
92
94
  }
93
95
  case "ui": {
94
- const { handleUiCommand } = await import("./ui-YJZUD3SH.js");
96
+ const { handleUiCommand } = await import("./ui-HEIZJSQB.js");
95
97
  await handleUiCommand(args.slice(1));
96
98
  break;
97
99
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * Velix v5 CLI\n *\n * Commands:\n * velix create <name> Create a new Velix project\n * velix dev Start development server\n * velix build Build for production\n * velix start Start production server\n * velix g <type> <name> Generate (page, component, api, layout, middleware, etc.)\n * velix doctor Health check\n * velix info Framework info\n * velix analyze Bundle analysis\n */\n\nimport pc from 'picocolors';\nimport { VERSION } from './version.js';\nimport { showBanner, log } from './commands/shared.js';\n\n// ============================================================================\n// Help\n// ============================================================================\n\nfunction showHelp() {\n showBanner();\n console.log(` ${pc.bold('Usage:')} velix <command> [options]`);\n console.log('');\n console.log(` ${pc.bold('Commands:')}`);\n console.log(` ${pc.cyan('create')} <name> Create a new Velix project`);\n console.log(` ${pc.cyan('dev')} Start development server`);\n console.log(` ${pc.cyan('build')} Build for production`);\n console.log(` ${pc.cyan('start')} Start production server`);\n console.log(` ${pc.cyan('g')} <type> <name> Generate component/page/api/...`);\n console.log(` ${pc.cyan('ui')} add <component> Install Shadcn-style UI components`);\n console.log(` ${pc.cyan('pack')} [options] Velix Pack diagnostics (--analyze, --debug, --profile)`);\n console.log(` ${pc.cyan('doctor')} Health check & diagnostics`);\n console.log(` ${pc.cyan('info')} Framework & environment info`);\n console.log(` ${pc.cyan('analyze')} Bundle analysis`);\n console.log('');\n console.log(` ${pc.bold('Generate types:')}`);\n console.log(` page, layout, component, hook, api, action, middleware, context, loading, error, not-found`);\n console.log('');\n console.log(` ${pc.bold('Examples:')}`);\n console.log(` ${pc.dim('$')} velix create my-app`);\n console.log(` ${pc.dim('$')} velix dev`);\n console.log(` ${pc.dim('$')} velix g page dashboard`);\n console.log(` ${pc.dim('$')} velix g api users`);\n console.log('');\n}\n\n// ============================================================================\n// Main CLI\n// ============================================================================\n\nasync function main() {\n const args = process.argv.slice(2);\n const command = args[0];\n\n if (!command || command === '--help' || command === '-h') {\n showHelp();\n return;\n }\n\n if (command === '--version' || command === '-v') {\n console.log(`velix v${VERSION}`);\n return;\n }\n\n switch (command) {\n case 'create': {\n const { createCommand } = await import('./commands/create.js');\n await createCommand(args[1]);\n break;\n }\n case 'dev': {\n const { devCommand } = await import('./commands/dev.js');\n await devCommand();\n break;\n }\n case 'build': {\n const { buildCommand } = await import('./commands/build.js');\n await buildCommand();\n break;\n }\n case 'start': {\n const { startCommand } = await import('./commands/build.js');\n await startCommand();\n break;\n }\n case 'g':\n case 'generate': {\n const { generateCommand } = await import('./commands/generate.js');\n await generateCommand(args[1], args[2]);\n break;\n }\n case 'doctor': {\n const { doctorCommand } = await import('./commands/doctor.js');\n await doctorCommand();\n break;\n }\n case 'info': {\n const { infoCommand } = await import('./commands/doctor.js');\n await infoCommand();\n break;\n }\n case 'analyze':\n log.info('Bundle analysis coming soon...');\n break;\n case 'pack': {\n const { packCommand } = await import('./commands/pack.js');\n await packCommand(args.slice(1));\n break;\n }\n\n case 'ui': {\n const { handleUiCommand } = await import('./commands/ui.js');\n await handleUiCommand(args.slice(1));\n break;\n }\n default:\n log.error(`Unknown command: ${command}`);\n showHelp();\n process.exit(1);\n }\n}\n\n// ============================================================================\n// Run\n// ============================================================================\n\nmain().catch(err => {\n log.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;AAgBA,OAAO,QAAQ;AAQf,SAAS,WAAW;AAClB,aAAW;AACX,UAAQ,IAAI,KAAK,GAAG,KAAK,QAAQ,CAAC,4BAA4B;AAC9D,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,KAAK,GAAG,KAAK,WAAW,CAAC,EAAE;AACvC,UAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,6CAA6C;AACjF,UAAQ,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,8CAA8C;AAC/E,UAAQ,IAAI,OAAO,GAAG,KAAK,OAAO,CAAC,wCAAwC;AAC3E,UAAQ,IAAI,OAAO,GAAG,KAAK,OAAO,CAAC,2CAA2C;AAC9E,UAAQ,IAAI,OAAO,GAAG,KAAK,GAAG,CAAC,uDAAuD;AACtF,UAAQ,IAAI,OAAO,GAAG,KAAK,IAAI,CAAC,uDAAuD;AACvF,UAAQ,IAAI,OAAO,GAAG,KAAK,MAAM,CAAC,8EAA8E;AAChH,UAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,6CAA6C;AACjF,UAAQ,IAAI,OAAO,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qBAAqB;AAC3D,YAAM,aAAa;AACnB;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,KAAK,YAAY;AACf,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,wBAAwB;AACjE,YAAM,gBAAgB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AACtC;AAAA,IACF;AAAA,IACA,KAAK,UAAU;AACb,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,sBAAsB;AAC7D,YAAM,cAAc;AACpB;AAAA,IACF;AAAA,IACA,KAAK,QAAQ;AACX,YAAM,EAAE,YAAY,IAAI,MAAM,OAAO,sBAAsB;AAC3D,YAAM,YAAY;AAClB;AAAA,IACF;AAAA,IACA,KAAK;AACH,UAAI,KAAK,gCAAgC;AACzC;AAAA,IACF,KAAK,QAAQ;AACX,YAAM,EAAE,YAAY,IAAI,MAAM,OAAO,oBAAoB;AACzD,YAAM,YAAY,KAAK,MAAM,CAAC,CAAC;AAC/B;AAAA,IACF;AAAA,IAEA,KAAK,MAAM;AACT,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,kBAAkB;AAC3D,YAAM,gBAAgB,KAAK,MAAM,CAAC,CAAC;AACnC;AAAA,IACF;AAAA,IACA;AACE,UAAI,MAAM,oBAAoB,OAAO,EAAE;AACvC,eAAS;AACT,cAAQ,KAAK,CAAC;AAAA,EAClB;AACF;AAMA,KAAK,EAAE,MAAM,SAAO;AAClB,MAAI,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAC1D,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * Velix v5 CLI\n *\n * Commands:\n * velix create <name> Create a new Velix project\n * velix dev Start development server\n * velix build Build for production\n * velix start Start production server\n * velix g <type> <name> Generate (page, component, api, layout, middleware, etc.)\n * velix doctor Health check\n * velix info Framework info\n * velix analyze Bundle analysis\n */\n\nimport pc from 'picocolors';\nimport { VERSION } from './version.js';\nimport { showBanner, log } from './commands/shared.js';\n\n// ============================================================================\n// Help\n// ============================================================================\n\nfunction showHelp() {\n showBanner();\n console.log(` ${pc.bold('Usage:')} velix <command> [options]`);\n console.log('');\n console.log(` ${pc.bold('Commands:')}`);\n console.log(` ${pc.cyan('create')} <name> Create a new Velix project`);\n console.log(` ${pc.cyan('dev')} Start development server`);\n console.log(` ${pc.cyan('build')} Build for production`);\n console.log(` ${pc.cyan('start')} Start production server`);\n console.log(` ${pc.cyan('g')} <type> <name> Generate component/page/api/...`);\n console.log(` ${pc.cyan('ui')} add <component> Install Shadcn-style UI components`);\n console.log(` ${pc.cyan('pack')} [options] Velix Pack diagnostics (--analyze, --debug, --profile)`);\n console.log(` ${pc.cyan('doctor')} Health check & diagnostics`);\n console.log(` ${pc.cyan('info')} Framework & environment info`);\n console.log(` ${pc.cyan('analyze')} Bundle analysis`);\n console.log('');\n console.log(` ${pc.bold('Generate types:')}`);\n console.log(` page, layout, component, hook, api, action, middleware, context, loading, error, not-found`);\n console.log('');\n console.log(` ${pc.bold('Examples:')}`);\n console.log(` ${pc.dim('$')} velix create my-app`);\n console.log(` ${pc.dim('$')} velix dev`);\n console.log(` ${pc.dim('$')} velix g page dashboard`);\n console.log(` ${pc.dim('$')} velix g api users`);\n console.log('');\n}\n\n// ============================================================================\n// Main CLI\n// ============================================================================\n\nasync function main() {\n const args = process.argv.slice(2);\n const command = args[0];\n\n if (!command || command === '--help' || command === '-h') {\n showHelp();\n return;\n }\n\n if (command === '--version' || command === '-v') {\n console.log(`velix v${VERSION}`);\n return;\n }\n\n switch (command) {\n case 'create': {\n const { createCommand } = await import('./commands/create.js');\n await createCommand(args[1]);\n break;\n }\n case 'dev': {\n const { devCommand } = await import('./commands/dev.js');\n await devCommand();\n break;\n }\n case 'build': {\n const { buildCommand } = await import('./commands/build.js');\n await buildCommand();\n break;\n }\n case 'start': {\n const { startCommand } = await import('./commands/build.js');\n await startCommand();\n break;\n }\n case 'g':\n case 'generate': {\n const { generateCommand } = await import('./commands/generate.js');\n await generateCommand(args[1], args[2]);\n break;\n }\n case 'doctor': {\n const { doctorCommand } = await import('./commands/doctor.js');\n await doctorCommand();\n break;\n }\n case 'info': {\n const { infoCommand } = await import('./commands/doctor.js');\n await infoCommand();\n break;\n }\n case 'analyze': {\n const { analyzeCommand } = await import('./commands/analyze.js');\n await analyzeCommand();\n break;\n }\n case 'pack': {\n const { packCommand } = await import('./commands/pack.js');\n await packCommand(args.slice(1));\n break;\n }\n\n case 'ui': {\n const { handleUiCommand } = await import('./commands/ui.js');\n await handleUiCommand(args.slice(1));\n break;\n }\n default:\n log.error(`Unknown command: ${command}`);\n showHelp();\n process.exit(1);\n }\n}\n\n// ============================================================================\n// Run\n// ============================================================================\n\nmain().catch(err => {\n log.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;AAgBA,OAAO,QAAQ;AAQf,SAAS,WAAW;AAClB,aAAW;AACX,UAAQ,IAAI,KAAK,GAAG,KAAK,QAAQ,CAAC,4BAA4B;AAC9D,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,KAAK,GAAG,KAAK,WAAW,CAAC,EAAE;AACvC,UAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,6CAA6C;AACjF,UAAQ,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,8CAA8C;AAC/E,UAAQ,IAAI,OAAO,GAAG,KAAK,OAAO,CAAC,wCAAwC;AAC3E,UAAQ,IAAI,OAAO,GAAG,KAAK,OAAO,CAAC,2CAA2C;AAC9E,UAAQ,IAAI,OAAO,GAAG,KAAK,GAAG,CAAC,uDAAuD;AACtF,UAAQ,IAAI,OAAO,GAAG,KAAK,IAAI,CAAC,uDAAuD;AACvF,UAAQ,IAAI,OAAO,GAAG,KAAK,MAAM,CAAC,8EAA8E;AAChH,UAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,6CAA6C;AACjF,UAAQ,IAAI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,OAAO,qBAAqB;AAC3D,YAAM,aAAa;AACnB;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,KAAK,YAAY;AACf,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,wBAAwB;AACjE,YAAM,gBAAgB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AACtC;AAAA,IACF;AAAA,IACA,KAAK,UAAU;AACb,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,sBAAsB;AAC7D,YAAM,cAAc;AACpB;AAAA,IACF;AAAA,IACA,KAAK,QAAQ;AACX,YAAM,EAAE,YAAY,IAAI,MAAM,OAAO,sBAAsB;AAC3D,YAAM,YAAY;AAClB;AAAA,IACF;AAAA,IACA,KAAK,WAAW;AACd,YAAM,EAAE,eAAe,IAAI,MAAM,OAAO,uBAAuB;AAC/D,YAAM,eAAe;AACrB;AAAA,IACF;AAAA,IACA,KAAK,QAAQ;AACX,YAAM,EAAE,YAAY,IAAI,MAAM,OAAO,oBAAoB;AACzD,YAAM,YAAY,KAAK,MAAM,CAAC,CAAC;AAC/B;AAAA,IACF;AAAA,IAEA,KAAK,MAAM;AACT,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,kBAAkB;AAC3D,YAAM,gBAAgB,KAAK,MAAM,CAAC,CAAC;AACnC;AAAA,IACF;AAAA,IACA;AACE,UAAI,MAAM,oBAAoB,OAAO,EAAE;AACvC,eAAS;AACT,cAAQ,KAAK,CAAC;AAAA,EAClB;AACF;AAMA,KAAK,EAAE,MAAM,SAAO;AAClB,MAAI,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAC1D,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
@@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.met
2
2
  import {
3
3
  log,
4
4
  showBanner
5
- } from "./chunk-LCJYRHLH.js";
5
+ } from "./chunk-5YFLZUDY.js";
6
6
 
7
7
  // commands/pack.ts
8
8
  import pc from "picocolors";
@@ -13,7 +13,7 @@ async function packCommand(args) {
13
13
  const isDebug = args.includes("--debug");
14
14
  const isProfile = args.includes("--profile");
15
15
  try {
16
- const { VelixPack, formatBuildStats } = await import("./src-BXA4CRFC.js");
16
+ const { VelixPack, formatBuildStats } = await import("./src-5Q73PUIX.js");
17
17
  const pack = new VelixPack({
18
18
  projectRoot: process.cwd(),
19
19
  mode: "production"
@@ -33,4 +33,4 @@ async function packCommand(args) {
33
33
  export {
34
34
  packCommand
35
35
  };
36
- //# sourceMappingURL=pack-DHCJCDBT.js.map
36
+ //# sourceMappingURL=pack-OTG6XUQ6.js.map
@@ -136,6 +136,10 @@ function isServerModule(filePath, content) {
136
136
  return false;
137
137
  }
138
138
  function isClientModule(filePath, content) {
139
+ const normalized = filePath.replace(/\\/g, "/");
140
+ if (normalized.includes("/components/") || normalized.startsWith("components/") || normalized.includes("/client/")) {
141
+ return true;
142
+ }
139
143
  if (content) {
140
144
  const firstLines = content.split("\n").slice(0, 5).map((l) => l.trim());
141
145
  if (firstLines.some((l) => l === "'use client'" || l === '"use client"' || l === "'use island'" || l === '"use island"')) {
@@ -557,24 +561,41 @@ var Bundler = class {
557
561
  async bundle(moduleGraph) {
558
562
  const splitter = new CodeSplitter(moduleGraph);
559
563
  const chunks = splitter.splitIntoChunks();
560
- const entryFiles = Array.from(moduleGraph.getAllModules().values()).map((m) => m.path).filter((p) => fs5.existsSync(p));
561
- if (entryFiles.length === 0) return chunks;
564
+ const allModules = Array.from(moduleGraph.getAllModules().values());
565
+ const serverFiles = allModules.filter((m) => m.type !== "client" && fs5.existsSync(m.path)).map((m) => m.path);
566
+ const clientFiles = allModules.filter((m) => m.type === "client" && fs5.existsSync(m.path)).map((m) => m.path);
562
567
  const serverOutDir = path7.join(this.outDir, "server");
563
568
  const clientOutDir = path7.join(this.outDir, "client");
564
569
  if (!fs5.existsSync(serverOutDir)) fs5.mkdirSync(serverOutDir, { recursive: true });
565
570
  if (!fs5.existsSync(clientOutDir)) fs5.mkdirSync(clientOutDir, { recursive: true });
566
- await esbuild2.build({
567
- entryPoints: entryFiles,
568
- outdir: serverOutDir,
569
- bundle: false,
570
- format: "esm",
571
- platform: "node",
572
- target: "es2022",
573
- minify: this.minify,
574
- sourcemap: this.sourcemap,
575
- jsx: "automatic",
576
- logLevel: "silent"
577
- });
571
+ if (serverFiles.length > 0) {
572
+ await esbuild2.build({
573
+ entryPoints: serverFiles,
574
+ outdir: serverOutDir,
575
+ bundle: false,
576
+ format: "esm",
577
+ platform: "node",
578
+ target: "es2022",
579
+ minify: this.minify,
580
+ sourcemap: this.sourcemap,
581
+ jsx: "automatic",
582
+ logLevel: "silent"
583
+ });
584
+ }
585
+ if (clientFiles.length > 0) {
586
+ await esbuild2.build({
587
+ entryPoints: clientFiles,
588
+ outdir: clientOutDir,
589
+ bundle: false,
590
+ format: "esm",
591
+ platform: "browser",
592
+ target: "es2022",
593
+ minify: this.minify,
594
+ sourcemap: this.sourcemap,
595
+ jsx: "automatic",
596
+ logLevel: "silent"
597
+ });
598
+ }
578
599
  return chunks;
579
600
  }
580
601
  };
@@ -718,6 +739,7 @@ client: ${v.clientModule}
718
739
  server: ${v.serverModule}
719
740
  `);
720
741
  }
742
+ throw new Error(`[VELIX_PACK] Build failed due to ${violations.length} server/client boundary violation(s).`);
721
743
  }
722
744
  const chunks = await this.bundler.bundle(this.moduleGraph);
723
745
  const cacheStats = this.cache.getStats();
@@ -764,29 +786,36 @@ server: ${v.serverModule}
764
786
  await this.processFile(filePath);
765
787
  return this.moduleGraph.getAffectedModules(filePath);
766
788
  }
789
+ processingSet = /* @__PURE__ */ new Set();
767
790
  async processFile(filePath) {
768
- const relativeId = this.moduleGraph.toRelativeId(filePath);
769
- const transformResult = await this.pipeline.transform(filePath);
770
- let cached = this.cache.get(relativeId, transformResult.hash);
771
- if (!cached) {
772
- cached = {
773
- hash: transformResult.hash,
774
- code: transformResult.code,
775
- imports: transformResult.imports,
776
- type: transformResult.type,
777
- timestamp: Date.now()
778
- };
779
- this.cache.set(relativeId, cached);
780
- }
781
- const mod = this.moduleGraph.addModule(filePath, transformResult.type);
782
- mod.hash = transformResult.hash;
783
- this.moduleGraph.updateDependencies(filePath, transformResult.imports);
784
- for (const importPath of transformResult.imports) {
785
- if (!this.moduleGraph.getModuleByPath(importPath)) {
786
- if (fs6.existsSync(importPath)) {
787
- await this.processFile(importPath);
791
+ if (this.processingSet.has(filePath)) return;
792
+ this.processingSet.add(filePath);
793
+ try {
794
+ const relativeId = this.moduleGraph.toRelativeId(filePath);
795
+ const transformResult = await this.pipeline.transform(filePath);
796
+ let cached = this.cache.get(relativeId, transformResult.hash);
797
+ if (!cached) {
798
+ cached = {
799
+ hash: transformResult.hash,
800
+ code: transformResult.code,
801
+ imports: transformResult.imports,
802
+ type: transformResult.type,
803
+ timestamp: Date.now()
804
+ };
805
+ this.cache.set(relativeId, cached);
806
+ }
807
+ const mod = this.moduleGraph.addModule(filePath, transformResult.type);
808
+ mod.hash = transformResult.hash;
809
+ this.moduleGraph.updateDependencies(filePath, transformResult.imports);
810
+ for (const importPath of transformResult.imports) {
811
+ if (!this.moduleGraph.getModuleByPath(importPath)) {
812
+ if (fs6.existsSync(importPath)) {
813
+ await this.processFile(importPath);
814
+ }
788
815
  }
789
816
  }
817
+ } finally {
818
+ this.processingSet.delete(filePath);
790
819
  }
791
820
  }
792
821
  findSourceFiles(dir) {
@@ -819,4 +848,4 @@ export {
819
848
  VelixPack,
820
849
  formatBuildStats
821
850
  };
822
- //# sourceMappingURL=src-BXA4CRFC.js.map
851
+ //# sourceMappingURL=src-5Q73PUIX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../velix-pack/src/index.ts","../../velix-pack/src/resolver/index.ts","../../velix-pack/src/resolver/aliases.ts","../../velix-pack/src/graph/module-graph.ts","../../velix-pack/src/graph/module.ts","../../velix-pack/src/graph/boundary.ts","../../velix-pack/src/transform/index.ts","../../velix-pack/src/transform/typescript.ts","../../velix-pack/src/transform/css.ts","../../velix-pack/src/transform/json.ts","../../velix-pack/src/cache/fs-cache.ts","../../velix-pack/src/cache/index.ts","../../velix-pack/src/bundler/index.ts","../../velix-pack/src/bundler/chunk.ts","../../velix-pack/src/bundler/code-splitter.ts","../../velix-pack/src/watcher/index.ts","../../velix-pack/src/hmr/index.ts","../../velix-pack/src/analyzer/index.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport { Resolver } from './resolver/index.js';\nimport { ModuleGraph } from './graph/module-graph.js';\nimport { TransformPipeline } from './transform/index.js';\nimport { CacheManager } from './cache/index.js';\nimport { Bundler } from './bundler/index.js';\nimport { FileWatcher } from './watcher/index.js';\nimport { HMRBridge } from './hmr/index.js';\nimport { formatBuildStats } from './analyzer/index.js';\nimport { PackOptions, BuildStats } from './types.js';\n\nexport * from './types.js';\nexport { Resolver } from './resolver/index.js';\nexport { ModuleGraph } from './graph/module-graph.js';\nexport { CacheManager } from './cache/index.js';\nexport { formatBuildStats } from './analyzer/index.js';\n\nexport class VelixPack {\n private options: Required<PackOptions>;\n private resolver: Resolver;\n private moduleGraph: ModuleGraph;\n private pipeline: TransformPipeline;\n private cache: CacheManager;\n private bundler: Bundler;\n private watcher: FileWatcher | null = null;\n private hmr: HMRBridge = new HMRBridge();\n private stats: BuildStats = {\n duration: 0,\n modulesCount: 0,\n chunksCount: 0,\n cacheHits: 0,\n cacheMisses: 0,\n serverModulesCount: 0,\n clientModulesCount: 0,\n sharedModulesCount: 0,\n initialJsSize: 0,\n asyncJsSize: 0,\n };\n\n constructor(options: PackOptions = {}) {\n const projectRoot = options.projectRoot || process.cwd();\n this.options = {\n projectRoot,\n appDir: options.appDir || path.join(projectRoot, 'app'),\n outDir: options.outDir || path.join(projectRoot, '.velix'),\n mode: options.mode || 'development',\n minify: options.minify ?? false,\n sourcemap: options.sourcemap ?? true,\n };\n\n this.resolver = new Resolver({ projectRoot });\n this.moduleGraph = new ModuleGraph(projectRoot);\n this.pipeline = new TransformPipeline(this.resolver);\n this.cache = new CacheManager(projectRoot);\n this.bundler = new Bundler({\n projectRoot,\n outDir: this.options.outDir,\n minify: this.options.minify,\n sourcemap: this.options.sourcemap,\n });\n }\n\n public async build(): Promise<BuildStats> {\n const startTime = Date.now();\n\n // 1. Discover entries\n const sourceFiles = this.findSourceFiles(this.options.appDir);\n const serverFiles = fs.existsSync(path.join(this.options.projectRoot, 'server'))\n ? this.findSourceFiles(path.join(this.options.projectRoot, 'server'))\n : [];\n const allFiles = Array.from(new Set([...sourceFiles, ...serverFiles]));\n\n // 2. Build graph & transform modules\n for (const filePath of allFiles) {\n await this.processFile(filePath);\n }\n\n // 3. Check boundaries\n const violations = this.moduleGraph.checkBoundaries();\n if (violations.length > 0) {\n for (const v of violations) {\n console.error(`ERROR [VELIX_PACK]\\nServer module imported from client module.\\nclient: ${v.clientModule}\\nserver: ${v.serverModule}\\n`);\n }\n throw new Error(`[VELIX_PACK] Build failed due to ${violations.length} server/client boundary violation(s).`);\n }\n\n // 4. Bundle & split chunks\n const chunks = await this.bundler.bundle(this.moduleGraph);\n\n // 5. Gather statistics\n const cacheStats = this.cache.getStats();\n const modules = Array.from(this.moduleGraph.getAllModules().values());\n\n this.stats = {\n duration: Date.now() - startTime,\n modulesCount: modules.length,\n chunksCount: chunks.length,\n cacheHits: cacheStats.hits,\n cacheMisses: cacheStats.misses,\n serverModulesCount: modules.filter(m => m.type === 'server').length,\n clientModulesCount: modules.filter(m => m.type === 'client').length,\n sharedModulesCount: modules.filter(m => m.type === 'shared').length,\n initialJsSize: chunks.filter(c => c.isInitial).reduce((acc, c) => acc + c.size, 0),\n asyncJsSize: chunks.filter(c => !c.isInitial).reduce((acc, c) => acc + c.size, 0),\n };\n\n return this.stats;\n }\n\n public watch(onRebuild?: (affectedModules: string[]) => void): FileWatcher {\n const serverDir = path.join(this.options.projectRoot, 'server');\n const watchPaths = [this.options.appDir];\n if (fs.existsSync(serverDir)) watchPaths.push(serverDir);\n\n this.watcher = new FileWatcher(watchPaths);\n this.watcher.start({\n onChange: async (filePath) => {\n const affected = await this.rebuildIncremental(filePath);\n this.hmr.notifyFileChanged(filePath, Array.from(affected));\n if (onRebuild) onRebuild(Array.from(affected));\n },\n onAdd: async (filePath) => {\n await this.processFile(filePath);\n const affected = this.moduleGraph.getAffectedModules(filePath);\n if (onRebuild) onRebuild(Array.from(affected));\n },\n onUnlink: (filePath) => {\n const affected = this.moduleGraph.removeModule(filePath);\n this.cache.invalidate(this.moduleGraph.toRelativeId(filePath));\n if (onRebuild) onRebuild(Array.from(affected));\n },\n });\n\n return this.watcher;\n }\n\n private async rebuildIncremental(filePath: string): Promise<Set<string>> {\n await this.processFile(filePath);\n return this.moduleGraph.getAffectedModules(filePath);\n }\n\n private processingSet = new Set<string>();\n\n private async processFile(filePath: string): Promise<void> {\n if (this.processingSet.has(filePath)) return;\n this.processingSet.add(filePath);\n\n try {\n const relativeId = this.moduleGraph.toRelativeId(filePath);\n\n // Transform\n const transformResult = await this.pipeline.transform(filePath);\n\n // Check cache\n let cached = this.cache.get(relativeId, transformResult.hash);\n if (!cached) {\n cached = {\n hash: transformResult.hash,\n code: transformResult.code,\n imports: transformResult.imports,\n type: transformResult.type,\n timestamp: Date.now(),\n };\n this.cache.set(relativeId, cached);\n }\n\n // Add to graph\n const mod = this.moduleGraph.addModule(filePath, transformResult.type);\n mod.hash = transformResult.hash;\n\n // Update dependencies graph\n this.moduleGraph.updateDependencies(filePath, transformResult.imports);\n\n // Recursively process unvisited imports\n for (const importPath of transformResult.imports) {\n if (!this.moduleGraph.getModuleByPath(importPath)) {\n if (fs.existsSync(importPath)) {\n await this.processFile(importPath);\n }\n }\n }\n } finally {\n this.processingSet.delete(filePath);\n }\n }\n\n private findSourceFiles(dir: string): string[] {\n const results: string[] = [];\n if (!fs.existsSync(dir)) return results;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules' && entry.name !== '.velix' && entry.name !== 'dist') {\n results.push(...this.findSourceFiles(fullPath));\n }\n } else if (/\\.(tsx?|jsx?)$/.test(entry.name)) {\n results.push(fullPath);\n }\n }\n\n return results;\n }\n\n public getHMR(): HMRBridge {\n return this.hmr;\n }\n\n public getStats(): BuildStats {\n return this.stats;\n }\n}\n","import fs from 'fs';\nimport path from 'path';\nimport { loadPathAliases, PathAlias } from './aliases.js';\n\nexport interface ResolverOptions {\n projectRoot: string;\n extensions?: string[];\n}\n\nexport class Resolver {\n private projectRoot: string;\n private aliases: PathAlias[];\n private extensions: string[];\n\n constructor(options: ResolverOptions) {\n this.projectRoot = options.projectRoot;\n this.aliases = loadPathAliases(this.projectRoot);\n this.extensions = options.extensions || ['.tsx', '.ts', '.jsx', '.js', '.json', '.css'];\n }\n\n public resolve(importPath: string, importerPath: string): string | null {\n // 1. External packages (node_modules or bare specifiers)\n if (!importPath.startsWith('.') && !importPath.startsWith('/') && !this.isAliasMatch(importPath)) {\n return null; // External package\n }\n\n // 2. Resolve alias\n let targetPath = importPath;\n for (const alias of this.aliases) {\n if (importPath === alias.prefix || importPath.startsWith(alias.prefix + '/')) {\n targetPath = importPath.replace(alias.prefix, alias.target);\n break;\n }\n }\n\n // 3. Absolute vs relative resolution\n let absolutePath = targetPath;\n if (!path.isAbsolute(targetPath)) {\n absolutePath = path.resolve(path.dirname(importerPath), targetPath);\n }\n\n // 4. Check if exact file exists\n if (fs.existsSync(absolutePath) && fs.statSync(absolutePath).isFile()) {\n return absolutePath;\n }\n\n // 4b. Handle ESM .js -> .ts / .tsx mapping\n if (absolutePath.endsWith('.js')) {\n const tsPath = absolutePath.slice(0, -3) + '.ts';\n const tsxPath = absolutePath.slice(0, -3) + '.tsx';\n if (fs.existsSync(tsPath) && fs.statSync(tsPath).isFile()) return tsPath;\n if (fs.existsSync(tsxPath) && fs.statSync(tsxPath).isFile()) return tsxPath;\n }\n\n // 5. Try extensions\n for (const ext of this.extensions) {\n const pathWithExt = absolutePath + ext;\n if (fs.existsSync(pathWithExt) && fs.statSync(pathWithExt).isFile()) {\n return pathWithExt;\n }\n }\n\n // 6. Try index file\n for (const ext of this.extensions) {\n const indexPath = path.join(absolutePath, `index${ext}`);\n if (fs.existsSync(indexPath) && fs.statSync(indexPath).isFile()) {\n return indexPath;\n }\n }\n\n return null;\n }\n\n private isAliasMatch(importPath: string): boolean {\n return this.aliases.some(alias => importPath === alias.prefix || importPath.startsWith(alias.prefix + '/'));\n }\n}\n","import fs from 'fs';\nimport path from 'path';\n\nexport interface PathAlias {\n prefix: string;\n target: string;\n}\n\nexport function loadPathAliases(projectRoot: string): PathAlias[] {\n const tsconfigPath = path.join(projectRoot, 'tsconfig.json');\n if (!fs.existsSync(tsconfigPath)) return [];\n\n try {\n const raw = fs.readFileSync(tsconfigPath, 'utf-8');\n // Strip comments simple regex for json\n const jsonStr = raw.replace(/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/.*/g, '');\n const tsconfig = JSON.parse(jsonStr);\n const compilerOptions = tsconfig?.compilerOptions || {};\n const paths = compilerOptions.paths || {};\n const baseUrl = compilerOptions.baseUrl ? path.resolve(projectRoot, compilerOptions.baseUrl) : projectRoot;\n\n const aliases: PathAlias[] = [];\n for (const [key, value] of Object.entries(paths)) {\n if (Array.isArray(value) && value.length > 0) {\n const prefix = key.replace(/\\/\\*$/, '');\n const targetRelative = (value[0] as string).replace(/\\/\\*$/, '');\n aliases.push({\n prefix,\n target: path.resolve(baseUrl, targetRelative),\n });\n }\n }\n\n return aliases;\n } catch {\n return [];\n }\n}\n","import path from 'path';\nimport { Module } from './module.js';\nimport { ModuleNode, ModuleType, BoundaryViolation } from '../types.js';\nimport { checkBoundaryViolations } from './boundary.js';\n\nexport class ModuleGraph {\n private modules: Map<string, Module> = new Map();\n private projectRoot: string;\n\n constructor(projectRoot: string) {\n this.projectRoot = projectRoot;\n }\n\n public getModule(id: string): Module | undefined {\n return this.modules.get(id);\n }\n\n public getModuleByPath(filePath: string): Module | undefined {\n const id = this.toRelativeId(filePath);\n return this.modules.get(id);\n }\n\n public addModule(filePath: string, type: ModuleType = 'shared'): Module {\n const id = this.toRelativeId(filePath);\n let mod = this.modules.get(id);\n if (!mod) {\n mod = new Module(id, filePath, type);\n this.modules.set(id, mod);\n } else {\n mod.type = type;\n }\n return mod;\n }\n\n public removeModule(filePath: string): Set<string> {\n const id = this.toRelativeId(filePath);\n const mod = this.modules.get(id);\n const affectedDependents = new Set<string>();\n\n if (mod) {\n // Collect dependents\n for (const depId of mod.dependents) {\n affectedDependents.add(depId);\n const depMod = this.modules.get(depId);\n if (depMod) {\n depMod.removeDependency(id);\n }\n }\n\n // Cleanup dependencies\n for (const depId of mod.dependencies) {\n const depMod = this.modules.get(depId);\n if (depMod) {\n depMod.removeDependent(id);\n }\n }\n\n this.modules.delete(id);\n }\n\n return affectedDependents;\n }\n\n public updateDependencies(filePath: string, dependencyPaths: string[]): void {\n const id = this.toRelativeId(filePath);\n const mod = this.getModule(id);\n if (!mod) return;\n\n const newDepIds = new Set(dependencyPaths.map(p => this.toRelativeId(p)));\n\n // Remove old dependencies no longer imported\n for (const oldDepId of Array.from(mod.dependencies)) {\n if (!newDepIds.has(oldDepId)) {\n mod.removeDependency(oldDepId);\n const depMod = this.modules.get(oldDepId);\n if (depMod) {\n depMod.removeDependent(id);\n }\n }\n }\n\n // Add new dependencies\n for (const newDepId of newDepIds) {\n if (!mod.dependencies.has(newDepId)) {\n mod.addDependency(newDepId);\n const depMod = this.modules.get(newDepId);\n if (depMod) {\n depMod.addDependent(id);\n }\n }\n }\n }\n\n /**\n * Finds all affected modules recursively when a file changes\n */\n public getAffectedModules(filePath: string): Set<string> {\n const startId = this.toRelativeId(filePath);\n const affected = new Set<string>();\n const queue = [startId];\n\n while (queue.length > 0) {\n const currentId = queue.shift()!;\n if (!affected.has(currentId)) {\n affected.add(currentId);\n const mod = this.modules.get(currentId);\n if (mod) {\n for (const dependentId of mod.dependents) {\n queue.push(dependentId);\n }\n }\n }\n }\n\n return affected;\n }\n\n public getAllModules(): Map<string, Module> {\n return this.modules;\n }\n\n public checkBoundaries(): BoundaryViolation[] {\n return checkBoundaryViolations(this.modules);\n }\n\n public toRelativeId(filePath: string): string {\n const relative = path.relative(this.projectRoot, filePath);\n return relative.replace(/\\\\/g, '/');\n }\n\n public clear(): void {\n this.modules.clear();\n }\n}\n","import { ModuleNode, ModuleType } from '../types.js';\n\nexport class Module implements ModuleNode {\n public id: string;\n public path: string;\n public type: ModuleType;\n public dependencies: Set<string> = new Set();\n public dependents: Set<string> = new Set();\n public hash?: string;\n public lastModified?: number;\n public isEntry?: boolean;\n\n constructor(id: string, path: string, type: ModuleType = 'shared') {\n this.id = id;\n this.path = path;\n this.type = type;\n }\n\n public addDependency(depId: string): void {\n this.dependencies.add(depId);\n }\n\n public removeDependency(depId: string): void {\n this.dependencies.delete(depId);\n }\n\n public addDependent(dependentId: string): void {\n this.dependents.add(dependentId);\n }\n\n public removeDependent(dependentId: string): void {\n this.dependents.delete(dependentId);\n }\n}\n","import path from 'path';\nimport { ModuleNode, BoundaryViolation } from '../types.js';\n\n/**\n * Checks if a module is classified as server-only by convention or path\n */\nexport function isServerModule(filePath: string, content?: string): boolean {\n const normalized = filePath.replace(/\\\\/g, '/');\n if (normalized.includes('/server/') || normalized.startsWith('server/')) return true;\n if (content) {\n const firstLines = content.split('\\n').slice(0, 5).map(l => l.trim());\n if (firstLines.some(l => l === \"'use server'\" || l === '\"use server\"')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Checks if a module is classified as client-only\n */\nexport function isClientModule(filePath: string, content?: string): boolean {\n const normalized = filePath.replace(/\\\\/g, '/');\n if (normalized.includes('/components/') || normalized.startsWith('components/') || normalized.includes('/client/')) {\n return true;\n }\n if (content) {\n const firstLines = content.split('\\n').slice(0, 5).map(l => l.trim());\n if (firstLines.some(l => l === \"'use client'\" || l === '\"use client\"' || l === \"'use island'\" || l === '\"use island\"')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Validates server/client boundary rules across the module graph\n */\nexport function checkBoundaryViolations(modules: Map<string, ModuleNode>): BoundaryViolation[] {\n const violations: BoundaryViolation[] = [];\n\n for (const [id, mod] of modules.entries()) {\n if (mod.type === 'client') {\n for (const depId of mod.dependencies) {\n const dep = modules.get(depId);\n if (dep && dep.type === 'server') {\n violations.push({\n clientModule: id,\n serverModule: depId,\n importStatement: `Import of server module \"${depId}\" from client module \"${id}\"`,\n });\n }\n }\n }\n }\n\n return violations;\n}\n","import fs from 'fs';\nimport path from 'path';\nimport crypto from 'crypto';\nimport { Resolver } from '../resolver/index.js';\nimport { transformTypeScript } from './typescript.js';\nimport { transformCSS } from './css.js';\nimport { transformJSON } from './json.js';\nimport { TransformResult } from '../types.js';\n\nexport class TransformPipeline {\n private resolver: Resolver;\n\n constructor(resolver: Resolver) {\n this.resolver = resolver;\n }\n\n public async transform(filePath: string): Promise<TransformResult> {\n const content = fs.readFileSync(filePath, 'utf-8');\n const hash = crypto.createHash('md5').update(content).digest('hex');\n const ext = path.extname(filePath);\n\n if (ext === '.ts' || ext === '.tsx' || ext === '.js' || ext === '.jsx') {\n const result = await transformTypeScript(filePath, content, this.resolver);\n return { ...result, hash };\n } else if (ext === '.css') {\n const result = await transformCSS(filePath, content);\n return { ...result, hash };\n } else if (ext === '.json') {\n const result = await transformJSON(filePath, content);\n return { ...result, hash };\n }\n\n return {\n code: content,\n imports: [],\n type: 'shared',\n hash,\n };\n }\n}\n","import esbuild from 'esbuild';\nimport fs from 'fs';\nimport path from 'path';\nimport { Resolver } from '../resolver/index.js';\nimport { isClientModule, isServerModule } from '../graph/boundary.js';\nimport { ModuleType } from '../types.js';\n\nexport interface TransformResultTS {\n code: string;\n map?: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformTypeScript(\n filePath: string,\n content: string,\n resolver: Resolver\n): Promise<TransformResultTS> {\n const ext = path.extname(filePath);\n const loader: esbuild.Loader = ext === '.tsx' ? 'tsx' : ext === '.jsx' ? 'jsx' : 'ts';\n\n const result = await esbuild.transform(content, {\n loader,\n target: 'es2022',\n format: 'esm',\n jsx: 'automatic',\n sourcemap: 'inline',\n sourcefile: filePath,\n });\n\n // Extract imports from code using regex or AST scan\n const imports = extractImports(content, filePath, resolver);\n\n // Determine type\n let type: ModuleType = 'shared';\n if (isServerModule(filePath, content)) {\n type = 'server';\n } else if (isClientModule(filePath, content)) {\n type = 'client';\n }\n\n return {\n code: result.code,\n map: result.map,\n imports,\n type,\n };\n}\n\nexport function extractImports(content: string, filePath: string, resolver: Resolver): string[] {\n const imports: string[] = [];\n // Regex matches static import statements & dynamic import()\n const importRegex = /(?:import|export)\\s+(?:[\\s\\S]*?\\s+from\\s+)?['\"]([^'\"]+)['\"]|import\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\n let match: RegExpExecArray | null;\n while ((match = importRegex.exec(content)) !== null) {\n const importPath = match[1] || match[2];\n if (importPath) {\n const resolved = resolver.resolve(importPath, filePath);\n if (resolved) {\n imports.push(resolved);\n }\n }\n }\n\n return Array.from(new Set(imports));\n}\n","import { ModuleType } from '../types.js';\n\nexport interface TransformResultCSS {\n code: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformCSS(filePath: string, content: string): Promise<TransformResultCSS> {\n // CSS transform simply packages CSS or passes it along\n return {\n code: content,\n imports: [],\n type: 'shared',\n };\n}\n","import { ModuleType } from '../types.js';\n\nexport interface TransformResultJSON {\n code: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformJSON(filePath: string, content: string): Promise<TransformResultJSON> {\n let code = '';\n try {\n const json = JSON.parse(content);\n code = `export default ${JSON.stringify(json)};`;\n } catch {\n code = `export default {};`;\n }\n\n return {\n code,\n imports: [],\n type: 'shared',\n };\n}\n","import fs from 'fs';\nimport path from 'path';\nimport { CacheEntry } from '../types.js';\n\nexport class FSCache {\n private cacheDir: string;\n private memoryCache: Map<string, CacheEntry> = new Map();\n\n constructor(projectRoot: string) {\n this.cacheDir = path.join(projectRoot, '.velix', 'cache', 'pack');\n this.ensureCacheDir();\n }\n\n private ensureCacheDir(): void {\n if (!fs.existsSync(this.cacheDir)) {\n fs.mkdirSync(this.cacheDir, { recursive: true });\n }\n }\n\n public get(id: string, currentHash: string): CacheEntry | null {\n // 1. Check memory cache first\n const mem = this.memoryCache.get(id);\n if (mem && mem.hash === currentHash) {\n return mem;\n }\n\n // 2. Check filesystem cache\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n\n if (fs.existsSync(filePath)) {\n try {\n const raw = fs.readFileSync(filePath, 'utf-8');\n const entry: CacheEntry = JSON.parse(raw);\n if (entry.hash === currentHash) {\n this.memoryCache.set(id, entry);\n return entry;\n }\n } catch {\n // Ignored, corrupt entry will be overwritten\n }\n }\n\n return null;\n }\n\n public set(id: string, entry: CacheEntry): void {\n this.memoryCache.set(id, entry);\n\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n\n try {\n this.ensureCacheDir();\n fs.writeFileSync(filePath, JSON.stringify(entry), 'utf-8');\n } catch {\n // Non-fatal cache write failure\n }\n }\n\n public invalidate(id: string): void {\n this.memoryCache.delete(id);\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n if (fs.existsSync(filePath)) {\n try {\n fs.unlinkSync(filePath);\n } catch {}\n }\n }\n\n public clear(): void {\n this.memoryCache.clear();\n if (fs.existsSync(this.cacheDir)) {\n try {\n fs.rmSync(this.cacheDir, { recursive: true, force: true });\n this.ensureCacheDir();\n } catch {}\n }\n }\n}\n","import { FSCache } from './fs-cache.js';\nimport { CacheEntry } from '../types.js';\n\nexport class CacheManager {\n private fsCache: FSCache;\n private hits: number = 0;\n private misses: number = 0;\n\n constructor(projectRoot: string) {\n this.fsCache = new FSCache(projectRoot);\n }\n\n public get(id: string, currentHash: string): CacheEntry | null {\n const entry = this.fsCache.get(id, currentHash);\n if (entry) {\n this.hits++;\n return entry;\n }\n this.misses++;\n return null;\n }\n\n public set(id: string, entry: CacheEntry): void {\n this.fsCache.set(id, entry);\n }\n\n public invalidate(id: string): void {\n this.fsCache.invalidate(id);\n }\n\n public clear(): void {\n this.fsCache.clear();\n this.hits = 0;\n this.misses = 0;\n }\n\n public getStats() {\n return {\n hits: this.hits,\n misses: this.misses,\n hitRatio: this.hits + this.misses > 0 ? (this.hits / (this.hits + this.misses)) * 100 : 0,\n };\n }\n}\n","import esbuild from 'esbuild';\nimport path from 'path';\nimport fs from 'fs';\nimport { ModuleGraph } from '../graph/module-graph.js';\nimport { CodeSplitter } from './code-splitter.js';\nimport { Chunk } from './chunk.js';\n\nexport interface BundlerOptions {\n projectRoot: string;\n outDir: string;\n minify?: boolean;\n sourcemap?: boolean;\n}\n\nexport class Bundler {\n private projectRoot: string;\n private outDir: string;\n private minify: boolean;\n private sourcemap: boolean;\n\n constructor(options: BundlerOptions) {\n this.projectRoot = options.projectRoot;\n this.outDir = options.outDir;\n this.minify = options.minify ?? false;\n this.sourcemap = options.sourcemap ?? true;\n }\n\n public async bundle(moduleGraph: ModuleGraph): Promise<Chunk[]> {\n const splitter = new CodeSplitter(moduleGraph);\n const chunks = splitter.splitIntoChunks();\n\n const allModules = Array.from(moduleGraph.getAllModules().values());\n const serverFiles = allModules\n .filter(m => m.type !== 'client' && fs.existsSync(m.path))\n .map(m => m.path);\n\n const clientFiles = allModules\n .filter(m => m.type === 'client' && fs.existsSync(m.path))\n .map(m => m.path);\n\n const serverOutDir = path.join(this.outDir, 'server');\n const clientOutDir = path.join(this.outDir, 'client');\n\n if (!fs.existsSync(serverOutDir)) fs.mkdirSync(serverOutDir, { recursive: true });\n if (!fs.existsSync(clientOutDir)) fs.mkdirSync(clientOutDir, { recursive: true });\n\n // 1. Bundle server modules\n if (serverFiles.length > 0) {\n await esbuild.build({\n entryPoints: serverFiles,\n outdir: serverOutDir,\n bundle: false,\n format: 'esm',\n platform: 'node',\n target: 'es2022',\n minify: this.minify,\n sourcemap: this.sourcemap,\n jsx: 'automatic',\n logLevel: 'silent',\n });\n }\n\n // 2. Bundle client modules\n if (clientFiles.length > 0) {\n await esbuild.build({\n entryPoints: clientFiles,\n outdir: clientOutDir,\n bundle: false,\n format: 'esm',\n platform: 'browser',\n target: 'es2022',\n minify: this.minify,\n sourcemap: this.sourcemap,\n jsx: 'automatic',\n logLevel: 'silent',\n });\n }\n\n return chunks;\n }\n}\n","export interface ChunkOptions {\n name: string;\n isInitial?: boolean;\n type: 'server' | 'client' | 'shared';\n}\n\nexport class Chunk {\n public name: string;\n public isInitial: boolean;\n public type: 'server' | 'client' | 'shared';\n public modules: Set<string> = new Set();\n public size: number = 0;\n\n constructor(options: ChunkOptions) {\n this.name = options.name;\n this.isInitial = options.isInitial ?? false;\n this.type = options.type;\n }\n\n public addModule(moduleId: string, moduleSize: number = 0): void {\n this.modules.add(moduleId);\n this.size += moduleSize;\n }\n}\n","import path from 'path';\nimport { ModuleGraph } from '../graph/module-graph.js';\nimport { Chunk } from './chunk.js';\n\nexport class CodeSplitter {\n private moduleGraph: ModuleGraph;\n\n constructor(moduleGraph: ModuleGraph) {\n this.moduleGraph = moduleGraph;\n }\n\n public splitIntoChunks(): Chunk[] {\n const chunks: Chunk[] = [];\n const allModules = Array.from(this.moduleGraph.getAllModules().values());\n\n const serverChunk = new Chunk({ name: 'server-bundle', isInitial: true, type: 'server' });\n const clientInitialChunk = new Chunk({ name: 'client-main', isInitial: true, type: 'client' });\n const routeChunksMap = new Map<string, Chunk>();\n\n for (const mod of allModules) {\n const estimatedSize = mod.path.length * 10; // rough estimation fallback\n\n if (mod.type === 'server') {\n serverChunk.addModule(mod.id, estimatedSize);\n } else {\n // Check if it's a route module in app/\n const isRoute = (mod.id.includes('app/') || mod.id.includes('app\\\\')) && (mod.id.endsWith('page.tsx') || mod.id.endsWith('page.jsx'));\n if (isRoute) {\n const normalizedId = mod.id.replace(/\\\\/g, '/');\n const routeName = normalizedId\n .replace(/^app\\//, '')\n .replace(/(?:^|\\/)page\\.[tj]sx?$/, '')\n .replace(/[\\/\\\\]/g, '_') || 'home';\n \n let chunk = routeChunksMap.get(routeName);\n if (!chunk) {\n chunk = new Chunk({ name: `route-${routeName}`, isInitial: false, type: 'client' });\n routeChunksMap.set(routeName, chunk);\n }\n chunk.addModule(mod.id, estimatedSize);\n } else {\n clientInitialChunk.addModule(mod.id, estimatedSize);\n }\n }\n }\n\n chunks.push(serverChunk);\n chunks.push(clientInitialChunk);\n for (const routeChunk of routeChunksMap.values()) {\n chunks.push(routeChunk);\n }\n\n return chunks;\n }\n}\n","import chokidar, { FSWatcher } from 'chokidar';\nimport path from 'path';\n\nexport interface WatcherEvents {\n onChange: (filePath: string) => void;\n onAdd: (filePath: string) => void;\n onUnlink: (filePath: string) => void;\n}\n\nexport class FileWatcher {\n private watcher: FSWatcher | null = null;\n private watchPaths: string[];\n\n constructor(watchPaths: string[]) {\n this.watchPaths = watchPaths;\n }\n\n public start(events: WatcherEvents): void {\n this.watcher = chokidar.watch(this.watchPaths, {\n ignored: /(^|[\\/\\\\])\\..|node_modules|\\.velix|dist/,\n persistent: true,\n ignoreInitial: true,\n });\n\n this.watcher.on('change', (filePath) => events.onChange(path.resolve(filePath)));\n this.watcher.on('add', (filePath) => events.onAdd(path.resolve(filePath)));\n this.watcher.on('unlink', (filePath) => events.onUnlink(path.resolve(filePath)));\n }\n\n public close(): void {\n if (this.watcher) {\n this.watcher.close();\n this.watcher = null;\n }\n }\n}\n","export interface HMRMessage {\n type: 'file-changed' | 'file-added' | 'file-removed' | 'full-reload' | 'compile-done' | 'boundary-error';\n file?: string;\n affectedModules?: string[];\n error?: string;\n timestamp: number;\n}\n\nexport type HMRBroadcaster = (msg: HMRMessage) => void;\n\nexport class HMRBridge {\n private broadcaster: HMRBroadcaster | null = null;\n\n public setBroadcaster(broadcaster: HMRBroadcaster): void {\n this.broadcaster = broadcaster;\n }\n\n public notifyFileChanged(filePath: string, affectedModules: string[]): void {\n if (this.broadcaster) {\n this.broadcaster({\n type: 'file-changed',\n file: filePath,\n affectedModules,\n timestamp: Date.now(),\n });\n }\n }\n\n public notifyBoundaryError(error: string): void {\n if (this.broadcaster) {\n this.broadcaster({\n type: 'boundary-error',\n error,\n timestamp: Date.now(),\n });\n }\n }\n}\n","import pc from 'picocolors';\nimport { BuildStats } from '../types.js';\n\nexport function formatBuildStats(stats: BuildStats): string {\n const lines: string[] = [];\n\n lines.push(pc.bold(pc.green('VELIX PACK ANALYSIS')));\n lines.push('');\n lines.push(pc.bold('Build Stats'));\n lines.push(pc.dim('─────'));\n lines.push(`Time: ${pc.cyan((stats.duration / 1000).toFixed(2) + 's')}`);\n lines.push(`Modules: ${pc.yellow(stats.modulesCount.toString())}`);\n lines.push(`Chunks: ${pc.cyan(stats.chunksCount.toString())}`);\n lines.push(`Cache hit: ${pc.green(stats.cacheHits + ' / ' + (stats.cacheHits + stats.cacheMisses))}`);\n lines.push('');\n lines.push(pc.bold('Client'));\n lines.push(pc.dim('──────'));\n lines.push(`Modules: ${stats.clientModulesCount}`);\n lines.push(`Initial JS: ${pc.cyan((stats.initialJsSize / 1024).toFixed(1) + ' KB')}`);\n lines.push(`Async JS: ${pc.cyan((stats.asyncJsSize / 1024).toFixed(1) + ' KB')}`);\n lines.push('');\n lines.push(pc.bold('Server'));\n lines.push(pc.dim('──────'));\n lines.push(`Modules: ${stats.serverModulesCount}`);\n\n return lines.join('\\n');\n}\n"],"mappings":";;;AAAA,OAAOA,WAAU;AACjB,OAAOC,SAAQ;;;ACDf,OAAOC,SAAQ;AACf,OAAOC,WAAU;;;ACDjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAOV,SAAS,gBAAgB,aAAkC;AAChE,QAAM,eAAe,KAAK,KAAK,aAAa,eAAe;AAC3D,MAAI,CAAC,GAAG,WAAW,YAAY,EAAG,QAAO,CAAC;AAE1C,MAAI;AACF,UAAM,MAAM,GAAG,aAAa,cAAc,OAAO;AAEjD,UAAM,UAAU,IAAI,QAAQ,4BAA4B,EAAE;AAC1D,UAAM,WAAW,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,YAAY,mBAAmB,UAAU,gBAAgB,OAAO;AAGrE,iBAAW,cAAc,gBAAgB,SAAS;AAChD,YAAI,CAAC,KAAK,YAAY,gBAAgB,UAAU,GAAG;AACjD,cAAIA,IAAG,WAAW,UAAU,GAAG;AAC7B,kBAAM,KAAK,YAAY,UAAU;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AAAA,IACF,UAAE;AACA,WAAK,cAAc,OAAO,QAAQ;AAAA,IACpC;AAAA,EACF;AAAA,EAEQ,gBAAgB,KAAuB;AAC7C,UAAM,UAAoB,CAAC;AAC3B,QAAI,CAACA,IAAG,WAAW,GAAG,EAAG,QAAO;AAEhC,UAAM,UAAUA,IAAG,YAAY,KAAK,EAAE,eAAe,KAAK,CAAC;AAC3D,eAAW,SAAS,SAAS;AAC3B,YAAM,WAAWD,MAAK,KAAK,KAAK,MAAM,IAAI;AAC1C,UAAI,MAAM,YAAY,GAAG;AACvB,YAAI,MAAM,SAAS,kBAAkB,MAAM,SAAS,YAAY,MAAM,SAAS,QAAQ;AACrF,kBAAQ,KAAK,GAAG,KAAK,gBAAgB,QAAQ,CAAC;AAAA,QAChD;AAAA,MACF,WAAW,iBAAiB,KAAK,MAAM,IAAI,GAAG;AAC5C,gBAAQ,KAAK,QAAQ;AAAA,MACvB;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAAA,EAEO,SAAoB;AACzB,WAAO,KAAK;AAAA,EACd;AAAA,EAEO,WAAuB;AAC5B,WAAO,KAAK;AAAA,EACd;AACF;","names":["path","fs","fs","path","path","fs","path","path","path","fs","path","path","path","fs","path","fs","path","esbuild","path","fs","fs","path","esbuild","path","path","fs"]}
@@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.met
2
2
  import {
3
3
  log,
4
4
  writeFile
5
- } from "./chunk-LCJYRHLH.js";
5
+ } from "./chunk-5YFLZUDY.js";
6
6
 
7
7
  // commands/ui.ts
8
8
  import fs from "fs";
@@ -78,4 +78,4 @@ Button.displayName = "Button";
78
78
  export {
79
79
  handleUiCommand
80
80
  };
81
- //# sourceMappingURL=ui-YJZUD3SH.js.map
81
+ //# sourceMappingURL=ui-HEIZJSQB.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamvelix/cli",
3
- "version": "5.3.4",
3
+ "version": "5.3.6",
4
4
  "description": "Velix v5 CLI — Create, develop, and build Velix applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,13 +12,9 @@
12
12
  "dist",
13
13
  "assets"
14
14
  ],
15
- "scripts": {
16
- "build": "tsup",
17
- "dev": "tsup --watch"
18
- },
19
15
  "dependencies": {
20
- "@teamvelix/velix-core": "workspace:*",
21
- "@teamvelix/velix": "workspace:*",
16
+ "@teamvelix/velix-core": "^5.3.6",
17
+ "@teamvelix/velix": "^5.3.6",
22
18
  "ora": "^8.1.1",
23
19
  "picocolors": "^1.1.1",
24
20
  "prompts": "^2.4.2"
@@ -38,5 +34,9 @@
38
34
  },
39
35
  "publishConfig": {
40
36
  "access": "public"
37
+ },
38
+ "scripts": {
39
+ "build": "tsup",
40
+ "dev": "tsup --watch"
41
41
  }
42
- }
42
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../velix-pack/src/index.ts","../../velix-pack/src/resolver/index.ts","../../velix-pack/src/resolver/aliases.ts","../../velix-pack/src/graph/module-graph.ts","../../velix-pack/src/graph/module.ts","../../velix-pack/src/graph/boundary.ts","../../velix-pack/src/transform/index.ts","../../velix-pack/src/transform/typescript.ts","../../velix-pack/src/transform/css.ts","../../velix-pack/src/transform/json.ts","../../velix-pack/src/cache/fs-cache.ts","../../velix-pack/src/cache/index.ts","../../velix-pack/src/bundler/index.ts","../../velix-pack/src/bundler/chunk.ts","../../velix-pack/src/bundler/code-splitter.ts","../../velix-pack/src/watcher/index.ts","../../velix-pack/src/hmr/index.ts","../../velix-pack/src/analyzer/index.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport { Resolver } from './resolver/index.js';\nimport { ModuleGraph } from './graph/module-graph.js';\nimport { TransformPipeline } from './transform/index.js';\nimport { CacheManager } from './cache/index.js';\nimport { Bundler } from './bundler/index.js';\nimport { FileWatcher } from './watcher/index.js';\nimport { HMRBridge } from './hmr/index.js';\nimport { formatBuildStats } from './analyzer/index.js';\nimport { PackOptions, BuildStats } from './types.js';\n\nexport * from './types.js';\nexport { Resolver } from './resolver/index.js';\nexport { ModuleGraph } from './graph/module-graph.js';\nexport { CacheManager } from './cache/index.js';\nexport { formatBuildStats } from './analyzer/index.js';\n\nexport class VelixPack {\n private options: Required<PackOptions>;\n private resolver: Resolver;\n private moduleGraph: ModuleGraph;\n private pipeline: TransformPipeline;\n private cache: CacheManager;\n private bundler: Bundler;\n private watcher: FileWatcher | null = null;\n private hmr: HMRBridge = new HMRBridge();\n private stats: BuildStats = {\n duration: 0,\n modulesCount: 0,\n chunksCount: 0,\n cacheHits: 0,\n cacheMisses: 0,\n serverModulesCount: 0,\n clientModulesCount: 0,\n sharedModulesCount: 0,\n initialJsSize: 0,\n asyncJsSize: 0,\n };\n\n constructor(options: PackOptions = {}) {\n const projectRoot = options.projectRoot || process.cwd();\n this.options = {\n projectRoot,\n appDir: options.appDir || path.join(projectRoot, 'app'),\n outDir: options.outDir || path.join(projectRoot, '.velix'),\n mode: options.mode || 'development',\n minify: options.minify ?? false,\n sourcemap: options.sourcemap ?? true,\n };\n\n this.resolver = new Resolver({ projectRoot });\n this.moduleGraph = new ModuleGraph(projectRoot);\n this.pipeline = new TransformPipeline(this.resolver);\n this.cache = new CacheManager(projectRoot);\n this.bundler = new Bundler({\n projectRoot,\n outDir: this.options.outDir,\n minify: this.options.minify,\n sourcemap: this.options.sourcemap,\n });\n }\n\n public async build(): Promise<BuildStats> {\n const startTime = Date.now();\n\n // 1. Discover entries\n const sourceFiles = this.findSourceFiles(this.options.appDir);\n const serverFiles = fs.existsSync(path.join(this.options.projectRoot, 'server'))\n ? this.findSourceFiles(path.join(this.options.projectRoot, 'server'))\n : [];\n const allFiles = Array.from(new Set([...sourceFiles, ...serverFiles]));\n\n // 2. Build graph & transform modules\n for (const filePath of allFiles) {\n await this.processFile(filePath);\n }\n\n // 3. Check boundaries\n const violations = this.moduleGraph.checkBoundaries();\n if (violations.length > 0) {\n for (const v of violations) {\n console.error(`ERROR [VELIX_PACK]\\nServer module imported from client module.\\nclient: ${v.clientModule}\\nserver: ${v.serverModule}\\n`);\n }\n }\n\n // 4. Bundle & split chunks\n const chunks = await this.bundler.bundle(this.moduleGraph);\n\n // 5. Gather statistics\n const cacheStats = this.cache.getStats();\n const modules = Array.from(this.moduleGraph.getAllModules().values());\n\n this.stats = {\n duration: Date.now() - startTime,\n modulesCount: modules.length,\n chunksCount: chunks.length,\n cacheHits: cacheStats.hits,\n cacheMisses: cacheStats.misses,\n serverModulesCount: modules.filter(m => m.type === 'server').length,\n clientModulesCount: modules.filter(m => m.type === 'client').length,\n sharedModulesCount: modules.filter(m => m.type === 'shared').length,\n initialJsSize: chunks.filter(c => c.isInitial).reduce((acc, c) => acc + c.size, 0),\n asyncJsSize: chunks.filter(c => !c.isInitial).reduce((acc, c) => acc + c.size, 0),\n };\n\n return this.stats;\n }\n\n public watch(onRebuild?: (affectedModules: string[]) => void): FileWatcher {\n const serverDir = path.join(this.options.projectRoot, 'server');\n const watchPaths = [this.options.appDir];\n if (fs.existsSync(serverDir)) watchPaths.push(serverDir);\n\n this.watcher = new FileWatcher(watchPaths);\n this.watcher.start({\n onChange: async (filePath) => {\n const affected = await this.rebuildIncremental(filePath);\n this.hmr.notifyFileChanged(filePath, Array.from(affected));\n if (onRebuild) onRebuild(Array.from(affected));\n },\n onAdd: async (filePath) => {\n await this.processFile(filePath);\n const affected = this.moduleGraph.getAffectedModules(filePath);\n if (onRebuild) onRebuild(Array.from(affected));\n },\n onUnlink: (filePath) => {\n const affected = this.moduleGraph.removeModule(filePath);\n this.cache.invalidate(this.moduleGraph.toRelativeId(filePath));\n if (onRebuild) onRebuild(Array.from(affected));\n },\n });\n\n return this.watcher;\n }\n\n private async rebuildIncremental(filePath: string): Promise<Set<string>> {\n await this.processFile(filePath);\n return this.moduleGraph.getAffectedModules(filePath);\n }\n\n private async processFile(filePath: string): Promise<void> {\n const relativeId = this.moduleGraph.toRelativeId(filePath);\n\n // Transform\n const transformResult = await this.pipeline.transform(filePath);\n\n // Check cache\n let cached = this.cache.get(relativeId, transformResult.hash);\n if (!cached) {\n cached = {\n hash: transformResult.hash,\n code: transformResult.code,\n imports: transformResult.imports,\n type: transformResult.type,\n timestamp: Date.now(),\n };\n this.cache.set(relativeId, cached);\n }\n\n // Add to graph\n const mod = this.moduleGraph.addModule(filePath, transformResult.type);\n mod.hash = transformResult.hash;\n\n // Update dependencies graph\n this.moduleGraph.updateDependencies(filePath, transformResult.imports);\n\n // Recursively process unvisited imports\n for (const importPath of transformResult.imports) {\n if (!this.moduleGraph.getModuleByPath(importPath)) {\n if (fs.existsSync(importPath)) {\n await this.processFile(importPath);\n }\n }\n }\n }\n\n private findSourceFiles(dir: string): string[] {\n const results: string[] = [];\n if (!fs.existsSync(dir)) return results;\n\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules' && entry.name !== '.velix' && entry.name !== 'dist') {\n results.push(...this.findSourceFiles(fullPath));\n }\n } else if (/\\.(tsx?|jsx?)$/.test(entry.name)) {\n results.push(fullPath);\n }\n }\n\n return results;\n }\n\n public getHMR(): HMRBridge {\n return this.hmr;\n }\n\n public getStats(): BuildStats {\n return this.stats;\n }\n}\n","import fs from 'fs';\nimport path from 'path';\nimport { loadPathAliases, PathAlias } from './aliases.js';\n\nexport interface ResolverOptions {\n projectRoot: string;\n extensions?: string[];\n}\n\nexport class Resolver {\n private projectRoot: string;\n private aliases: PathAlias[];\n private extensions: string[];\n\n constructor(options: ResolverOptions) {\n this.projectRoot = options.projectRoot;\n this.aliases = loadPathAliases(this.projectRoot);\n this.extensions = options.extensions || ['.tsx', '.ts', '.jsx', '.js', '.json', '.css'];\n }\n\n public resolve(importPath: string, importerPath: string): string | null {\n // 1. External packages (node_modules or bare specifiers)\n if (!importPath.startsWith('.') && !importPath.startsWith('/') && !this.isAliasMatch(importPath)) {\n return null; // External package\n }\n\n // 2. Resolve alias\n let targetPath = importPath;\n for (const alias of this.aliases) {\n if (importPath === alias.prefix || importPath.startsWith(alias.prefix + '/')) {\n targetPath = importPath.replace(alias.prefix, alias.target);\n break;\n }\n }\n\n // 3. Absolute vs relative resolution\n let absolutePath = targetPath;\n if (!path.isAbsolute(targetPath)) {\n absolutePath = path.resolve(path.dirname(importerPath), targetPath);\n }\n\n // 4. Check if exact file exists\n if (fs.existsSync(absolutePath) && fs.statSync(absolutePath).isFile()) {\n return absolutePath;\n }\n\n // 4b. Handle ESM .js -> .ts / .tsx mapping\n if (absolutePath.endsWith('.js')) {\n const tsPath = absolutePath.slice(0, -3) + '.ts';\n const tsxPath = absolutePath.slice(0, -3) + '.tsx';\n if (fs.existsSync(tsPath) && fs.statSync(tsPath).isFile()) return tsPath;\n if (fs.existsSync(tsxPath) && fs.statSync(tsxPath).isFile()) return tsxPath;\n }\n\n // 5. Try extensions\n for (const ext of this.extensions) {\n const pathWithExt = absolutePath + ext;\n if (fs.existsSync(pathWithExt) && fs.statSync(pathWithExt).isFile()) {\n return pathWithExt;\n }\n }\n\n // 6. Try index file\n for (const ext of this.extensions) {\n const indexPath = path.join(absolutePath, `index${ext}`);\n if (fs.existsSync(indexPath) && fs.statSync(indexPath).isFile()) {\n return indexPath;\n }\n }\n\n return null;\n }\n\n private isAliasMatch(importPath: string): boolean {\n return this.aliases.some(alias => importPath === alias.prefix || importPath.startsWith(alias.prefix + '/'));\n }\n}\n","import fs from 'fs';\nimport path from 'path';\n\nexport interface PathAlias {\n prefix: string;\n target: string;\n}\n\nexport function loadPathAliases(projectRoot: string): PathAlias[] {\n const tsconfigPath = path.join(projectRoot, 'tsconfig.json');\n if (!fs.existsSync(tsconfigPath)) return [];\n\n try {\n const raw = fs.readFileSync(tsconfigPath, 'utf-8');\n // Strip comments simple regex for json\n const jsonStr = raw.replace(/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/.*/g, '');\n const tsconfig = JSON.parse(jsonStr);\n const compilerOptions = tsconfig?.compilerOptions || {};\n const paths = compilerOptions.paths || {};\n const baseUrl = compilerOptions.baseUrl ? path.resolve(projectRoot, compilerOptions.baseUrl) : projectRoot;\n\n const aliases: PathAlias[] = [];\n for (const [key, value] of Object.entries(paths)) {\n if (Array.isArray(value) && value.length > 0) {\n const prefix = key.replace(/\\/\\*$/, '');\n const targetRelative = (value[0] as string).replace(/\\/\\*$/, '');\n aliases.push({\n prefix,\n target: path.resolve(baseUrl, targetRelative),\n });\n }\n }\n\n return aliases;\n } catch {\n return [];\n }\n}\n","import path from 'path';\nimport { Module } from './module.js';\nimport { ModuleNode, ModuleType, BoundaryViolation } from '../types.js';\nimport { checkBoundaryViolations } from './boundary.js';\n\nexport class ModuleGraph {\n private modules: Map<string, Module> = new Map();\n private projectRoot: string;\n\n constructor(projectRoot: string) {\n this.projectRoot = projectRoot;\n }\n\n public getModule(id: string): Module | undefined {\n return this.modules.get(id);\n }\n\n public getModuleByPath(filePath: string): Module | undefined {\n const id = this.toRelativeId(filePath);\n return this.modules.get(id);\n }\n\n public addModule(filePath: string, type: ModuleType = 'shared'): Module {\n const id = this.toRelativeId(filePath);\n let mod = this.modules.get(id);\n if (!mod) {\n mod = new Module(id, filePath, type);\n this.modules.set(id, mod);\n } else {\n mod.type = type;\n }\n return mod;\n }\n\n public removeModule(filePath: string): Set<string> {\n const id = this.toRelativeId(filePath);\n const mod = this.modules.get(id);\n const affectedDependents = new Set<string>();\n\n if (mod) {\n // Collect dependents\n for (const depId of mod.dependents) {\n affectedDependents.add(depId);\n const depMod = this.modules.get(depId);\n if (depMod) {\n depMod.removeDependency(id);\n }\n }\n\n // Cleanup dependencies\n for (const depId of mod.dependencies) {\n const depMod = this.modules.get(depId);\n if (depMod) {\n depMod.removeDependent(id);\n }\n }\n\n this.modules.delete(id);\n }\n\n return affectedDependents;\n }\n\n public updateDependencies(filePath: string, dependencyPaths: string[]): void {\n const id = this.toRelativeId(filePath);\n const mod = this.getModule(id);\n if (!mod) return;\n\n const newDepIds = new Set(dependencyPaths.map(p => this.toRelativeId(p)));\n\n // Remove old dependencies no longer imported\n for (const oldDepId of Array.from(mod.dependencies)) {\n if (!newDepIds.has(oldDepId)) {\n mod.removeDependency(oldDepId);\n const depMod = this.modules.get(oldDepId);\n if (depMod) {\n depMod.removeDependent(id);\n }\n }\n }\n\n // Add new dependencies\n for (const newDepId of newDepIds) {\n if (!mod.dependencies.has(newDepId)) {\n mod.addDependency(newDepId);\n const depMod = this.modules.get(newDepId);\n if (depMod) {\n depMod.addDependent(id);\n }\n }\n }\n }\n\n /**\n * Finds all affected modules recursively when a file changes\n */\n public getAffectedModules(filePath: string): Set<string> {\n const startId = this.toRelativeId(filePath);\n const affected = new Set<string>();\n const queue = [startId];\n\n while (queue.length > 0) {\n const currentId = queue.shift()!;\n if (!affected.has(currentId)) {\n affected.add(currentId);\n const mod = this.modules.get(currentId);\n if (mod) {\n for (const dependentId of mod.dependents) {\n queue.push(dependentId);\n }\n }\n }\n }\n\n return affected;\n }\n\n public getAllModules(): Map<string, Module> {\n return this.modules;\n }\n\n public checkBoundaries(): BoundaryViolation[] {\n return checkBoundaryViolations(this.modules);\n }\n\n public toRelativeId(filePath: string): string {\n const relative = path.relative(this.projectRoot, filePath);\n return relative.replace(/\\\\/g, '/');\n }\n\n public clear(): void {\n this.modules.clear();\n }\n}\n","import { ModuleNode, ModuleType } from '../types.js';\n\nexport class Module implements ModuleNode {\n public id: string;\n public path: string;\n public type: ModuleType;\n public dependencies: Set<string> = new Set();\n public dependents: Set<string> = new Set();\n public hash?: string;\n public lastModified?: number;\n public isEntry?: boolean;\n\n constructor(id: string, path: string, type: ModuleType = 'shared') {\n this.id = id;\n this.path = path;\n this.type = type;\n }\n\n public addDependency(depId: string): void {\n this.dependencies.add(depId);\n }\n\n public removeDependency(depId: string): void {\n this.dependencies.delete(depId);\n }\n\n public addDependent(dependentId: string): void {\n this.dependents.add(dependentId);\n }\n\n public removeDependent(dependentId: string): void {\n this.dependents.delete(dependentId);\n }\n}\n","import path from 'path';\nimport { ModuleNode, BoundaryViolation } from '../types.js';\n\n/**\n * Checks if a module is classified as server-only by convention or path\n */\nexport function isServerModule(filePath: string, content?: string): boolean {\n const normalized = filePath.replace(/\\\\/g, '/');\n if (normalized.includes('/server/') || normalized.startsWith('server/')) return true;\n if (content) {\n const firstLines = content.split('\\n').slice(0, 5).map(l => l.trim());\n if (firstLines.some(l => l === \"'use server'\" || l === '\"use server\"')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Checks if a module is classified as client-only\n */\nexport function isClientModule(filePath: string, content?: string): boolean {\n if (content) {\n const firstLines = content.split('\\n').slice(0, 5).map(l => l.trim());\n if (firstLines.some(l => l === \"'use client'\" || l === '\"use client\"' || l === \"'use island'\" || l === '\"use island\"')) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Validates server/client boundary rules across the module graph\n */\nexport function checkBoundaryViolations(modules: Map<string, ModuleNode>): BoundaryViolation[] {\n const violations: BoundaryViolation[] = [];\n\n for (const [id, mod] of modules.entries()) {\n if (mod.type === 'client') {\n for (const depId of mod.dependencies) {\n const dep = modules.get(depId);\n if (dep && dep.type === 'server') {\n violations.push({\n clientModule: id,\n serverModule: depId,\n importStatement: `Import of server module \"${depId}\" from client module \"${id}\"`,\n });\n }\n }\n }\n }\n\n return violations;\n}\n","import fs from 'fs';\nimport path from 'path';\nimport crypto from 'crypto';\nimport { Resolver } from '../resolver/index.js';\nimport { transformTypeScript } from './typescript.js';\nimport { transformCSS } from './css.js';\nimport { transformJSON } from './json.js';\nimport { TransformResult } from '../types.js';\n\nexport class TransformPipeline {\n private resolver: Resolver;\n\n constructor(resolver: Resolver) {\n this.resolver = resolver;\n }\n\n public async transform(filePath: string): Promise<TransformResult> {\n const content = fs.readFileSync(filePath, 'utf-8');\n const hash = crypto.createHash('md5').update(content).digest('hex');\n const ext = path.extname(filePath);\n\n if (ext === '.ts' || ext === '.tsx' || ext === '.js' || ext === '.jsx') {\n const result = await transformTypeScript(filePath, content, this.resolver);\n return { ...result, hash };\n } else if (ext === '.css') {\n const result = await transformCSS(filePath, content);\n return { ...result, hash };\n } else if (ext === '.json') {\n const result = await transformJSON(filePath, content);\n return { ...result, hash };\n }\n\n return {\n code: content,\n imports: [],\n type: 'shared',\n hash,\n };\n }\n}\n","import esbuild from 'esbuild';\nimport fs from 'fs';\nimport path from 'path';\nimport { Resolver } from '../resolver/index.js';\nimport { isClientModule, isServerModule } from '../graph/boundary.js';\nimport { ModuleType } from '../types.js';\n\nexport interface TransformResultTS {\n code: string;\n map?: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformTypeScript(\n filePath: string,\n content: string,\n resolver: Resolver\n): Promise<TransformResultTS> {\n const ext = path.extname(filePath);\n const loader: esbuild.Loader = ext === '.tsx' ? 'tsx' : ext === '.jsx' ? 'jsx' : 'ts';\n\n const result = await esbuild.transform(content, {\n loader,\n target: 'es2022',\n format: 'esm',\n jsx: 'automatic',\n sourcemap: 'inline',\n sourcefile: filePath,\n });\n\n // Extract imports from code using regex or AST scan\n const imports = extractImports(content, filePath, resolver);\n\n // Determine type\n let type: ModuleType = 'shared';\n if (isServerModule(filePath, content)) {\n type = 'server';\n } else if (isClientModule(filePath, content)) {\n type = 'client';\n }\n\n return {\n code: result.code,\n map: result.map,\n imports,\n type,\n };\n}\n\nexport function extractImports(content: string, filePath: string, resolver: Resolver): string[] {\n const imports: string[] = [];\n // Regex matches static import statements & dynamic import()\n const importRegex = /(?:import|export)\\s+(?:[\\s\\S]*?\\s+from\\s+)?['\"]([^'\"]+)['\"]|import\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\n let match: RegExpExecArray | null;\n while ((match = importRegex.exec(content)) !== null) {\n const importPath = match[1] || match[2];\n if (importPath) {\n const resolved = resolver.resolve(importPath, filePath);\n if (resolved) {\n imports.push(resolved);\n }\n }\n }\n\n return Array.from(new Set(imports));\n}\n","import { ModuleType } from '../types.js';\n\nexport interface TransformResultCSS {\n code: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformCSS(filePath: string, content: string): Promise<TransformResultCSS> {\n // CSS transform simply packages CSS or passes it along\n return {\n code: content,\n imports: [],\n type: 'shared',\n };\n}\n","import { ModuleType } from '../types.js';\n\nexport interface TransformResultJSON {\n code: string;\n imports: string[];\n type: ModuleType;\n}\n\nexport async function transformJSON(filePath: string, content: string): Promise<TransformResultJSON> {\n let code = '';\n try {\n const json = JSON.parse(content);\n code = `export default ${JSON.stringify(json)};`;\n } catch {\n code = `export default {};`;\n }\n\n return {\n code,\n imports: [],\n type: 'shared',\n };\n}\n","import fs from 'fs';\nimport path from 'path';\nimport { CacheEntry } from '../types.js';\n\nexport class FSCache {\n private cacheDir: string;\n private memoryCache: Map<string, CacheEntry> = new Map();\n\n constructor(projectRoot: string) {\n this.cacheDir = path.join(projectRoot, '.velix', 'cache', 'pack');\n this.ensureCacheDir();\n }\n\n private ensureCacheDir(): void {\n if (!fs.existsSync(this.cacheDir)) {\n fs.mkdirSync(this.cacheDir, { recursive: true });\n }\n }\n\n public get(id: string, currentHash: string): CacheEntry | null {\n // 1. Check memory cache first\n const mem = this.memoryCache.get(id);\n if (mem && mem.hash === currentHash) {\n return mem;\n }\n\n // 2. Check filesystem cache\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n\n if (fs.existsSync(filePath)) {\n try {\n const raw = fs.readFileSync(filePath, 'utf-8');\n const entry: CacheEntry = JSON.parse(raw);\n if (entry.hash === currentHash) {\n this.memoryCache.set(id, entry);\n return entry;\n }\n } catch {\n // Ignored, corrupt entry will be overwritten\n }\n }\n\n return null;\n }\n\n public set(id: string, entry: CacheEntry): void {\n this.memoryCache.set(id, entry);\n\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n\n try {\n this.ensureCacheDir();\n fs.writeFileSync(filePath, JSON.stringify(entry), 'utf-8');\n } catch {\n // Non-fatal cache write failure\n }\n }\n\n public invalidate(id: string): void {\n this.memoryCache.delete(id);\n const safeFilename = encodeURIComponent(id) + '.json';\n const filePath = path.join(this.cacheDir, safeFilename);\n if (fs.existsSync(filePath)) {\n try {\n fs.unlinkSync(filePath);\n } catch {}\n }\n }\n\n public clear(): void {\n this.memoryCache.clear();\n if (fs.existsSync(this.cacheDir)) {\n try {\n fs.rmSync(this.cacheDir, { recursive: true, force: true });\n this.ensureCacheDir();\n } catch {}\n }\n }\n}\n","import { FSCache } from './fs-cache.js';\nimport { CacheEntry } from '../types.js';\n\nexport class CacheManager {\n private fsCache: FSCache;\n private hits: number = 0;\n private misses: number = 0;\n\n constructor(projectRoot: string) {\n this.fsCache = new FSCache(projectRoot);\n }\n\n public get(id: string, currentHash: string): CacheEntry | null {\n const entry = this.fsCache.get(id, currentHash);\n if (entry) {\n this.hits++;\n return entry;\n }\n this.misses++;\n return null;\n }\n\n public set(id: string, entry: CacheEntry): void {\n this.fsCache.set(id, entry);\n }\n\n public invalidate(id: string): void {\n this.fsCache.invalidate(id);\n }\n\n public clear(): void {\n this.fsCache.clear();\n this.hits = 0;\n this.misses = 0;\n }\n\n public getStats() {\n return {\n hits: this.hits,\n misses: this.misses,\n hitRatio: this.hits + this.misses > 0 ? (this.hits / (this.hits + this.misses)) * 100 : 0,\n };\n }\n}\n","import esbuild from 'esbuild';\nimport path from 'path';\nimport fs from 'fs';\nimport { ModuleGraph } from '../graph/module-graph.js';\nimport { CodeSplitter } from './code-splitter.js';\nimport { Chunk } from './chunk.js';\n\nexport interface BundlerOptions {\n projectRoot: string;\n outDir: string;\n minify?: boolean;\n sourcemap?: boolean;\n}\n\nexport class Bundler {\n private projectRoot: string;\n private outDir: string;\n private minify: boolean;\n private sourcemap: boolean;\n\n constructor(options: BundlerOptions) {\n this.projectRoot = options.projectRoot;\n this.outDir = options.outDir;\n this.minify = options.minify ?? false;\n this.sourcemap = options.sourcemap ?? true;\n }\n\n public async bundle(moduleGraph: ModuleGraph): Promise<Chunk[]> {\n const splitter = new CodeSplitter(moduleGraph);\n const chunks = splitter.splitIntoChunks();\n\n const entryFiles = Array.from(moduleGraph.getAllModules().values())\n .map(m => m.path)\n .filter(p => fs.existsSync(p));\n\n if (entryFiles.length === 0) return chunks;\n\n const serverOutDir = path.join(this.outDir, 'server');\n const clientOutDir = path.join(this.outDir, 'client');\n\n if (!fs.existsSync(serverOutDir)) fs.mkdirSync(serverOutDir, { recursive: true });\n if (!fs.existsSync(clientOutDir)) fs.mkdirSync(clientOutDir, { recursive: true });\n\n // Bundle via esbuild\n await esbuild.build({\n entryPoints: entryFiles,\n outdir: serverOutDir,\n bundle: false,\n format: 'esm',\n platform: 'node',\n target: 'es2022',\n minify: this.minify,\n sourcemap: this.sourcemap,\n jsx: 'automatic',\n logLevel: 'silent',\n });\n\n return chunks;\n }\n}\n","export interface ChunkOptions {\n name: string;\n isInitial?: boolean;\n type: 'server' | 'client' | 'shared';\n}\n\nexport class Chunk {\n public name: string;\n public isInitial: boolean;\n public type: 'server' | 'client' | 'shared';\n public modules: Set<string> = new Set();\n public size: number = 0;\n\n constructor(options: ChunkOptions) {\n this.name = options.name;\n this.isInitial = options.isInitial ?? false;\n this.type = options.type;\n }\n\n public addModule(moduleId: string, moduleSize: number = 0): void {\n this.modules.add(moduleId);\n this.size += moduleSize;\n }\n}\n","import path from 'path';\nimport { ModuleGraph } from '../graph/module-graph.js';\nimport { Chunk } from './chunk.js';\n\nexport class CodeSplitter {\n private moduleGraph: ModuleGraph;\n\n constructor(moduleGraph: ModuleGraph) {\n this.moduleGraph = moduleGraph;\n }\n\n public splitIntoChunks(): Chunk[] {\n const chunks: Chunk[] = [];\n const allModules = Array.from(this.moduleGraph.getAllModules().values());\n\n const serverChunk = new Chunk({ name: 'server-bundle', isInitial: true, type: 'server' });\n const clientInitialChunk = new Chunk({ name: 'client-main', isInitial: true, type: 'client' });\n const routeChunksMap = new Map<string, Chunk>();\n\n for (const mod of allModules) {\n const estimatedSize = mod.path.length * 10; // rough estimation fallback\n\n if (mod.type === 'server') {\n serverChunk.addModule(mod.id, estimatedSize);\n } else {\n // Check if it's a route module in app/\n const isRoute = (mod.id.includes('app/') || mod.id.includes('app\\\\')) && (mod.id.endsWith('page.tsx') || mod.id.endsWith('page.jsx'));\n if (isRoute) {\n const normalizedId = mod.id.replace(/\\\\/g, '/');\n const routeName = normalizedId\n .replace(/^app\\//, '')\n .replace(/(?:^|\\/)page\\.[tj]sx?$/, '')\n .replace(/[\\/\\\\]/g, '_') || 'home';\n \n let chunk = routeChunksMap.get(routeName);\n if (!chunk) {\n chunk = new Chunk({ name: `route-${routeName}`, isInitial: false, type: 'client' });\n routeChunksMap.set(routeName, chunk);\n }\n chunk.addModule(mod.id, estimatedSize);\n } else {\n clientInitialChunk.addModule(mod.id, estimatedSize);\n }\n }\n }\n\n chunks.push(serverChunk);\n chunks.push(clientInitialChunk);\n for (const routeChunk of routeChunksMap.values()) {\n chunks.push(routeChunk);\n }\n\n return chunks;\n }\n}\n","import chokidar, { FSWatcher } from 'chokidar';\nimport path from 'path';\n\nexport interface WatcherEvents {\n onChange: (filePath: string) => void;\n onAdd: (filePath: string) => void;\n onUnlink: (filePath: string) => void;\n}\n\nexport class FileWatcher {\n private watcher: FSWatcher | null = null;\n private watchPaths: string[];\n\n constructor(watchPaths: string[]) {\n this.watchPaths = watchPaths;\n }\n\n public start(events: WatcherEvents): void {\n this.watcher = chokidar.watch(this.watchPaths, {\n ignored: /(^|[\\/\\\\])\\..|node_modules|\\.velix|dist/,\n persistent: true,\n ignoreInitial: true,\n });\n\n this.watcher.on('change', (filePath) => events.onChange(path.resolve(filePath)));\n this.watcher.on('add', (filePath) => events.onAdd(path.resolve(filePath)));\n this.watcher.on('unlink', (filePath) => events.onUnlink(path.resolve(filePath)));\n }\n\n public close(): void {\n if (this.watcher) {\n this.watcher.close();\n this.watcher = null;\n }\n }\n}\n","export interface HMRMessage {\n type: 'file-changed' | 'file-added' | 'file-removed' | 'full-reload' | 'compile-done' | 'boundary-error';\n file?: string;\n affectedModules?: string[];\n error?: string;\n timestamp: number;\n}\n\nexport type HMRBroadcaster = (msg: HMRMessage) => void;\n\nexport class HMRBridge {\n private broadcaster: HMRBroadcaster | null = null;\n\n public setBroadcaster(broadcaster: HMRBroadcaster): void {\n this.broadcaster = broadcaster;\n }\n\n public notifyFileChanged(filePath: string, affectedModules: string[]): void {\n if (this.broadcaster) {\n this.broadcaster({\n type: 'file-changed',\n file: filePath,\n affectedModules,\n timestamp: Date.now(),\n });\n }\n }\n\n public notifyBoundaryError(error: string): void {\n if (this.broadcaster) {\n this.broadcaster({\n type: 'boundary-error',\n error,\n timestamp: Date.now(),\n });\n }\n }\n}\n","import pc from 'picocolors';\nimport { BuildStats } from '../types.js';\n\nexport function formatBuildStats(stats: BuildStats): string {\n const lines: string[] = [];\n\n lines.push(pc.bold(pc.green('VELIX PACK ANALYSIS')));\n lines.push('');\n lines.push(pc.bold('Build Stats'));\n lines.push(pc.dim('─────'));\n lines.push(`Time: ${pc.cyan((stats.duration / 1000).toFixed(2) + 's')}`);\n lines.push(`Modules: ${pc.yellow(stats.modulesCount.toString())}`);\n lines.push(`Chunks: ${pc.cyan(stats.chunksCount.toString())}`);\n lines.push(`Cache hit: ${pc.green(stats.cacheHits + ' / ' + (stats.cacheHits + stats.cacheMisses))}`);\n lines.push('');\n lines.push(pc.bold('Client'));\n lines.push(pc.dim('──────'));\n lines.push(`Modules: ${stats.clientModulesCount}`);\n lines.push(`Initial JS: ${pc.cyan((stats.initialJsSize / 1024).toFixed(1) + ' KB')}`);\n lines.push(`Async JS: ${pc.cyan((stats.asyncJsSize / 1024).toFixed(1) + ' KB')}`);\n lines.push('');\n lines.push(pc.bold('Server'));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AG,WAAW,GAAG,EAAG,QAAO;AAEhC,UAAM,UAAUA,IAAG,YAAY,KAAK,EAAE,eAAe,KAAK,CAAC;AAC3D,eAAW,SAAS,SAAS;AAC3B,YAAM,WAAWD,MAAK,KAAK,KAAK,MAAM,IAAI;AAC1C,UAAI,MAAM,YAAY,GAAG;AACvB,YAAI,MAAM,SAAS,kBAAkB,MAAM,SAAS,YAAY,MAAM,SAAS,QAAQ;AACrF,kBAAQ,KAAK,GAAG,KAAK,gBAAgB,QAAQ,CAAC;AAAA,QAChD;AAAA,MACF,WAAW,iBAAiB,KAAK,MAAM,IAAI,GAAG;AAC5C,gBAAQ,KAAK,QAAQ;AAAA,MACvB;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAAA,EAEO,SAAoB;AACzB,WAAO,KAAK;AAAA,EACd;AAAA,EAEO,WAAuB;AAC5B,WAAO,KAAK;AAAA,EACd;AACF;","names":["path","fs","fs","path","path","fs","path","path","path","fs","path","path","path","fs","path","fs","path","esbuild","path","fs","fs","path","esbuild","path","path","fs"]}
File without changes