titanpl 1.0.0 → 1.4.0
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 +15 -18
- package/package.json +7 -5
- package/packages/cli/README.md +17 -0
- package/packages/cli/index.js +20 -0
- package/packages/cli/package.json +34 -0
- package/packages/cli/src/commands/build.js +6 -0
- package/packages/cli/src/commands/dev.js +5 -0
- package/packages/cli/src/commands/init.js +182 -0
- package/packages/cli/src/commands/migrate.js +106 -0
- package/packages/cli/src/commands/start.js +5 -0
- package/packages/cli/src/commands/update.js +90 -0
- package/packages/cli/src/engine.js +143 -0
- package/packages/engine-darwin-arm64/README.md +13 -0
- package/packages/engine-darwin-arm64/package.json +10 -0
- package/packages/engine-linux-x64/README.md +11 -0
- package/packages/engine-linux-x64/package.json +10 -0
- package/packages/engine-win32-x64/README.md +11 -0
- package/packages/engine-win32-x64/bin/titan-engine.exe +0 -0
- package/packages/engine-win32-x64/bin/titan-server.exe +0 -0
- package/packages/engine-win32-x64/package.json +10 -0
- package/packages/native/README.md +11 -0
- package/packages/native/index.d.ts +41 -0
- package/packages/native/index.js +39 -0
- package/packages/native/package.json +26 -0
- package/packages/native/t.native.d.ts +2043 -0
- package/packages/packet/README.md +11 -0
- package/packages/packet/index.js +84 -0
- package/packages/packet/js/titan/builder.js +50 -0
- package/packages/packet/js/titan/bundle.js +164 -0
- package/packages/packet/js/titan/dev.js +172 -0
- package/packages/packet/js/titan/error-box.js +277 -0
- package/packages/packet/node_modules/typescript/LICENSE.txt +55 -0
- package/packages/packet/node_modules/typescript/README.md +50 -0
- package/packages/packet/node_modules/typescript/SECURITY.md +41 -0
- package/packages/packet/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/packages/packet/node_modules/typescript/bin/tsc +2 -0
- package/packages/packet/node_modules/typescript/bin/tsserver +2 -0
- package/packages/packet/node_modules/typescript/lib/_tsc.js +133818 -0
- package/packages/packet/node_modules/typescript/lib/_tsserver.js +659 -0
- package/packages/packet/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/packages/packet/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/lib.d.ts +22 -0
- package/packages/packet/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/packages/packet/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/packages/packet/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/packages/packet/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/packages/packet/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/packages/packet/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/packages/packet/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/packages/packet/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/packages/packet/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/packages/packet/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/packages/packet/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/packages/packet/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/packages/packet/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/packages/packet/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/packages/packet/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/tsc.js +8 -0
- package/packages/packet/node_modules/typescript/lib/tsserver.js +8 -0
- package/packages/packet/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/packages/packet/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/packages/packet/node_modules/typescript/lib/typesMap.json +497 -0
- package/packages/packet/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/packages/packet/node_modules/typescript/lib/typescript.js +200276 -0
- package/packages/packet/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/packages/packet/node_modules/typescript/lib/watchGuard.js +53 -0
- package/packages/packet/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/packages/packet/node_modules/typescript/package.json +120 -0
- package/packages/packet/package.json +23 -0
- package/packages/packet/ts/titan/builder.js +74 -0
- package/packages/packet/ts/titan/bundle.js +227 -0
- package/packages/packet/ts/titan/dev.js +175 -0
- package/packages/packet/ts/titan/error-box.js +277 -0
- package/packages/route/README.md +24 -0
- package/packages/route/index.d.ts +16 -0
- package/packages/route/index.js +52 -0
- package/packages/route/package.json +22 -0
- package/templates/extension/README.md +4 -0
- package/templates/extension/index.js +1 -12
- package/templates/extension/package.json +4 -4
- package/templates/js/app/app.js +1 -1
- package/templates/js/package.json +9 -8
- package/templates/rust-js/package.json +7 -7
- package/templates/rust-js/titan/dev.js +2 -2
- package/templates/rust-ts/package.json +7 -7
- package/templates/rust-ts/titan/dev.js +2 -2
- package/templates/ts/app/app.ts +1 -1
- package/templates/ts/package.json +9 -8
- package/titanpl-sdk/README.md +2 -0
- package/titanpl-sdk/package.json +4 -4
- package/titanpl-sdk/templates/titan/bundle.js +1 -1
- package/titanpl-sdk/templates/titan/dev.js +2 -2
- package/titanpl-sdk/templates/titan/error-box.js +2 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
import { spawn } from 'child_process';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
|
|
13
|
+
export function getEngineBinaryPath() {
|
|
14
|
+
const platform = os.platform(); // 'win32', 'linux', 'darwin'
|
|
15
|
+
const arch = os.arch(); // 'x64', 'arm64'
|
|
16
|
+
const pkgName = `@titanpl/engine-${platform}-${arch}`;
|
|
17
|
+
const binName = platform === 'win32' ? 'titan-server.exe' : 'titan-server';
|
|
18
|
+
|
|
19
|
+
// 1. Robust Binary Discovery (Monorepo, Local, or Global)
|
|
20
|
+
const searchPaths = [
|
|
21
|
+
__dirname,
|
|
22
|
+
process.cwd(),
|
|
23
|
+
path.join(process.cwd(), '..'),
|
|
24
|
+
path.join(process.cwd(), '..', '..')
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
for (let startPath of searchPaths) {
|
|
28
|
+
let current = startPath;
|
|
29
|
+
for (let i = 0; i < 8; i++) {
|
|
30
|
+
const potential = path.join(current, 'engine', 'target', 'release', binName);
|
|
31
|
+
if (fs.existsSync(potential)) return potential;
|
|
32
|
+
|
|
33
|
+
const parent = path.dirname(current);
|
|
34
|
+
if (parent === current) break;
|
|
35
|
+
current = parent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 2. Resolve installed optional dependency
|
|
40
|
+
try {
|
|
41
|
+
// We use a try/catch specifically for the resolve to provide a better diagnostic
|
|
42
|
+
let pkgPath;
|
|
43
|
+
try {
|
|
44
|
+
pkgPath = require.resolve(`${pkgName}/package.json`);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
// Fallback: check if the binary exists in a standard location even if require.resolve fails
|
|
47
|
+
const fallbackBin = path.join(process.cwd(), 'node_modules', pkgName, 'bin', binName);
|
|
48
|
+
if (fs.existsSync(fallbackBin)) return fallbackBin;
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
51
|
+
const pkgDir = path.dirname(pkgPath);
|
|
52
|
+
const binaryPath = path.join(pkgDir, 'bin', binName);
|
|
53
|
+
|
|
54
|
+
if (fs.existsSync(binaryPath)) {
|
|
55
|
+
return binaryPath;
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`Corrupted installation: Binary missing at ${binaryPath}.`);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
console.error(`\n[TITAN FATAL] Unsupported platform: ${platform} (${arch})`);
|
|
60
|
+
console.error(`Or the optional dependency '${pkgName}' failed to install.`);
|
|
61
|
+
console.error(`Error: ${err.message}\n`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function startEngine(watchMode = false) {
|
|
67
|
+
const distPath = path.resolve(process.cwd(), 'dist');
|
|
68
|
+
|
|
69
|
+
if (!fs.existsSync(distPath)) {
|
|
70
|
+
console.error("❌ 'dist/' directory not found. Please run 'titan build' first.");
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const binaryPath = getEngineBinaryPath();
|
|
75
|
+
|
|
76
|
+
// Arguments passed to Rust backend
|
|
77
|
+
const args = ['run', distPath];
|
|
78
|
+
if (watchMode) args.push('--watch');
|
|
79
|
+
|
|
80
|
+
console.log(`🚀 Starting Titan Engine...`);
|
|
81
|
+
|
|
82
|
+
const engineProcess = spawn(binaryPath, args, {
|
|
83
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
84
|
+
env: {
|
|
85
|
+
...process.env,
|
|
86
|
+
TITAN_ENV: watchMode ? 'development' : 'production',
|
|
87
|
+
Titan_Dev: watchMode ? '1' : '0'
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
let stderrBuffer = "";
|
|
92
|
+
|
|
93
|
+
engineProcess.stdout.pipe(process.stdout);
|
|
94
|
+
engineProcess.stderr.on('data', (data) => {
|
|
95
|
+
const chunk = data.toString();
|
|
96
|
+
stderrBuffer += chunk;
|
|
97
|
+
process.stderr.write(data);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
engineProcess.on('close', (code) => {
|
|
101
|
+
if (code !== 0 && code !== null) {
|
|
102
|
+
// Check for port binding errors
|
|
103
|
+
const isPortError = stderrBuffer.includes("Address already in use") ||
|
|
104
|
+
stderrBuffer.includes("address in use") ||
|
|
105
|
+
stderrBuffer.includes("os error 10048") || // Windows
|
|
106
|
+
stderrBuffer.includes("EADDRINUSE") ||
|
|
107
|
+
stderrBuffer.includes("AddrInUse");
|
|
108
|
+
|
|
109
|
+
if (isPortError) {
|
|
110
|
+
// Try to read intended port
|
|
111
|
+
let port = 5100;
|
|
112
|
+
try {
|
|
113
|
+
const routesPath = path.join(process.cwd(), "dist", "routes.json");
|
|
114
|
+
if (fs.existsSync(routesPath)) {
|
|
115
|
+
const routesConfig = JSON.parse(fs.readFileSync(routesPath, "utf8"));
|
|
116
|
+
if (routesConfig && routesConfig.__config && routesConfig.__config.port) {
|
|
117
|
+
port = routesConfig.__config.port;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch (e) { }
|
|
121
|
+
|
|
122
|
+
const cyan = (t) => `\x1b[36m${t}\x1b[0m`;
|
|
123
|
+
const yellow = (t) => `\x1b[33m${t}\x1b[0m`;
|
|
124
|
+
const red = (t) => `\x1b[31m${t}\x1b[0m`;
|
|
125
|
+
|
|
126
|
+
console.log("");
|
|
127
|
+
console.log(red("⏣ Your application cannot enter this orbit"));
|
|
128
|
+
console.log(red(`↳ Another application is already bound to port ${port}.`));
|
|
129
|
+
console.log("");
|
|
130
|
+
|
|
131
|
+
console.log(yellow("Recommended Actions:"));
|
|
132
|
+
console.log(yellow(" 1.") + " Release the occupied orbit (stop the other service).");
|
|
133
|
+
console.log(yellow(" 2.") + " Assign your application to a new orbit in " + cyan("app/app.js"));
|
|
134
|
+
console.log(yellow(" Example: ") + cyan(`t.start(${port + 1}, "Titan Running!")`));
|
|
135
|
+
console.log("");
|
|
136
|
+
} else {
|
|
137
|
+
console.error(`\n❌ [Titan Engine died with exit code ${code}]`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
return engineProcess;
|
|
143
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @titanpl/engine-darwin-arm64
|
|
2
|
+
|
|
3
|
+
The macOS ARM64 pre-compiled native engine binary for Titan Planet.
|
|
4
|
+
|
|
5
|
+
## What it works (What it does)
|
|
6
|
+
This package is the compiled core Rust + Axum server embedded with the Boa JavaScript runtime. It is specifically built for Apple Silicon (ARM64) macOS devices.
|
|
7
|
+
|
|
8
|
+
## How it works
|
|
9
|
+
This package is listed as an "optional dependency" in `@titanpl/cli`. During package installation, your package manager identifies the OS and automatically downloads this binary if it matches `darwin` + `arm64`. You do not need to install it directly.
|
|
10
|
+
|
|
11
|
+
When you run `titan start`, the CLI locates this binary and executes it as your web server.
|
|
12
|
+
|
|
13
|
+
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux and macOS versions are in development (dev only) for the new architecture and will be launched later.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @titanpl/engine-linux-x64
|
|
2
|
+
|
|
3
|
+
The Linux x64 pre-compiled native engine binary for Titan Planet.
|
|
4
|
+
|
|
5
|
+
## What it works (What it does)
|
|
6
|
+
This package holds the core Rust + Axum high-performance web server tightly coupled with the Boa JavaScript execution runtime. It is built natively for Linux x64 environments, requiring no Node.js execution layer.
|
|
7
|
+
|
|
8
|
+
## How it works
|
|
9
|
+
You don't need to manually interact with this module. It acts as an optional dependency resolved by `#titanpl/cli`. If you run TitanPlanet on a Linux x64 machine, npm/yarn automatically downloads this native binary to run your application.
|
|
10
|
+
|
|
11
|
+
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @titanpl/engine-win32-x64
|
|
2
|
+
|
|
3
|
+
The Windows x64 pre-compiled native engine binary for Titan Planet.
|
|
4
|
+
|
|
5
|
+
## What it works (What it does)
|
|
6
|
+
This module provides the highly concurrent Rust-based server binary (`titan.exe`) powered by Axum and Boa. It removes the necessity of a Node.js event loop by only executing static routes in Rust and specific dynamic logic in embedded JavaScript.
|
|
7
|
+
|
|
8
|
+
## How it works
|
|
9
|
+
Like the other engine packages, this works entirely behind the scenes. When `@titanpl/cli` is installed on a Windows instance, it fetches this `.exe` runtime. The CLI then maps your built assets and JS routes into the binary for deployment.
|
|
10
|
+
|
|
11
|
+
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @titanpl/native
|
|
2
|
+
|
|
3
|
+
The native utility extension module for Titan Planet.
|
|
4
|
+
|
|
5
|
+
## What it works (What it does)
|
|
6
|
+
It acts as the low-level communication bridge offering type definitions and utility wrappers out-of-the-box. Rather than being dependent on heavy JavaScript libraries, this package bridges Node-style features gracefully to the Titan runtime environment.
|
|
7
|
+
|
|
8
|
+
## How it works
|
|
9
|
+
You can import tools and primitives from this package into your server-side actions alongside `@titanpl/core` when you want direct low-level interaction or need access to platform operations that interact directly with the C/Rust engine.
|
|
10
|
+
|
|
11
|
+
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface Request {
|
|
2
|
+
method: string;
|
|
3
|
+
path: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
params: Record<string, any>;
|
|
6
|
+
query: Record<string, any>;
|
|
7
|
+
body: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FileSystem {
|
|
11
|
+
readFile(path: string, options?: any, callback?: (err: any, data: string) => void): string;
|
|
12
|
+
writeFile(path: string, data: string): void;
|
|
13
|
+
exists(path: string): boolean;
|
|
14
|
+
readdir(path: string): string[];
|
|
15
|
+
mkdir(path: string): void;
|
|
16
|
+
stat(path: string): any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const fs: FileSystem;
|
|
20
|
+
export function log(message: any): void;
|
|
21
|
+
export function defineAction<T = any>(handler: (req: Request) => T | Promise<T>): (req: Request) => T | Promise<T>;
|
|
22
|
+
export function fetch(url: string, options?: any): any;
|
|
23
|
+
export function drift<T>(op: any): T;
|
|
24
|
+
|
|
25
|
+
// Add more as needed based on native/index.js
|
|
26
|
+
export const db: any;
|
|
27
|
+
export const path: any;
|
|
28
|
+
export const jwt: any;
|
|
29
|
+
export const password: any;
|
|
30
|
+
export const crypto: any;
|
|
31
|
+
export const buffer: any;
|
|
32
|
+
export const ls: any;
|
|
33
|
+
export const session: any;
|
|
34
|
+
export const cookies: any;
|
|
35
|
+
export const os: any;
|
|
36
|
+
export const net: any;
|
|
37
|
+
export const proc: any;
|
|
38
|
+
export const time: any;
|
|
39
|
+
export const url: any;
|
|
40
|
+
export const response: any;
|
|
41
|
+
export const valid: any;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// titan.js - Named exports for users who prefer imports over the global `t`
|
|
2
|
+
|
|
3
|
+
export const fetch = t.fetch;
|
|
4
|
+
export const log = t.log;
|
|
5
|
+
export const read = t.read;
|
|
6
|
+
|
|
7
|
+
// Authentication & Security
|
|
8
|
+
export const jwt = t.jwt;
|
|
9
|
+
export const password = t.password;
|
|
10
|
+
|
|
11
|
+
// Database
|
|
12
|
+
export const db = t.db;
|
|
13
|
+
|
|
14
|
+
// File System & Path
|
|
15
|
+
export const fs = t.fs;
|
|
16
|
+
export const path = t.path;
|
|
17
|
+
|
|
18
|
+
// Crypto & Buffer
|
|
19
|
+
export const crypto = t.crypto;
|
|
20
|
+
export const buffer = t.buffer;
|
|
21
|
+
|
|
22
|
+
// Storage & Sessions
|
|
23
|
+
export const ls = t.ls;
|
|
24
|
+
export const localStorage = t.localStorage;
|
|
25
|
+
export const session = t.session;
|
|
26
|
+
export const cookies = t.cookies;
|
|
27
|
+
|
|
28
|
+
// System
|
|
29
|
+
export const os = t.os;
|
|
30
|
+
export const net = t.net;
|
|
31
|
+
export const proc = t.proc;
|
|
32
|
+
|
|
33
|
+
// Utilities
|
|
34
|
+
export const time = t.time;
|
|
35
|
+
export const url = t.url;
|
|
36
|
+
export const response = t.response;
|
|
37
|
+
export const valid = t.valid;
|
|
38
|
+
|
|
39
|
+
export const defineAction = (handler) => handler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@titanpl/native",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Titan native utilities package",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"titan",
|
|
8
|
+
"titanpl",
|
|
9
|
+
"t8n",
|
|
10
|
+
"native",
|
|
11
|
+
"utilities",
|
|
12
|
+
"ezetgalaxy"
|
|
13
|
+
],
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"types": "./t.native.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./t.native.d.ts",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@titanpl/core": "1.4.0",
|
|
24
|
+
"@titanpl/node": "1.4.0"
|
|
25
|
+
}
|
|
26
|
+
}
|