neex 0.7.44 → 0.8.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/README.md +50 -326
- package/bin/neex +31 -0
- package/install.js +94 -0
- package/package.json +30 -63
- package/dist/bin/neex.d.ts +0 -26
- package/dist/bin/neex.d.ts.map +0 -1
- package/dist/bin/neex.js +0 -8
- package/dist/src/build-manager.d.ts +0 -41
- package/dist/src/build-manager.d.ts.map +0 -1
- package/dist/src/build-manager.js +0 -369
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -67
- package/dist/src/commands/add-commands.d.ts +0 -4
- package/dist/src/commands/add-commands.d.ts.map +0 -1
- package/dist/src/commands/add-commands.js +0 -83
- package/dist/src/commands/build-commands.d.ts +0 -5
- package/dist/src/commands/build-commands.d.ts.map +0 -1
- package/dist/src/commands/build-commands.js +0 -123
- package/dist/src/commands/dev-commands.d.ts +0 -5
- package/dist/src/commands/dev-commands.d.ts.map +0 -1
- package/dist/src/commands/dev-commands.js +0 -198
- package/dist/src/commands/index.d.ts +0 -8
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -27
- package/dist/src/commands/init-commands.d.ts +0 -2
- package/dist/src/commands/init-commands.d.ts.map +0 -1
- package/dist/src/commands/init-commands.js +0 -20
- package/dist/src/commands/run-commands.d.ts +0 -3
- package/dist/src/commands/run-commands.d.ts.map +0 -1
- package/dist/src/commands/run-commands.js +0 -93
- package/dist/src/commands/server-commands.d.ts +0 -3
- package/dist/src/commands/server-commands.d.ts.map +0 -1
- package/dist/src/commands/server-commands.js +0 -51
- package/dist/src/commands/start-commands.d.ts +0 -5
- package/dist/src/commands/start-commands.d.ts.map +0 -1
- package/dist/src/commands/start-commands.js +0 -162
- package/dist/src/dev-manager.d.ts +0 -51
- package/dist/src/dev-manager.d.ts.map +0 -1
- package/dist/src/dev-manager.js +0 -471
- package/dist/src/index.d.ts +0 -41
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -70
- package/dist/src/logger-manager.d.ts +0 -4
- package/dist/src/logger-manager.d.ts.map +0 -1
- package/dist/src/logger-manager.js +0 -17
- package/dist/src/logger.d.ts +0 -34
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/logger.js +0 -279
- package/dist/src/runner.d.ts +0 -21
- package/dist/src/runner.d.ts.map +0 -1
- package/dist/src/runner.js +0 -414
- package/dist/src/start-manager.d.ts +0 -49
- package/dist/src/start-manager.d.ts.map +0 -1
- package/dist/src/start-manager.js +0 -484
- package/dist/src/types.d.ts +0 -41
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/utils.d.ts +0 -2
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -9
|
@@ -1,123 +0,0 @@
|
|
|
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.addBuildCommands = addBuildCommands;
|
|
7
|
-
const build_manager_js_1 = require("../build-manager.js");
|
|
8
|
-
const logger_manager_js_1 = require("../logger-manager.js");
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const figures_1 = __importDefault(require("figures"));
|
|
11
|
-
function addBuildCommands(program) {
|
|
12
|
-
let buildManager = null;
|
|
13
|
-
// Build command for TypeScript projects
|
|
14
|
-
program
|
|
15
|
-
.command('build [source]')
|
|
16
|
-
.description('Build TypeScript project for production (default: src)')
|
|
17
|
-
.option('-o, --output <dir>', 'Output directory', 'dist')
|
|
18
|
-
.option('-w, --watch', 'Watch mode for continuous building')
|
|
19
|
-
.option('-c, --clean', 'Clean output directory before build', true)
|
|
20
|
-
.option('-s, --sourcemap', 'Generate source maps')
|
|
21
|
-
.option('-t, --target <target>', 'TypeScript target (es2020, es2022, etc.)', 'es2020')
|
|
22
|
-
.option('-f, --format <format>', 'Output format (cjs, esm)', 'cjs')
|
|
23
|
-
.option('--tsconfig <file>', 'TypeScript config file', 'tsconfig.json')
|
|
24
|
-
.option('-v, --verbose', 'Verbose output')
|
|
25
|
-
.option('-q, --quiet', 'Quiet output')
|
|
26
|
-
.option('--no-color', 'Disable colored output')
|
|
27
|
-
.option('--analyze', 'Analyze bundle size')
|
|
28
|
-
.action(async (source, options) => {
|
|
29
|
-
try {
|
|
30
|
-
const sourceDir = source || 'src';
|
|
31
|
-
if (!options.quiet) {
|
|
32
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green(figures_1.default.play)} Building TypeScript project from ${chalk_1.default.cyan(sourceDir)}`, 'info');
|
|
33
|
-
}
|
|
34
|
-
buildManager = new build_manager_js_1.BuildManager({
|
|
35
|
-
source: sourceDir,
|
|
36
|
-
output: options.output,
|
|
37
|
-
watch: options.watch,
|
|
38
|
-
clean: options.clean,
|
|
39
|
-
minify: false, // TSC doesn't handle minification
|
|
40
|
-
sourcemap: options.sourcemap,
|
|
41
|
-
target: options.target,
|
|
42
|
-
format: options.format,
|
|
43
|
-
bundle: false, // TSC doesn't bundle
|
|
44
|
-
external: [], // Not applicable for TSC
|
|
45
|
-
tsconfig: options.tsconfig,
|
|
46
|
-
verbose: options.verbose,
|
|
47
|
-
quiet: options.quiet,
|
|
48
|
-
color: options.color,
|
|
49
|
-
analyze: options.analyze,
|
|
50
|
-
});
|
|
51
|
-
// --- Signal Handlers for Build ---
|
|
52
|
-
const cleanupAndExit = (signal) => {
|
|
53
|
-
if (buildManager) {
|
|
54
|
-
logger_manager_js_1.loggerManager.printLine(`\n${chalk_1.default.yellow('⏹')} Received ${signal}, shutting down...`, 'info');
|
|
55
|
-
buildManager.stop().then(() => process.exit(0));
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
process.exit(0);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const sigintHandler = () => cleanupAndExit('SIGINT');
|
|
62
|
-
const sigtermHandler = () => cleanupAndExit('SIGTERM');
|
|
63
|
-
process.on('SIGINT', sigintHandler);
|
|
64
|
-
process.on('SIGTERM', sigtermHandler);
|
|
65
|
-
await buildManager.build();
|
|
66
|
-
// If not in watch mode, show completion message
|
|
67
|
-
if (!options.watch && !options.quiet) {
|
|
68
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green(figures_1.default.tick)} Build completed successfully`, 'info');
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
if (error instanceof Error) {
|
|
73
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red(figures_1.default.cross)} Build failed: ${error.message}`, 'error');
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red(figures_1.default.cross)} An unknown build error occurred`, 'error');
|
|
77
|
-
}
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
// Add a quick build command without options
|
|
82
|
-
program
|
|
83
|
-
.command('compile [source]')
|
|
84
|
-
.alias('tsc')
|
|
85
|
-
.description('Quick TypeScript compilation (alias for build)')
|
|
86
|
-
.action(async (source) => {
|
|
87
|
-
try {
|
|
88
|
-
const sourceDir = source || 'src';
|
|
89
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.blue(figures_1.default.info)} Compiling TypeScript...`, 'info');
|
|
90
|
-
buildManager = new build_manager_js_1.BuildManager({
|
|
91
|
-
source: sourceDir,
|
|
92
|
-
output: 'dist',
|
|
93
|
-
watch: false,
|
|
94
|
-
clean: true,
|
|
95
|
-
minify: false,
|
|
96
|
-
sourcemap: false,
|
|
97
|
-
target: 'es2020',
|
|
98
|
-
format: 'cjs',
|
|
99
|
-
bundle: false,
|
|
100
|
-
external: [],
|
|
101
|
-
tsconfig: 'tsconfig.json',
|
|
102
|
-
verbose: false,
|
|
103
|
-
quiet: false,
|
|
104
|
-
color: true,
|
|
105
|
-
analyze: false,
|
|
106
|
-
});
|
|
107
|
-
await buildManager.build();
|
|
108
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green(figures_1.default.tick)} Compilation completed`, 'info');
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
if (error instanceof Error) {
|
|
112
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red(figures_1.default.cross)} Compilation failed: ${error.message}`, 'error');
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red(figures_1.default.cross)} An unknown compilation error occurred`, 'error');
|
|
116
|
-
}
|
|
117
|
-
process.exit(1);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
// Cleanup function is no longer needed here as it's handled within the command
|
|
121
|
-
const cleanupBuild = async () => { };
|
|
122
|
-
return { cleanupBuild };
|
|
123
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/dev-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG;IAAE,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAgS3E"}
|
|
@@ -1,198 +0,0 @@
|
|
|
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.addDevCommands = addDevCommands;
|
|
7
|
-
const dev_manager_js_1 = require("../dev-manager.js");
|
|
8
|
-
const logger_manager_js_1 = require("../logger-manager.js");
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const figures_1 = __importDefault(require("figures"));
|
|
11
|
-
function addDevCommands(program) {
|
|
12
|
-
let devManager = null;
|
|
13
|
-
// Ultra-fast dev command optimized for speed
|
|
14
|
-
program
|
|
15
|
-
.command('dev [file]')
|
|
16
|
-
.description('Start ultra-fast TypeScript development server (like tsx)')
|
|
17
|
-
.option('-w, --watch <patterns>', 'Watch patterns (comma-separated)', 'src/**/*')
|
|
18
|
-
.option('-i, --ignore <patterns>', 'Ignore patterns (comma-separated)', 'node_modules,dist,build,.git')
|
|
19
|
-
.option('-e, --ext <extensions>', 'File extensions to watch', 'ts,tsx,js,jsx')
|
|
20
|
-
.option('-d, --delay <ms>', 'Restart delay in milliseconds', parseInt, 100)
|
|
21
|
-
.option('--fast', 'Ultra-fast mode (50ms delay)')
|
|
22
|
-
.option('--no-clear', "Don't clear console on restart")
|
|
23
|
-
.option('--no-color', 'Disable colored output')
|
|
24
|
-
.option('-q, --quiet', 'Minimal output')
|
|
25
|
-
.option('-v, --verbose', 'Verbose logging')
|
|
26
|
-
.option('--inspect', 'Enable Node.js inspector')
|
|
27
|
-
.option('--inspect-brk', 'Enable Node.js inspector with breakpoint')
|
|
28
|
-
.option('--env <file>', 'Environment file to load', '.env')
|
|
29
|
-
.option('--exec <command>', 'Custom command to execute')
|
|
30
|
-
.option('--tsconfig <path>', 'TypeScript config file path')
|
|
31
|
-
.option('--no-source-maps', 'Disable source map generation')
|
|
32
|
-
.option('--transpile-only', 'Skip type checking (faster)')
|
|
33
|
-
.option('--node-args <args>', 'Node.js arguments (comma-separated)', '')
|
|
34
|
-
.action(async (file, options) => {
|
|
35
|
-
try {
|
|
36
|
-
const targetFile = file || 'src/index.ts';
|
|
37
|
-
const delay = options.fast ? 50 : options.delay;
|
|
38
|
-
if (!options.quiet) {
|
|
39
|
-
console.log(''); // Empty line for better visual separation
|
|
40
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green(figures_1.default.play)} Starting ${chalk_1.default.cyan('neex dev')} for ${chalk_1.default.cyan(targetFile)}`, 'info');
|
|
41
|
-
}
|
|
42
|
-
devManager = new dev_manager_js_1.DevManager({
|
|
43
|
-
file: targetFile,
|
|
44
|
-
watch: options.watch.split(',').map((p) => p.trim()),
|
|
45
|
-
ignore: options.ignore.split(',').map((p) => p.trim()),
|
|
46
|
-
extensions: options.ext.split(',').map((e) => e.trim()),
|
|
47
|
-
delay: delay,
|
|
48
|
-
color: options.color,
|
|
49
|
-
quiet: options.quiet,
|
|
50
|
-
verbose: options.verbose,
|
|
51
|
-
clearConsole: options.clear,
|
|
52
|
-
inspect: options.inspect,
|
|
53
|
-
inspectBrk: options.inspectBrk,
|
|
54
|
-
envFile: options.env,
|
|
55
|
-
execCommand: options.exec,
|
|
56
|
-
tsConfig: options.tsconfig,
|
|
57
|
-
sourceMaps: options.sourceMaps,
|
|
58
|
-
transpileOnly: options.transpileOnly,
|
|
59
|
-
nodeArgs: options.nodeArgs
|
|
60
|
-
? options.nodeArgs.split(',').map((arg) => arg.trim())
|
|
61
|
-
: [],
|
|
62
|
-
});
|
|
63
|
-
// --- Signal Handlers for Dev ---
|
|
64
|
-
let isShuttingDown = false;
|
|
65
|
-
const cleanupAndExit = () => {
|
|
66
|
-
if (isShuttingDown)
|
|
67
|
-
return;
|
|
68
|
-
isShuttingDown = true;
|
|
69
|
-
if (devManager) {
|
|
70
|
-
logger_manager_js_1.loggerManager.printLine(`\n${chalk_1.default.yellow('⏹')} Received SIGINT, shutting down...`, 'info');
|
|
71
|
-
devManager.stop().then(() => process.exit(0));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const sigintHandler = () => cleanupAndExit();
|
|
75
|
-
const sigtermHandler = () => cleanupAndExit();
|
|
76
|
-
process.on('SIGINT', sigintHandler);
|
|
77
|
-
process.on('SIGTERM', sigtermHandler);
|
|
78
|
-
await devManager.start();
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
if (error instanceof Error) {
|
|
82
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red('✖')} ${error.message}`, 'error');
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red('✖')} Unknown error occurred`, 'error');
|
|
86
|
-
}
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
// Clean cache command
|
|
91
|
-
program
|
|
92
|
-
.command('dev:clean')
|
|
93
|
-
.description('Clean development cache and temp files')
|
|
94
|
-
.action(() => {
|
|
95
|
-
const path = require('path');
|
|
96
|
-
const fs = require('fs');
|
|
97
|
-
const tempDir = path.join(process.cwd(), '.neex-temp');
|
|
98
|
-
const nodeModulesCache = path.join(process.cwd(), 'node_modules/.cache');
|
|
99
|
-
let cleaned = false;
|
|
100
|
-
if (fs.existsSync(tempDir)) {
|
|
101
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
102
|
-
cleaned = true;
|
|
103
|
-
}
|
|
104
|
-
if (fs.existsSync(nodeModulesCache)) {
|
|
105
|
-
try {
|
|
106
|
-
fs.rmSync(nodeModulesCache, { recursive: true, force: true });
|
|
107
|
-
cleaned = true;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
// Ignore cache cleanup errors
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (cleaned) {
|
|
114
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green('✓')} Cache cleaned successfully`, 'info');
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.blue('ℹ')} No cache to clean`, 'info');
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
// TypeScript config check
|
|
121
|
-
program
|
|
122
|
-
.command('dev:check')
|
|
123
|
-
.description('Check TypeScript configuration')
|
|
124
|
-
.option('--tsconfig <path>', 'TypeScript config file path')
|
|
125
|
-
.action(options => {
|
|
126
|
-
const path = require('path');
|
|
127
|
-
const fs = require('fs');
|
|
128
|
-
const configPath = options.tsconfig || 'tsconfig.json';
|
|
129
|
-
if (!fs.existsSync(configPath)) {
|
|
130
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red('✖')} TypeScript config not found: ${configPath}`, 'error');
|
|
131
|
-
process.exit(1);
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
135
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.green('✓')} TypeScript config is valid`, 'info');
|
|
136
|
-
if (config.compilerOptions && !options.quiet) {
|
|
137
|
-
const opts = config.compilerOptions;
|
|
138
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim('Configuration:')}`, 'info');
|
|
139
|
-
logger_manager_js_1.loggerManager.printLine(` Target: ${opts.target || 'ES5'}`, 'info');
|
|
140
|
-
logger_manager_js_1.loggerManager.printLine(` Module: ${opts.module || 'CommonJS'}`, 'info');
|
|
141
|
-
logger_manager_js_1.loggerManager.printLine(` Strict: ${opts.strict || false}`, 'info');
|
|
142
|
-
logger_manager_js_1.loggerManager.printLine(` Source Maps: ${opts.sourceMap || false}`, 'info');
|
|
143
|
-
logger_manager_js_1.loggerManager.printLine(` Skip Lib Check: ${opts.skipLibCheck || false}`, 'info');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.red('✖')} Invalid TypeScript config: ${error.message}`, 'error');
|
|
148
|
-
process.exit(1);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
// Performance info command
|
|
152
|
-
program
|
|
153
|
-
.command('dev:info')
|
|
154
|
-
.description('Show development server information')
|
|
155
|
-
.action(() => {
|
|
156
|
-
const path = require('path');
|
|
157
|
-
const fs = require('fs');
|
|
158
|
-
const os = require('os');
|
|
159
|
-
console.log('');
|
|
160
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.blue('⚡')} ${chalk_1.default.bold('neex dev')} - Development Server Info`, 'info');
|
|
161
|
-
console.log('');
|
|
162
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim('System:')}`, 'info');
|
|
163
|
-
logger_manager_js_1.loggerManager.printLine(` Platform: ${os.platform()} ${os.arch()}`, 'info');
|
|
164
|
-
logger_manager_js_1.loggerManager.printLine(` Node.js: ${process.version}`, 'info');
|
|
165
|
-
logger_manager_js_1.loggerManager.printLine(` Memory: ${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB used`, 'info');
|
|
166
|
-
console.log('');
|
|
167
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim('Features:')}`, 'info');
|
|
168
|
-
logger_manager_js_1.loggerManager.printLine(` ${chalk_1.default.green('✓')} Ultra-fast TypeScript compilation`, 'info');
|
|
169
|
-
logger_manager_js_1.loggerManager.printLine(` ${chalk_1.default.green('✓')} Intelligent module caching`, 'info');
|
|
170
|
-
logger_manager_js_1.loggerManager.printLine(` ${chalk_1.default.green('✓')} Hot reload with dependency tracking`, 'info');
|
|
171
|
-
logger_manager_js_1.loggerManager.printLine(` ${chalk_1.default.green('✓')} Source map support`, 'info');
|
|
172
|
-
logger_manager_js_1.loggerManager.printLine(` ${chalk_1.default.green('✓')} Memory-optimized processing`, 'info');
|
|
173
|
-
const tsConfigExists = fs.existsSync('tsconfig.json');
|
|
174
|
-
const packageJsonExists = fs.existsSync('package.json');
|
|
175
|
-
console.log('');
|
|
176
|
-
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim('Project:')}`, 'info');
|
|
177
|
-
logger_manager_js_1.loggerManager.printLine(` TypeScript Config: ${tsConfigExists ? chalk_1.default.green('✓') : chalk_1.default.red('✖')}`, 'info');
|
|
178
|
-
logger_manager_js_1.loggerManager.printLine(` Package.json: ${packageJsonExists ? chalk_1.default.green('✓') : chalk_1.default.red('✖')}`, 'info');
|
|
179
|
-
if (packageJsonExists) {
|
|
180
|
-
try {
|
|
181
|
-
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
182
|
-
if (pkg.name) {
|
|
183
|
-
logger_manager_js_1.loggerManager.printLine(` Name: ${pkg.name}`, 'info');
|
|
184
|
-
}
|
|
185
|
-
if (pkg.version) {
|
|
186
|
-
logger_manager_js_1.loggerManager.printLine(` Version: ${pkg.version}`, 'info');
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
// Ignore package.json parsing errors
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
console.log('');
|
|
194
|
-
});
|
|
195
|
-
// Cleanup function is no longer needed here as it's handled within the command
|
|
196
|
-
const cleanupDev = () => { };
|
|
197
|
-
return { cleanupDev };
|
|
198
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './run-commands.js';
|
|
2
|
-
export * from './dev-commands.js';
|
|
3
|
-
export * from './server-commands.js';
|
|
4
|
-
export * from './start-commands.js';
|
|
5
|
-
export * from './build-commands.js';
|
|
6
|
-
export { runInit } from './init-commands.js';
|
|
7
|
-
export { addPlugin } from './add-commands.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.addPlugin = exports.runInit = void 0;
|
|
18
|
-
// src/commands/index.ts - Export all commands
|
|
19
|
-
__exportStar(require("./run-commands.js"), exports);
|
|
20
|
-
__exportStar(require("./dev-commands.js"), exports);
|
|
21
|
-
__exportStar(require("./server-commands.js"), exports);
|
|
22
|
-
__exportStar(require("./start-commands.js"), exports);
|
|
23
|
-
__exportStar(require("./build-commands.js"), exports);
|
|
24
|
-
var init_commands_js_1 = require("./init-commands.js");
|
|
25
|
-
Object.defineProperty(exports, "runInit", { enumerable: true, get: function () { return init_commands_js_1.runInit; } });
|
|
26
|
-
var add_commands_js_1 = require("./add-commands.js");
|
|
27
|
-
Object.defineProperty(exports, "addPlugin", { enumerable: true, get: function () { return add_commands_js_1.addPlugin; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/init-commands.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAgB5C"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runInit = runInit;
|
|
4
|
-
// src/commands/init-commands.ts
|
|
5
|
-
const child_process_1 = require("child_process");
|
|
6
|
-
function runInit(args) {
|
|
7
|
-
// No extra logs, just run the command.
|
|
8
|
-
const child = (0, child_process_1.spawn)('npx', ['create-neex', ...args], {
|
|
9
|
-
stdio: 'inherit', // This will show the output of create-neex directly
|
|
10
|
-
shell: true,
|
|
11
|
-
});
|
|
12
|
-
child.on('close', code => {
|
|
13
|
-
// The process exit code will be inherited from the child process.
|
|
14
|
-
process.exit(code ?? 1);
|
|
15
|
-
});
|
|
16
|
-
child.on('error', err => {
|
|
17
|
-
console.error('Failed to start npx create-neex:', err);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/run-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsGrD"}
|
|
@@ -1,93 +0,0 @@
|
|
|
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.addRunCommands = addRunCommands;
|
|
7
|
-
const index_js_1 = require("../index.js");
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const figures_1 = __importDefault(require("figures"));
|
|
10
|
-
function addRunCommands(program) {
|
|
11
|
-
let cleanupRunner = null;
|
|
12
|
-
// Main command for sequential execution (similar to run-s)
|
|
13
|
-
program
|
|
14
|
-
.command('s <commands...>')
|
|
15
|
-
.alias('seq')
|
|
16
|
-
.alias('sequential')
|
|
17
|
-
.description('Run commands sequentially')
|
|
18
|
-
.option('-c, --no-color', 'Disable colored output')
|
|
19
|
-
.option('-t, --no-timing', 'Hide timing information')
|
|
20
|
-
.option('-p, --no-prefix', 'Hide command prefix')
|
|
21
|
-
.option('-s, --stop-on-error', 'Stop on first error')
|
|
22
|
-
.option('-o, --no-output', 'Hide command output')
|
|
23
|
-
.option('-m, --minimal', 'Use minimal output format')
|
|
24
|
-
.action(async (commands, options) => {
|
|
25
|
-
try {
|
|
26
|
-
await (0, index_js_1.run)(commands, {
|
|
27
|
-
parallel: false,
|
|
28
|
-
color: options.color,
|
|
29
|
-
showTiming: options.timing,
|
|
30
|
-
prefix: options.prefix,
|
|
31
|
-
stopOnError: options.stopOnError,
|
|
32
|
-
printOutput: options.output,
|
|
33
|
-
minimalOutput: options.minimal,
|
|
34
|
-
registerCleanup: cleanup => {
|
|
35
|
-
cleanupRunner = cleanup;
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (error instanceof Error) {
|
|
41
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
45
|
-
}
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
// runx command: parallel execution by default (with alias 'p'), can run sequentially with -q
|
|
50
|
-
program
|
|
51
|
-
.command('p <commands...>', { isDefault: true })
|
|
52
|
-
.alias('par')
|
|
53
|
-
.alias('parallel')
|
|
54
|
-
.description('Run commands in parallel (default) or sequentially with -q. This is the default command.')
|
|
55
|
-
.option('-c, --no-color', 'Disable colored output')
|
|
56
|
-
.option('-t, --no-timing', 'Hide timing information')
|
|
57
|
-
.option('-p, --no-prefix', 'Hide command prefix')
|
|
58
|
-
.option('-s, --stop-on-error', 'Stop on first error')
|
|
59
|
-
.option('-o, --no-output', 'Hide command output')
|
|
60
|
-
.option('-m, --minimal', 'Use minimal output format')
|
|
61
|
-
.option('-x, --max-parallel <number>', 'Maximum number of parallel processes', parseInt)
|
|
62
|
-
.option('-q, --sequential', 'Run commands sequentially instead of in parallel')
|
|
63
|
-
.option('--retry <count>', 'Number of times to retry a failed command', parseInt)
|
|
64
|
-
.option('--retry-delay <ms>', 'Delay in milliseconds between retries', parseInt)
|
|
65
|
-
.action(async (commands, options) => {
|
|
66
|
-
try {
|
|
67
|
-
await (0, index_js_1.run)(commands, {
|
|
68
|
-
parallel: !options.sequential,
|
|
69
|
-
maxParallel: options.maxParallel,
|
|
70
|
-
color: options.color,
|
|
71
|
-
showTiming: options.timing,
|
|
72
|
-
prefix: options.prefix,
|
|
73
|
-
stopOnError: options.stopOnError,
|
|
74
|
-
printOutput: options.output,
|
|
75
|
-
minimalOutput: options.minimal,
|
|
76
|
-
retry: options.retry,
|
|
77
|
-
retryDelay: options.retryDelay,
|
|
78
|
-
registerCleanup: cleanup => {
|
|
79
|
-
cleanupRunner = cleanup;
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
if (error instanceof Error) {
|
|
85
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} Error: ${error.message}`));
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown error occurred`));
|
|
89
|
-
}
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/server-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqDxD"}
|
|
@@ -1,51 +0,0 @@
|
|
|
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.addServerCommands = addServerCommands;
|
|
7
|
-
const index_js_1 = require("../index.js");
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const figures_1 = __importDefault(require("figures"));
|
|
10
|
-
function addServerCommands(program) {
|
|
11
|
-
let cleanupRunner = null;
|
|
12
|
-
// Servers command specifically optimized for running web servers
|
|
13
|
-
program
|
|
14
|
-
.command('servers <commands...>')
|
|
15
|
-
.alias('srv')
|
|
16
|
-
.description('Run multiple servers with optimized output for API, frontend, etc.')
|
|
17
|
-
.option('-c, --no-color', 'Disable colored output')
|
|
18
|
-
.option('-t, --no-timing', 'Hide timing information')
|
|
19
|
-
.option('-p, --no-prefix', 'Hide command prefix')
|
|
20
|
-
.option('-s, --stop-on-error', 'Stop when any server crashes')
|
|
21
|
-
.option('-x, --max-parallel <number>', 'Maximum number of parallel servers', parseInt)
|
|
22
|
-
.option('-g, --group-output', 'Group outputs by server')
|
|
23
|
-
.action(async (commands, options) => {
|
|
24
|
-
try {
|
|
25
|
-
console.log(chalk_1.default.blue(`${figures_1.default.info} Starting servers in parallel mode...`));
|
|
26
|
-
await (0, index_js_1.run)(commands, {
|
|
27
|
-
parallel: true,
|
|
28
|
-
maxParallel: options.maxParallel,
|
|
29
|
-
color: options.color,
|
|
30
|
-
showTiming: options.timing,
|
|
31
|
-
prefix: options.prefix,
|
|
32
|
-
stopOnError: options.stopOnError,
|
|
33
|
-
printOutput: true,
|
|
34
|
-
registerCleanup: cleanup => {
|
|
35
|
-
cleanupRunner = cleanup;
|
|
36
|
-
},
|
|
37
|
-
groupOutput: options.groupOutput,
|
|
38
|
-
isServerMode: true,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
if (error instanceof Error) {
|
|
43
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} Server Error: ${error.message}`));
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} An unknown server error occurred`));
|
|
47
|
-
}
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-commands.d.ts","sourceRoot":"","sources":["../../../src/commands/start-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG;IAClD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAkMA"}
|