@titanpl/cli 5.0.4 → 5.0.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/package.json +1 -1
- package/src/engine.js +25 -5
- package/templates/common/README.md +1 -1
package/package.json
CHANGED
package/src/engine.js
CHANGED
|
@@ -19,6 +19,7 @@ export function resolveEngineBinaryPath() {
|
|
|
19
19
|
const arch = os.arch();
|
|
20
20
|
const pkgName = `@titanpl/engine-${platform}-${arch}`;
|
|
21
21
|
const binName = platform === 'win32' ? 'titan-server.exe' : 'titan-server';
|
|
22
|
+
const shortPkgName = pkgName.split('/').pop();
|
|
22
23
|
|
|
23
24
|
// 1. Monorepo search (local dev)
|
|
24
25
|
const searchPaths = [
|
|
@@ -31,8 +32,14 @@ export function resolveEngineBinaryPath() {
|
|
|
31
32
|
for (let startPath of searchPaths) {
|
|
32
33
|
let current = startPath;
|
|
33
34
|
for (let i = 0; i < 8; i++) {
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// Check built binary (engine/target/release/...)
|
|
36
|
+
const builtBin = path.join(current, 'engine', 'target', 'release', binName);
|
|
37
|
+
if (fs.existsSync(builtBin)) return builtBin;
|
|
38
|
+
|
|
39
|
+
// Check package binary (packages/engine-*/bin/...)
|
|
40
|
+
const pkgBin = path.join(current, 'packages', shortPkgName, 'bin', binName);
|
|
41
|
+
if (fs.existsSync(pkgBin)) return pkgBin;
|
|
42
|
+
|
|
36
43
|
const parent = path.dirname(current);
|
|
37
44
|
if (parent === current) break;
|
|
38
45
|
current = parent;
|
|
@@ -47,9 +54,22 @@ export function resolveEngineBinaryPath() {
|
|
|
47
54
|
} catch (e) { }
|
|
48
55
|
|
|
49
56
|
// 3. Fallback: sibling in node_modules (global install layout)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
// We need to handle scoped packages correctly.
|
|
58
|
+
// If we are at .../node_modules/@titanpl/cli/src
|
|
59
|
+
// Up 1: .../node_modules/@titanpl/cli
|
|
60
|
+
// Up 2: .../node_modules/@titanpl
|
|
61
|
+
// Up 3: .../node_modules (This is where the engine package should be)
|
|
62
|
+
let current = __dirname;
|
|
63
|
+
for (let i = 0; i < 5; i++) {
|
|
64
|
+
const potentialNm = path.join(current, 'node_modules');
|
|
65
|
+
if (fs.existsSync(potentialNm)) {
|
|
66
|
+
const siblingBin = path.join(potentialNm, pkgName, 'bin', binName);
|
|
67
|
+
if (fs.existsSync(siblingBin)) return siblingBin;
|
|
68
|
+
}
|
|
69
|
+
const parent = path.dirname(current);
|
|
70
|
+
if (parent === current) break;
|
|
71
|
+
current = parent;
|
|
72
|
+
}
|
|
53
73
|
|
|
54
74
|
// 4. Walk upwards from current dir searching for binary in root or .ext/node_modules
|
|
55
75
|
let searchDir = process.cwd();
|
|
@@ -78,7 +78,7 @@ docker run -p 5100:5100 my-titan-app
|
|
|
78
78
|
|
|
79
79
|
## 🌐 Community & Support
|
|
80
80
|
|
|
81
|
-
- **Documentation**: [docs.titanpl.com](https://
|
|
81
|
+
- **Documentation**: [docs.titanpl.com](https://titanpl.vercel.app)
|
|
82
82
|
- **GitHub**: [github.com/t8nlab/titanpl](https://github.com/t8nlab/titanpl)
|
|
83
83
|
- **Discord**: [Join our community](https://discord.gg/titanpl)
|
|
84
84
|
|