titanpl 6.0.0 → 7.0.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.
Files changed (227) hide show
  1. package/package.json +2 -6
  2. package/packages/cli/index.js +25 -11
  3. package/packages/cli/package.json +4 -4
  4. package/packages/cli/src/commands/build-ext.js +157 -0
  5. package/packages/cli/src/commands/build.js +12 -0
  6. package/packages/cli/src/commands/create.js +160 -0
  7. package/packages/cli/src/commands/init.js +5 -11
  8. package/packages/cli/src/commands/run-ext.js +104 -0
  9. package/{titanpl-sdk → packages/core-source}/LICENSE +1 -1
  10. package/packages/core-source/README.md +128 -0
  11. package/packages/core-source/V8_SERIALIZATION.md +125 -0
  12. package/packages/core-source/configure.js +50 -0
  13. package/packages/core-source/globals.d.ts +2238 -0
  14. package/packages/core-source/index.d.ts +515 -0
  15. package/packages/core-source/index.js +639 -0
  16. package/packages/core-source/jsconfig.json +12 -0
  17. package/packages/core-source/mkctx.config.json +7 -0
  18. package/packages/core-source/native/Cargo.lock +1559 -0
  19. package/packages/core-source/native/Cargo.toml +30 -0
  20. package/packages/core-source/native/src/crypto_impl.rs +139 -0
  21. package/packages/core-source/native/src/lib.rs +702 -0
  22. package/packages/core-source/native/src/storage_impl.rs +73 -0
  23. package/packages/core-source/native/src/v8_impl.rs +93 -0
  24. package/packages/core-source/package-lock.json +1464 -0
  25. package/packages/core-source/package.json +53 -0
  26. package/packages/core-source/tests/buffer.test.js +78 -0
  27. package/packages/core-source/tests/cookies.test.js +117 -0
  28. package/packages/core-source/tests/crypto.test.js +142 -0
  29. package/packages/core-source/tests/fs.test.js +176 -0
  30. package/packages/core-source/tests/ls.test.js +149 -0
  31. package/packages/core-source/tests/net.test.js +84 -0
  32. package/packages/core-source/tests/os.test.js +81 -0
  33. package/packages/core-source/tests/path.test.js +102 -0
  34. package/packages/core-source/tests/response.test.js +146 -0
  35. package/packages/core-source/tests/session.test.js +110 -0
  36. package/packages/core-source/tests/setup.js +325 -0
  37. package/packages/core-source/tests/time.test.js +57 -0
  38. package/packages/core-source/tests/url.test.js +82 -0
  39. package/packages/core-source/titan-ext.d.ts +2 -0
  40. package/packages/core-source/titan.json +9 -0
  41. package/packages/core-source/vitest.config.js +8 -0
  42. package/packages/engine-darwin-arm64/README.md +0 -2
  43. package/packages/engine-darwin-arm64/package.json +1 -1
  44. package/packages/engine-linux-x64/README.md +0 -2
  45. package/packages/engine-linux-x64/package.json +1 -1
  46. package/packages/engine-win32-x64/README.md +0 -1
  47. package/packages/engine-win32-x64/bin/titan-server.exe +0 -0
  48. package/packages/engine-win32-x64/package.json +1 -1
  49. package/packages/native/README.md +0 -1
  50. package/packages/native/index.d.ts +25 -4
  51. package/packages/native/index.js +7 -0
  52. package/packages/native/package.json +2 -2
  53. package/packages/native/t.native.d.ts +167 -2
  54. package/packages/packet/index.js +103 -94
  55. package/packages/packet/package.json +1 -1
  56. package/packages/route/package.json +1 -1
  57. package/packages/sdk/index.js +2 -0
  58. package/packages/sdk/package.json +18 -0
  59. package/packages/sdk/test/index.js +120 -0
  60. package/templates/common/_tanfig.json +19 -13
  61. package/templates/extension/index.d.ts +26 -22
  62. package/templates/extension/index.js +15 -15
  63. package/templates/extension/native/Cargo.toml +5 -3
  64. package/templates/extension/native/src/lib.rs +2 -3
  65. package/templates/extension/package.json +10 -20
  66. package/templates/extension/titan.json +5 -16
  67. package/templates/extension/utils/registerExtension.js +44 -0
  68. package/templates/js/package.json +8 -8
  69. package/templates/rust-js/package.json +5 -5
  70. package/templates/rust-ts/package.json +5 -5
  71. package/templates/ts/package.json +8 -8
  72. package/packages/packet/node_modules/typescript/LICENSE.txt +0 -55
  73. package/packages/packet/node_modules/typescript/README.md +0 -50
  74. package/packages/packet/node_modules/typescript/SECURITY.md +0 -41
  75. package/packages/packet/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  76. package/packages/packet/node_modules/typescript/bin/tsc +0 -2
  77. package/packages/packet/node_modules/typescript/bin/tsserver +0 -2
  78. package/packages/packet/node_modules/typescript/lib/_tsc.js +0 -133818
  79. package/packages/packet/node_modules/typescript/lib/_tsserver.js +0 -659
  80. package/packages/packet/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  81. package/packages/packet/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  82. package/packages/packet/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  83. package/packages/packet/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  84. package/packages/packet/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  85. package/packages/packet/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  86. package/packages/packet/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  87. package/packages/packet/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  88. package/packages/packet/node_modules/typescript/lib/lib.d.ts +0 -22
  89. package/packages/packet/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  90. package/packages/packet/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  91. package/packages/packet/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  92. package/packages/packet/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  93. package/packages/packet/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  94. package/packages/packet/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  95. package/packages/packet/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  96. package/packages/packet/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  97. package/packages/packet/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  98. package/packages/packet/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  99. package/packages/packet/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  100. package/packages/packet/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  101. package/packages/packet/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  102. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  103. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  104. package/packages/packet/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  105. package/packages/packet/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  106. package/packages/packet/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  107. package/packages/packet/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  108. package/packages/packet/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  109. package/packages/packet/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  110. package/packages/packet/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  111. package/packages/packet/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  112. package/packages/packet/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  113. package/packages/packet/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  114. package/packages/packet/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  115. package/packages/packet/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  116. package/packages/packet/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  117. package/packages/packet/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  118. package/packages/packet/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  119. package/packages/packet/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  120. package/packages/packet/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  121. package/packages/packet/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  122. package/packages/packet/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  123. package/packages/packet/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  124. package/packages/packet/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  125. package/packages/packet/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  126. package/packages/packet/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  127. package/packages/packet/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  128. package/packages/packet/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  129. package/packages/packet/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  130. package/packages/packet/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  131. package/packages/packet/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  132. package/packages/packet/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  133. package/packages/packet/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  134. package/packages/packet/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  135. package/packages/packet/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  136. package/packages/packet/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  137. package/packages/packet/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  138. package/packages/packet/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  139. package/packages/packet/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  140. package/packages/packet/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  141. package/packages/packet/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  142. package/packages/packet/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  143. package/packages/packet/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  144. package/packages/packet/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  145. package/packages/packet/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  146. package/packages/packet/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  147. package/packages/packet/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  148. package/packages/packet/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  149. package/packages/packet/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  150. package/packages/packet/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  151. package/packages/packet/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  152. package/packages/packet/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  153. package/packages/packet/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  154. package/packages/packet/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  155. package/packages/packet/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  156. package/packages/packet/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  157. package/packages/packet/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  158. package/packages/packet/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  159. package/packages/packet/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  160. package/packages/packet/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  161. package/packages/packet/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  162. package/packages/packet/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  163. package/packages/packet/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  164. package/packages/packet/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  165. package/packages/packet/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  166. package/packages/packet/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  167. package/packages/packet/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  168. package/packages/packet/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  169. package/packages/packet/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  170. package/packages/packet/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  171. package/packages/packet/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  172. package/packages/packet/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  173. package/packages/packet/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  174. package/packages/packet/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  175. package/packages/packet/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  176. package/packages/packet/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  177. package/packages/packet/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  178. package/packages/packet/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  179. package/packages/packet/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  180. package/packages/packet/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  181. package/packages/packet/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  182. package/packages/packet/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  183. package/packages/packet/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  184. package/packages/packet/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  185. package/packages/packet/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  186. package/packages/packet/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  187. package/packages/packet/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  188. package/packages/packet/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  189. package/packages/packet/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  190. package/packages/packet/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  191. package/packages/packet/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  192. package/packages/packet/node_modules/typescript/lib/tsc.js +0 -8
  193. package/packages/packet/node_modules/typescript/lib/tsserver.js +0 -8
  194. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  195. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  196. package/packages/packet/node_modules/typescript/lib/typesMap.json +0 -497
  197. package/packages/packet/node_modules/typescript/lib/typescript.d.ts +0 -11437
  198. package/packages/packet/node_modules/typescript/lib/typescript.js +0 -200276
  199. package/packages/packet/node_modules/typescript/lib/typingsInstaller.js +0 -8
  200. package/packages/packet/node_modules/typescript/lib/watchGuard.js +0 -53
  201. package/packages/packet/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  202. package/packages/packet/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  203. package/packages/packet/node_modules/typescript/package.json +0 -120
  204. package/titanpl-sdk/README.md +0 -111
  205. package/titanpl-sdk/assets/titanpl-sdk.png +0 -0
  206. package/titanpl-sdk/bin/run.js +0 -274
  207. package/titanpl-sdk/index.js +0 -5
  208. package/titanpl-sdk/package-lock.json +0 -28
  209. package/titanpl-sdk/package.json +0 -40
  210. package/titanpl-sdk/templates/app/actions/hello.js +0 -5
  211. package/titanpl-sdk/templates/app/app.js +0 -7
  212. package/titanpl-sdk/templates/jsconfig.json +0 -19
  213. package/titanpl-sdk/templates/server/Cargo.toml +0 -52
  214. package/titanpl-sdk/templates/server/src/action_management.rs +0 -175
  215. package/titanpl-sdk/templates/server/src/errors.rs +0 -12
  216. package/titanpl-sdk/templates/server/src/extensions/builtin.rs +0 -1060
  217. package/titanpl-sdk/templates/server/src/extensions/external.rs +0 -338
  218. package/titanpl-sdk/templates/server/src/extensions/mod.rs +0 -580
  219. package/titanpl-sdk/templates/server/src/extensions/titan_core.js +0 -249
  220. package/titanpl-sdk/templates/server/src/fast_path.rs +0 -719
  221. package/titanpl-sdk/templates/server/src/main.rs +0 -607
  222. package/titanpl-sdk/templates/server/src/runtime.rs +0 -284
  223. package/titanpl-sdk/templates/server/src/utils.rs +0 -33
  224. package/titanpl-sdk/templates/titan/bundle.js +0 -259
  225. package/titanpl-sdk/templates/titan/dev.js +0 -390
  226. package/titanpl-sdk/templates/titan/error-box.js +0 -277
  227. package/titanpl-sdk/templates/titan/titan.js +0 -129
