titanpl 2.0.2 → 2.0.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 +1 -1
- package/package.json +1 -1
- package/packages/cli/package.json +5 -5
- package/packages/cli/src/engine.js +18 -1
- package/packages/engine-darwin-arm64/package.json +1 -1
- package/packages/engine-linux-x64/package.json +1 -1
- package/packages/engine-win32-x64/package.json +1 -1
- package/packages/native/package.json +1 -1
- package/packages/packet/js/titan/dev.js +39 -11
- package/packages/packet/package.json +1 -1
- package/packages/packet/ts/titan/dev.js +39 -11
- package/packages/route/package.json +1 -1
- package/templates/extension/package.json +2 -2
- package/templates/js/package.json +5 -5
- package/templates/rust-js/package.json +4 -4
- package/templates/rust-ts/package.json +4 -4
- package/templates/ts/package.json +5 -5
- package/titanpl-sdk/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Titan handles the integration automatically.
|
|
|
80
80
|
|
|
81
81
|
# 🚀 Quick Start
|
|
82
82
|
### 1. Prerequisites
|
|
83
|
-
* **Rust** (latest stable): [Install Rust](https://rust-lang.org/tools/install/)
|
|
83
|
+
* **Rust** (latest stable): [Install Rust](https://rust-lang.org/tools/install/) [Optional]
|
|
84
84
|
* **Node.js** (v18+): Required for CLI and JS tooling.
|
|
85
85
|
|
|
86
86
|
### 2. Install CLI
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titanpl",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Titan Planet is a JavaScript-first backend framework that embeds JS actions into a Rust + Axum server and ships as a single native binary. Routes are compiled to static metadata; only actions run in the embedded JS runtime. No Node.js. No event loop in production.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "ezetgalaxy",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titanpl/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "The unified CLI for Titan Planet. Use it to create, manage, build, and deploy high-performance backend projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"titanpl",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"tit": "./index.js"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@titanpl/engine-win32-x64": "2.0.
|
|
25
|
-
"@titanpl/engine-linux-x64": "2.0.
|
|
26
|
-
"@titanpl/engine-darwin-arm64": "2.0.
|
|
24
|
+
"@titanpl/engine-win32-x64": "2.0.3",
|
|
25
|
+
"@titanpl/engine-linux-x64": "2.0.3",
|
|
26
|
+
"@titanpl/engine-darwin-arm64": "2.0.3"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@titanpl/packet": "2.0.
|
|
29
|
+
"@titanpl/packet": "2.0.3",
|
|
30
30
|
"prompts": "^2.4.2",
|
|
31
31
|
"commander": "^11.0.0",
|
|
32
32
|
"chalk": "^4.1.2"
|
|
@@ -2,7 +2,7 @@ import os from 'os';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import { createRequire } from 'module';
|
|
5
|
-
import { spawn } from 'child_process';
|
|
5
|
+
import { spawn, execSync } from 'child_process';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -51,6 +51,23 @@ export function resolveEngineBinaryPath() {
|
|
|
51
51
|
const siblingBin = path.join(cliParent, pkgName, 'bin', binName);
|
|
52
52
|
if (fs.existsSync(siblingBin)) return siblingBin;
|
|
53
53
|
|
|
54
|
+
// 4. Walk upwards from current dir searching for node_modules/@titanpl/engine-...
|
|
55
|
+
let searchDir = process.cwd();
|
|
56
|
+
for (let i = 0; i < 5; i++) {
|
|
57
|
+
const nmBin = path.join(searchDir, 'node_modules', pkgName, 'bin', binName);
|
|
58
|
+
if (fs.existsSync(nmBin)) return nmBin;
|
|
59
|
+
const parent = path.dirname(searchDir);
|
|
60
|
+
if (parent === searchDir) break;
|
|
61
|
+
searchDir = parent;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 5. Check global npm
|
|
65
|
+
try {
|
|
66
|
+
const globalModules = execSync('npm root -g').toString().trim();
|
|
67
|
+
const globalBin = path.join(globalModules, pkgName, 'bin', binName);
|
|
68
|
+
if (fs.existsSync(globalBin)) return globalBin;
|
|
69
|
+
} catch (e) { }
|
|
70
|
+
|
|
54
71
|
return null;
|
|
55
72
|
}
|
|
56
73
|
|
|
@@ -38,33 +38,53 @@ function getEngineBinaryPath(root) {
|
|
|
38
38
|
// 1. Monorepo search (dev environment)
|
|
39
39
|
let current = root;
|
|
40
40
|
for (let i = 0; i < 5; i++) {
|
|
41
|
-
const
|
|
42
|
-
if (fs.existsSync(
|
|
41
|
+
const potentialRelease = path.join(current, 'engine', 'target', 'release', binName);
|
|
42
|
+
if (fs.existsSync(potentialRelease)) return potentialRelease;
|
|
43
|
+
const potentialDebug = path.join(current, 'engine', 'target', 'debug', binName);
|
|
44
|
+
if (fs.existsSync(potentialDebug)) return potentialDebug;
|
|
45
|
+
|
|
46
|
+
// Check sibling monorepo folder for test-apps
|
|
47
|
+
const siblingRelease = path.join(current, 'titanpl', 'engine', 'target', 'release', binName);
|
|
48
|
+
if (fs.existsSync(siblingRelease)) return siblingRelease;
|
|
49
|
+
const siblingDebug = path.join(current, 'titanpl', 'engine', 'target', 'debug', binName);
|
|
50
|
+
if (fs.existsSync(siblingDebug)) return siblingDebug;
|
|
51
|
+
const siblingPkg = path.join(current, 'titanpl', 'packages', pkgName.replace('@titanpl/', ''), 'bin', binName);
|
|
52
|
+
if (fs.existsSync(siblingPkg)) return siblingPkg;
|
|
53
|
+
|
|
43
54
|
current = path.dirname(current);
|
|
44
55
|
}
|
|
45
56
|
|
|
46
57
|
// 2. Search relative to @titanpl/cli (where optionalDependencies are installed)
|
|
47
|
-
// This is the primary path for globally-installed CLI users.
|
|
48
58
|
try {
|
|
49
|
-
const
|
|
50
|
-
const cliPkgPath =
|
|
59
|
+
const req = createRequire(import.meta.url);
|
|
60
|
+
const cliPkgPath = req.resolve('@titanpl/cli/package.json');
|
|
51
61
|
const cliDir = path.dirname(cliPkgPath);
|
|
52
|
-
// Check cli's own node_modules (global install sibling)
|
|
53
62
|
const cliNodeModulesBin = path.join(cliDir, 'node_modules', pkgName, 'bin', binName);
|
|
54
63
|
if (fs.existsSync(cliNodeModulesBin)) return cliNodeModulesBin;
|
|
55
|
-
|
|
56
|
-
const
|
|
64
|
+
|
|
65
|
+
const nodeModulesDir = path.dirname(path.dirname(cliDir));
|
|
66
|
+
const parentNodeModulesBin = path.join(nodeModulesDir, pkgName, 'bin', binName);
|
|
57
67
|
if (fs.existsSync(parentNodeModulesBin)) return parentNodeModulesBin;
|
|
58
68
|
} catch (e) { }
|
|
59
69
|
|
|
60
|
-
// 3. Search in the project's own node_modules
|
|
70
|
+
// 3. Search in the project's own node_modules directly
|
|
61
71
|
try {
|
|
62
|
-
const
|
|
63
|
-
const pkgPath =
|
|
72
|
+
const req = createRequire(import.meta.url);
|
|
73
|
+
const pkgPath = req.resolve(`${pkgName}/package.json`);
|
|
64
74
|
const binPath = path.join(path.dirname(pkgPath), 'bin', binName);
|
|
65
75
|
if (fs.existsSync(binPath)) return binPath;
|
|
66
76
|
} catch (e) { }
|
|
67
77
|
|
|
78
|
+
// Walk upwards from current dir searching for node_modules/@titanpl/engine-...
|
|
79
|
+
let searchDir = process.cwd();
|
|
80
|
+
for (let i = 0; i < 5; i++) {
|
|
81
|
+
const nmBin = path.join(searchDir, 'node_modules', pkgName, 'bin', binName);
|
|
82
|
+
if (fs.existsSync(nmBin)) return nmBin;
|
|
83
|
+
const parent = path.dirname(searchDir);
|
|
84
|
+
if (parent === searchDir) break;
|
|
85
|
+
searchDir = parent;
|
|
86
|
+
}
|
|
87
|
+
|
|
68
88
|
// 4. Fallback: check common global npm paths
|
|
69
89
|
const globalSearchRoots = [
|
|
70
90
|
process.env.npm_config_prefix,
|
|
@@ -76,8 +96,16 @@ function getEngineBinaryPath(root) {
|
|
|
76
96
|
for (const gRoot of globalSearchRoots) {
|
|
77
97
|
const gBin = path.join(gRoot, 'node_modules', pkgName, 'bin', binName);
|
|
78
98
|
if (fs.existsSync(gBin)) return gBin;
|
|
99
|
+
const libNodeModulesBin = path.join(gRoot, 'lib', 'node_modules', pkgName, 'bin', binName);
|
|
100
|
+
if (fs.existsSync(libNodeModulesBin)) return libNodeModulesBin;
|
|
79
101
|
}
|
|
80
102
|
|
|
103
|
+
try {
|
|
104
|
+
const globalModules = execSync('npm root -g').toString().trim();
|
|
105
|
+
const globalBin = path.join(globalModules, pkgName, 'bin', binName);
|
|
106
|
+
if (fs.existsSync(globalBin)) return globalBin;
|
|
107
|
+
} catch (e) { }
|
|
108
|
+
|
|
81
109
|
return null;
|
|
82
110
|
}
|
|
83
111
|
|
|
@@ -38,33 +38,53 @@ function getEngineBinaryPath(root) {
|
|
|
38
38
|
// 1. Monorepo search (dev environment)
|
|
39
39
|
let current = root;
|
|
40
40
|
for (let i = 0; i < 5; i++) {
|
|
41
|
-
const
|
|
42
|
-
if (fs.existsSync(
|
|
41
|
+
const potentialRelease = path.join(current, 'engine', 'target', 'release', binName);
|
|
42
|
+
if (fs.existsSync(potentialRelease)) return potentialRelease;
|
|
43
|
+
const potentialDebug = path.join(current, 'engine', 'target', 'debug', binName);
|
|
44
|
+
if (fs.existsSync(potentialDebug)) return potentialDebug;
|
|
45
|
+
|
|
46
|
+
// Check sibling monorepo folder for test-apps
|
|
47
|
+
const siblingRelease = path.join(current, 'titanpl', 'engine', 'target', 'release', binName);
|
|
48
|
+
if (fs.existsSync(siblingRelease)) return siblingRelease;
|
|
49
|
+
const siblingDebug = path.join(current, 'titanpl', 'engine', 'target', 'debug', binName);
|
|
50
|
+
if (fs.existsSync(siblingDebug)) return siblingDebug;
|
|
51
|
+
const siblingPkg = path.join(current, 'titanpl', 'packages', pkgName.replace('@titanpl/', ''), 'bin', binName);
|
|
52
|
+
if (fs.existsSync(siblingPkg)) return siblingPkg;
|
|
53
|
+
|
|
43
54
|
current = path.dirname(current);
|
|
44
55
|
}
|
|
45
56
|
|
|
46
57
|
// 2. Search relative to @titanpl/cli (where optionalDependencies are installed)
|
|
47
|
-
// This is the primary path for globally-installed CLI users.
|
|
48
58
|
try {
|
|
49
|
-
const
|
|
50
|
-
const cliPkgPath =
|
|
59
|
+
const req = createRequire(import.meta.url);
|
|
60
|
+
const cliPkgPath = req.resolve('@titanpl/cli/package.json');
|
|
51
61
|
const cliDir = path.dirname(cliPkgPath);
|
|
52
|
-
// Check cli's own node_modules (global install sibling)
|
|
53
62
|
const cliNodeModulesBin = path.join(cliDir, 'node_modules', pkgName, 'bin', binName);
|
|
54
63
|
if (fs.existsSync(cliNodeModulesBin)) return cliNodeModulesBin;
|
|
55
|
-
|
|
56
|
-
const
|
|
64
|
+
|
|
65
|
+
const nodeModulesDir = path.dirname(path.dirname(cliDir));
|
|
66
|
+
const parentNodeModulesBin = path.join(nodeModulesDir, pkgName, 'bin', binName);
|
|
57
67
|
if (fs.existsSync(parentNodeModulesBin)) return parentNodeModulesBin;
|
|
58
68
|
} catch (e) { }
|
|
59
69
|
|
|
60
|
-
// 3. Search in the project's own node_modules
|
|
70
|
+
// 3. Search in the project's own node_modules directly
|
|
61
71
|
try {
|
|
62
|
-
const
|
|
63
|
-
const pkgPath =
|
|
72
|
+
const req = createRequire(import.meta.url);
|
|
73
|
+
const pkgPath = req.resolve(`${pkgName}/package.json`);
|
|
64
74
|
const binPath = path.join(path.dirname(pkgPath), 'bin', binName);
|
|
65
75
|
if (fs.existsSync(binPath)) return binPath;
|
|
66
76
|
} catch (e) { }
|
|
67
77
|
|
|
78
|
+
// Walk upwards from current dir searching for node_modules/@titanpl/engine-...
|
|
79
|
+
let searchDir = process.cwd();
|
|
80
|
+
for (let i = 0; i < 5; i++) {
|
|
81
|
+
const nmBin = path.join(searchDir, 'node_modules', pkgName, 'bin', binName);
|
|
82
|
+
if (fs.existsSync(nmBin)) return nmBin;
|
|
83
|
+
const parent = path.dirname(searchDir);
|
|
84
|
+
if (parent === searchDir) break;
|
|
85
|
+
searchDir = parent;
|
|
86
|
+
}
|
|
87
|
+
|
|
68
88
|
// 4. Fallback: check common global npm paths
|
|
69
89
|
const globalSearchRoots = [
|
|
70
90
|
process.env.npm_config_prefix,
|
|
@@ -76,8 +96,16 @@ function getEngineBinaryPath(root) {
|
|
|
76
96
|
for (const gRoot of globalSearchRoots) {
|
|
77
97
|
const gBin = path.join(gRoot, 'node_modules', pkgName, 'bin', binName);
|
|
78
98
|
if (fs.existsSync(gBin)) return gBin;
|
|
99
|
+
const libNodeModulesBin = path.join(gRoot, 'lib', 'node_modules', pkgName, 'bin', binName);
|
|
100
|
+
if (fs.existsSync(libNodeModulesBin)) return libNodeModulesBin;
|
|
79
101
|
}
|
|
80
102
|
|
|
103
|
+
try {
|
|
104
|
+
const globalModules = execSync('npm root -g').toString().trim();
|
|
105
|
+
const globalBin = path.join(globalModules, pkgName, 'bin', binName);
|
|
106
|
+
if (fs.existsSync(globalBin)) return globalBin;
|
|
107
|
+
} catch (e) { }
|
|
108
|
+
|
|
81
109
|
return null;
|
|
82
110
|
}
|
|
83
111
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{name}}",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A Titan Planet extension",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@titanpl/core": "latest",
|
|
19
19
|
"chokidar": "^5.0.0",
|
|
20
20
|
"esbuild": "^0.27.2",
|
|
21
|
-
"titanpl-sdk": "2.0.
|
|
21
|
+
"titanpl-sdk": "2.0.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@tgrv/microgravity": "latest"
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"template": "js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@titanpl/cli": "2.0.
|
|
10
|
-
"@titanpl/route": "2.0.
|
|
11
|
-
"@titanpl/native": "2.0.
|
|
9
|
+
"@titanpl/cli": "2.0.3",
|
|
10
|
+
"@titanpl/route": "2.0.3",
|
|
11
|
+
"@titanpl/native": "2.0.3",
|
|
12
12
|
"@titanpl/core": "latest",
|
|
13
13
|
"@titanpl/node": "latest",
|
|
14
|
-
"@titanpl/packet": "2.0.
|
|
14
|
+
"@titanpl/packet": "2.0.3"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "titan build",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"eslint": "^9.39.2",
|
|
25
25
|
"eslint-plugin-titanpl": "latest"
|
|
26
26
|
},
|
|
27
|
-
"version": "2.0.
|
|
27
|
+
"version": "2.0.3"
|
|
28
28
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titanpl",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A Titan Planet server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"titan": {
|
|
7
7
|
"template": "rust-js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@titanpl/cli": "2.0.
|
|
11
|
-
"@titanpl/route": "2.0.
|
|
12
|
-
"@titanpl/native": "2.0.
|
|
10
|
+
"@titanpl/cli": "2.0.3",
|
|
11
|
+
"@titanpl/route": "2.0.3",
|
|
12
|
+
"@titanpl/native": "2.0.3",
|
|
13
13
|
"@titanpl/core": "latest",
|
|
14
14
|
"@titanpl/node": "latest"
|
|
15
15
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titanpl",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A Titan Planet server (Rust + TypeScript)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"titan": {
|
|
7
7
|
"template": "rust-ts"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@titanpl/cli": "2.0.
|
|
11
|
-
"@titanpl/route": "2.0.
|
|
12
|
-
"@titanpl/native": "2.0.
|
|
10
|
+
"@titanpl/cli": "2.0.3",
|
|
11
|
+
"@titanpl/route": "2.0.3",
|
|
12
|
+
"@titanpl/native": "2.0.3",
|
|
13
13
|
"@titanpl/core": "latest",
|
|
14
14
|
"@titanpl/node": "latest",
|
|
15
15
|
"typescript": "^5.0.0"
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"template": "ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@titanpl/cli": "2.0.
|
|
10
|
-
"@titanpl/route": "2.0.
|
|
11
|
-
"@titanpl/native": "2.0.
|
|
9
|
+
"@titanpl/cli": "2.0.3",
|
|
10
|
+
"@titanpl/route": "2.0.3",
|
|
11
|
+
"@titanpl/native": "2.0.3",
|
|
12
12
|
"@titanpl/core": "latest",
|
|
13
13
|
"@titanpl/node": "latest",
|
|
14
|
-
"@titanpl/packet": "2.0.
|
|
14
|
+
"@titanpl/packet": "2.0.3",
|
|
15
15
|
"typescript": "^5.0.0"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"eslint-plugin-titanpl": "latest",
|
|
27
27
|
"@typescript-eslint/parser": "^8.54.0"
|
|
28
28
|
},
|
|
29
|
-
"version": "2.0.
|
|
29
|
+
"version": "2.0.3"
|
|
30
30
|
}
|
package/titanpl-sdk/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titanpl-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Development SDK for Titan Planet. Provides TypeScript type definitions for the global 't' runtime object and a 'lite' test-harness runtime for building and verifying extensions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|