@teamvelix/cli 5.3.1 → 5.3.3
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/dist/{build-UNC2I4XB.js → build-R6YPQMKQ.js} +8 -4
- package/dist/build-R6YPQMKQ.js.map +1 -0
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/chunk-7D4SUZUM.js.map +1 -0
- package/dist/{chunk-A7YBQRHF.js → chunk-QVHVWNX3.js} +2 -2
- package/dist/chunk-QVHVWNX3.js.map +1 -0
- package/dist/{create-3SBBVRRP.js → create-ECJXHPS4.js} +18 -6
- package/dist/create-ECJXHPS4.js.map +1 -0
- package/dist/{dev-3V3YIUIM.js → dev-H632BVX7.js} +8 -4
- package/dist/dev-H632BVX7.js.map +1 -0
- package/dist/{doctor-M23QU3GP.js → doctor-4ZBGISX6.js} +3 -2
- package/dist/{doctor-M23QU3GP.js.map → doctor-4ZBGISX6.js.map} +1 -1
- package/dist/{generate-B6CNYZ54.js → generate-F5PULUKX.js} +3 -2
- package/dist/{generate-B6CNYZ54.js.map → generate-F5PULUKX.js.map} +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/pack-IHVEY27S.js +36 -0
- package/dist/pack-IHVEY27S.js.map +1 -0
- package/dist/src-YLSZ2QML.js +8173 -0
- package/dist/src-YLSZ2QML.js.map +1 -0
- package/dist/{ui-575K5B5U.js → ui-2KJQ4SG6.js} +3 -2
- package/dist/{ui-575K5B5U.js.map → ui-2KJQ4SG6.js.map} +1 -1
- package/package.json +6 -6
- package/LICENSE +0 -21
- package/dist/build-UNC2I4XB.js.map +0 -1
- package/dist/chunk-A7YBQRHF.js.map +0 -1
- package/dist/create-3SBBVRRP.js.map +0 -1
- package/dist/dev-3V3YIUIM.js.map +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log,
|
|
3
3
|
showBanner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QVHVWNX3.js";
|
|
5
|
+
import "./chunk-7D4SUZUM.js";
|
|
5
6
|
|
|
6
7
|
// commands/build.ts
|
|
7
8
|
import fs from "fs";
|
|
8
9
|
import path from "path";
|
|
9
10
|
async function buildCommand() {
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const isPack = args.includes("--pack");
|
|
10
13
|
showBanner();
|
|
11
|
-
log.info(
|
|
14
|
+
log.info(`Building for production${isPack ? " with Velix Pack Beta" : ""}...`);
|
|
12
15
|
const { spawn } = await import("child_process");
|
|
13
16
|
const cwd = process.cwd();
|
|
14
17
|
const candidates = [
|
|
@@ -21,7 +24,8 @@ async function buildCommand() {
|
|
|
21
24
|
log.error("Could not find Velix runtime. Run `npm install` first.");
|
|
22
25
|
process.exit(1);
|
|
23
26
|
}
|
|
24
|
-
const
|
|
27
|
+
const packFlag = isPack ? " --pack" : "";
|
|
28
|
+
const child = spawn(`npx tsx "${buildScript}"${packFlag}`, {
|
|
25
29
|
stdio: "inherit",
|
|
26
30
|
cwd,
|
|
27
31
|
shell: true
|
|
@@ -60,4 +64,4 @@ export {
|
|
|
60
64
|
buildCommand,
|
|
61
65
|
startCommand
|
|
62
66
|
};
|
|
63
|
-
//# sourceMappingURL=build-
|
|
67
|
+
//# sourceMappingURL=build-R6YPQMKQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../commands/build.ts"],"sourcesContent":["/**\n * `velix build` — Build for production\n */\nimport fs from 'fs';\nimport path from 'path';\nimport { showBanner, log } from './shared.js';\n\nexport async function buildCommand() {\n const args = process.argv.slice(2);\n const isPack = args.includes('--pack');\n\n showBanner();\n log.info(`Building for production${isPack ? ' with Velix Pack Beta' : ''}...`);\n\n const { spawn } = await import('child_process');\n\n const cwd = process.cwd();\n const candidates = [\n path.join(cwd, 'node_modules', '@teamvelix', 'velix', 'dist', 'runtime', 'start-build.js'),\n path.join(cwd, 'packages', 'velix', 'dist', 'runtime', 'start-build.js'),\n path.join(cwd, 'packages', 'velix', 'runtime', 'start-build.ts'),\n ];\n\n const buildScript = candidates.find(c => fs.existsSync(c));\n if (!buildScript) {\n log.error('Could not find Velix runtime. Run `npm install` first.');\n process.exit(1);\n }\n\n const packFlag = isPack ? ' --pack' : '';\n const child = spawn(`npx tsx \"${buildScript}\"${packFlag}`, {\n stdio: 'inherit', cwd, shell: true,\n });\n\n child.on('error', (err) => {\n log.error(`Failed to build: ${err.message}`);\n process.exit(1);\n });\n}\n\n/**\n * `velix start` — Start production server\n */\nexport async function startCommand() {\n showBanner();\n log.info('Starting production server...');\n\n const { spawn } = await import('child_process');\n\n const cwd = process.cwd();\n const candidates = [\n path.join(cwd, 'node_modules', '@teamvelix', 'velix', 'dist', 'runtime', 'start-prod.js'),\n path.join(cwd, 'packages', 'velix', 'dist', 'runtime', 'start-prod.js'),\n path.join(cwd, 'packages', 'velix', 'runtime', 'start-prod.ts'),\n ];\n\n const prodScript = candidates.find(c => fs.existsSync(c));\n if (!prodScript) {\n log.error('Could not find Velix runtime. Run `npm install` first.');\n process.exit(1);\n }\n\n const child = spawn(`npx tsx \"${prodScript}\"`, {\n stdio: 'inherit', cwd, shell: true,\n });\n\n child.on('error', (err) => {\n log.error(`Failed to start production server: ${err.message}`);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;AAGA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGjB,eAAsB,eAAe;AACnC,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,QAAM,SAAS,KAAK,SAAS,QAAQ;AAErC,aAAW;AACX,MAAI,KAAK,0BAA0B,SAAS,0BAA0B,EAAE,KAAK;AAE7E,QAAM,EAAE,MAAM,IAAI,MAAM,OAAO,eAAe;AAE9C,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,aAAa;AAAA,IACjB,KAAK,KAAK,KAAK,gBAAgB,cAAc,SAAS,QAAQ,WAAW,gBAAgB;AAAA,IACzF,KAAK,KAAK,KAAK,YAAY,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KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=chunk-7D4SUZUM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// version.ts
|
|
2
|
-
var VERSION = "5.3.
|
|
2
|
+
var VERSION = "5.3.3";
|
|
3
3
|
|
|
4
4
|
// commands/shared.ts
|
|
5
5
|
import pc from "picocolors";
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
pascalCase,
|
|
43
43
|
camelCase
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-QVHVWNX3.js.map
|
|
@@ -0,0 +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.3';\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":[]}
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
log,
|
|
4
4
|
showBanner,
|
|
5
5
|
writeFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QVHVWNX3.js";
|
|
7
|
+
import "./chunk-7D4SUZUM.js";
|
|
7
8
|
|
|
8
9
|
// commands/create.ts
|
|
9
10
|
import fs from "fs";
|
|
@@ -74,11 +75,21 @@ async function createCommand(name) {
|
|
|
74
75
|
});
|
|
75
76
|
useShadcn = shResponse.useShadcn;
|
|
76
77
|
}
|
|
78
|
+
let usePack = flags.includes("--pack") ? true : flags.includes("--no-pack") ? false : void 0;
|
|
79
|
+
if (usePack === void 0) {
|
|
80
|
+
const packResponse = await prompts({
|
|
81
|
+
type: "confirm",
|
|
82
|
+
name: "usePack",
|
|
83
|
+
message: "Enable Velix Pack Beta engine? (Recommended for fast rebuilds & HMR)",
|
|
84
|
+
initial: true
|
|
85
|
+
});
|
|
86
|
+
usePack = packResponse.usePack;
|
|
87
|
+
}
|
|
77
88
|
const { default: ora } = await import("ora");
|
|
78
89
|
const spinner = ora("Creating project...").start();
|
|
79
90
|
try {
|
|
80
91
|
fs.mkdirSync(projectDir, { recursive: true });
|
|
81
|
-
generateProjectFiles(projectDir, name, template, useTailwind, useShadcn);
|
|
92
|
+
generateProjectFiles(projectDir, name, template, useTailwind, useShadcn, usePack);
|
|
82
93
|
spinner.succeed(`Project ${pc.bold(name)} created!`);
|
|
83
94
|
log.blank();
|
|
84
95
|
console.log(` ${pc.bold("Next steps:")}`);
|
|
@@ -92,15 +103,15 @@ async function createCommand(name) {
|
|
|
92
103
|
process.exit(1);
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
|
-
function generateProjectFiles(dir, name, template, useTailwind = true, useShadcn = false) {
|
|
106
|
+
function generateProjectFiles(dir, name, template, useTailwind = true, useShadcn = false, usePack = true) {
|
|
96
107
|
const pkg = {
|
|
97
108
|
name,
|
|
98
109
|
version: "0.1.0",
|
|
99
110
|
private: true,
|
|
100
111
|
type: "module",
|
|
101
112
|
scripts: {
|
|
102
|
-
dev: "velix dev",
|
|
103
|
-
build: "velix build",
|
|
113
|
+
dev: usePack ? "velix dev --pack" : "velix dev",
|
|
114
|
+
build: usePack ? "velix build --pack" : "velix build",
|
|
104
115
|
start: "velix start"
|
|
105
116
|
},
|
|
106
117
|
dependencies: {
|
|
@@ -110,6 +121,7 @@ function generateProjectFiles(dir, name, template, useTailwind = true, useShadcn
|
|
|
110
121
|
},
|
|
111
122
|
devDependencies: {
|
|
112
123
|
"@teamvelix/cli": `^${VERSION}`,
|
|
124
|
+
"@teamvelix/velix-pack": "^0.1.0-beta.1",
|
|
113
125
|
typescript: "^5.7.0",
|
|
114
126
|
"@types/react": "^19.0.0",
|
|
115
127
|
"@types/react-dom": "^19.0.0"
|
|
@@ -367,4 +379,4 @@ export function POST(_request: Request) {
|
|
|
367
379
|
export {
|
|
368
380
|
createCommand
|
|
369
381
|
};
|
|
370
|
-
//# sourceMappingURL=create-
|
|
382
|
+
//# sourceMappingURL=create-ECJXHPS4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../commands/create.ts"],"sourcesContent":["/**\n * `velix create <name>` — Create a new Velix project\n */\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport pc from 'picocolors';\nimport prompts from 'prompts';\nimport { VERSION } from '../version.js';\nimport { showBanner, log, writeFile } from './shared.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport async function createCommand(name?: string) {\n showBanner();\n\n if (!name) {\n const response = await prompts({\n type: 'text',\n name: 'name',\n message: 'Project name:',\n initial: 'my-velix-app',\n });\n name = response.name;\n if (!name) { log.error('Project name is required'); process.exit(1); }\n }\n\n const projectDir = path.resolve(process.cwd(), name);\n\n if (fs.existsSync(projectDir)) {\n log.error(`Directory ${name} already exists`);\n process.exit(1);\n }\n\n // Choose template\n const flags = process.argv.slice(3);\n const templateFlag = flags.find(a => a.startsWith('--template='))?.split('=')[1];\n const tailwindFlag = flags.includes('--tailwind');\n const noTailwindFlag = flags.includes('--no-tailwind');\n\n let template = templateFlag;\n let useTailwind: boolean | undefined = tailwindFlag ? true : (noTailwindFlag ? false : undefined);\n\n if (!template) {\n const response = await prompts({\n type: 'select',\n name: 'template',\n message: 'Select a template:',\n choices: [\n { title: '✨ Default - Full Velix app with examples', value: 'default' },\n { title: '⚡ Minimal', value: 'minimal' },\n ],\n });\n template = response.template;\n }\n\n if (!template) {\n log.error('No template selected');\n process.exit(1);\n }\n\n if (useTailwind === undefined) {\n const twResponse = await prompts({\n type: 'confirm',\n name: 'useTailwind',\n message: 'Use Tailwind CSS?',\n initial: true\n });\n useTailwind = twResponse.useTailwind;\n }\n\n let useShadcn: boolean | undefined = flags.includes('--shadcn') ? true : (flags.includes('--no-shadcn') ? false : undefined);\n\n if (useTailwind && useShadcn === undefined) {\n const shResponse = await prompts({\n type: 'confirm',\n name: 'useShadcn',\n message: 'Use Shadcn UI components?',\n initial: true\n });\n useShadcn = shResponse.useShadcn;\n }\n\n let usePack: boolean | undefined = flags.includes('--pack') ? true : (flags.includes('--no-pack') ? false : undefined);\n\n if (usePack === undefined) {\n const packResponse = await prompts({\n type: 'confirm',\n name: 'usePack',\n message: 'Enable Velix Pack Beta engine? (Recommended for fast rebuilds & HMR)',\n initial: true\n });\n usePack = packResponse.usePack;\n }\n\n const { default: ora } = await import('ora');\n const spinner = ora('Creating project...').start();\n\n try {\n fs.mkdirSync(projectDir, { recursive: true });\n generateProjectFiles(projectDir, name, template, useTailwind, useShadcn, usePack);\n spinner.succeed(`Project ${pc.bold(name)} created!`);\n log.blank();\n console.log(` ${pc.bold('Next steps:')}`);\n console.log(` ${pc.dim('$')} cd ${name}`);\n console.log(` ${pc.dim('$')} npm install`);\n console.log(` ${pc.dim('$')} npm run dev`);\n log.blank();\n } catch (err: unknown) {\n spinner.fail('Failed to create project');\n log.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n}\n\ninterface PackageJson {\n name: string;\n version: string;\n private: boolean;\n type: string;\n scripts: Record<string, string>;\n dependencies: Record<string, string>;\n devDependencies: Record<string, string>;\n}\n\nfunction generateProjectFiles(dir: string, name: string, template: string, useTailwind: boolean = true, useShadcn: boolean = false, usePack: boolean = true) {\n const pkg: PackageJson = {\n name,\n version: '0.1.0',\n private: true,\n type: 'module',\n scripts: {\n dev: usePack ? 'velix dev --pack' : 'velix dev',\n build: usePack ? 'velix build --pack' : 'velix build',\n start: 'velix start',\n },\n dependencies: {\n '@teamvelix/velix': `^${VERSION}`,\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n },\n devDependencies: {\n '@teamvelix/cli': `^${VERSION}`,\n '@teamvelix/velix-pack': '^0.1.0-beta.1',\n typescript: '^5.7.0',\n '@types/react': '^19.0.0',\n '@types/react-dom': '^19.0.0',\n },\n };\n\n if (useTailwind) {\n pkg.devDependencies = {\n ...pkg.devDependencies,\n 'tailwindcss': '^4.0.0',\n '@tailwindcss/cli': '^4.0.0',\n };\n }\n\n if (useShadcn) {\n pkg.dependencies = {\n ...pkg.dependencies,\n 'clsx': '^2.1.0',\n 'tailwind-merge': '^2.2.1',\n 'lucide-react': '^0.359.0'\n };\n }\n\n writeFile(path.join(dir, 'package.json'), JSON.stringify(pkg, null, 2));\n\n writeFile(path.join(dir, 'velix.config.ts'), `import { defineConfig${useTailwind ? ', tailwindPlugin' : ''} } from \"@teamvelix/velix\";\n\nexport default defineConfig({\n app: {\n name: \"${name}\",\n },\n server: {\n port: 3000,\n host: \"localhost\",\n },\n seo: {\n sitemap: true,\n robots: true,\n openGraph: true,\n },\n favicon: \"/favicon.webp\",\n ${useTailwind ? `plugins: [\\n tailwindPlugin()\\n ],` : 'plugins: [],'}\n});\n`);\n\n writeFile(path.join(dir, 'tsconfig.json'), JSON.stringify({\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n jsx: 'react-jsx',\n strict: true,\n esModuleInterop: true,\n skipLibCheck: true,\n forceConsistentCasingInFileNames: true,\n },\n include: ['app/**/*.ts', 'app/**/*.tsx', 'server/**/*.ts'],\n exclude: ['node_modules', '.velix']\n }, null, 2));\n\n if (useTailwind) {\n writeFile(path.join(dir, 'tailwind.config.ts'), `import type { Config } from \"tailwindcss\";\\n\\nexport default {\\n content: [\\n \"./index.html\",\\n \"./app/**/*.{js,ts,jsx,tsx}\",\\n \"./components/**/*.{js,ts,jsx,tsx}\",\\n \"./lib/**/*.{js,ts,jsx,tsx}\",\\n \"./src/**/*.{js,ts,jsx,tsx}\",\\n ],\\n} satisfies Config;\\n`);\n }\n\n fs.mkdirSync(path.join(dir, 'app'), { recursive: true });\n writeFile(path.join(dir, 'app', 'globals.css'), useTailwind ? `@import \"tailwindcss\";\\n\\n@theme {\\n --color-velix-deep: #0B1120;\\n --color-velix-dark: #0F172A;\\n --color-velix-accent: #2563EB;\\n --color-velix-cyan: #22D3EE;\\n --color-velix-glow: #38BDF8;\\n}\\n` : `body { margin: 0; font-family: sans-serif; }\\n`);\n\n writeFile(path.join(dir, 'app', 'layout.tsx'), `import \"./globals.css\";\n\nexport const metadata = {\n title: \"${name}\",\n description: \"Built with Velix v5\",\n};\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n return (\n <html lang=\"en\">\n <body className=\"${useTailwind ? 'bg-velix-deep text-slate-100' : 'bg-slate-900 text-white'} min-h-screen font-sans antialiased\">{children}</body>\n </html>\n );\n}\n`);\n\n if (template === 'minimal') {\n writeFile(path.join(dir, 'app', 'page.tsx'), `export const metadata = {\\n title: \"${name}\",\\n};\\n\\nexport default function MinimalPage() {\\n return (\\n <main className=\"min-h-screen flex flex-col items-center justify-center bg-[#0F172A] text-slate-100 font-sans\">\\n <h1 className=\"text-4xl font-bold tracking-tight text-white mb-2\">Velix</h1>\\n <p className=\"text-slate-400\">Minimal starter.</p>\\n </main>\\n );\\n}\\n`);\n } else {\n // Full template with components...\n fs.mkdirSync(path.join(dir, 'components', 'ui'), { recursive: true });\n\n let buttonCode = `import React from 'react';\\n\\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\\n variant?: 'primary' | 'secondary';\\n}\\n\\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\\n ({ className = '', variant = 'primary', ...props }, ref) => {\\n const base = \"inline-flex flex-row gap-2 items-center justify-center font-medium transition-all duration-300 h-12 rounded-xl px-8 focus:outline-none focus:ring-2 focus:ring-velix-cyan/50\";\\n const variants = {\\n primary: \"bg-gradient-to-r from-velix-accent to-velix-cyan text-white shadow-[0_0_20px_rgba(34,211,238,0.25)] hover:shadow-[0_0_30px_rgba(34,211,238,0.45)]\",\\n secondary: \"bg-white/5 text-slate-200 border border-white/10 hover:bg-white/10 hover:border-velix-cyan/30\"\\n };\\n return <button ref={ref} className={\\`\\${base} \\${variants[variant]} \\${className}\\`} {...props} />;\\n }\\n);\\nButton.displayName = \"Button\";\\n`;\n\n if (useShadcn) {\n fs.mkdirSync(path.join(dir, 'lib'), { recursive: true });\n writeFile(path.join(dir, 'lib', 'utils.ts'), `import { clsx, type ClassValue } from \"clsx\";\\nimport { twMerge } from \"tailwind-merge\";\\n\\nexport function cn(...inputs: ClassValue[]) {\\n return twMerge(clsx(inputs));\\n}\\n`);\n buttonCode = `import * as React from \"react\";\\nimport { cn } from \"../../lib/utils\";\\n\\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\\n variant?: 'primary' | 'secondary';\\n}\\n\\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\\n ({ className, variant = 'primary', ...props }, ref) => {\\n const classes = cn(\\n \"inline-flex flex-row gap-2 items-center justify-center font-medium transition-all duration-300 h-12 rounded-xl px-8 focus:outline-none focus:ring-2 focus:ring-velix-cyan/50\",\\n variant === 'primary' ? \"bg-gradient-to-r from-velix-accent to-velix-cyan text-white shadow-[0_0_20px_rgba(34,211,238,0.25)] hover:shadow-[0_0_30px_rgba(34,211,238,0.45)]\" : \"bg-white/5 text-slate-200 border border-white/10 hover:bg-white/10 hover:border-velix-cyan/30\",\\n className\\n );\\n return <button className={classes} ref={ref} {...props} />;\\n }\\n);\\nButton.displayName = \"Button\";\\n`;\n }\n writeFile(path.join(dir, 'components', 'ui', 'button.tsx'), buttonCode);\n\n const cardClasses = \"group relative p-8 bg-velix-dark/60 border border-white/5 rounded-2xl hover:border-velix-cyan/20 transition-colors duration-300 overflow-hidden\";\n const cardGradient = \"absolute inset-0 bg-gradient-to-br from-velix-accent/0 to-velix-cyan/0 group-hover:from-velix-accent/5 group-hover:to-velix-cyan/5 transition-all duration-500\";\n const cardCode = useShadcn\n ? `import React from \"react\";\\nimport { cn } from \"../../lib/utils\";\\n\\nexport function Card({ title, description, className = '' }: { title: string; description: string; className?: string }) {\\n return (\\n <div className={cn(\"${cardClasses}\", className)}>\\n <div className=\"${cardGradient}\"></div>\\n <h3 className=\"text-xl font-semibold text-slate-100 mb-3 relative z-10\">{title}</h3>\\n <p className=\"text-sm text-slate-400 leading-relaxed relative z-10\">{description}</p>\\n </div>\\n );\\n}\\n`\n : `import React from \"react\";\\n\\nexport function Card({ title, description, className = '' }: { title: string; description: string; className?: string }) {\\n return (\\n <div className={\"${cardClasses} \" + className}>\\n <div className=\"${cardGradient}\"></div>\\n <h3 className=\"text-xl font-semibold text-slate-100 mb-3 relative z-10\">{title}</h3>\\n <p className=\"text-sm text-slate-400 leading-relaxed relative z-10\">{description}</p>\\n </div>\\n );\\n}\\n`;\n writeFile(path.join(dir, 'components', 'ui', 'card.tsx'), cardCode);\n\n writeFile(path.join(dir, 'app', 'page.tsx'), `import { Button } from \"../components/ui/button\";\nimport { Card } from \"../components/ui/card\";\n\nexport const metadata = {\n title: \"Welcome to Velix\",\n description: \"Build fast. Ship faster.\",\n};\n\nexport default function HomePage() {\n return (\n <main className=\"min-h-screen flex flex-col items-center justify-center p-8 bg-gradient-to-b from-[#0B1628] via-velix-dark to-velix-deep text-slate-100 font-sans relative overflow-hidden\">\n <div className=\"absolute top-1/4 left-1/3 w-[500px] h-[500px] bg-velix-accent/15 rounded-full blur-[140px] pointer-events-none\"></div>\n <div className=\"absolute bottom-1/4 right-1/4 w-[400px] h-[400px] bg-velix-cyan/10 rounded-full blur-[120px] pointer-events-none\"></div>\n <div className=\"z-10 flex flex-col items-center max-w-5xl w-full text-center mt-12 mb-auto\">\n <div className=\"mb-10 w-24 h-24 bg-gradient-to-br from-velix-accent to-velix-cyan rounded-2xl shadow-[0_0_50px_rgba(34,211,238,0.3)] flex items-center justify-center relative group\">\n <div className=\"absolute inset-0 bg-velix-cyan/20 rounded-2xl blur-xl group-hover:blur-2xl transition-all duration-500\"></div>\n <span className=\"text-5xl font-black text-white relative z-10 tracking-tighter\">V</span>\n </div>\n <h1 className=\"text-5xl md:text-7xl font-extrabold mb-6 tracking-tight\">\n <span className=\"bg-clip-text text-transparent bg-gradient-to-r from-white to-slate-400\">Welcome to</span>{\" \"}\n <span className=\"bg-clip-text text-transparent bg-gradient-to-r from-velix-cyan via-velix-glow to-velix-accent\">Velix</span>\n </h1>\n <p className=\"text-xl md:text-2xl text-slate-400 mb-12 tracking-wide font-light\">\n Build fast. Ship faster.\n </p>\n <div className=\"flex flex-col sm:flex-row gap-5 mb-24 w-full sm:w-auto\">\n <a href=\"https://github.com/Velixteam/velix\" target=\"_blank\" rel=\"noreferrer\" className=\"w-full sm:w-auto\">\n <Button variant=\"primary\" className=\"w-full\">Get Started</Button>\n </a>\n <a href=\"https://teamvelix.vercel.app\" target=\"_blank\" rel=\"noreferrer\" className=\"w-full sm:w-auto\">\n <Button variant=\"secondary\" className=\"w-full\">Documentation</Button>\n </a>\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 w-full text-left\">\n <Card title=\"Routing\" description=\"File-system based routing that feels instantly familiar and snappy.\" />\n <Card title=\"Actions\" description=\"Type-safe server actions mapped seamlessly directly to your client.\" />\n <Card title=\"Plugins\" description=\"Extend the framework capabilities with a simple yet powerful API.\" />\n <Card title=\"Deployment\" description=\"Deploy to any cloud provider or serverless edge with zero config.\" />\n </div>\n </div>\n <div className=\"mt-16 pb-8 text-slate-600 text-sm tracking-widest uppercase font-mono\">\n Velix © ${new Date().getFullYear()}\n </div>\n </main>\n );\n}\n`);\n }\n\n if (template !== 'minimal') {\n fs.mkdirSync(path.join(dir, 'server', 'api'), { recursive: true });\n writeFile(path.join(dir, 'server', 'api', 'hello.ts'), `export function GET() {\n return Response.json({ message: \"Hello from Velix API!\" });\n}\n\nexport function POST(_request: Request) {\n return Response.json({ received: true });\n}\n`);\n\n fs.mkdirSync(path.join(dir, 'public'), { recursive: true });\n }\n\n // Copy favicon\n const logoSrc = path.join(__dirname, '..', 'assets', 'logo.webp');\n if (fs.existsSync(logoSrc)) {\n fs.mkdirSync(path.join(dir, 'public'), { recursive: true });\n fs.copyFileSync(logoSrc, path.join(dir, 'public', 'favicon.webp'));\n }\n}\n"],"mappings":";;;;;;;;;AAGA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,OAAO,QAAQ;AACf,OAAO,aAAa;AAIpB,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAEzC,eAAsB,cAAc,MAAe;AACjD,aAAW;AAEX,MAAI,CAAC,MAAM;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C;AAAA,EAC5D;AAGA,QAAM,UAAU,KAAK,KAAK,WAAW,MAAM,UAAU,WAAW;AAChE,MAAI,GAAG,WAAW,OAAO,GAAG;AAC1B,OAAG,UAAU,KAAK,KAAK,KAAK,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AAC1D,OAAG,aAAa,SAAS,KAAK,KAAK,KAAK,UAAU,cAAc,CAAC;AAAA,EACnE;AACF;","names":[]}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log,
|
|
3
3
|
showBanner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QVHVWNX3.js";
|
|
5
|
+
import "./chunk-7D4SUZUM.js";
|
|
5
6
|
|
|
6
7
|
// commands/dev.ts
|
|
7
8
|
import fs from "fs";
|
|
8
9
|
import path from "path";
|
|
9
10
|
async function devCommand() {
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const isPack = args.includes("--pack");
|
|
10
13
|
showBanner();
|
|
11
|
-
log.info(
|
|
14
|
+
log.info(`Starting development server${isPack ? " with Velix Pack Beta" : ""}...`);
|
|
12
15
|
const { spawn } = await import("child_process");
|
|
13
16
|
const cwd = process.cwd();
|
|
14
17
|
const candidates = [
|
|
@@ -21,7 +24,8 @@ async function devCommand() {
|
|
|
21
24
|
log.error("Could not find Velix runtime. Run `npm install` first.");
|
|
22
25
|
process.exit(1);
|
|
23
26
|
}
|
|
24
|
-
const
|
|
27
|
+
const packFlag = isPack ? " --pack" : "";
|
|
28
|
+
const child = spawn(`npx tsx --no-cache "${devScript}"${packFlag}`, {
|
|
25
29
|
stdio: "inherit",
|
|
26
30
|
cwd,
|
|
27
31
|
shell: true
|
|
@@ -34,4 +38,4 @@ async function devCommand() {
|
|
|
34
38
|
export {
|
|
35
39
|
devCommand
|
|
36
40
|
};
|
|
37
|
-
//# sourceMappingURL=dev-
|
|
41
|
+
//# sourceMappingURL=dev-H632BVX7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../commands/dev.ts"],"sourcesContent":["/**\n * `velix dev` — Start development server\n */\nimport fs from 'fs';\nimport path from 'path';\nimport { showBanner, log } from './shared.js';\n\nexport async function devCommand() {\n const args = process.argv.slice(2);\n const isPack = args.includes('--pack');\n\n showBanner();\n log.info(`Starting development server${isPack ? ' with Velix Pack Beta' : ''}...`);\n\n const { spawn } = await import('child_process');\n\n const cwd = process.cwd();\n const candidates = [\n path.join(cwd, 'node_modules', '@teamvelix', 'velix', 'dist', 'runtime', 'start-dev.js'),\n path.join(cwd, 'packages', 'velix', 'dist', 'runtime', 'start-dev.js'),\n path.join(cwd, 'packages', 'velix', 'runtime', 'start-dev.ts'),\n ];\n\n const devScript = candidates.find(c => fs.existsSync(c));\n if (!devScript) {\n log.error('Could not find Velix runtime. Run `npm install` first.');\n process.exit(1);\n }\n\n const packFlag = isPack ? ' --pack' : '';\n const child = spawn(`npx tsx --no-cache \"${devScript}\"${packFlag}`, {\n stdio: 'inherit', cwd, shell: true,\n });\n\n child.on('error', (err) => {\n log.error(`Failed to start dev server: ${err.message}`);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;AAGA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGjB,eAAsB,aAAa;AACjC,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,QAAM,SAAS,KAAK,SAAS,QAAQ;AAErC,aAAW;AACX,MAAI,KAAK,8BAA8B,SAAS,0BAA0B,EAAE,KAAK;AAEjF,QAAM,EAAE,MAAM,IAAI,MAAM,OAAO,eAAe;AAE9C,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,aAAa;AAAA,IACjB,KAAK,KAAK,KAAK,gBAAgB,cAAc,SAAS,QAAQ,WAAW,cAAc;AAAA,IACvF,KAAK,KAAK,KAAK,YAAY,SAAS,QAAQ,WAAW,cAAc;AAAA,IACrE,KAAK,KAAK,KAAK,YAAY,SAAS,WAAW,cAAc;AAAA,EAC/D;AAEA,QAAM,YAAY,WAAW,KAAK,OAAK,GAAG,WAAW,CAAC,CAAC;AACvD,MAAI,CAAC,WAAW;AACd,QAAI,MAAM,wDAAwD;AAClE,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,WAAW,SAAS,YAAY;AACtC,QAAM,QAAQ,MAAM,uBAAuB,SAAS,IAAI,QAAQ,IAAI;AAAA,IAClE,OAAO;AAAA,IAAW;AAAA,IAAK,OAAO;AAAA,EAChC,CAAC;AAED,QAAM,GAAG,SAAS,CAAC,QAAQ;AACzB,QAAI,MAAM,+BAA+B,IAAI,OAAO,EAAE;AACtD,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
VERSION,
|
|
3
3
|
log,
|
|
4
4
|
showBanner
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QVHVWNX3.js";
|
|
6
|
+
import "./chunk-7D4SUZUM.js";
|
|
6
7
|
|
|
7
8
|
// commands/doctor.ts
|
|
8
9
|
import fs from "fs";
|
|
@@ -44,4 +45,4 @@ export {
|
|
|
44
45
|
doctorCommand,
|
|
45
46
|
infoCommand
|
|
46
47
|
};
|
|
47
|
-
//# sourceMappingURL=doctor-
|
|
48
|
+
//# sourceMappingURL=doctor-4ZBGISX6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../commands/doctor.ts"],"sourcesContent":["/**\n * `velix doctor` & `velix info`\n */\nimport fs from 'fs';\nimport pc from 'picocolors';\nimport { VERSION } from '../version.js';\nimport { showBanner, log } from './shared.js';\n\nexport async function doctorCommand() {\n showBanner();\n console.log(` ${pc.bold('Velix Doctor')}`);\n log.blank();\n\n const checks = [\n { name: 'Node.js version', check: () => { const v = parseInt(process.version.slice(1)); return v >= 18 ? '✔' : '✖'; }, info: process.version },\n { name: 'velix.config.ts', check: () => fs.existsSync('velix.config.ts') || fs.existsSync('velix.config.js') ? '✔' : '✖', info: '' },\n { name: 'app/ directory', check: () => fs.existsSync('app') ? '✔' : '✖', info: '' },\n { name: 'package.json', check: () => fs.existsSync('package.json') ? '✔' : '✖', info: '' },\n { name: 'tsconfig.json', check: () => fs.existsSync('tsconfig.json') ? '✔' : '✖', info: '' },\n { name: 'node_modules', check: () => fs.existsSync('node_modules') ? '✔' : '⚠ Run npm install', info: '' },\n ];\n\n for (const { name, check, info } of checks) {\n const result = check();\n const icon = result === '✔' ? pc.green('✔') : result.startsWith('✖') ? pc.red('✖') : pc.yellow('⚠');\n const infoStr = info ? ` ${pc.dim(info)}` : (result.length > 1 ? ` ${pc.yellow(result.slice(2))}` : '');\n console.log(` ${icon} ${name}${infoStr}`);\n }\n\n log.blank();\n}\n\nexport async function infoCommand() {\n showBanner();\n console.log(` ${pc.bold('Environment:')}`);\n console.log(` Velix: ${pc.cyan(`v${VERSION}`)}`);\n console.log(` Node: ${pc.dim(process.version)}`);\n console.log(` Platform: ${pc.dim(process.platform)}`);\n console.log(` Arch: ${pc.dim(process.arch)}`);\n console.log(` CWD: ${pc.dim(process.cwd())}`);\n log.blank();\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../commands/doctor.ts"],"sourcesContent":["/**\n * `velix doctor` & `velix info`\n */\nimport fs from 'fs';\nimport pc from 'picocolors';\nimport { VERSION } from '../version.js';\nimport { showBanner, log } from './shared.js';\n\nexport async function doctorCommand() {\n showBanner();\n console.log(` ${pc.bold('Velix Doctor')}`);\n log.blank();\n\n const checks = [\n { name: 'Node.js version', check: () => { const v = parseInt(process.version.slice(1)); return v >= 18 ? '✔' : '✖'; }, info: process.version },\n { name: 'velix.config.ts', check: () => fs.existsSync('velix.config.ts') || fs.existsSync('velix.config.js') ? '✔' : '✖', info: '' },\n { name: 'app/ directory', check: () => fs.existsSync('app') ? '✔' : '✖', info: '' },\n { name: 'package.json', check: () => fs.existsSync('package.json') ? '✔' : '✖', info: '' },\n { name: 'tsconfig.json', check: () => fs.existsSync('tsconfig.json') ? '✔' : '✖', info: '' },\n { name: 'node_modules', check: () => fs.existsSync('node_modules') ? '✔' : '⚠ Run npm install', info: '' },\n ];\n\n for (const { name, check, info } of checks) {\n const result = check();\n const icon = result === '✔' ? pc.green('✔') : result.startsWith('✖') ? pc.red('✖') : pc.yellow('⚠');\n const infoStr = info ? ` ${pc.dim(info)}` : (result.length > 1 ? ` ${pc.yellow(result.slice(2))}` : '');\n console.log(` ${icon} ${name}${infoStr}`);\n }\n\n log.blank();\n}\n\nexport async function infoCommand() {\n showBanner();\n console.log(` ${pc.bold('Environment:')}`);\n console.log(` Velix: ${pc.cyan(`v${VERSION}`)}`);\n console.log(` Node: ${pc.dim(process.version)}`);\n console.log(` Platform: ${pc.dim(process.platform)}`);\n console.log(` Arch: ${pc.dim(process.arch)}`);\n console.log(` CWD: ${pc.dim(process.cwd())}`);\n log.blank();\n}\n"],"mappings":";;;;;;;;AAGA,OAAO,QAAQ;AACf,OAAO,QAAQ;AAIf,eAAsB,gBAAgB;AACpC,aAAW;AACX,UAAQ,IAAI,KAAK,GAAG,KAAK,cAAc,CAAC,EAAE;AAC1C,MAAI,MAAM;AAEV,QAAM,SAAS;AAAA,IACb,EAAE,MAAM,mBAAmB,OAAO,MAAM;AAAE,YAAM,IAAI,SAAS,QAAQ,QAAQ,MAAM,CAAC,CAAC;AAAG,aAAO,KAAK,KAAK,WAAM;AAAA,IAAK,GAAG,MAAM,QAAQ,QAAQ;AAAA,IAC7I,EAAE,MAAM,mBAAmB,OAAO,MAAM,GAAG,WAAW,iBAAiB,KAAK,GAAG,WAAW,iBAAiB,IAAI,WAAM,UAAK,MAAM,GAAG;AAAA,IACnI,EAAE,MAAM,kBAAkB,OAAO,MAAM,GAAG,WAAW,KAAK,IAAI,WAAM,UAAK,MAAM,GAAG;AAAA,IAClF,EAAE,MAAM,gBAAgB,OAAO,MAAM,GAAG,WAAW,cAAc,IAAI,WAAM,UAAK,MAAM,GAAG;AAAA,IACzF,EAAE,MAAM,iBAAiB,OAAO,MAA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|
|
8
9
|
// commands/generate.ts
|
|
9
10
|
import fs from "fs";
|
|
@@ -198,4 +199,4 @@ export function use${pascalCase(n)}() {
|
|
|
198
199
|
export {
|
|
199
200
|
generateCommand
|
|
200
201
|
};
|
|
201
|
-
//# sourceMappingURL=generate-
|
|
202
|
+
//# sourceMappingURL=generate-F5PULUKX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../commands/generate.ts"],"sourcesContent":["/**\n * `velix g <type> <name>` — Generate component/page/api/...\n */\nimport fs from 'fs';\nimport path from 'path';\nimport pc from 'picocolors';\nimport prompts from 'prompts';\nimport { log, writeFile, capitalize, pascalCase, camelCase } from './shared.js';\n\nexport async function generateCommand(type?: string, name?: string) {\n const validTypes = ['page', 'layout', 'component', 'hook', 'api', 'action', 'middleware', 'context', 'loading', 'error', 'not-found'];\n\n if (!type) {\n const { type: selectedType } = await prompts({\n type: 'select',\n name: 'type',\n message: 'What do you want to generate?',\n choices: validTypes.map(t => ({ title: t, value: t })),\n });\n type = selectedType;\n if (!type) process.exit(0);\n }\n\n if (!validTypes.includes(type)) {\n log.error(`Invalid type: ${type}. Valid: ${validTypes.join(', ')}`);\n process.exit(1);\n }\n\n if (!name && !['loading', 'error', 'not-found'].includes(type)) {\n const { name: inputName } = await prompts({\n type: 'text',\n name: 'name',\n message: `${type} name:`,\n });\n name = inputName;\n if (!name) process.exit(0);\n }\n\n const templates: Record<string, (n: string) => { path: string; content: string }> = {\n page: (n) => ({\n path: `app/${n}/page.tsx`,\n content: `export const metadata = {\\n title: \"${capitalize(n)}\",\\n};\\n\\nexport default function ${pascalCase(n)}Page() {\\n return (\\n <main>\\n <h1>${capitalize(n)}</h1>\\n </main>\\n );\\n}\\n`\n }),\n layout: (n) => ({\n path: `app/${n}/layout.tsx`,\n content: `export default function ${pascalCase(n)}Layout({ children }: { children: React.ReactNode }) {\\n return <div>{children}</div>;\\n}\\n`\n }),\n component: (n) => ({\n path: `components/${pascalCase(n)}.tsx`,\n content: `interface ${pascalCase(n)}Props {\\n // props\\n}\\n\\nexport default function ${pascalCase(n)}({}: ${pascalCase(n)}Props) {\\n return <div>${pascalCase(n)}</div>;\\n}\\n`\n }),\n hook: (n) => ({\n path: `hooks/use${pascalCase(n)}.ts`,\n content: `import { useState } from 'react';\\n\\nexport function use${pascalCase(n)}() {\\n const [state, setState] = useState(null);\\n return { state, setState };\\n}\\n`\n }),\n api: (n) => ({\n path: `server/api/${n}.ts`,\n content: `export function GET(_request: Request) {\\n return Response.json({ message: \"Hello from ${n}\" });\\n}\\n\\nexport function POST(_request: Request) {\\n return Response.json({ received: true });\\n}\\n`\n }),\n action: (n) => ({\n path: `server/actions/${n}.ts`,\n content: `'use server';\\n\\nexport async function ${camelCase(n)}Action(_prevState: unknown, formData: FormData) {\\n // Server action logic\\n return { success: true };\\n}\\n`\n }),\n middleware: (n) => ({\n path: `middleware/${n}.ts`,\n content: `export default async function ${camelCase(n)}Middleware(req: Request, res: Response, next: () => Promise<void>) {\\n // Middleware logic\\n await next();\\n}\\n`\n }),\n context: (n) => ({\n path: `contexts/${pascalCase(n)}Context.tsx`,\n content: `'use client';\\nimport { createContext, useContext, type ReactNode } from 'react';\\n\\ninterface ${pascalCase(n)}ContextType {\\n // context values\\n}\\n\\nconst ${pascalCase(n)}Context = createContext<${pascalCase(n)}ContextType | null>(null);\\n\\nexport function ${pascalCase(n)}Provider({ children }: { children: ReactNode }) {\\n return <${pascalCase(n)}Context.Provider value={{}}>{children}</${pascalCase(n)}Context.Provider>;\\n}\\n\\nexport function use${pascalCase(n)}() {\\n const ctx = useContext(${pascalCase(n)}Context);\\n if (!ctx) throw new Error('use${pascalCase(n)} must be used within ${pascalCase(n)}Provider');\\n return ctx;\\n}\\n`\n }),\n loading: () => ({\n path: `app/loading.tsx`,\n content: `export default function Loading() {\\n return <div>Loading...</div>;\\n}\\n`\n }),\n error: (n) => ({\n path: n ? `app/${n}/error.tsx` : `app/error.tsx`,\n content: [\n `import { defineError } from 'velix';`,\n ``,\n `export default defineError(({ error, reset }) => {`,\n ` return (`,\n ` <div>`,\n ` <h1>Something went wrong</h1>`,\n ` <p>{error.message}</p>`,\n ` {(error as any).status && <p>Status: {(error as any).status}</p>}`,\n ` <button onClick={reset}>Try again</button>`,\n ` <a href=\"/\">Go home</a>`,\n ` </div>`,\n ` );`,\n `});`,\n ``,\n ].join('\\n'),\n }),\n 'not-found': (n) => ({\n path: n ? `app/${n}/not-found.tsx` : `app/not-found.tsx`,\n content: [\n `import { defineNotFound } from 'velix';`,\n ``,\n `export default defineNotFound(() => {`,\n ` return (`,\n ` <div>`,\n ` <h1>404</h1>`,\n ` <p>This page could not be found.</p>`,\n ` <a href=\"/\">Go home</a>`,\n ` </div>`,\n ` );`,\n `});`,\n ``,\n ].join('\\n'),\n }),\n };\n\n const generator = templates[type!];\n if (!generator) { log.error(`No template for type: ${type}`); process.exit(1); }\n\n const { path: filePath, content } = generator(name || '');\n const fullPath = path.resolve(process.cwd(), filePath);\n\n if (fs.existsSync(fullPath)) {\n log.warn(`File already exists: ${filePath}`);\n const { overwrite } = await prompts({\n type: 'confirm', name: 'overwrite', message: 'Overwrite?', initial: false,\n });\n if (!overwrite) process.exit(0);\n }\n\n fs.mkdirSync(path.dirname(fullPath), { recursive: true });\n fs.writeFileSync(fullPath, content);\n log.success(`Created ${pc.cyan(filePath)}`);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../commands/generate.ts"],"sourcesContent":["/**\n * `velix g <type> <name>` — Generate component/page/api/...\n */\nimport fs from 'fs';\nimport path from 'path';\nimport pc from 'picocolors';\nimport prompts from 'prompts';\nimport { log, writeFile, capitalize, pascalCase, camelCase } from './shared.js';\n\nexport async function generateCommand(type?: string, name?: string) {\n const validTypes = ['page', 'layout', 'component', 'hook', 'api', 'action', 'middleware', 'context', 'loading', 'error', 'not-found'];\n\n if (!type) {\n const { type: selectedType } = await prompts({\n type: 'select',\n name: 'type',\n message: 'What do you want to generate?',\n choices: validTypes.map(t => ({ title: t, value: t })),\n });\n type = selectedType;\n if (!type) process.exit(0);\n }\n\n if (!validTypes.includes(type)) {\n log.error(`Invalid type: ${type}. Valid: ${validTypes.join(', ')}`);\n process.exit(1);\n }\n\n if (!name && !['loading', 'error', 'not-found'].includes(type)) {\n const { name: inputName } = await prompts({\n type: 'text',\n name: 'name',\n message: `${type} name:`,\n });\n name = inputName;\n if (!name) process.exit(0);\n }\n\n const templates: Record<string, (n: string) => { path: string; content: string }> = {\n page: (n) => ({\n path: `app/${n}/page.tsx`,\n content: `export const metadata = {\\n title: \"${capitalize(n)}\",\\n};\\n\\nexport default function ${pascalCase(n)}Page() {\\n return (\\n <main>\\n <h1>${capitalize(n)}</h1>\\n </main>\\n );\\n}\\n`\n }),\n layout: (n) => ({\n path: `app/${n}/layout.tsx`,\n content: `export default function ${pascalCase(n)}Layout({ children }: { children: React.ReactNode }) {\\n return <div>{children}</div>;\\n}\\n`\n }),\n component: (n) => ({\n path: `components/${pascalCase(n)}.tsx`,\n content: `interface ${pascalCase(n)}Props {\\n // props\\n}\\n\\nexport default function ${pascalCase(n)}({}: ${pascalCase(n)}Props) {\\n return <div>${pascalCase(n)}</div>;\\n}\\n`\n }),\n hook: (n) => ({\n path: `hooks/use${pascalCase(n)}.ts`,\n content: `import { useState } from 'react';\\n\\nexport function use${pascalCase(n)}() {\\n const [state, setState] = useState(null);\\n return { state, setState };\\n}\\n`\n }),\n api: (n) => ({\n path: `server/api/${n}.ts`,\n content: `export function GET(_request: Request) {\\n return Response.json({ message: \"Hello from ${n}\" });\\n}\\n\\nexport function POST(_request: Request) {\\n return Response.json({ received: true });\\n}\\n`\n }),\n action: (n) => ({\n path: `server/actions/${n}.ts`,\n content: `'use server';\\n\\nexport async function ${camelCase(n)}Action(_prevState: unknown, formData: FormData) {\\n // Server action logic\\n return { success: true };\\n}\\n`\n }),\n middleware: (n) => ({\n path: `middleware/${n}.ts`,\n content: `export default async function ${camelCase(n)}Middleware(req: Request, res: Response, next: () => Promise<void>) {\\n // Middleware logic\\n await next();\\n}\\n`\n }),\n context: (n) => ({\n path: `contexts/${pascalCase(n)}Context.tsx`,\n content: `'use client';\\nimport { createContext, useContext, type ReactNode } from 'react';\\n\\ninterface ${pascalCase(n)}ContextType {\\n // context values\\n}\\n\\nconst ${pascalCase(n)}Context = createContext<${pascalCase(n)}ContextType | null>(null);\\n\\nexport function ${pascalCase(n)}Provider({ children }: { children: ReactNode }) {\\n return <${pascalCase(n)}Context.Provider value={{}}>{children}</${pascalCase(n)}Context.Provider>;\\n}\\n\\nexport function use${pascalCase(n)}() {\\n const ctx = useContext(${pascalCase(n)}Context);\\n if (!ctx) throw new Error('use${pascalCase(n)} must be used within ${pascalCase(n)}Provider');\\n return ctx;\\n}\\n`\n }),\n loading: () => ({\n path: `app/loading.tsx`,\n content: `export default function Loading() {\\n return <div>Loading...</div>;\\n}\\n`\n }),\n error: (n) => ({\n path: n ? `app/${n}/error.tsx` : `app/error.tsx`,\n content: [\n `import { defineError } from 'velix';`,\n ``,\n `export default defineError(({ error, reset }) => {`,\n ` return (`,\n ` <div>`,\n ` <h1>Something went wrong</h1>`,\n ` <p>{error.message}</p>`,\n ` {(error as any).status && <p>Status: {(error as any).status}</p>}`,\n ` <button onClick={reset}>Try again</button>`,\n ` <a href=\"/\">Go home</a>`,\n ` </div>`,\n ` );`,\n `});`,\n ``,\n ].join('\\n'),\n }),\n 'not-found': (n) => ({\n path: n ? `app/${n}/not-found.tsx` : `app/not-found.tsx`,\n content: [\n `import { defineNotFound } from 'velix';`,\n ``,\n `export default defineNotFound(() => {`,\n ` return (`,\n ` <div>`,\n ` <h1>404</h1>`,\n ` <p>This page could not be found.</p>`,\n ` <a href=\"/\">Go home</a>`,\n ` </div>`,\n ` );`,\n `});`,\n ``,\n ].join('\\n'),\n }),\n };\n\n const generator = templates[type!];\n if (!generator) { log.error(`No template for type: ${type}`); process.exit(1); }\n\n const { path: filePath, content } = generator(name || '');\n const fullPath = path.resolve(process.cwd(), filePath);\n\n if (fs.existsSync(fullPath)) {\n log.warn(`File already exists: ${filePath}`);\n const { overwrite } = await prompts({\n type: 'confirm', name: 'overwrite', message: 'Overwrite?', initial: false,\n });\n if (!overwrite) process.exit(0);\n }\n\n fs.mkdirSync(path.dirname(fullPath), { recursive: true });\n fs.writeFileSync(fullPath, content);\n log.success(`Created ${pc.cyan(filePath)}`);\n}\n"],"mappings":";;;;;;;;;AAGA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,aAAa;AAGpB,eAAsB,gBAAgB,MAAe,MAAe;AAClE,QAAM,aAAa,CAAC,QAAQ,UAAU,aAAa,QAAQ,OAAO,UAAU,cAAc,WAAW,WAAW,SAAS,WAAW;AAEpI,MAAI,CAAC,MAAM;AACT,UAAM,EAAE,MAAM,aAAa,IAAI,MAAM,QAAQ;AAAA,MAC3C,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS,WAAW,IAAI,QAAM,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE;AAAA,IACvD,CAAC;AACD,WAAO;AACP,QAAI,CAAC,KAAM,SAAQ,KAAK,CAAC;AAAA,EAC3B;AAEA,MAAI,CAAC,WAAW,SAAS,IAAI,GAAG;AAC9B,QAAI,MAAM,iBAAiB,IAAI,YAAY,WAAW,KAAK,IAAI,CAAC,EAAE;AAClE,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,CAAC,QAAQ,CAAC,CAAC,WAAW,SAAS,WAAW,EAAE,SAAS,IAAI,GAAG;AAC9D,UAAM,EAAE,MAAM,UAAU,IAAI,MAAM,QAAQ;AAAA,MACxC,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS,GAAG,IAAI;AAAA,IAClB,CAAC;AACD,WAAO;AACP,QAAI,CAAC,KAAM,SAAQ,KAAK,CAAC;AAAA,EAC3B;AAEA,QAAM,YAA8E;AAAA,IAClF,MAAM,CAAC,OAAO;AAAA,MACZ,MAAM,OAAO,CA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D,QAAM,WAAW,KAAK,QAAQ,QAAQ,IAAI,GAAG,QAAQ;AAErD,MAAI,GAAG,WAAW,QAAQ,GAAG;AAC3B,QAAI,KAAK,wBAAwB,QAAQ,EAAE;AAC3C,UAAM,EAAE,UAAU,IAAI,MAAM,QAAQ;AAAA,MAClC,MAAM;AAAA,MAAW,MAAM;AAAA,MAAa,SAAS;AAAA,MAAc,SAAS;AAAA,IACtE,CAAC;AACD,QAAI,CAAC,UAAW,SAAQ,KAAK,CAAC;AAAA,EAChC;AAEA,KAAG,UAAU,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACxD,KAAG,cAAc,UAAU,OAAO;AAClC,MAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,CAAC,EAAE;AAC5C;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
VERSION,
|
|
4
4
|
log,
|
|
5
5
|
showBanner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QVHVWNX3.js";
|
|
7
|
+
import "./chunk-7D4SUZUM.js";
|
|
7
8
|
|
|
8
9
|
// index.ts
|
|
9
10
|
import pc from "picocolors";
|
|
@@ -18,6 +19,7 @@ function showHelp() {
|
|
|
18
19
|
console.log(` ${pc.cyan("start")} Start production server`);
|
|
19
20
|
console.log(` ${pc.cyan("g")} <type> <name> Generate component/page/api/...`);
|
|
20
21
|
console.log(` ${pc.cyan("ui")} add <component> Install Shadcn-style UI components`);
|
|
22
|
+
console.log(` ${pc.cyan("pack")} [options] Velix Pack diagnostics (--analyze, --debug, --profile)`);
|
|
21
23
|
console.log(` ${pc.cyan("doctor")} Health check & diagnostics`);
|
|
22
24
|
console.log(` ${pc.cyan("info")} Framework & environment info`);
|
|
23
25
|
console.log(` ${pc.cyan("analyze")} Bundle analysis`);
|
|
@@ -45,46 +47,51 @@ async function main() {
|
|
|
45
47
|
}
|
|
46
48
|
switch (command) {
|
|
47
49
|
case "create": {
|
|
48
|
-
const { createCommand } = await import("./create-
|
|
50
|
+
const { createCommand } = await import("./create-ECJXHPS4.js");
|
|
49
51
|
await createCommand(args[1]);
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
54
|
case "dev": {
|
|
53
|
-
const { devCommand } = await import("./dev-
|
|
55
|
+
const { devCommand } = await import("./dev-H632BVX7.js");
|
|
54
56
|
await devCommand();
|
|
55
57
|
break;
|
|
56
58
|
}
|
|
57
59
|
case "build": {
|
|
58
|
-
const { buildCommand } = await import("./build-
|
|
60
|
+
const { buildCommand } = await import("./build-R6YPQMKQ.js");
|
|
59
61
|
await buildCommand();
|
|
60
62
|
break;
|
|
61
63
|
}
|
|
62
64
|
case "start": {
|
|
63
|
-
const { startCommand } = await import("./build-
|
|
65
|
+
const { startCommand } = await import("./build-R6YPQMKQ.js");
|
|
64
66
|
await startCommand();
|
|
65
67
|
break;
|
|
66
68
|
}
|
|
67
69
|
case "g":
|
|
68
70
|
case "generate": {
|
|
69
|
-
const { generateCommand } = await import("./generate-
|
|
71
|
+
const { generateCommand } = await import("./generate-F5PULUKX.js");
|
|
70
72
|
await generateCommand(args[1], args[2]);
|
|
71
73
|
break;
|
|
72
74
|
}
|
|
73
75
|
case "doctor": {
|
|
74
|
-
const { doctorCommand } = await import("./doctor-
|
|
76
|
+
const { doctorCommand } = await import("./doctor-4ZBGISX6.js");
|
|
75
77
|
await doctorCommand();
|
|
76
78
|
break;
|
|
77
79
|
}
|
|
78
80
|
case "info": {
|
|
79
|
-
const { infoCommand } = await import("./doctor-
|
|
81
|
+
const { infoCommand } = await import("./doctor-4ZBGISX6.js");
|
|
80
82
|
await infoCommand();
|
|
81
83
|
break;
|
|
82
84
|
}
|
|
83
85
|
case "analyze":
|
|
84
86
|
log.info("Bundle analysis coming soon...");
|
|
85
87
|
break;
|
|
88
|
+
case "pack": {
|
|
89
|
+
const { packCommand } = await import("./pack-IHVEY27S.js");
|
|
90
|
+
await packCommand(args.slice(1));
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
86
93
|
case "ui": {
|
|
87
|
-
const { handleUiCommand } = await import("./ui-
|
|
94
|
+
const { handleUiCommand } = await import("./ui-2KJQ4SG6.js");
|
|
88
95
|
await handleUiCommand(args.slice(1));
|
|
89
96
|
break;
|
|
90
97
|
}
|
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('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\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":"
|
|
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,GAAG,KAAK,MAAM,CAAC,iDAAiD;AACnF,UAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,CAAC,iCAAiC;AACtE,UAAQ,IAAI,EAAE;AACd,UAA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AO,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":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
log,
|
|
3
|
+
showBanner
|
|
4
|
+
} from "./chunk-QVHVWNX3.js";
|
|
5
|
+
import "./chunk-7D4SUZUM.js";
|
|
6
|
+
|
|
7
|
+
// commands/pack.ts
|
|
8
|
+
import pc from "picocolors";
|
|
9
|
+
async function packCommand(args) {
|
|
10
|
+
showBanner();
|
|
11
|
+
log.info("Running Velix Pack Beta engine...");
|
|
12
|
+
const isAnalyze = args.includes("--analyze");
|
|
13
|
+
const isDebug = args.includes("--debug");
|
|
14
|
+
const isProfile = args.includes("--profile");
|
|
15
|
+
try {
|
|
16
|
+
const { VelixPack, formatBuildStats } = await import("./src-YLSZ2QML.js");
|
|
17
|
+
const pack = new VelixPack({
|
|
18
|
+
projectRoot: process.cwd(),
|
|
19
|
+
mode: "production"
|
|
20
|
+
});
|
|
21
|
+
const stats = await pack.build();
|
|
22
|
+
if (isAnalyze || isProfile || isDebug) {
|
|
23
|
+
console.log("\n" + formatBuildStats(stats) + "\n");
|
|
24
|
+
} else {
|
|
25
|
+
log.success(`Velix Pack build finished in ${(stats.duration / 1e3).toFixed(2)}s`);
|
|
26
|
+
console.log(pc.dim(`Modules: ${stats.modulesCount} | Chunks: ${stats.chunksCount} | Cache hits: ${stats.cacheHits}`));
|
|
27
|
+
}
|
|
28
|
+
} catch (err) {
|
|
29
|
+
log.error(`Velix Pack failed: ${err?.message || String(err)}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
packCommand
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=pack-IHVEY27S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../commands/pack.ts"],"sourcesContent":["/**\n * `velix pack` — Velix Pack diagnostic & build command\n */\nimport { showBanner, log } from './shared.js';\nimport pc from 'picocolors';\n\nexport async function packCommand(args: string[]) {\n showBanner();\n log.info('Running Velix Pack Beta engine...');\n\n const isAnalyze = args.includes('--analyze');\n const isDebug = args.includes('--debug');\n const isProfile = args.includes('--profile');\n\n try {\n const { VelixPack, formatBuildStats } = await import('@teamvelix/velix-pack');\n\n const pack = new VelixPack({\n projectRoot: process.cwd(),\n mode: 'production',\n });\n\n const stats = await pack.build();\n\n if (isAnalyze || isProfile || isDebug) {\n console.log('\\n' + formatBuildStats(stats) + '\\n');\n } else {\n log.success(`Velix Pack build finished in ${(stats.duration / 1000).toFixed(2)}s`);\n console.log(pc.dim(`Modules: ${stats.modulesCount} | Chunks: ${stats.chunksCount} | Cache hits: ${stats.cacheHits}`));\n }\n } catch (err: any) {\n log.error(`Velix Pack failed: ${err?.message || String(err)}`);\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;AAIA,OAAO,QAAQ;AAEf,eAAsB,YAAY,MAAgB;AAChD,aAAW;AACX,MAAI,KAAK,mCAAmC;AAE5C,QAAM,YAAY,KAAK,SAAS,WAAW;AAC3C,QAAM,UAAU,KAAK,SAAS,SAAS;AACvC,QAAM,YAAY,KAAK,SAAS,WAAW;AAE3C,MAAI;AACF,UAAM,EAAE,WAAW,iBAAiB,IAAI,MAAM,OAAO,mBAAuB;AAE5E,UAAM,OAAO,IAAI,UAAU;AAAA,MACzB,aAAa,QAAQ,IAAI;AAAA,MACzB,MAAM;AAAA,IACR,CAAC;AAED,UAAM,QAAQ,MAAM,KAAK,MAAM;AAE/B,QAAI,aAAa,aAAa,SAAS;AACrC,cAAQ,IAAI,OAAO,iBAAiB,KAAK,IAAI,IAAI;AAAA,IACnD,OAAO;AACL,UAAI,QAAQ,iCAAiC,MAAM,WAAW,KAAM,QAAQ,CAAC,CAAC,GAAG;AACjF,cAAQ,IAAI,GAAG,IAAI,YAAY,MAAM,YAAY,cAAc,MAAM,WAAW,kBAAkB,MAAM,SAAS,EAAE,CAAC;AAAA,IACtH;AAAA,EACF,SAAS,KAAU;AACjB,QAAI,MAAM,sBAAsB,KAAK,WAAW,OAAO,GAAG,CAAC,EAAE;AAC7D,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
|