titanpl 26.16.4 → 26.16.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
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",
@@ -8,6 +8,7 @@ import { buildCommand } from "./src/commands/build.js";
8
8
  import { devCommand } from "./src/commands/dev.js";
9
9
  import { startCommand } from "./src/commands/start.js";
10
10
  import { migrateCommand } from "./src/commands/migrate.js";
11
+ import { updateCommand } from "./src/commands/update.js";
11
12
  import { initCommand } from "./src/commands/init.js";
12
13
 
13
14
  /* -------------------------------------------------------
@@ -51,9 +52,11 @@ ${bold(cyan("╰─────────────────────
51
52
 
52
53
  ${bold("Commands:")}
53
54
  ${cyan("init")} ${gray("Scaffold a new Titan project")}
55
+ ${cyan("create")} ${gray("Create a new project or extension (e.g. 'titan create ext my-ext')")}
54
56
  ${cyan("build")} ${gray("Compile actions and build production dist")}
55
57
  ${cyan("dev")} ${gray("Start the Gravity Engine in dev/watch mode")}
56
58
  ${cyan("start")} ${gray("Start the production Gravity Engine")}
59
+ ${cyan("update")} ${gray("Update an existing project to latest Titan version")}
57
60
  ${cyan("migrate")} ${gray("Migrate a legacy project to the new architecture")}
58
61
 
59
62
  ${bold("Options:")}
@@ -105,6 +108,18 @@ const cmd = process.argv[2];
105
108
  break;
106
109
  }
107
110
 
111
+ case "create": {
112
+ const type = process.argv[3];
113
+ const name = process.argv[4];
114
+ if (type === "ext" || type === "extension") {
115
+ await initCommand(name, "extension");
116
+ } else {
117
+ // Fallback to init behavior
118
+ await initCommand(type, null);
119
+ }
120
+ break;
121
+ }
122
+
108
123
  case "build":
109
124
  console.log(cyan("→ Building Titan project..."));
110
125
  await buildCommand();
@@ -120,6 +135,10 @@ const cmd = process.argv[2];
120
135
  startCommand();
121
136
  break;
122
137
 
138
+ case "update":
139
+ await updateCommand();
140
+ break;
141
+
123
142
  case "migrate":
124
143
  await migrateCommand();
125
144
  break;
@@ -1,28 +1,17 @@
1
- /**
2
- * Titan Extension Entry Point
3
- * You can attach methods to the global `t` object here.
4
- */
5
-
6
1
  // Define your extension Key
7
2
  if (typeof Titan === "undefined") globalThis.Titan = t;
8
3
  const EXT_KEY = "{{name}}";
9
4
 
10
- t.log(EXT_KEY, "Extension loading...");
11
-
12
5
  // Preserve any native functions already attached to this key
13
6
  t[EXT_KEY] = Object.assign(t[EXT_KEY] || {}, {
14
7
  // Example pure JavaScript function
15
8
  hello: function (name) {
16
- t.log(EXT_KEY, `Hello ${name} from ${EXT_KEY}!`);
17
- return `Hello ${name}!`;
9
+ return `Hello ${name} from ${EXT_KEY}!`;
18
10
  },
19
11
 
20
12
  // Example Wrapper for Native function
21
13
  calc: function (a, b) {
22
- t.log(EXT_KEY, `Calculating ${a} + ${b} natively...`);
23
14
  // Assumes the native function 'add' is mapped in titan.json
24
15
  return t[EXT_KEY].add(a, b);
25
16
  }
26
17
  });
27
-
28
- t.log(EXT_KEY, "Extension loaded!");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{name}}",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
4
4
  "description": "A Titan Planet extension",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -15,10 +15,10 @@
15
15
  "author": "",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@titanpl/core": "26.16.2",
18
+ "@titanpl/core": "latest",
19
19
  "chokidar": "^5.0.0",
20
20
  "esbuild": "^0.27.2",
21
- "titanpl-sdk": "26.16.4"
21
+ "titanpl-sdk": "26.16.7"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@tgrv/microgravity": "latest"
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
4
4
  "description": "A Titan Planet server",
5
5
  "type": "module",
6
6
  "titan": {
7
7
  "template": "js"
8
8
  },
9
9
  "dependencies": {
10
- "@titanpl/cli": "26.16.4",
11
- "@titanpl/route": "26.16.4",
12
- "@titanpl/native": "26.16.4",
13
- "@titanpl/core": "26.16.2",
14
- "@titanpl/node": "26.16.2"
10
+ "@titanpl/cli": "26.16.7",
11
+ "@titanpl/route": "26.16.7",
12
+ "@titanpl/native": "26.16.7",
13
+ "@titanpl/core": "latest",
14
+ "@titanpl/node": "latest"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "titan build",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
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": "26.16.4",
11
- "@titanpl/route": "26.16.4",
12
- "@titanpl/native": "26.16.4",
13
- "@titanpl/core": "26.16.2",
14
- "@titanpl/node": "26.16.2"
10
+ "@titanpl/cli": "26.16.7",
11
+ "@titanpl/route": "26.16.7",
12
+ "@titanpl/native": "26.16.7",
13
+ "@titanpl/core": "latest",
14
+ "@titanpl/node": "latest"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "titan build",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
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": "26.16.4",
11
- "@titanpl/route": "26.16.4",
12
- "@titanpl/native": "26.16.4",
13
- "@titanpl/core": "26.16.2",
14
- "@titanpl/node": "26.16.2",
10
+ "@titanpl/cli": "26.16.7",
11
+ "@titanpl/route": "26.16.7",
12
+ "@titanpl/native": "26.16.7",
13
+ "@titanpl/core": "latest",
14
+ "@titanpl/node": "latest",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "scripts": {
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
4
4
  "description": "A Titan Planet server (TypeScript)",
5
5
  "type": "module",
6
6
  "titan": {
7
7
  "template": "ts"
8
8
  },
9
9
  "dependencies": {
10
- "@titanpl/cli": "26.16.4",
11
- "@titanpl/route": "26.16.4",
12
- "@titanpl/native": "26.16.4",
13
- "@titanpl/core": "26.16.2",
14
- "@titanpl/node": "26.16.2",
10
+ "@titanpl/cli": "26.16.7",
11
+ "@titanpl/route": "26.16.7",
12
+ "@titanpl/native": "26.16.7",
13
+ "@titanpl/core": "latest",
14
+ "@titanpl/node": "latest",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "titanpl-sdk",
3
- "version": "26.16.4",
3
+ "version": "26.16.7",
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",