neex 0.6.1 → 0.6.2
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/src/commands/dev-commands.js +14 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,27 +43,35 @@ async function fileExists(filePath) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
// Helper function to determine the best command to run the file
|
|
46
|
-
async function getBestCommand(filePath) {
|
|
46
|
+
async function getBestCommand(filePath, showInfo = false) {
|
|
47
47
|
const ext = path.extname(filePath).toLowerCase();
|
|
48
48
|
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
49
49
|
// Check if file exists
|
|
50
50
|
if (!(await fileExists(absolutePath))) {
|
|
51
51
|
throw new Error(`File not found: ${filePath}`);
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
if (showInfo) {
|
|
54
|
+
console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Analyzing ${chalk_1.default.cyan(path.basename(filePath))}`));
|
|
55
|
+
}
|
|
54
56
|
switch (ext) {
|
|
55
57
|
case '.ts':
|
|
56
58
|
case '.mts':
|
|
57
59
|
case '.cts':
|
|
58
|
-
|
|
60
|
+
if (showInfo) {
|
|
61
|
+
console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: TypeScript detected, ready to run`));
|
|
62
|
+
}
|
|
59
63
|
return `npx ts-node ${filePath}`;
|
|
60
64
|
case '.js':
|
|
61
65
|
case '.mjs':
|
|
62
66
|
case '.cjs':
|
|
63
|
-
|
|
67
|
+
if (showInfo) {
|
|
68
|
+
console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: JavaScript detected, ready to run`));
|
|
69
|
+
}
|
|
64
70
|
return `node ${filePath}`;
|
|
65
71
|
default:
|
|
66
|
-
|
|
72
|
+
if (showInfo) {
|
|
73
|
+
console.log(chalk_1.default.yellow(`${figures_1.default.warning} neex dev: Unknown file type, using Node.js`));
|
|
74
|
+
}
|
|
67
75
|
return `node ${filePath}`;
|
|
68
76
|
}
|
|
69
77
|
}
|
|
@@ -86,6 +94,7 @@ function addDevCommands(program) {
|
|
|
86
94
|
.option('-d, --delay <ms>', 'Delay before restart in milliseconds', parseInt)
|
|
87
95
|
.option('--clear', 'Clear console on restart')
|
|
88
96
|
.option('--verbose', 'Verbose output')
|
|
97
|
+
.option('--info', 'Show detailed information and logs')
|
|
89
98
|
.option('--signal <signal>', 'Signal to send to processes on restart', 'SIGTERM')
|
|
90
99
|
.action(async (file, options) => {
|
|
91
100
|
try {
|