@ezetgalaxy/titan 26.7.2 → 26.7.5

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": "@ezetgalaxy/titan",
3
- "version": "26.7.2",
3
+ "version": "26.7.5",
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",
@@ -12,7 +12,6 @@
12
12
  },
13
13
  "files": [
14
14
  "index.js",
15
- "scripts/",
16
15
  "templates/",
17
16
  "titan",
18
17
  "titanpl-sdk",
@@ -45,7 +44,8 @@
45
44
  ],
46
45
  "scripts": {
47
46
  "build": "echo \"No build step\"",
48
- "test": "echo \"No tests specified\""
47
+ "test": "echo \"No tests specified\"",
48
+ "test_titan_init": "node scripts/test_titan_init.js"
49
49
  },
50
50
  "dependencies": {
51
51
  "chokidar": "^5.0.0",
@@ -18,6 +18,20 @@ COPY . .
18
18
  # Install JS dependencies (needed for Titan DSL + bundler)
19
19
  RUN npm install
20
20
 
21
+ SHELL ["/bin/bash", "-c"]
22
+
23
+ # Extract Titan extensions into .ext
24
+ RUN mkdir -p /app/.ext && \
25
+ find /app/node_modules -maxdepth 5 -type f -name "titan.json" -print0 | \
26
+ while IFS= read -r -d '' file; do \
27
+ pkg_dir="$(dirname "$file")"; \
28
+ pkg_name="$(basename "$pkg_dir")"; \
29
+ echo "Copying Titan extension: $pkg_name from $pkg_dir"; \
30
+ cp -r "$pkg_dir" "/app/.ext/$pkg_name"; \
31
+ done && \
32
+ echo "Extensions in .ext:" && \
33
+ ls -R /app/.ext
34
+
21
35
  # Build Titan metadata + bundle JS actions
22
36
  RUN titan build
23
37
 
@@ -34,7 +48,7 @@ FROM debian:stable-slim
34
48
  WORKDIR /app
35
49
 
36
50
  # Copy Rust binary from builder stage
37
- COPY --from=builder /app/server/target/release/server ./titan-server
51
+ COPY --from=builder /app/server/target/release/titan-server ./titan-server
38
52
 
39
53
  # Copy Titan routing metadata
40
54
  COPY --from=builder /app/server/routes.json ./routes.json
@@ -44,10 +58,9 @@ COPY --from=builder /app/server/action_map.json ./action_map.json
44
58
  RUN mkdir -p /app/actions
45
59
  COPY --from=builder /app/server/actions /app/actions
46
60
 
47
- COPY --from=builder /app/db /app/assets
61
+ # Copy only Titan extensions
62
+ COPY --from=builder /app/.ext ./.ext
48
63
 
49
- # Expose Titan port
50
64
  EXPOSE 3000
51
65
 
52
- # Start Titan
53
66
  CMD ["./titan-server"]
@@ -0,0 +1,25 @@
1
+ # Node
2
+ node_modules/
3
+ npm-debug.log
4
+ yarn-error.log
5
+
6
+ # Titan build output (auto-generated — DO NOT COMMIT)
7
+ server/routes.json
8
+ server/action_map.json
9
+ server/actions/*.jsbundle
10
+ server/titan/*.jsbundle
11
+
12
+ # Rust build output (auto-generated — DO NOT COMMIT)
13
+ server/target/
14
+ server/target/**
15
+
16
+ # Logs
17
+ *.log
18
+
19
+ # System files
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # Environment files
24
+ .env
25
+ .env.local
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "{{name}}",
2
+ "name": "titanpl",
3
3
  "version": "1.0.0",
4
4
  "description": "A Titan Planet server",
5
5
  "type": "module",
@@ -0,0 +1,3 @@
1
+ {
2
+ "POST:/hello": "hello"
3
+ }
@@ -0,0 +1,45 @@
1
+ const defineAction = (fn) => fn;
2
+ var __titan_exports = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // app/actions/hello.js
22
+ var hello_exports = {};
23
+ __export(hello_exports, {
24
+ hello: () => hello
25
+ });
26
+ var hello = (req) => {
27
+ return {
28
+ message: `Hello from Titan ${req.body.name}`
29
+ };
30
+ };
31
+ return __toCommonJS(hello_exports);
32
+ })();
33
+
34
+ (function () {
35
+ const fn =
36
+ __titan_exports["hello"] ||
37
+ __titan_exports.default;
38
+
39
+ if (typeof fn !== "function") {
40
+ throw new Error("[Titan] Action 'hello' not found or not a function");
41
+ }
42
+
43
+ globalThis["hello"] = fn;
44
+ })();
45
+
@@ -0,0 +1,16 @@
1
+ {
2
+ "__config": {
3
+ "port": 3000
4
+ },
5
+ "routes": {
6
+ "POST:/hello": {
7
+ "type": "action",
8
+ "value": "hello"
9
+ },
10
+ "GET:/": {
11
+ "type": "text",
12
+ "value": "Ready to land on Titan Planet 🚀"
13
+ }
14
+ },
15
+ "__dynamic_routes": []
16
+ }