neex 0.2.9 → 0.3.1
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/README.md +1 -1
- package/dist/cli.js +11 -161
- package/dist/cli.js.map +1 -1
- package/dist/commands/process-command/process.d.ts +2 -0
- package/dist/commands/process-command/process.js +149 -0
- package/dist/commands/process-command/process.js.map +1 -0
- package/dist/commands/project-command/build.d.ts +3 -0
- package/dist/commands/project-command/build.js +41 -0
- package/dist/commands/project-command/build.js.map +1 -0
- package/dist/commands/project-command/cache.d.ts +3 -0
- package/dist/commands/project-command/cache.js +56 -0
- package/dist/commands/project-command/cache.js.map +1 -0
- package/dist/commands/project-command/dev.d.ts +3 -0
- package/dist/commands/project-command/dev.js +51 -0
- package/dist/commands/project-command/dev.js.map +1 -0
- package/dist/commands/project-command/start.d.ts +3 -0
- package/dist/commands/project-command/start.js +45 -0
- package/dist/commands/project-command/start.js.map +1 -0
- package/dist/commands/run-commands/run.d.ts +2 -0
- package/dist/commands/run-commands/run.js +81 -0
- package/dist/commands/run-commands/run.js.map +1 -0
- package/dist/index.d.ts +2 -10
- package/dist/index.js +14 -18
- package/dist/index.js.map +1 -1
- package/dist/process-manager.d.ts +20 -10
- package/dist/process-manager.js +64 -43
- package/dist/process-manager.js.map +1 -1
- package/dist/project-manager.d.ts +2 -0
- package/dist/project-manager.js +28 -14
- package/dist/project-manager.js.map +1 -1
- package/dist/typescript-runner.js +2 -1
- package/dist/typescript-runner.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
-
# Neex v0.
|
|
9
|
+
# Neex v0.3.1
|
|
10
10
|
### 🚀 Neex: The Modern Build System for Polyrepo-in-Monorepo Architecture
|
|
11
11
|
|
|
12
12
|
[](https://www.npmjs.com/package/neex)
|
package/dist/cli.js
CHANGED
|
@@ -6,168 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = cli;
|
|
7
7
|
// src/cli.ts - Updated version
|
|
8
8
|
const commander_1 = require("commander");
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const figures_1 = __importDefault(require("figures"));
|
|
11
|
-
const child_process_1 = require("child_process");
|
|
12
|
-
const path_1 = require("path");
|
|
13
|
-
const fs_1 = require("fs");
|
|
14
9
|
const project_manager_js_1 = require("./project-manager.js");
|
|
15
|
-
const dev_js_1 = require("./commands/dev.js");
|
|
16
|
-
const build_js_1 = require("./commands/build.js");
|
|
17
|
-
const start_js_1 = require("./commands/start.js");
|
|
18
|
-
const cache_js_1 = require("./commands/cache.js");
|
|
19
|
-
const process_js_1 = require("./commands/process.js");
|
|
20
|
-
const run_js_1 = require("./commands/run.js");
|
|
10
|
+
const dev_js_1 = require("./commands/project-command/dev.js");
|
|
11
|
+
const build_js_1 = require("./commands/project-command/build.js");
|
|
12
|
+
const start_js_1 = require("./commands/project-command/start.js");
|
|
13
|
+
const cache_js_1 = require("./commands/project-command/cache.js");
|
|
14
|
+
const process_js_1 = require("./commands/process-command/process.js");
|
|
15
|
+
const run_js_1 = require("./commands/run-commands/run.js");
|
|
16
|
+
const logger_js_1 = __importDefault(require("./logger.js"));
|
|
21
17
|
const { version } = require('../../package.json');
|
|
22
|
-
const crypto_1 = require("crypto");
|
|
23
|
-
const util_1 = require("util");
|
|
24
|
-
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
25
|
-
// TypeScript Cache Manager for faster transpilation
|
|
26
|
-
class TypeScriptCache {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.enabled = true;
|
|
29
|
-
this.cacheDir = (0, path_1.join)(process.cwd(), '.neex', 'cache');
|
|
30
|
-
if (!(0, fs_1.existsSync)(this.cacheDir)) {
|
|
31
|
-
(0, fs_1.mkdirSync)(this.cacheDir, { recursive: true });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
getFileHash(filePath) {
|
|
35
|
-
try {
|
|
36
|
-
const content = (0, fs_1.readFileSync)(filePath, 'utf8');
|
|
37
|
-
return (0, crypto_1.createHash)('md5').update(content).digest('hex');
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return '';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
getCachePath(filePath) {
|
|
44
|
-
const hash = this.getFileHash(filePath);
|
|
45
|
-
const fileName = `${hash}.js`;
|
|
46
|
-
return (0, path_1.join)(this.cacheDir, fileName);
|
|
47
|
-
}
|
|
48
|
-
isCached(filePath) {
|
|
49
|
-
if (!this.enabled)
|
|
50
|
-
return false;
|
|
51
|
-
const cachePath = this.getCachePath(filePath);
|
|
52
|
-
return (0, fs_1.existsSync)(cachePath);
|
|
53
|
-
}
|
|
54
|
-
getCachedFile(filePath) {
|
|
55
|
-
if (!this.isCached(filePath))
|
|
56
|
-
return null;
|
|
57
|
-
return this.getCachePath(filePath);
|
|
58
|
-
}
|
|
59
|
-
cacheFile(originalPath, compiledPath) {
|
|
60
|
-
if (!this.enabled)
|
|
61
|
-
return;
|
|
62
|
-
try {
|
|
63
|
-
const cachePath = this.getCachePath(originalPath);
|
|
64
|
-
const compiledContent = (0, fs_1.readFileSync)(compiledPath, 'utf8');
|
|
65
|
-
(0, fs_1.writeFileSync)(cachePath, compiledContent);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.warn(chalk_1.default.yellow(`Warning: Failed to cache ${originalPath}`));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
clear() {
|
|
72
|
-
try {
|
|
73
|
-
(0, child_process_1.exec)(`rm -rf ${this.cacheDir}`);
|
|
74
|
-
(0, fs_1.mkdirSync)(this.cacheDir, { recursive: true });
|
|
75
|
-
console.log(chalk_1.default.green(`${figures_1.default.tick} Cache cleared successfully`));
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} Failed to clear cache`));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// Fast TypeScript Runner using SWC or ESBuild
|
|
83
|
-
class FastTypeScriptRunner {
|
|
84
|
-
constructor() {
|
|
85
|
-
this.cache = new TypeScriptCache();
|
|
86
|
-
this.tempDir = (0, path_1.join)(process.cwd(), '.neex', 'temp');
|
|
87
|
-
if (!(0, fs_1.existsSync)(this.tempDir)) {
|
|
88
|
-
(0, fs_1.mkdirSync)(this.tempDir, { recursive: true });
|
|
89
|
-
}
|
|
90
|
-
this.compiler = this.detectBestCompiler();
|
|
91
|
-
}
|
|
92
|
-
detectBestCompiler() {
|
|
93
|
-
try {
|
|
94
|
-
require.resolve('@swc/core');
|
|
95
|
-
return 'swc';
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
try {
|
|
99
|
-
require.resolve('esbuild');
|
|
100
|
-
return 'esbuild';
|
|
101
|
-
}
|
|
102
|
-
catch {
|
|
103
|
-
return 'tsc';
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
async compile(filePath) {
|
|
108
|
-
const cachedFile = this.cache.getCachedFile(filePath);
|
|
109
|
-
if (cachedFile) {
|
|
110
|
-
return cachedFile;
|
|
111
|
-
}
|
|
112
|
-
const outputPath = (0, path_1.join)(this.tempDir, `${Date.now()}.js`);
|
|
113
|
-
try {
|
|
114
|
-
switch (this.compiler) {
|
|
115
|
-
case 'swc':
|
|
116
|
-
await this.compileWithSWC(filePath, outputPath);
|
|
117
|
-
break;
|
|
118
|
-
case 'esbuild':
|
|
119
|
-
await this.compileWithESBuild(filePath, outputPath);
|
|
120
|
-
break;
|
|
121
|
-
default:
|
|
122
|
-
await this.compileWithTSC(filePath, outputPath);
|
|
123
|
-
}
|
|
124
|
-
this.cache.cacheFile(filePath, outputPath);
|
|
125
|
-
return outputPath;
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
throw new Error(`Compilation failed: ${error}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async compileWithSWC(input, output) {
|
|
132
|
-
const swc = require('@swc/core');
|
|
133
|
-
const result = await swc.transformFile(input, {
|
|
134
|
-
jsc: {
|
|
135
|
-
parser: {
|
|
136
|
-
syntax: 'typescript',
|
|
137
|
-
tsx: false,
|
|
138
|
-
decorators: true,
|
|
139
|
-
},
|
|
140
|
-
target: 'es2022',
|
|
141
|
-
transform: {
|
|
142
|
-
legacyDecorator: true,
|
|
143
|
-
decoratorMetadata: true,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
module: {
|
|
147
|
-
type: 'commonjs',
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
(0, fs_1.writeFileSync)(output, result.code);
|
|
151
|
-
}
|
|
152
|
-
async compileWithESBuild(input, output) {
|
|
153
|
-
const esbuild = require('esbuild');
|
|
154
|
-
await esbuild.build({
|
|
155
|
-
entryPoints: [input],
|
|
156
|
-
outfile: output,
|
|
157
|
-
platform: 'node',
|
|
158
|
-
target: 'node18',
|
|
159
|
-
format: 'cjs',
|
|
160
|
-
sourcemap: true,
|
|
161
|
-
bundle: false,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
async compileWithTSC(input, output) {
|
|
165
|
-
await execAsync(`npx tsc ${input} --outFile ${output} --target ES2022 --module commonjs --esModuleInterop --allowSyntheticDefaultImports --experimentalDecorators --emitDecoratorMetadata --skipLibCheck`);
|
|
166
|
-
}
|
|
167
|
-
clearCache() {
|
|
168
|
-
this.cache.clear();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
18
|
function cli() {
|
|
172
19
|
const program = new commander_1.Command();
|
|
173
20
|
const projectManager = new project_manager_js_1.ProjectManager();
|
|
@@ -189,7 +36,10 @@ function cli() {
|
|
|
189
36
|
}
|
|
190
37
|
// Graceful shutdown handling
|
|
191
38
|
const handleSignal = (signal) => {
|
|
192
|
-
|
|
39
|
+
logger_js_1.default.printLine(`Shutting down...`, 'warn');
|
|
40
|
+
if (projectManager) {
|
|
41
|
+
projectManager.cleanup(signal);
|
|
42
|
+
}
|
|
193
43
|
setTimeout(() => process.exit(0), 500);
|
|
194
44
|
};
|
|
195
45
|
process.on('SIGINT', () => handleSignal('SIGINT')); // Ctrl+C
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAiBA,sBAoCC;AArDD,+BAA+B;AAC/B,yCAAoC;AAIpC,6DAAsD;AACtD,8DAAuE;AACvE,kEAA2E;AAC3E,kEAA2E;AAC3E,kEAA2E;AAC3E,sEAAgF;AAChF,2DAAqE;AACrE,4DAAiC;AACjC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAIlD,SAAwB,GAAG;IACvB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC9B,MAAM,cAAc,GAAG,IAAI,mCAAc,EAAE,CAAC;IAE5C,OAAO;SACF,IAAI,CAAC,MAAM,CAAC;SACZ,WAAW,CAAC,sEAAsE,CAAC;SACnF,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB,wBAAwB;IACxB,IAAA,2BAAkB,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC5C,IAAA,+BAAoB,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC9C,IAAA,+BAAoB,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC9C,IAAA,+BAAoB,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC9C,IAAA,oCAAuB,EAAC,OAAO,CAAC,CAAC;IACjC,IAAA,4BAAmB,EAAC,OAAO,CAAC,CAAC;IAE7B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B,qCAAqC;IACrC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAED,6BAA6B;IAC7B,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,EAAE;QAC5C,mBAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC7C,IAAI,cAAc,EAAE,CAAC;YACjB,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;IAC7D,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerProcessCommands = registerProcessCommands;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
const chokidar_1 = require("chokidar");
|
|
10
|
+
const process_manager_js_1 = require("../../process-manager.js");
|
|
11
|
+
function registerProcessCommands(program) {
|
|
12
|
+
// Start process command
|
|
13
|
+
program
|
|
14
|
+
.command('startx <command>')
|
|
15
|
+
.description('Start a process with monitoring and auto-restart')
|
|
16
|
+
.option('-n, --name <name>', 'Process name')
|
|
17
|
+
.option('-w, --watch', 'Watch for file changes and auto-restart')
|
|
18
|
+
.option('-r, --max-restarts <number>', 'Maximum number of restart attempts', '5')
|
|
19
|
+
.option('-d, --restart-delay <number>', 'Delay between restarts in milliseconds', '1000')
|
|
20
|
+
.option('-c, --cwd <path>', 'Working directory for the process')
|
|
21
|
+
.action(async (command, options) => {
|
|
22
|
+
try {
|
|
23
|
+
const process = await process_manager_js_1.processManager.startProcess(command, {
|
|
24
|
+
name: options.name,
|
|
25
|
+
watch: options.watch,
|
|
26
|
+
maxRestarts: parseInt(options.maxRestarts),
|
|
27
|
+
restartDelay: parseInt(options.restartDelay),
|
|
28
|
+
cwd: options.cwd
|
|
29
|
+
});
|
|
30
|
+
console.log(chalk_1.default.green(`${figures_1.default.tick} Process started successfully`));
|
|
31
|
+
console.log(chalk_1.default.blue(`Name: ${process.name}`));
|
|
32
|
+
console.log(chalk_1.default.blue(`PID: ${process.pid}`));
|
|
33
|
+
console.log(chalk_1.default.blue(`Command: ${process.command}`));
|
|
34
|
+
console.log(chalk_1.default.blue(`Max Restarts: ${process.maxRestarts}`));
|
|
35
|
+
console.log(chalk_1.default.blue(`Restart Delay: ${process.restartDelay}ms`));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error instanceof Error) {
|
|
39
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
43
|
+
}
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Stop process command
|
|
48
|
+
program
|
|
49
|
+
.command('stopx <name>')
|
|
50
|
+
.description('Stop a running process')
|
|
51
|
+
.option('-f, --force', 'Force stop the process')
|
|
52
|
+
.action(async (name, options) => {
|
|
53
|
+
try {
|
|
54
|
+
await process_manager_js_1.processManager.stop(name);
|
|
55
|
+
console.log(chalk_1.default.green(`${figures_1.default.tick} Process stopped successfully`));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof Error) {
|
|
59
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
63
|
+
}
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
// List processes command
|
|
68
|
+
program
|
|
69
|
+
.command('list')
|
|
70
|
+
.description('List all running processes')
|
|
71
|
+
.option('-a, --all', 'Show all processes including stopped ones')
|
|
72
|
+
.option('-j, --json', 'Output in JSON format')
|
|
73
|
+
.action((options) => {
|
|
74
|
+
try {
|
|
75
|
+
process_manager_js_1.processManager.list();
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error instanceof Error) {
|
|
79
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
83
|
+
}
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
// Monitor process command
|
|
88
|
+
program
|
|
89
|
+
.command('monit <name>')
|
|
90
|
+
.description('Monitor a process in real-time')
|
|
91
|
+
.option('-i, --interval <number>', 'Update interval in milliseconds', '1000')
|
|
92
|
+
.action((name, options) => {
|
|
93
|
+
try {
|
|
94
|
+
const interval = parseInt(options.interval);
|
|
95
|
+
if (isNaN(interval) || interval < 100) {
|
|
96
|
+
throw new Error('Interval must be a number greater than 100ms');
|
|
97
|
+
}
|
|
98
|
+
process_manager_js_1.processManager.monit(name);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
if (error instanceof Error) {
|
|
102
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
106
|
+
}
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
// View logs command
|
|
111
|
+
program
|
|
112
|
+
.command('log <name>')
|
|
113
|
+
.description('View process logs')
|
|
114
|
+
.option('-f, --follow', 'Follow log output')
|
|
115
|
+
.option('-e, --errors', 'Show only errors')
|
|
116
|
+
.option('-w, --warnings', 'Show only warnings')
|
|
117
|
+
.option('-l, --lines <number>', 'Number of lines to show', '100')
|
|
118
|
+
.action((name, options) => {
|
|
119
|
+
try {
|
|
120
|
+
const lines = parseInt(options.lines);
|
|
121
|
+
if (isNaN(lines) || lines < 1) {
|
|
122
|
+
throw new Error('Lines must be a positive number');
|
|
123
|
+
}
|
|
124
|
+
process_manager_js_1.processManager.log(name, lines);
|
|
125
|
+
if (options.follow) {
|
|
126
|
+
const watcher = (0, chokidar_1.watch)(process_manager_js_1.processManager.getLogPath(name), {
|
|
127
|
+
persistent: true
|
|
128
|
+
});
|
|
129
|
+
watcher.on('change', () => {
|
|
130
|
+
process_manager_js_1.processManager.log(name, 1);
|
|
131
|
+
});
|
|
132
|
+
process.on('SIGINT', () => {
|
|
133
|
+
watcher.close();
|
|
134
|
+
process.exit(0);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (error instanceof Error) {
|
|
140
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
144
|
+
}
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/commands/process-command/process.ts"],"names":[],"mappings":";;;;;AAMA,0DAwIC;AA7ID,kDAA0B;AAC1B,sDAA8B;AAC9B,uCAAiC;AACjC,iEAA0D;AAE1D,SAAgB,uBAAuB,CAAC,OAAgB;IACpD,wBAAwB;IACxB,OAAO;SACF,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC;SAC3C,MAAM,CAAC,aAAa,EAAE,yCAAyC,CAAC;SAChE,MAAM,CAAC,6BAA6B,EAAE,oCAAoC,EAAE,GAAG,CAAC;SAChF,MAAM,CAAC,8BAA8B,EAAE,wCAAwC,EAAE,MAAM,CAAC;SACxF,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;SAC/D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC/B,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,mCAAc,CAAC,YAAY,CAAC,OAAO,EAAE;gBACvD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC1C,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC;gBAC5C,GAAG,EAAE,OAAO,CAAC,GAAG;aACnB,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,iBAAO,CAAC,IAAI,+BAA+B,CAAC,CAAC,CAAC;YACzE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACjD,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
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerBuildCommand = registerBuildCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
function registerBuildCommand(program, projectManager) {
|
|
10
|
+
program
|
|
11
|
+
.command('build')
|
|
12
|
+
.description('Build TypeScript project with optimized output')
|
|
13
|
+
.option('-o, --outDir <dir>', 'Output directory', 'dist')
|
|
14
|
+
.option('-m, --minify', 'Minify output')
|
|
15
|
+
.option('-s, --sourcemap', 'Generate source maps')
|
|
16
|
+
.option('-w, --watch', 'Watch mode')
|
|
17
|
+
.option('-c, --compiler <type>', 'Compiler to use: swc, esbuild, tsc', 'auto')
|
|
18
|
+
.option('--target <target>', 'Target ES version', 'ES2022')
|
|
19
|
+
.action(async (options) => {
|
|
20
|
+
try {
|
|
21
|
+
await projectManager.build({
|
|
22
|
+
outDir: options.outDir,
|
|
23
|
+
minify: options.minify,
|
|
24
|
+
sourcemap: options.sourcemap,
|
|
25
|
+
watch: options.watch,
|
|
26
|
+
compiler: options.compiler,
|
|
27
|
+
target: options.target
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof Error) {
|
|
32
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
36
|
+
}
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/project-command/build.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CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerCacheCommand = registerCacheCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
const logger_js_1 = __importDefault(require("../../logger.js"));
|
|
10
|
+
function registerCacheCommand(program, projectManager) {
|
|
11
|
+
program
|
|
12
|
+
.command('cache')
|
|
13
|
+
.description('Manage TypeScript compilation cache')
|
|
14
|
+
.option('-c, --clear', 'Clear compilation cache')
|
|
15
|
+
.option('-s, --stats', 'Show cache statistics')
|
|
16
|
+
.option('-p, --path', 'Show cache directory path')
|
|
17
|
+
.action((options) => {
|
|
18
|
+
try {
|
|
19
|
+
if (options.clear) {
|
|
20
|
+
projectManager.clearCache();
|
|
21
|
+
console.log(chalk_1.default.green(`${figures_1.default.tick} Cache cleared successfully`));
|
|
22
|
+
}
|
|
23
|
+
else if (options.stats) {
|
|
24
|
+
const stats = projectManager.getCacheStats();
|
|
25
|
+
console.log(chalk_1.default.blue('Cache Statistics:'));
|
|
26
|
+
console.log(chalk_1.default.white(` Size: ${stats.size}`));
|
|
27
|
+
console.log(chalk_1.default.white(` Files: ${stats.files}`));
|
|
28
|
+
console.log(chalk_1.default.white(` Last Updated: ${stats.lastUpdated}`));
|
|
29
|
+
if (stats.files === 0) {
|
|
30
|
+
console.log(chalk_1.default.yellow(`${figures_1.default.warning} Cache is empty`));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (options.path) {
|
|
34
|
+
const cachePath = projectManager.getCachePath();
|
|
35
|
+
console.log(chalk_1.default.blue('Cache Directory:'));
|
|
36
|
+
console.log(chalk_1.default.white(` ${cachePath}`));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log(chalk_1.default.blue('Cache management:'));
|
|
40
|
+
console.log(chalk_1.default.white(' --clear Clear compilation cache'));
|
|
41
|
+
console.log(chalk_1.default.white(' --stats Show cache statistics'));
|
|
42
|
+
console.log(chalk_1.default.white(' --path Show cache directory path'));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof Error) {
|
|
47
|
+
logger_js_1.default.printLine(`Error: ${error.message}`, 'error');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
logger_js_1.default.printLine('An unknown error occurred', 'error');
|
|
51
|
+
}
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/commands/project-command/cache.ts"],"names":[],"mappings":";;;;;AAMA,oDAwCC;AA7CD,kDAA0B;AAC1B,sDAA8B;AAE9B,gEAAqC;AAErC,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,cAA8B;IACjF,OAAO;SACF,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,aAAa,EAAE,yBAAyB,CAAC;SAChD,MAAM,CAAC,aAAa,EAAE,uBAAuB,CAAC;SAC9C,MAAM,CAAC,YAAY,EAAE,2BAA2B,CAAC;SACjD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,IAAI,CAAC;YACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAChB,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC5B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,iBAAO,CAAC,IAAI,6BAA6B,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,mCAAmC,CAAC,CAAC,CAAC;gBAC9D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC,CAAC;YACtE,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBACzB,mBAAM,CAAC,SAAS,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACJ,mBAAM,CAAC,SAAS,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerDevCommand = registerDevCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
function registerDevCommand(program, projectManager) {
|
|
10
|
+
program
|
|
11
|
+
.command('dev <entry>')
|
|
12
|
+
.description('Run project in development mode with hot reload')
|
|
13
|
+
.option('-p, --port <number>', 'Port to run the server on', '3000')
|
|
14
|
+
.option('-w, --watch <paths...>', 'Paths to watch for changes', ['src'])
|
|
15
|
+
.option('-i, --ignore <paths...>', 'Paths to ignore', ['node_modules', 'dist', '.git', '.neex'])
|
|
16
|
+
.option('-e, --ext <extensions...>', 'File extensions to watch', ['ts', 'js', 'json'])
|
|
17
|
+
.option('-d, --delay <number>', 'Delay before restarting in milliseconds', '500')
|
|
18
|
+
.option('-c, --no-color', 'Disable colored output')
|
|
19
|
+
.option('--no-clear', 'Disable screen clearing on restart')
|
|
20
|
+
.option('--no-cache', 'Disable TypeScript compilation cache')
|
|
21
|
+
.option('--compiler <type>', 'Choose compiler: swc, esbuild, tsc', 'auto')
|
|
22
|
+
.option('--inspect', 'Enable Node.js inspector')
|
|
23
|
+
.option('--inspect-brk', 'Enable Node.js inspector with break')
|
|
24
|
+
.action(async (entry, options) => {
|
|
25
|
+
try {
|
|
26
|
+
await projectManager.startDev({
|
|
27
|
+
entry,
|
|
28
|
+
port: options.port,
|
|
29
|
+
watch: options.watch,
|
|
30
|
+
ignore: options.ignore,
|
|
31
|
+
ext: options.ext,
|
|
32
|
+
delay: options.delay,
|
|
33
|
+
clear: options.clear,
|
|
34
|
+
cache: options.cache,
|
|
35
|
+
compiler: options.compiler,
|
|
36
|
+
inspect: options.inspect,
|
|
37
|
+
inspectBrk: options.inspectBrk
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (error instanceof Error) {
|
|
42
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
46
|
+
}
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/project-command/dev.ts"],"names":[],"mappings":";;;;;AAKA,gDAuCC;AA3CD,kDAA0B;AAC1B,sDAA8B;AAG9B,SAAgB,kBAAkB,CAAC,OAAgB,EAAE,cAA8B;IAC/E,OAAO;SACF,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAClE,MAAM,CAAC,wBAAwB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C,eAAK,CAAC,GAAG,CAAC,GAAG,iBAAO,CAAC,KAAK,WAAW,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACzE,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,iBAAO,CAAC,KAAK,4BAA4B,CAAC,CAAC,CAAC;YAC3E,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerStartCommand = registerStartCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const figures_1 = __importDefault(require("figures"));
|
|
9
|
+
function registerStartCommand(program, projectManager) {
|
|
10
|
+
program
|
|
11
|
+
.command('start')
|
|
12
|
+
.description('Start the built application in production mode with health monitoring')
|
|
13
|
+
.option('-p, --port <number>', 'Port to run the server on', '3000')
|
|
14
|
+
.option('-o, --outDir <dir>', 'Output directory', 'dist')
|
|
15
|
+
.option('-e, --entry <file>', 'Entry file name', 'server.js')
|
|
16
|
+
.option('-i, --inspect', 'Enable Node.js inspector')
|
|
17
|
+
.option('-c, --cluster', 'Run in cluster mode')
|
|
18
|
+
.option('-w, --workers <number>', 'Number of worker processes', '0')
|
|
19
|
+
.option('--max-memory <size>', 'Maximum memory per process (e.g., 1024M)')
|
|
20
|
+
.option('--health-check', 'Enable health check endpoint')
|
|
21
|
+
.action(async (options) => {
|
|
22
|
+
try {
|
|
23
|
+
await projectManager.start({
|
|
24
|
+
port: options.port,
|
|
25
|
+
outDir: options.outDir,
|
|
26
|
+
entry: options.entry,
|
|
27
|
+
inspect: options.inspect,
|
|
28
|
+
cluster: options.cluster,
|
|
29
|
+
workers: options.workers,
|
|
30
|
+
maxMemory: options.maxMemory,
|
|
31
|
+
healthCheck: options.healthCheck
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
40
|
+
}
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/project-command/start.ts"],"names":[],"mappings":";;;;;AAKA,oDAiCC;AArCD,kDAA0B;AAC1B,sDAA8B;AAG9B,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,cAA8B;IACjF,OAAO;SACF,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,uEAAuE,CAAC;SACpF,MAAM,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAClE,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,CAAC;SACxD,MAAM,CAAC,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,CAAC;SAC5D,MAAM,CAAC,eAAe,EAAE,0BAA0B,CAAC;SACnD,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC;SAC9C,MAAM,CAAC,wBAAwB,EAAE,4BAA4B,EAAE,GAAG,CAAC;SACnE,MAAM,CAAC,qBAAqB,EAAE,0CAA0C,CAAC;SACzE,MAAM,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,IAAI,CAAC;YACD,MAAM,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