@@ -1,120 +0,0 @@
1
- {
2
- "name": "typescript",
3
- "author": "Microsoft Corp.",
4
- "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.9.3",
6
- "license": "Apache-2.0",
7
- "description": "TypeScript is a language for application scale JavaScript development",
8
- "keywords": [
9
- "TypeScript",
10
- "Microsoft",
11
- "compiler",
12
- "language",
13
- "javascript"
14
- ],
15
- "bugs": {
16
- "url": "https://github.com/microsoft/TypeScript/issues"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/microsoft/TypeScript.git"
21
- },
22
- "main": "./lib/typescript.js",
23
- "typings": "./lib/typescript.d.ts",
24
- "bin": {
25
- "tsc": "./bin/tsc",
26
- "tsserver": "./bin/tsserver"
27
- },
28
- "engines": {
29
- "node": ">=14.17"
30
- },
31
- "files": [
32
- "bin",
33
- "lib",
34
- "!lib/enu",
35
- "LICENSE.txt",
36
- "README.md",
37
- "SECURITY.md",
38
- "ThirdPartyNoticeText.txt",
39
- "!**/.gitattributes"
40
- ],
41
- "devDependencies": {
42
- "@dprint/formatter": "^0.4.1",
43
- "@dprint/typescript": "0.93.4",
44
- "@esfx/canceltoken": "^1.0.0",
45
- "@eslint/js": "^9.20.0",
46
- "@octokit/rest": "^21.1.1",
47
- "@types/chai": "^4.3.20",
48
- "@types/diff": "^7.0.1",
49
- "@types/minimist": "^1.2.5",
50
- "@types/mocha": "^10.0.10",
51
- "@types/ms": "^0.7.34",
52
- "@types/node": "latest",
53
- "@types/source-map-support": "^0.5.10",
54
- "@types/which": "^3.0.4",
55
- "@typescript-eslint/rule-tester": "^8.24.1",
56
- "@typescript-eslint/type-utils": "^8.24.1",
57
- "@typescript-eslint/utils": "^8.24.1",
58
- "azure-devops-node-api": "^14.1.0",
59
- "c8": "^10.1.3",
60
- "chai": "^4.5.0",
61
- "chokidar": "^4.0.3",
62
- "diff": "^7.0.0",
63
- "dprint": "^0.49.0",
64
- "esbuild": "^0.25.0",
65
- "eslint": "^9.20.1",
66
- "eslint-formatter-autolinkable-stylish": "^1.4.0",
67
- "eslint-plugin-regexp": "^2.7.0",
68
- "fast-xml-parser": "^4.5.2",
69
- "glob": "^10.4.5",
70
- "globals": "^15.15.0",
71
- "hereby": "^1.10.0",
72
- "jsonc-parser": "^3.3.1",
73
- "knip": "^5.44.4",
74
- "minimist": "^1.2.8",
75
- "mocha": "^10.8.2",
76
- "mocha-fivemat-progress-reporter": "^0.1.0",
77
- "monocart-coverage-reports": "^2.12.1",
78
- "ms": "^2.1.3",
79
- "picocolors": "^1.1.1",
80
- "playwright": "^1.50.1",
81
- "source-map-support": "^0.5.21",
82
- "tslib": "^2.8.1",
83
- "typescript": "^5.7.3",
84
- "typescript-eslint": "^8.24.1",
85
- "which": "^3.0.1"
86
- },
87
- "overrides": {
88
- "typescript@*": "$typescript"
89
- },
90
- "scripts": {
91
- "test": "hereby runtests-parallel --light=false",
92
- "test:eslint-rules": "hereby run-eslint-rules-tests",
93
- "build": "npm run build:compiler && npm run build:tests",
94
- "build:compiler": "hereby local",
95
- "build:tests": "hereby tests",
96
- "build:tests:notypecheck": "hereby tests --no-typecheck",
97
- "clean": "hereby clean",
98
- "gulp": "hereby",
99
- "lint": "hereby lint",
100
- "knip": "hereby knip",
101
- "format": "dprint fmt",
102
- "setup-hooks": "node scripts/link-hooks.mjs"
103
- },
104
- "browser": {
105
- "fs": false,
106
- "os": false,
107
- "path": false,
108
- "crypto": false,
109
- "buffer": false,
110
- "source-map-support": false,
111
- "inspector": false,
112
- "perf_hooks": false
113
- },
114
- "packageManager": "npm@8.19.4",
115
- "volta": {
116
- "node": "20.1.0",
117
- "npm": "8.19.4"
118
- },
119
- "gitHead": "c63de15a992d37f0d6cec03ac7631872838602cb"
120
- }
@@ -1,111 +0,0 @@
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
- [![npm version](https://img.shields.io/npm/v/titanpl-sdk.svg?style=flat-square)](https://www.npmjs.com/package/titanpl-sdk)
13
- [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg?style=flat-square)](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
- **Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
28
-
29
- ---
30
-
31
- ## ✨ Features
32
-
33
- - **💎 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.
34
- - **🛡️ Static Validation**: Catch parameter mismatches and typos in `t.log`, `t.fetch`, `t.db`, etc., during development.
35
- - **🔌 Extension Test Harness**: A "lite" version of the Titan runtime that simulates the native environment to test extensions in isolation.
36
- - **🚀 Zero Production Trace**: This is a `devDependencies` package. It never ships with your binary, keeping your production footprint at literal zero.
37
-
38
- ---
39
-
40
- ## 🚀 The Test Harness (Lite Runtime)
41
-
42
- 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.
43
-
44
- ### How it works:
45
- When you run the SDK in an extension folder, it:
46
- 1. **Scaffolds a Virtual Project**: Creates a temporary, minimal Titan environment in `.titan_test_run`.
47
- 2. **Native Compilation**: Automatically builds your native Rust code (`native/`) if it exists.
48
- 3. **Hot-Linking**: Junctions your local extension into the virtual project's `node_modules`.
49
- 4. **Verification**: Generates a test suite that attempts to call your extension's methods via the real `t` object inside the sandbox.
50
-
51
- ### Usage:
52
-
53
- ```bash
54
- # Inside your extension directory
55
- npx titan-sdk
56
- ```
57
-
58
- ---
59
-
60
- ## ⌨️ Enabling IntelliSense
61
-
62
- 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.
63
-
64
- 1. **Install the SDK**:
65
- ```bash
66
- npm install --save-dev titan-sdk
67
- ```
68
-
69
- 2. **Configure Types**:
70
- Create or update `jsconfig.json` (or `tsconfig.json`) in your project root:
71
- ```json
72
- {
73
- "compilerOptions": {
74
- "types": ["titan-sdk"]
75
- }
76
- }
77
- ```
78
-
79
- Now your editor will treat `t` as a first-class citizen:
80
- ```ts
81
- export const myAction = defineAction((req) => {
82
- t.log("Request received", req.path); // Autocomplete works!
83
- return { status: "ok" };
84
- });
85
- ```
86
-
87
- ---
88
-
89
- ## 🧱 What's Included? (Types Only)
90
-
91
- The SDK provides types for the native APIs provided by the Titan Planet engine:
92
-
93
- - **`t.log`**: Standardized logging that appears in the Titan binary console.
94
- - **`t.fetch`**: Types for the high-performance Rust-native network stack.
95
- - **`t.db`**: Interface for the native PostgreSQL driver.
96
- - **`t.read`**: Definitions for optimized filesystem reads.
97
- - **`t.jwt` / `t.password`**: Security helper types.
98
-
99
- ---
100
-
101
- ## 🌍 Community & Documentation
102
-
103
- - **Core Framework**: [Titan Planet](https://github.com/ezet-galaxy/titanpl)
104
- - **Official Docs**: [Titan Planet Docs](https://titan-docs-ez.vercel.app/docs)
105
- - **Author**: [ezetgalaxy](https://github.com/ezet-galaxy)
106
-
107
- ---
108
-
109
- <p align="center">
110
- Built with ❤️ for the <a href="https://titan-docs-ez.vercel.app/">Titan Planet</a> ecosystem.
111
- </p>
Binary file
@@ -1,274 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from "fs";
3
- import path from "path";
4
- import { execSync } from "child_process";
5
- import { fileURLToPath } from "url";
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- // Helper for colors
11
- const cyan = (t) => `\x1b[36m${t}\x1b[0m`;
12
- const green = (t) => `\x1b[32m${t}\x1b[0m`;
13
- const red = (t) => `\x1b[31m${t}\x1b[0m`;
14
- const yellow = (t) => `\x1b[33m${t}\x1b[0m`;
15
-
16
- function copyDir(src, dest, excludes = []) {
17
- // console.log(`DEBUG: copyDir ${src} -> ${dest}`);
18
- if (!fs.existsSync(src)) {
19
- console.log(red(`Source does not exist: ${src}`));
20
- return;
21
- }
22
-
23
- fs.mkdirSync(dest, { recursive: true });
24
-
25
- const files = fs.readdirSync(src);
26
- // console.log(`DEBUG: Found ${files.length} files in ${src}`);
27
-
28
- for (const file of files) {
29
- if (excludes.includes(file)) {
30
- // console.log(`DEBUG: Skipping excluded ${file}`);
31
- continue;
32
- }
33
-
34
- const srcPath = path.join(src, file);
35
- const destPath = path.join(dest, file);
36
-
37
- if (fs.lstatSync(srcPath).isDirectory()) {
38
- copyDir(srcPath, destPath, excludes);
39
- } else {
40
- // console.log(`DEBUG: Copying file ${file}`);
41
- try {
42
- fs.copyFileSync(srcPath, destPath);
43
- } catch (err) {
44
- console.log(red(`ERROR: Failed to copy ${file}: ${err.message}`));
45
- }
46
- }
47
- }
48
- }
49
-
50
- function run() {
51
- console.log(cyan("TitanPl SDK: Test Runner"));
52
-
53
- // 1. Validate we are in an extension directory
54
- const cwd = process.cwd();
55
- console.log(cyan(`Current Working Directory: ${cwd}`));
56
-
57
- const manifestPath = path.join(cwd, "titan.json");
58
- if (!fs.existsSync(manifestPath)) {
59
- console.log(red("Error: titan.json not found. Run this command inside your extension folder."));
60
- process.exit(1);
61
- }
62
-
63
- const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
64
- const name = manifest.name;
65
- console.log(green(`Extension: ${name}`));
66
-
67
- // 2. Build Native Logic (if properly set up)
68
- const nativeDir = path.join(cwd, "native");
69
- if (fs.existsSync(nativeDir) && fs.existsSync(path.join(nativeDir, "Cargo.toml"))) {
70
- console.log(cyan("Building native Rust module..."));
71
- try {
72
- execSync("cargo build --release", { cwd: nativeDir, stdio: "inherit" });
73
- } catch (e) {
74
- console.log(red("Failed to build native module."));
75
- process.exit(1);
76
- }
77
- }
78
-
79
- // 3. Setup Test Harness (Mini Titan Project)
80
- // 3. Setup Test Harness (Mini Titan Project)
81
- const runDir = path.join(cwd, ".titan_test_run");
82
- const appDir = path.join(runDir, "app");
83
- const actionsDir = path.join(appDir, "actions");
84
- const nmDir = path.join(runDir, "node_modules");
85
-
86
- const isFirstRun = !fs.existsSync(runDir);
87
-
88
- if (isFirstRun) {
89
- console.log(cyan("Initializing test environment..."));
90
- fs.mkdirSync(runDir, { recursive: true });
91
-
92
- // Create app structure
93
- fs.mkdirSync(appDir);
94
-
95
- // Create actions folder (required by Titan build)
96
- fs.mkdirSync(actionsDir);
97
-
98
- // Copy titan/ and server/ from templates
99
- const templatesDir = path.join(__dirname, "..", "templates");
100
- console.log(cyan(`Templates Source: ${templatesDir}`));
101
-
102
- const titanSrc = path.join(templatesDir, "titan");
103
- const titanDest = path.join(runDir, "titan");
104
-
105
- if (fs.existsSync(titanSrc)) {
106
- copyDir(titanSrc, titanDest);
107
- if (!fs.existsSync(path.join(titanDest, "titan.js"))) {
108
- throw new Error("Failed to copy titan.js template");
109
- }
110
- } else {
111
- console.log(red(`Error: Titan templates not found at ${titanSrc}`));
112
- process.exit(1);
113
- }
114
-
115
- const serverSrc = path.join(templatesDir, "server");
116
- const serverDest = path.join(runDir, "server");
117
- if (fs.existsSync(serverSrc)) {
118
- copyDir(serverSrc, serverDest);
119
- } else {
120
- console.log(red(`Error: Server templates not found at ${serverSrc}`));
121
- process.exit(1);
122
- }
123
-
124
- // Create package.json for the test harness
125
- const pkgJson = {
126
- "type": "module",
127
- "dependencies": {
128
- // We can add dependencies here if needed
129
- }
130
- };
131
- fs.writeFileSync(path.join(runDir, "package.json"), JSON.stringify(pkgJson, null, 2));
132
-
133
- // Create 'node_modules'
134
- // const nmDir = path.join(runDir, "node_modules"); // Already defined
135
- fs.mkdirSync(nmDir);
136
- } else {
137
- console.log(cyan("Using existing test environment..."));
138
- }
139
-
140
- // const nmDir = path.join(runDir, "node_modules"); // Already defined
141
- if (!fs.existsSync(nmDir)) fs.mkdirSync(nmDir, { recursive: true });
142
-
143
- // COPY Extension to node_modules/NAME (Force Copy to avoid Symlink Loops)
144
- const extDest = path.join(nmDir, name);
145
- console.log(cyan(`Copying extension to ${extDest}...`));
146
-
147
- // Always exclude the test run folder itself + standard ignores
148
- const excludes = ['.titan_test_run', 'node_modules', '.git', 'target', 'dist'];
149
- copyDir(cwd, extDest, excludes);
150
-
151
- // Create default test files ONLY if they don't exist
152
- // const actionsDir = path.join(runDir, "app", "actions"); // Already defined
153
- const testActionPath = path.join(actionsDir, "test.js");
154
-
155
- if (!fs.existsSync(testActionPath)) {
156
- const testAction = `export const test = (req) => {
157
- const ext = t["${name}"];
158
-
159
- const results = {
160
- extension: "${name}",
161
- loaded: !!ext,
162
- methods: ext ? Object.keys(ext) : [],
163
- timestamp: new Date().toISOString()
164
- };
165
-
166
- if (ext && ext.hello) {
167
- try {
168
- results.hello_test = ext.hello("World");
169
- } catch(e) {
170
- results.hello_error = String(e);
171
- }
172
- }
173
-
174
- if (ext && ext.calc) {
175
- try {
176
- results.calc_test = ext.calc(15, 25);
177
- } catch(e) {
178
- results.calc_error = String(e);
179
- }
180
- }
181
-
182
- return results;
183
- };
184
- `;
185
- fs.writeFileSync(testActionPath, testAction);
186
- }
187
-
188
- const appJsPath = path.join(runDir, "app", "app.js");
189
- if (!fs.existsSync(appJsPath)) {
190
- const testScript = `import t from "../titan/titan.js";
191
-
192
- // 1. Expose 't' globally because extensions expect it (like in the real runtime)
193
- globalThis.t = t;
194
-
195
- // 2. Dynamic import ensures 't' is set BEFORE the extension loads
196
- await import("${name}");
197
-
198
- // Extension test harness for: ${name}
199
- const ext = t["${name}"];
200
-
201
- t.log("---------------------------------------------------");
202
- t.log("Testing Extension: ${name}");
203
- t.log("---------------------------------------------------");
204
-
205
- if (!ext) {
206
- console.log("ERROR: Extension '${name}' not found in global 't'.");
207
- } else {
208
- t.log("✓ Extension loaded successfully!");
209
- t.log("✓ Available methods:", Object.keys(ext).join(", "));
210
-
211
- // Try 'hello' if it exists
212
- if (typeof ext.hello === 'function') {
213
- console.log("\\nTesting ext.hello('Titan')...");
214
- try {
215
- const res = ext.hello("Titan");
216
- t.log("✓ Result:", res);
217
- } catch(e) {
218
- t.log("✗ Error:", e.message);
219
- }
220
- }
221
-
222
- // Try 'calc' if it exists
223
- if (typeof ext.calc === 'function') {
224
- console.log("\\nTesting ext.calc(10, 20)...");
225
- try {
226
- const res = ext.calc(10, 20);
227
- t.log("✓ Result:", res);
228
- } catch(e) {
229
- t.log("✗ Error:", e.message);
230
- }
231
- }
232
- }
233
-
234
- t.log("---------------------------------------------------");
235
- t.log("✓ Test complete!");
236
- t.log("\\n📍 Routes:");
237
- t.log(" GET http://localhost:3000/ → Test harness info");
238
- t.log(" GET http://localhost:3000/test → Extension test results (JSON)");
239
- t.log("---------------------------------------------------\\n");
240
-
241
- // Create routes
242
- t.get("/test").action("test");
243
- t.get("/").reply("🚀 Extension Test Harness for ${name}\\n\\nVisit /test to see extension test results");
244
-
245
- await t.start(3000, "Titan Extension Test Running!", 10, 16);
246
- `;
247
- fs.writeFileSync(appJsPath, testScript);
248
- }
249
-
250
- // Build the app (bundle actions)
251
- console.log(cyan("Building test app..."));
252
- try {
253
- execSync("node app/app.js --build", {
254
- cwd: runDir,
255
- stdio: "inherit",
256
- env: { ...process.env, NODE_OPTIONS: "--no-warnings" }
257
- });
258
- } catch (e) {
259
- console.log(red("Failed to build test app. checking for runtime errors..."));
260
- }
261
-
262
- // 4. Run Titan Server using cargo run
263
- console.log(green("\\x1b[1m\\n>>> STARTING EXTENSION TEST >>>\\n\\x1b[0m"));
264
-
265
- const serverDir = path.join(runDir, "server");
266
-
267
- try {
268
- execSync("cargo run", { cwd: serverDir, stdio: "inherit" });
269
- } catch (e) {
270
- // console.log(red("Runtime exited."));
271
- }
272
- }
273
-
274
- run();
@@ -1,5 +0,0 @@
1
- // Titan SDK
2
- // This package is primarily for type definitions and development tools.
3
- // The 't' object is injected globally by the Titan runtime.
4
-
5
- export const VERSION = "0.0.1";
@@ -1,28 +0,0 @@
1
- {
2
- "name": "titanpl-sdk",
3
- "version": "0.1.7",
4
- "lockfileVersion": 3,
5
- "requires": true,
6
- "packages": {
7
- "": {
8
- "name": "titanpl-sdk",
9
- "version": "0.1.7",
10
- "license": "ISC",
11
- "dependencies": {
12
- "@titanpl/core": "^1.0.1"
13
- },
14
- "bin": {
15
- "titanpl-sdk": "bin/run.js"
16
- }
17
- },
18
- "node_modules/@titanpl/core": {
19
- "version": "1.0.1",
20
- "resolved": "https://registry.npmjs.org/@titanpl/core/-/core-1.0.1.tgz",
21
- "integrity": "sha512-5zcDMNnf+oghKkQMiPBFuhLlRy2IASyWMAAMgfqa4AzoXxiw2BzzfN0B2EA76Dy9AhCeK2mY84Zm+FSE7ANVFg==",
22
- "license": "ISC",
23
- "engines": {
24
- "node": ">=18.0.0"
25
- }
26
- }
27
- }
28
- }
@@ -1,40 +0,0 @@
1
- {
2
- "name": "titanpl-sdk",
3
- "version": "6.0.0",
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
- "main": "index.js",
6
- "type": "module",
7
- "types": "index.d.ts",
8
- "bin": {
9
- "titanpl-sdk": "./bin/run.js"
10
- },
11
- "files": [
12
- "bin/",
13
- "templates/",
14
- "titan",
15
- "assets",
16
- "index.js",
17
- "index.d.ts",
18
- "README.md"
19
- ],
20
- "keywords": [
21
- "titan",
22
- "titan-planet",
23
- "titanpl-sdk",
24
- "ezetgalaxy",
25
- "types",
26
- "typescript",
27
- "intellisense",
28
- "sdk",
29
- "backend-sdk",
30
- "extension-development"
31
- ],
32
- "license": "ISC",
33
- "dependencies": {
34
- "@titanpl/core": "latest",
35
- "@titanpl/node": "latest"
36
- },
37
- "devDependencies": {
38
- "@tgrv/microgravity": "latest"
39
- }
40
- }
@@ -1,5 +0,0 @@
1
- export const hello = (req) => {
2
- return {
3
- message: `Hello from Titan ${req.body.name}`,
4
- };
5
- }
@@ -1,7 +0,0 @@
1
- import t from "@titanpl/route";
2
-
3
- t.post("/hello").action("hello") // pass a json payload { "name": "titan" }
4
-
5
- t.get("/").reply("Ready to land on Titan Planet 🚀");
6
-
7
- t.start(5100, "Titan Running!");
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "esnext",
4
- "target": "esnext",
5
- "checkJs": false,
6
- "noImplicitAny": false,
7
- "allowJs": true,
8
- "moduleResolution": "node",
9
- "baseUrl": ".",
10
- "paths": {
11
- "*": [
12
- "./app/*"
13
- ]
14
- }
15
- },
16
- "include": [
17
- "app/**/*"
18
- ]
19
- }
@@ -1,52 +0,0 @@
1
- [package]
2
- name = "titan-server"
3
- version = "0.1.0"
4
- edition = "2024"
5
-
6
- [dependencies]
7
- axum = "0.8.7"
8
- dotenv = "0.15.0"
9
- reqwest = { version = "0.12.24", features = ["json", "rustls-tls", "gzip", "brotli", "blocking"] }
10
- serde = { version = "1.0.228", features = ["derive"] }
11
- serde_json = "1.0.145"
12
- thiserror = "2.0.17"
13
- tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "process", "fs"] }
14
- tower-http = { version = "0.6.7", features = ["cors"] }
15
- tracing = "0.1.43"
16
- tracing-subscriber = "0.3.22"
17
- anyhow = "1"
18
- v8 = "0.106.0"
19
- dotenvy = "0.15"
20
- base64 = "0.21"
21
- regex = "1.10"
22
- bcrypt = "0.15"
23
- jsonwebtoken = "9"
24
- postgres = { version = "0.19", features = ["with-serde_json-1"] }
25
- libloading = "0.8"
26
- walkdir = "2"
27
- crossbeam = "0.8.4"
28
- dashmap = "6.1.0"
29
- bytes = "1.11.0"
30
- smallvec = "1.15.1"
31
- num_cpus = "1.17.0"
32
- deadpool-postgres = "0.12"
33
- tokio-postgres = "0.7"
34
-
35
- # Performance: Global Allocator
36
- mimalloc = { version = "0.1", default-features = false }
37
-
38
- # Static Analysis: OXC (Zero runtime cost, used at startup)
39
- oxc = { version = "0.108", features = ["semantic"] }
40
-
41
- # Release Profile
42
- [profile.release]
43
- opt-level = 3
44
- lto = "fat"
45
- codegen-units = 1
46
- panic = "abort"
47
- strip = true
48
-
49
- # Dev Profile
50
- [profile.dev]
51
- opt-level = 0
52
- debug = 1