lapeh 2.3.3 → 2.3.5
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/bin/index.js +23 -2
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
@@ -47,7 +47,28 @@ function runDev() {
|
|
|
47
47
|
const bootstrapPath = fs.existsSync(localBootstrapPath) ? localBootstrapPath : fallbackBootstrapPath;
|
|
48
48
|
|
|
49
49
|
// We execute a script that requires ts-node to run lib/bootstrap.ts
|
|
50
|
-
|
|
50
|
+
// IMPORTANT: We need to use 'npx' to run nodemon from the project's node_modules,
|
|
51
|
+
// BUT we also need to ensure we use the project's ts-node and tsconfig-paths.
|
|
52
|
+
|
|
53
|
+
// The previous error "Cannot find module 'E:\PROJECT\ANY\2026\TESTING'" suggests an issue with argument parsing or path spaces.
|
|
54
|
+
// The path contains spaces "TESTING LAPEH". When passed to `exec`, it might be splitting.
|
|
55
|
+
// We should quote the paths properly.
|
|
56
|
+
|
|
57
|
+
// Windows paths with spaces are tricky.
|
|
58
|
+
// We need to use slightly different quoting strategy or use spawn instead of execSync for better argument handling.
|
|
59
|
+
// However, execSync is simpler for now.
|
|
60
|
+
|
|
61
|
+
// Using simple double quotes around the whole argument for node -r might work better if we escape backslashes?
|
|
62
|
+
// Or just ensure paths are quoted.
|
|
63
|
+
|
|
64
|
+
// Let's try to escape backslashes in paths for the string interpolation
|
|
65
|
+
const safeTsNodePath = tsNodePath.replace(/\\/g, '\\\\');
|
|
66
|
+
const safeTsConfigPathsPath = tsConfigPathsPath.replace(/\\/g, '\\\\');
|
|
67
|
+
const safeBootstrapPath = bootstrapPath.replace(/\\/g, '\\\\');
|
|
68
|
+
|
|
69
|
+
const cmd = `npx nodemon --watch src --watch lib --ext ts,json --exec "node -r \\"${safeTsNodePath}\\" -r \\"${safeTsConfigPathsPath}\\" \\"${safeBootstrapPath}\\""`;
|
|
70
|
+
|
|
71
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
51
72
|
} catch (error) {
|
|
52
73
|
// Ignore error
|
|
53
74
|
}
|