titanpl 2.0.1 → 2.0.3

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 (43) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/packages/cli/README.md +17 -17
  4. package/packages/cli/index.js +160 -160
  5. package/packages/cli/package.json +5 -5
  6. package/packages/cli/src/commands/build.js +5 -5
  7. package/packages/cli/src/commands/dev.js +12 -12
  8. package/packages/cli/src/commands/init.js +196 -174
  9. package/packages/cli/src/commands/migrate.js +124 -124
  10. package/packages/cli/src/commands/start.js +4 -4
  11. package/packages/cli/src/commands/update.js +90 -90
  12. package/packages/cli/src/engine.js +169 -152
  13. package/packages/engine-darwin-arm64/README.md +13 -13
  14. package/packages/engine-darwin-arm64/package.json +1 -1
  15. package/packages/engine-linux-x64/README.md +11 -11
  16. package/packages/engine-linux-x64/package.json +1 -1
  17. package/packages/engine-win32-x64/README.md +11 -11
  18. package/packages/engine-win32-x64/package.json +1 -1
  19. package/packages/native/README.md +11 -11
  20. package/packages/native/index.d.ts +41 -41
  21. package/packages/native/index.js +39 -39
  22. package/packages/native/package.json +1 -1
  23. package/packages/packet/README.md +11 -11
  24. package/packages/packet/index.js +83 -83
  25. package/packages/packet/js/titan/builder.js +50 -50
  26. package/packages/packet/js/titan/bundle.js +164 -164
  27. package/packages/packet/js/titan/dev.js +53 -19
  28. package/packages/packet/js/titan/error-box.js +277 -277
  29. package/packages/packet/package.json +1 -1
  30. package/packages/packet/ts/titan/bundle.js +227 -227
  31. package/packages/packet/ts/titan/dev.js +53 -20
  32. package/packages/packet/ts/titan/error-box.js +277 -277
  33. package/packages/route/README.md +24 -24
  34. package/packages/route/index.d.ts +16 -16
  35. package/packages/route/index.js +52 -52
  36. package/packages/route/package.json +1 -1
  37. package/templates/common/_gitignore +1 -1
  38. package/templates/extension/package.json +2 -2
  39. package/templates/js/package.json +5 -5
  40. package/templates/rust-js/package.json +4 -4
  41. package/templates/rust-ts/package.json +4 -4
  42. package/templates/ts/package.json +5 -5
  43. package/titanpl-sdk/package.json +1 -1
@@ -1,52 +1,52 @@
1
- const routes = {};
2
- const dynamicRoutes = {};
3
- const actionMap = {};
4
-
5
- function addRoute(method, route) {
6
- const key = `${method.toUpperCase()}:${route}`;
7
-
8
- return {
9
- reply(value) {
10
- routes[key] = {
11
- type: typeof value === "object" ? "json" : "text",
12
- value
13
- };
14
- },
15
-
16
- action(name) {
17
- if (route.includes(":")) {
18
- if (!dynamicRoutes[method]) dynamicRoutes[method] = [];
19
- dynamicRoutes[method].push({
20
- method: method.toUpperCase(),
21
- pattern: route,
22
- action: name
23
- });
24
- actionMap[key] = name;
25
- } else {
26
- routes[key] = {
27
- type: "action",
28
- value: name
29
- };
30
- actionMap[key] = name;
31
- }
32
- }
33
- };
34
- }
35
-
36
- const t = {
37
- get(route) { return addRoute("GET", route); },
38
- post(route) { return addRoute("POST", route); },
39
- put(route) { return addRoute("PUT", route); },
40
- delete(route) { return addRoute("DELETE", route); },
41
- log(module, msg) { console.log(`[${module}] ${msg}`); },
42
-
43
- start(port = 3000, msg = "", threads, stack_mb = 8) {
44
- globalThis.__TITAN_CONFIG__ = { port, msg, threads, stack_mb };
45
- }
46
- };
47
-
48
- globalThis.__TITAN_ROUTES_MAP__ = routes;
49
- globalThis.__TITAN_DYNAMIC_ROUTES__ = dynamicRoutes;
50
- globalThis.__TITAN_ACTION_MAP__ = actionMap;
51
-
52
- export default t;
1
+ const routes = {};
2
+ const dynamicRoutes = {};
3
+ const actionMap = {};
4
+
5
+ function addRoute(method, route) {
6
+ const key = `${method.toUpperCase()}:${route}`;
7
+
8
+ return {
9
+ reply(value) {
10
+ routes[key] = {
11
+ type: typeof value === "object" ? "json" : "text",
12
+ value
13
+ };
14
+ },
15
+
16
+ action(name) {
17
+ if (route.includes(":")) {
18
+ if (!dynamicRoutes[method]) dynamicRoutes[method] = [];
19
+ dynamicRoutes[method].push({
20
+ method: method.toUpperCase(),
21
+ pattern: route,
22
+ action: name
23
+ });
24
+ actionMap[key] = name;
25
+ } else {
26
+ routes[key] = {
27
+ type: "action",
28
+ value: name
29
+ };
30
+ actionMap[key] = name;
31
+ }
32
+ }
33
+ };
34
+ }
35
+
36
+ const t = {
37
+ get(route) { return addRoute("GET", route); },
38
+ post(route) { return addRoute("POST", route); },
39
+ put(route) { return addRoute("PUT", route); },
40
+ delete(route) { return addRoute("DELETE", route); },
41
+ log(module, msg) { console.log(`[${module}] ${msg}`); },
42
+
43
+ start(port = 3000, msg = "", threads, stack_mb = 8) {
44
+ globalThis.__TITAN_CONFIG__ = { port, msg, threads, stack_mb };
45
+ }
46
+ };
47
+
48
+ globalThis.__TITAN_ROUTES_MAP__ = routes;
49
+ globalThis.__TITAN_DYNAMIC_ROUTES__ = dynamicRoutes;
50
+ globalThis.__TITAN_ACTION_MAP__ = actionMap;
51
+
52
+ export default t;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/route",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Titan routing DSL",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -6,7 +6,7 @@ yarn-error.log*
6
6
  package-lock.json
