@snowieedev/vertex-cli 0.1.0
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/commands/build.d.ts +1 -0
- package/dist/commands/build.js +20 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.js +23 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +21 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/version.d.ts +1 -0
- package/dist/commands/version.js +6 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildCommand(): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { logger, handleError } from '@snowieedev/vertex-shared';
|
|
2
|
+
import { loadConfig } from '@snowieedev/vertex-config';
|
|
3
|
+
import { createBuilder } from '@snowieedev/vertex-builder';
|
|
4
|
+
export async function buildCommand() {
|
|
5
|
+
try {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
logger.info('Starting production build...');
|
|
8
|
+
const config = await loadConfig(cwd);
|
|
9
|
+
// Hardcoded to esbuild for Phase 1
|
|
10
|
+
const builder = await createBuilder('esbuild', cwd, config);
|
|
11
|
+
const result = await builder.build();
|
|
12
|
+
if (result.warnings && result.warnings.length > 0) {
|
|
13
|
+
result.warnings.forEach(w => logger.warn(w));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
handleError(err);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;QAErC,mCAAmC;QACnC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAE5D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QAErC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function devCommand(): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { logger, handleError } from '@snowieedev/vertex-shared';
|
|
2
|
+
import { loadConfig } from '@snowieedev/vertex-config';
|
|
3
|
+
import { createServer } from '@snowieedev/vertex-dev-server';
|
|
4
|
+
export async function devCommand() {
|
|
5
|
+
try {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
logger.info('Starting dev server...');
|
|
8
|
+
const config = await loadConfig(cwd);
|
|
9
|
+
// In future, this could be configurable. For now, strictly Vite.
|
|
10
|
+
const devServer = await createServer('vite', cwd, config);
|
|
11
|
+
await devServer.start();
|
|
12
|
+
// Catch signals to gracefully close
|
|
13
|
+
process.on('SIGINT', async () => {
|
|
14
|
+
logger.info('Shutting down dev server...');
|
|
15
|
+
await devServer.close();
|
|
16
|
+
process.exit(0);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
handleError(err);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;QAErC,iEAAiE;QACjE,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QAExB,oCAAoC;QACpC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAC3C,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function doctorCommand(): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { logger } from '@snowieedev/vertex-shared';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
|
+
export function doctorCommand() {
|
|
4
|
+
logger.info('VERTEX Diagnostics:');
|
|
5
|
+
try {
|
|
6
|
+
const nodeVersion = execSync('node -v').toString().trim();
|
|
7
|
+
logger.success(`Node.js: ${nodeVersion}`);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
logger.error('Node.js not found');
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const pnpmVersion = execSync('pnpm -v').toString().trim();
|
|
14
|
+
logger.success(`pnpm: ${pnpmVersion}`);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
logger.error('pnpm not found');
|
|
18
|
+
}
|
|
19
|
+
logger.info('Environment appears healthy.');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,YAAY,WAAW,EAAE,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function versionCommand(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACnE,gDAAgD;AAChD,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,cAAc,SAAS,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { devCommand } from './commands/dev.js';
|
|
4
|
+
import { buildCommand } from './commands/build.js';
|
|
5
|
+
import { doctorCommand } from './commands/doctor.js';
|
|
6
|
+
import { versionCommand } from './commands/version.js';
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program
|
|
9
|
+
.name('vertex')
|
|
10
|
+
.description('The VERTEX Framework CLI')
|
|
11
|
+
.version('0.1.0', '-v, --version', 'Output the current version');
|
|
12
|
+
program
|
|
13
|
+
.command('dev')
|
|
14
|
+
.description('Start the development server')
|
|
15
|
+
.action(devCommand);
|
|
16
|
+
program
|
|
17
|
+
.command('build')
|
|
18
|
+
.description('Build the project for production')
|
|
19
|
+
.action(buildCommand);
|
|
20
|
+
program
|
|
21
|
+
.command('doctor')
|
|
22
|
+
.description('Run diagnostics on your environment')
|
|
23
|
+
.action(doctorCommand);
|
|
24
|
+
// Also support `vertex --version` out of the box via commander,
|
|
25
|
+
// but we explicitly wire the action just in case they typed `vertex version`
|
|
26
|
+
program
|
|
27
|
+
.command('version')
|
|
28
|
+
.description('Print framework version')
|
|
29
|
+
.action(versionCommand);
|
|
30
|
+
program.parse(process.argv);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,0BAA0B,CAAC;KACvC,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,4BAA4B,CAAC,CAAC;AAEnE,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,8BAA8B,CAAC;KAC3C,MAAM,CAAC,UAAU,CAAC,CAAC;AAEtB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,qCAAqC,CAAC;KAClD,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,gEAAgE;AAChE,6EAA6E;AAC7E,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,yBAAyB,CAAC;KACtC,MAAM,CAAC,cAAc,CAAC,CAAC;AAE1B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@snowieedev/vertex-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for VERTEX framework",
|
|
5
|
+
"bin": {
|
|
6
|
+
"vertex": "./dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"commander": "^12.0.0",
|
|
14
|
+
"@snowieedev/vertex-shared": "0.1.0",
|
|
15
|
+
"@snowieedev/vertex-config": "0.1.0",
|
|
16
|
+
"@snowieedev/vertex-dev-server": "0.1.0",
|
|
17
|
+
"@snowieedev/vertex-builder": "0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"typescript": "^5.4.0",
|
|
21
|
+
"@types/node": "^20.11.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"dev": "tsc --watch",
|
|
26
|
+
"clean": "rm -rf dist"
|
|
27
|
+
}
|
|
28
|
+
}
|