@ezetgalaxy/titan 26.8.3 → 26.9.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 +63 -14
- package/index.js +62 -15
- package/package.json +1 -1
- package/templates/extension/README.md +104 -104
- package/templates/extension/index.js +27 -27
- package/templates/extension/jsconfig.json +12 -12
- package/templates/extension/native/Cargo.toml +9 -9
- package/templates/extension/native/src/lib.rs +5 -5
- package/templates/extension/package.json +20 -20
- package/templates/extension/titan.json +17 -17
- package/templates/js/Dockerfile +66 -66
- package/templates/js/_dockerignore +3 -3
- package/templates/js/_gitignore +1 -0
- package/templates/js/app/actions/hello.js +5 -5
- package/templates/js/app/titan.d.ts +87 -87
- package/templates/js/jsconfig.json +18 -18
- package/templates/js/server/src/action_management.rs +131 -131
- package/templates/js/server/src/errors.rs +10 -10
- package/templates/js/server/src/extensions.rs +989 -989
- package/templates/js/server/src/utils.rs +33 -33
- package/templates/js/titan/bundle.js +78 -78
- package/templates/js/titan/dev.js +9 -1
- package/templates/js/titan/titan.js +122 -122
- package/templates/rust/Dockerfile +66 -66
- package/templates/rust/_dockerignore +3 -3
- package/templates/rust/_gitignore +1 -0
- package/templates/rust/app/actions/hello.js +5 -5
- package/templates/rust/app/actions/rust_hello.rs +14 -14
- package/templates/rust/app/titan.d.ts +101 -101
- package/templates/rust/jsconfig.json +18 -18
- package/templates/rust/server/src/action_management.rs +131 -131
- package/templates/rust/server/src/errors.rs +10 -10
- package/templates/rust/server/src/extensions.rs +989 -989
- package/templates/rust/server/src/utils.rs +33 -33
- package/templates/rust/titan/dev.js +9 -1
- package/templates/rust-ts/Dockerfile +66 -0
- package/templates/rust-ts/_dockerignore +3 -0
- package/templates/rust-ts/_gitignore +38 -0
- package/templates/rust-ts/app/actions/hello.ts +5 -0
- package/templates/rust-ts/app/actions/rust_hello.rs +14 -0
- package/templates/rust-ts/app/app.ts +11 -0
- package/templates/rust-ts/app/titan.d.ts +101 -0
- package/templates/rust-ts/package.json +14 -0
- package/templates/rust-ts/server/Cargo.lock +2869 -0
- package/templates/rust-ts/server/Cargo.toml +39 -0
- package/templates/rust-ts/server/src/action_management.rs +131 -0
- package/templates/rust-ts/server/src/errors.rs +51 -0
- package/templates/rust-ts/server/src/extensions.rs +989 -0
- package/templates/rust-ts/server/src/main.rs +468 -0
- package/templates/rust-ts/server/src/utils.rs +33 -0
- package/templates/rust-ts/titan/bundle.js +157 -0
- package/templates/rust-ts/titan/dev.js +402 -0
- package/templates/rust-ts/titan/titan.js +122 -0
- package/templates/rust-ts/tsconfig.json +21 -0
- package/templates/ts/Dockerfile +66 -0
- package/templates/ts/_dockerignore +3 -0
- package/templates/ts/_gitignore +38 -0
- package/templates/ts/app/actions/hello.ts +9 -0
- package/templates/ts/app/app.ts +10 -0
- package/templates/ts/app/titan.d.ts +102 -0
- package/templates/ts/package.json +26 -0
- package/templates/ts/server/Cargo.lock +2869 -0
- package/templates/ts/server/Cargo.toml +27 -0
- package/templates/ts/server/src/action_management.rs +131 -0
- package/templates/ts/server/src/errors.rs +51 -0
- package/templates/ts/server/src/extensions.rs +989 -0
- package/templates/ts/server/src/main.rs +437 -0
- package/templates/ts/server/src/utils.rs +33 -0
- package/templates/ts/titan/bundle.js +78 -0
- package/templates/ts/titan/dev.js +402 -0
- package/templates/ts/titan/titan.js +122 -0
- package/templates/ts/tsconfig.json +16 -0
- package/titanpl-sdk/README.md +109 -109
- package/titanpl-sdk/bin/run.js +254 -254
- package/titanpl-sdk/index.d.ts +46 -46
- package/titanpl-sdk/index.js +5 -5
- package/titanpl-sdk/package.json +32 -32
- package/titanpl-sdk/templates/.dockerignore +3 -3
- package/titanpl-sdk/templates/Dockerfile +53 -53
- package/titanpl-sdk/templates/app/actions/hello.js +5 -5
- package/titanpl-sdk/templates/app/titan.d.ts +87 -87
- package/titanpl-sdk/templates/jsconfig.json +18 -18
- package/titanpl-sdk/templates/server/src/action_management.rs +131 -131
- package/titanpl-sdk/templates/server/src/errors.rs +10 -10
- package/titanpl-sdk/templates/server/src/extensions.rs +640 -640
- package/titanpl-sdk/templates/server/src/utils.rs +33 -33
- package/titanpl-sdk/templates/titan/bundle.js +65 -65
- package/titanpl-sdk/templates/titan/dev.js +113 -113
- package/titanpl-sdk/templates/titan/titan.js +98 -98
- package/templates/js/server/action_map.json +0 -3
- package/templates/js/server/actions/hello.jsbundle +0 -48
- package/templates/js/server/routes.json +0 -16
- package/templates/rust/server/action_map.json +0 -3
- package/templates/rust/server/actions/hello.jsbundle +0 -47
- package/templates/rust/server/routes.json +0 -22
- package/templates/rust/server/src/actions_rust/mod.rs +0 -19
- package/templates/rust/server/src/actions_rust/rust_hello.rs +0 -14
package/titanpl-sdk/README.md
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
<img src="./assets/titanpl-sdk.png" alt="Titan SDK Logo" width="120" />
|
|
4
|
-
<h1>Titan SDK</h1>
|
|
5
|
-
<p>
|
|
6
|
-
<b>The Developer Toolkit for Titan Planet. Type safety, IntelliSense, and Extension Testing.</b>
|
|
7
|
-
</p>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div align="center">
|
|
11
|
-
|
|
12
|
-
[](https://www.npmjs.com/package/titanpl-sdk)
|
|
13
|
-
[](https://opensource.org/licenses/ISC)
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 🌌 Overview
|
|
20
|
-
|
|
21
|
-
**Titan SDK** is NOT the runtime engine itself. It is a **development-only toolkit** designed to bridge the gap between your local coding environment and the native Titan Planet binary.
|
|
22
|
-
|
|
23
|
-
It provides the necessary **Type Definitions** to make your IDE understand the global `t` object and a **Lite Test Harness** to verify your extensions before they ever touch a production binary.
|
|
24
|
-
|
|
25
|
-
> **Note:** The actual implementation of `t.log`, `t.fetch`, and other APIs are embedded directly into the [Titan Planet Binary](https://github.com/ezet-galaxy/titanpl). This SDK simply provides the "blueprints" (types) and a "sandbox" (test runner).
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## ✨ Features
|
|
30
|
-
|
|
31
|
-
- **💎 Blueprint Types (IntelliSense)**: Provides the full TypeScript `index.d.ts` for the global `t` object so you get autocomplete in VS Code and other editors.
|
|
32
|
-
- **🛡️ Static Validation**: Catch parameter mismatches and typos in `t.log`, `t.fetch`, `t.db`, etc., during development.
|
|
33
|
-
- **🔌 Extension Test Harness**: A "lite" version of the Titan runtime that simulates the native environment to test extensions in isolation.
|
|
34
|
-
- **🚀 Zero Production Trace**: This is a `devDependencies` package. It never ships with your binary, keeping your production footprint at literal zero.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## 🚀 The Test Harness (Lite Runtime)
|
|
39
|
-
|
|
40
|
-
The SDK includes a specialized **Test Runner** (`titan-sdk`). This is a "lite" version of the Titan ecosystem that acts as a bridge for developers.
|
|
41
|
-
|
|
42
|
-
### How it works:
|
|
43
|
-
When you run the SDK in an extension folder, it:
|
|
44
|
-
1. **Scaffolds a Virtual Project**: Creates a temporary, minimal Titan environment in `.titan_test_run`.
|
|
45
|
-
2. **Native Compilation**: Automatically builds your native Rust code (`native/`) if it exists.
|
|
46
|
-
3. **Hot-Linking**: Junctions your local extension into the virtual project's `node_modules`.
|
|
47
|
-
4. **Verification**: Generates a test suite that attempts to call your extension's methods via the real `t` object inside the sandbox.
|
|
48
|
-
|
|
49
|
-
### Usage:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# Inside your extension directory
|
|
53
|
-
npx titan-sdk
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## ⌨️ Enabling IntelliSense
|
|
59
|
-
|
|
60
|
-
Since the `t` object is injected globally by the Titan engine at runtime, your IDE won't recognize it by default. The SDK fixes this.
|
|
61
|
-
|
|
62
|
-
1. **Install the SDK**:
|
|
63
|
-
```bash
|
|
64
|
-
npm install --save-dev titan-sdk
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
2. **Configure Types**:
|
|
68
|
-
Create or update `jsconfig.json` (or `tsconfig.json`) in your project root:
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"compilerOptions": {
|
|
72
|
-
"types": ["titan-sdk"]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Now your editor will treat `t` as a first-class citizen:
|
|
78
|
-
```js
|
|
79
|
-
export function myAction(req) {
|
|
80
|
-
t.log.info("Request received", req.path); // Autocomplete works!
|
|
81
|
-
return { status: "ok" };
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## 🧱 What's Included? (Types Only)
|
|
88
|
-
|
|
89
|
-
The SDK provides types for the native APIs provided by the Titan Planet engine:
|
|
90
|
-
|
|
91
|
-
- **`t.log`**: Standardized logging that appears in the Titan binary console.
|
|
92
|
-
- **`t.fetch`**: Types for the high-performance Rust-native network stack.
|
|
93
|
-
- **`t.db`**: Interface for the native PostgreSQL driver.
|
|
94
|
-
- **`t.read`**: Definitions for optimized filesystem reads.
|
|
95
|
-
- **`t.jwt` / `t.password`**: Security helper types.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## 🌍 Community & Documentation
|
|
100
|
-
|
|
101
|
-
- **Core Framework**: [Titan Planet](https://github.com/ezet-galaxy/titanpl)
|
|
102
|
-
- **Official Docs**: [Titan Planet Docs](https://titan-docs-ez.vercel.app/docs)
|
|
103
|
-
- **Author**: [ezetgalaxy](https://github.com/ezet-galaxy)
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
<p align="center">
|
|
108
|
-
Built with ❤️ for the <a href="https://titan-docs-ez.vercel.app/">Titan Planet</a> ecosystem.
|
|
109
|
-
</p>
|
|
1
|
+
|
|
2
|
+
<div align="center">
|
|
3
|
+
<img src="./assets/titanpl-sdk.png" alt="Titan SDK Logo" width="120" />
|
|
4
|
+
<h1>Titan SDK</h1>
|
|
5
|
+
<p>
|
|
6
|
+
<b>The Developer Toolkit for Titan Planet. Type safety, IntelliSense, and Extension Testing.</b>
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/titanpl-sdk)
|
|
13
|
+
[](https://opensource.org/licenses/ISC)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🌌 Overview
|
|
20
|
+
|
|
21
|
+
**Titan SDK** is NOT the runtime engine itself. It is a **development-only toolkit** designed to bridge the gap between your local coding environment and the native Titan Planet binary.
|
|
22
|
+
|
|
23
|
+
It provides the necessary **Type Definitions** to make your IDE understand the global `t` object and a **Lite Test Harness** to verify your extensions before they ever touch a production binary.
|
|
24
|
+
|
|
25
|
+
> **Note:** The actual implementation of `t.log`, `t.fetch`, and other APIs are embedded directly into the [Titan Planet Binary](https://github.com/ezet-galaxy/titanpl). This SDK simply provides the "blueprints" (types) and a "sandbox" (test runner).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ✨ Features
|
|
30
|
+
|
|
31
|
+
- **💎 Blueprint Types (IntelliSense)**: Provides the full TypeScript `index.d.ts` for the global `t` object so you get autocomplete in VS Code and other editors.
|
|
32
|
+
- **🛡️ Static Validation**: Catch parameter mismatches and typos in `t.log`, `t.fetch`, `t.db`, etc., during development.
|
|
33
|
+
- **🔌 Extension Test Harness**: A "lite" version of the Titan runtime that simulates the native environment to test extensions in isolation.
|
|
34
|
+
- **🚀 Zero Production Trace**: This is a `devDependencies` package. It never ships with your binary, keeping your production footprint at literal zero.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 🚀 The Test Harness (Lite Runtime)
|
|
39
|
+
|
|
40
|
+
The SDK includes a specialized **Test Runner** (`titan-sdk`). This is a "lite" version of the Titan ecosystem that acts as a bridge for developers.
|
|
41
|
+
|
|
42
|
+
### How it works:
|
|
43
|
+
When you run the SDK in an extension folder, it:
|
|
44
|
+
1. **Scaffolds a Virtual Project**: Creates a temporary, minimal Titan environment in `.titan_test_run`.
|
|
45
|
+
2. **Native Compilation**: Automatically builds your native Rust code (`native/`) if it exists.
|
|
46
|
+
3. **Hot-Linking**: Junctions your local extension into the virtual project's `node_modules`.
|
|
47
|
+
4. **Verification**: Generates a test suite that attempts to call your extension's methods via the real `t` object inside the sandbox.
|
|
48
|
+
|
|
49
|
+
### Usage:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Inside your extension directory
|
|
53
|
+
npx titan-sdk
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## ⌨️ Enabling IntelliSense
|
|
59
|
+
|
|
60
|
+
Since the `t` object is injected globally by the Titan engine at runtime, your IDE won't recognize it by default. The SDK fixes this.
|
|
61
|
+
|
|
62
|
+
1. **Install the SDK**:
|
|
63
|
+
```bash
|
|
64
|
+
npm install --save-dev titan-sdk
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. **Configure Types**:
|
|
68
|
+
Create or update `jsconfig.json` (or `tsconfig.json`) in your project root:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"compilerOptions": {
|
|
72
|
+
"types": ["titan-sdk"]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Now your editor will treat `t` as a first-class citizen:
|
|
78
|
+
```js
|
|
79
|
+
export function myAction(req) {
|
|
80
|
+
t.log.info("Request received", req.path); // Autocomplete works!
|
|
81
|
+
return { status: "ok" };
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🧱 What's Included? (Types Only)
|
|
88
|
+
|
|
89
|
+
The SDK provides types for the native APIs provided by the Titan Planet engine:
|
|
90
|
+
|
|
91
|
+
- **`t.log`**: Standardized logging that appears in the Titan binary console.
|
|
92
|
+
- **`t.fetch`**: Types for the high-performance Rust-native network stack.
|
|
93
|
+
- **`t.db`**: Interface for the native PostgreSQL driver.
|
|
94
|
+
- **`t.read`**: Definitions for optimized filesystem reads.
|
|
95
|
+
- **`t.jwt` / `t.password`**: Security helper types.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 🌍 Community & Documentation
|
|
100
|
+
|
|
101
|
+
- **Core Framework**: [Titan Planet](https://github.com/ezet-galaxy/titanpl)
|
|
102
|
+
- **Official Docs**: [Titan Planet Docs](https://titan-docs-ez.vercel.app/docs)
|
|
103
|
+
- **Author**: [ezetgalaxy](https://github.com/ezet-galaxy)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
Built with ❤️ for the <a href="https://titan-docs-ez.vercel.app/">Titan Planet</a> ecosystem.
|
|
109
|
+
</p>
|