titan-sdk 0.0.2 → 0.0.4

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.
Files changed (2) hide show
  1. package/README.md +52 -57
  2. package/package.json +2 -3
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  # 🛠️ Titan SDK
3
3
 
4
- **Empower your Titan Planet development with first-class type safety and elite developer tools.**
4
+ **The Developer Toolkit for Titan Planet. Type safety, IntelliSense, and Extension Testing.**
5
5
 
6
6
  [![npm version](https://img.shields.io/npm/v/titan-sdk.svg?style=flat-square)](https://www.npmjs.com/package/titan-sdk)
7
7
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg?style=flat-square)](https://opensource.org/licenses/ISC)
@@ -10,97 +10,92 @@
10
10
 
11
11
  ## 🌌 Overview
12
12
 
13
- **Titan SDK** is the official developer toolkit for [Titan Planet](https://github.com/ezetgalaxy/titan). It provides the glue between your JavaScript actions and the high-performance Rust runtime, ensuring you have full IntelliSense, type safety, and debugging capabilities.
13
+ **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.
14
14
 
15
- Whether you are building standard API actions or complex extensions, Titan SDK is your essential companion.
15
+ 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.
16
+
17
+ > **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/-ezetgalaxy-titan). This SDK simply provides the "blueprints" (types) and a "sandbox" (test runner).
16
18
 
17
19
  ---
18
20
 
19
21
  ## ✨ Features
20
22
 
21
- - **💎 Elite IntelliSense**: Full TypeScript definitions for the global `t` object.
22
- - **🛡️ Type Safety**: Prevent runtime errors with compile-time checks for `t.log`, `t.fetch`, `t.db`, and more.
23
- - **🔌 Extension Support**: Tools and types for building custom extensions that plug directly into the Titan Rust engine.
24
- - **🚀 Zero Overhead**: Designed to be a development-only dependency that maximizes productivity without bloating your production binary.
23
+ - **💎 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.
24
+ - **🛡️ Static Validation**: Catch parameter mismatches and typos in `t.log`, `t.fetch`, `t.db`, etc., during development.
25
+ - **🔌 Extension Test Harness**: A "lite" version of the Titan runtime that simulates the native environment to test extensions in isolation.
26
+ - **🚀 Zero Production Trace**: This is a `devDependencies` package. It never ships with your binary, keeping your production footprint at literal zero.
25
27
 
26
28
  ---
27
29
 
28
- ## 🚀 Getting Started
30
+ ## 🚀 The Test Harness (Lite Runtime)
31
+
32
+ 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.
29
33
 
30
- ### Installation
34
+ ### How it works:
35
+ When you run the SDK in an extension folder, it:
36
+ 1. **Scaffolds a Virtual Project**: Creates a temporary, minimal Titan environment in `.titan_test_run`.
37
+ 2. **Native Compilation**: Automatically builds your native Rust code (`native/`) if it exists.
38
+ 3. **Hot-Linking**: Junctions your local extension into the virtual project's `node_modules`.
39
+ 4. **Verification**: Generates a test suite that attempts to call your extension's methods via the real `t` object inside the sandbox.
31
40
 
32
- Add the SDK to your Titan project:
41
+ ### Usage:
33
42
 
34
43
  ```bash
35
- npm install --save-dev titan-sdk
44
+ # Inside your extension directory
45
+ npx titan-sdk
36
46
  ```
37
47
 
38
- ### Enable IntelliSense
48
+ ---
39
49
 
40
- To get full autocomplete for the Titan runtime APIs, simply create a `tsconfig.json` or `jsconfig.json` in your project root:
50
+ ## ⌨️ Enabling IntelliSense
41
51
 
42
- ```json
43
- {
44
- "compilerOptions": {
45
- "types": ["titan-sdk"]
46
- }
47
- }
48
- ```
52
+ 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.
53
+
54
+ 1. **Install the SDK**:
55
+ ```bash
56
+ npm install --save-dev titan-sdk
57
+ ```
49
58
 
50
- Now, when you type `t.` in your actions, you'll see everything available:
59
+ 2. **Configure Types**:
60
+ Create or update `jsconfig.json` (or `tsconfig.json`) in your project root:
61
+ ```json
62
+ {
63
+ "compilerOptions": {
64
+ "types": ["titan-sdk"]
65
+ }
66
+ }
67
+ ```
51
68
 
69
+ Now your editor will treat `t` as a first-class citizen:
52
70
  ```js
53
71
  export function myAction(req) {
54
- t.log.info("Request received", req.path);
55
-
56
- // Fully typed db queries!
57
- const data = t.db.query("SELECT * FROM users WHERE id = $1", [req.params.id]);
58
-
59
- return data;
72
+ t.log.info("Request received", req.path); // Autocomplete works!
73
+ return { status: "ok" };
60
74
  }
61
75
  ```
62
76
 
63
77
  ---
64
78
 
65
- ## 🔧 Core APIs Powered by SDK
66
-
67
- The SDK provides types for the entire `t` namespace:
79
+ ## 🧱 What's Included? (Types Only)
68
80
 
69
- - **`t.log`**: Structured logging (info, warn, error).
70
- - **`t.fetch`**: High-performance Rust-native fetch wrapper.
71
- - **`t.db`**: Native PostgreSQL interface for extreme speed.
72
- - **`t.read`**: Optimized file system access.
73
- - **`t.jwt`**: Built-in JWT handling (if enabled).
81
+ The SDK provides types for the native APIs provided by the Titan Planet engine:
74
82
 
75
- ---
76
-
77
- ## 🧩 Building Extensions
78
-
79
- Titan SDK allows you to define types for your own extensions.
80
-
81
- ```typescript
82
- // Define your extension types
83
- declare global {
84
- namespace Titan {
85
- interface Runtime {
86
- myCustomTool: {
87
- doSomething: () => void;
88
- };
89
- }
90
- }
91
- }
92
- ```
83
+ - **`t.log`**: Standardized logging that appears in the Titan binary console.
84
+ - **`t.fetch`**: Types for the high-performance Rust-native network stack.
85
+ - **`t.db`**: Interface for the native PostgreSQL driver.
86
+ - **`t.read`**: Definitions for optimized filesystem reads.
87
+ - **`t.jwt` / `t.password`**: Security helper types.
93
88
 
94
89
  ---
95
90
 
96
91
  ## 🌍 Community & Documentation
97
92
 
98
- - **Documentation**: [Titan Planet Docs](https://titan-docs-ez.vercel.app/docs)
99
- - **Author**: [ezetgalaxy](https://github.com/ezetgalaxy)
100
- - **Ecosystem**: [Titan Planet](https://github.com/ezetgalaxy/titan)
93
+ - **Core Framework**: [Titan Planet](https://github.com/ezet-galaxy/-ezetgalaxy-titan)
94
+ - **Official Docs**: [Titan Planet Docs](https://titan-docs-ez.vercel.app/docs)
95
+ - **Author**: [ezetgalaxy](https://github.com/ezet-galaxy)
101
96
 
102
97
  ---
103
98
 
104
99
  <p align="center">
105
- Built with ❤️ for the <a href="https://github.com/ezetgalaxy/titan">Titan Planet</a> ecosystem.
100
+ Built with ❤️ for the <a href="https://github.com/ezet-galaxy/-ezetgalaxy-titan">Titan Planet</a> ecosystem.
106
101
  </p>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "titan-sdk",
3
- "version": "0.0.2",
4
- "description": "Developer SDK and Type Definitions for Titan Planet the high-performance Rust-powered JavaScript backend framework. Includes IntelliSense support and extension building tools.",
3
+ "version": "0.0.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",
7
7
  "types": "index.d.ts",
@@ -12,7 +12,6 @@
12
12
  "titan",
13
13
  "titan-planet",
14
14
  "titan-sdk",
15
- "titanjs",
16
15
  "ezetgalaxy",
17
16
  "types",
18
17
  "typescript",