7
7
  yarn.lock
8
8
 
9
- # Titan Gravity Engine (Auto-generated - DO NOT COMMIT)
9
+ # Titan Engine (Auto-generated - DO NOT COMMIT)
10
10
  dist/
11
11
  .titan/
12
12
  .ext/
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{name}}",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "A Titan Planet extension",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "@titanpl/core": "latest",
19
19
  "chokidar": "^5.0.0",
20
20
  "esbuild": "^0.27.2",
21
- "titanpl-sdk": "2.0.1"
21
+ "titanpl-sdk": "2.0.3"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@tgrv/microgravity": "latest"
@@ -6,12 +6,12 @@
6
6
  "template": "js"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "2.0.1",
10
- "@titanpl/route": "2.0.1",
11
- "@titanpl/native": "2.0.1",
9
+ "@titanpl/cli": "2.0.3",
10
+ "@titanpl/route": "2.0.3",
11
+ "@titanpl/native": "2.0.3",
12
12
  "@titanpl/core": "latest",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "2.0.1"
14
+ "@titanpl/packet": "2.0.3"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "titan build",
@@ -24,5 +24,5 @@
24
24
  "eslint": "^9.39.2",
25
25
  "eslint-plugin-titanpl": "latest"
26
26
  },
27
- "version": "2.0.1"
27
+ "version": "2.0.3"
28
28
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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": "2.0.1",
11
- "@titanpl/route": "2.0.1",
12
- "@titanpl/native": "2.0.1",
10
+ "@titanpl/cli": "2.0.3",
11
+ "@titanpl/route": "2.0.3",
12
+ "@titanpl/native": "2.0.3",
13
13
  "@titanpl/core": "latest",
14
14
  "@titanpl/node": "latest"
15
15
  },
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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": "2.0.1",
11
- "@titanpl/route": "2.0.1",
12
- "@titanpl/native": "2.0.1",
10
+ "@titanpl/cli": "2.0.3",
11
+ "@titanpl/route": "2.0.3",
12
+ "@titanpl/native": "2.0.3",
13
13
  "@titanpl/core": "latest",
14
14
  "@titanpl/node": "latest",
15
15
  "typescript": "^5.0.0"
@@ -6,12 +6,12 @@
6
6
  "template": "ts"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "2.0.1",
10
- "@titanpl/route": "2.0.1",
11
- "@titanpl/native": "2.0.1",
9
+ "@titanpl/cli": "2.0.3",
10
+ "@titanpl/route": "2.0.3",
11
+ "@titanpl/native": "2.0.3",
12
12
  "@titanpl/core": "latest",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "2.0.1",
14
+ "@titanpl/packet": "2.0.3",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "eslint-plugin-titanpl": "latest",
27
27
  "@typescript-eslint/parser": "^8.54.0"
28
28
  },
29
- "version": "2.0.1"
29
+ "version": "2.0.3"
30
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "titanpl-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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",