titanpl 7.0.0-beta → 7.0.1

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 (155) hide show
  1. package/package.json +2 -6
  2. package/packages/cli/package.json +4 -4
  3. package/packages/cli/src/commands/build-ext.js +17 -4
  4. package/packages/engine-darwin-arm64/package.json +1 -1
  5. package/packages/engine-linux-x64/package.json +1 -1
  6. package/packages/engine-win32-x64/bin/titan-server.exe +0 -0
  7. package/packages/engine-win32-x64/package.json +1 -1
  8. package/packages/native/index.d.ts +43 -1
  9. package/packages/native/index.js +7 -0
  10. package/packages/native/package.json +2 -2
  11. package/packages/native/t.native.d.ts +176 -3
  12. package/packages/packet/index.js +94 -102
  13. package/packages/packet/package.json +1 -1
  14. package/packages/route/package.json +1 -1
  15. package/packages/sdk/package.json +1 -1
  16. package/templates/common/_tanfig.json +4 -2
  17. package/templates/extension/README_WASM.md +38 -0
  18. package/templates/extension/package.json +2 -2
  19. package/templates/js/package.json +8 -8
  20. package/templates/rust-js/package.json +5 -5
  21. package/templates/rust-ts/package.json +5 -5
  22. package/templates/ts/package.json +8 -8
  23. package/packages/packet/node_modules/typescript/LICENSE.txt +0 -55
  24. package/packages/packet/node_modules/typescript/README.md +0 -50
  25. package/packages/packet/node_modules/typescript/SECURITY.md +0 -41
  26. package/packages/packet/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  27. package/packages/packet/node_modules/typescript/bin/tsc +0 -2
  28. package/packages/packet/node_modules/typescript/bin/tsserver +0 -2
  29. package/packages/packet/node_modules/typescript/lib/_tsc.js +0 -133818
  30. package/packages/packet/node_modules/typescript/lib/_tsserver.js +0 -659
  31. package/packages/packet/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  32. package/packages/packet/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  33. package/packages/packet/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  34. package/packages/packet/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  35. package/packages/packet/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  36. package/packages/packet/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  37. package/packages/packet/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  38. package/packages/packet/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  39. package/packages/packet/node_modules/typescript/lib/lib.d.ts +0 -22
  40. package/packages/packet/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  41. package/packages/packet/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  42. package/packages/packet/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  43. package/packages/packet/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  44. package/packages/packet/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  45. package/packages/packet/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  46. package/packages/packet/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  47. package/packages/packet/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  48. package/packages/packet/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  49. package/packages/packet/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  50. package/packages/packet/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  51. package/packages/packet/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  52. package/packages/packet/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  53. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  54. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  55. package/packages/packet/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  56. package/packages/packet/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  57. package/packages/packet/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  58. package/packages/packet/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  59. package/packages/packet/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  60. package/packages/packet/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  61. package/packages/packet/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  62. package/packages/packet/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  63. package/packages/packet/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  64. package/packages/packet/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  65. package/packages/packet/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  66. package/packages/packet/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  67. package/packages/packet/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  68. package/packages/packet/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  69. package/packages/packet/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  70. package/packages/packet/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  71. package/packages/packet/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  72. package/packages/packet/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  73. package/packages/packet/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  74. package/packages/packet/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  75. package/packages/packet/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  76. package/packages/packet/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  77. package/packages/packet/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  78. package/packages/packet/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  79. package/packages/packet/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  80. package/packages/packet/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  81. package/packages/packet/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  82. package/packages/packet/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  83. package/packages/packet/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  84. package/packages/packet/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  85. package/packages/packet/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  86. package/packages/packet/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  87. package/packages/packet/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  88. package/packages/packet/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  89. package/packages/packet/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  90. package/packages/packet/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  91. package/packages/packet/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  92. package/packages/packet/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  93. package/packages/packet/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  94. package/packages/packet/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  95. package/packages/packet/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  96. package/packages/packet/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  97. package/packages/packet/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  98. package/packages/packet/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  99. package/packages/packet/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  100. package/packages/packet/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  101. package/packages/packet/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  102. package/packages/packet/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  103. package/packages/packet/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  104. package/packages/packet/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  105. package/packages/packet/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  106. package/packages/packet/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  107. package/packages/packet/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  108. package/packages/packet/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  109. package/packages/packet/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  110. package/packages/packet/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  111. package/packages/packet/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  112. package/packages/packet/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  113. package/packages/packet/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  114. package/packages/packet/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  115. package/packages/packet/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  116. package/packages/packet/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  117. package/packages/packet/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  118. package/packages/packet/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  119. package/packages/packet/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  120. package/packages/packet/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  121. package/packages/packet/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  122. package/packages/packet/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  123. package/packages/packet/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  124. package/packages/packet/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  125. package/packages/packet/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  126. package/packages/packet/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  127. package/packages/packet/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  128. package/packages/packet/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  129. package/packages/packet/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  130. package/packages/packet/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  131. package/packages/packet/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  132. package/packages/packet/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  133. package/packages/packet/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  134. package/packages/packet/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  135. package/packages/packet/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  136. package/packages/packet/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  137. package/packages/packet/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  138. package/packages/packet/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  139. package/packages/packet/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  140. package/packages/packet/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  141. package/packages/packet/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  142. package/packages/packet/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  143. package/packages/packet/node_modules/typescript/lib/tsc.js +0 -8
  144. package/packages/packet/node_modules/typescript/lib/tsserver.js +0 -8
  145. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  146. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  147. package/packages/packet/node_modules/typescript/lib/typesMap.json +0 -497
  148. package/packages/packet/node_modules/typescript/lib/typescript.d.ts +0 -11437
  149. package/packages/packet/node_modules/typescript/lib/typescript.js +0 -200276
  150. package/packages/packet/node_modules/typescript/lib/typingsInstaller.js +0 -8
  151. package/packages/packet/node_modules/typescript/lib/watchGuard.js +0 -53
  152. package/packages/packet/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  153. package/packages/packet/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  154. package/packages/packet/node_modules/typescript/package.json +0 -120
  155. package/templates/extension/README.md +0 -69
@@ -83,10 +83,19 @@ export async function build(root = process.cwd()) {
83
83
  * Release build (Production ready folder)
84
84
  */
85
85
  export async function release(root = process.cwd()) {
86
- const dist = await build(root);
87
86
  const buildDir = path.join(root, "build");
88
87
 
89
- // Read config
88
+ // Step 1: Pre-build (Production mode)
89
+ // Run production build to generate 'dist' folder
90
+ const dist = await build(root);
91
+
92
+ // Step 2: Clear or ensure build dir
93
+ if (fs.existsSync(buildDir)) {
94
+ fs.rmSync(buildDir, { recursive: true, force: true });
95
+ }
96
+ fs.mkdirSync(buildDir, { recursive: true });
97
+
98
+ // Step 3: Read config and files list
90
99
  let config = {};
91
100
  const configPath = fs.existsSync(path.join(root, "tanfig.json"))
92
101
  ? path.join(root, "tanfig.json")
@@ -100,49 +109,63 @@ export async function release(root = process.cwd()) {
100
109
  } catch (e) { }
101
110
  }
102
111
 
103
- const filesToCopy = config.build && config.build.files ? config.build.files : ["public", "static", "db", "config", "tanfig.json", "titan.json"];
104
-
105
- // Clear or ensure build dir
106
- if (fs.existsSync(buildDir)) {
107
- fs.rmSync(buildDir, { recursive: true, force: true });
108
- }
109
- fs.mkdirSync(buildDir, { recursive: true });
110
-
111
- // 1. Copy dist
112
- copyDir(dist, path.join(buildDir, "dist"));
112
+ // Default files to copy from root
113
+ const defaultFiles = ["public", "static", "db", "config", "views", "auth"];
114
+ const userFiles = config.build && Array.isArray(config.build.files) ? config.build.files : [];
115
+ const filesToCopy = Array.from(new Set([...defaultFiles, ...userFiles]));
113
116
 
114
- // 2. Extra files/folders from root based on config
117
+ // Step 4: Copy Files & Folders from root and app folders to build
115
118
  for (const item of filesToCopy) {
119
+ // Check root first, then app/ folder
116
120
  const src = path.join(root, item);
121
+ const appSrc = path.join(root, "app", item);
122
+ const dest = path.join(buildDir, item);
123
+
117
124
  if (fs.existsSync(src)) {
118
- const dest = path.join(buildDir, item);
119
125
  copyDir(src, dest);
126
+ } else if (fs.existsSync(appSrc)) {
127
+ const appDest = path.join(buildDir, "app", item);
128
+ copyDir(appSrc, appDest);
120
129
  }
121
130
  }
122
131
 
123
- // 3. Copy package.json & tanfig.json
124
- const pkgPath = path.join(root, "package.json");
125
- if (fs.existsSync(pkgPath)) {
126
- fs.copyFileSync(pkgPath, path.join(buildDir, "package.json"));
127
- }
128
- const tanfigPath = path.join(root, "tanfig.json");
129
- if (fs.existsSync(tanfigPath)) {
130
- fs.copyFileSync(tanfigPath, path.join(buildDir, "tanfig.json"));
131
- }
132
- const titanConfigPath = path.join(root, "titan.json");
133
- if (fs.existsSync(titanConfigPath)) {
134
- fs.copyFileSync(titanConfigPath, path.join(buildDir, "titan.json"));
132
+ // Step 5: Copy generated 'dist' (static routes/actions metadata)
133
+ copyDir(dist, path.join(buildDir, "dist"));
134
+
135
+ // Step 6: Copy essential config files (mandatory for runtime)
136
+ const essentials = ["package.json", "tanfig.json", "titan.json"];
137
+ for (const f of essentials) {
138
+ const src = path.join(root, f);
139
+ if (fs.existsSync(src)) {
140
+ fs.copyFileSync(src, path.join(buildDir, f));
141
+ }
135
142
  }
136
143
 
137
- // 4. Create .env
144
+ // Step 7: Create .env for production
138
145
  fs.writeFileSync(path.join(buildDir, ".env"), "TITAN_DEV=0\n");
139
146
 
140
- // 5. Extract extensions
147
+ // Step 8: Extract Extensions
141
148
  const extDir = path.join(buildDir, ".ext");
142
149
  fs.mkdirSync(extDir, { recursive: true });
143
150
 
144
151
  const nodeModules = path.join(root, "node_modules");
145
152
  if (fs.existsSync(nodeModules)) {
153
+ const localPkgs = path.resolve(root, "../../packages");
154
+ if (fs.existsSync(localPkgs)) {
155
+ const pkgs = fs.readdirSync(localPkgs);
156
+ for (const pkg of pkgs) {
157
+ const pkgPath = path.join(localPkgs, pkg);
158
+ const titanJsonPath = path.join(pkgPath, "titan.json");
159
+ if (fs.existsSync(titanJsonPath)) {
160
+ try {
161
+ const config = JSON.parse(fs.readFileSync(titanJsonPath, "utf8"));
162
+ const extName = config.name;
163
+ const dest = path.join(extDir, extName.includes("/") ? extName : extName);
164
+ copyDir(pkgPath, dest);
165
+ } catch(e) {}
166
+ }
167
+ }
168
+ }
146
169
  const findExtensions = (dir, depth = 0) => {
147
170
  if (depth > 2) return;
148
171
  if (!fs.existsSync(dir)) return;
@@ -164,6 +187,8 @@ export async function release(root = process.cwd()) {
164
187
  }
165
188
 
166
189
  const destPath = path.join(extDir, targetPkgName);
190
+ if (fs.existsSync(destPath)) continue; // Don't overwrite monorepo packages
191
+
167
192
  fs.mkdirSync(path.dirname(destPath), { recursive: true });
168
193
 
169
194
  copyDir(fullPath, destPath, (src) => {
@@ -178,98 +203,65 @@ export async function release(root = process.cwd()) {
178
203
  }
179
204
  };
180
205
  findExtensions(nodeModules);
181
- }
182
-
183
- // 6. Copy Engine binaries
184
- if (fs.existsSync(path.join(nodeModules, "@titanpl"))) {
185
- const scopeDir = path.join(nodeModules, "@titanpl");
186
- const folders = fs.readdirSync(scopeDir);
187
- for (const folder of folders) {
188
- if (folder.startsWith("engine-")) {
189
- const engineDest = path.join(extDir, "@titanpl", folder);
190
- copyDir(path.join(scopeDir, folder), engineDest);
191
- }
192
- }
193
- }
194
206
 
195
- // 7. Create node_modules junction to .ext for engine resolution
196
- // If env is 'deploy' or 'production', we might want to skip this for a cleaner build
197
- const buildEnv = config.build && (config.build.env || config.build.purpose) ? (config.build.env || config.build.purpose) : "test";
198
-
199
- if (buildEnv !== "deploy" && buildEnv !== "production") {
200
- const nmSymlink = path.join(buildDir, "node_modules");
201
- if (!fs.existsSync(nmSymlink)) {
202
- try {
203
- // Junctions don't require admin on Windows
204
- fs.symlinkSync(".ext", nmSymlink, "junction");
205
- } catch (e) {
206
- try {
207
- fs.symlinkSync(".ext", nmSymlink, "dir");
208
- } catch (e2) {
209
- // Fallback or ignore if symlink creation is totally restricted
207
+ // Also copy engine binaries if they exist in node_modules
208
+ if (fs.existsSync(path.join(nodeModules, "@titanpl"))) {
209
+ const scopeDir = path.join(nodeModules, "@titanpl");
210
+ const folders = fs.readdirSync(scopeDir);
211
+ for (const folder of folders) {
212
+ if (folder.startsWith("engine-") || folder.startsWith("runtime-")) {
213
+ const engineDest = path.join(extDir, "@titanpl", folder);
214
+ copyDir(path.join(scopeDir, folder), engineDest);
210
215
  }
211
216
  }
212
217
  }
213
218
  }
214
219
 
215
- // 8. Create 'titan' executable link in the build root for easy starting
220
+ // Step 9: Copy/Extract titan-server binary to build root
216
221
  const binName = process.platform === "win32" ? "titan-server.exe" : "titan-server";
217
222
  let engineBin = null;
218
223
 
219
- // Strategy A: Search in the .ext we just populated
220
- const findInExt = (dir) => {
221
- if (!fs.existsSync(dir)) return null;
222
- const entries = fs.readdirSync(dir);
223
- for (const entry of entries) {
224
- const full = path.join(dir, entry);
225
- if (fs.statSync(full).isDirectory()) {
226
- // Check both pkgRoot/bin/titan-server and pkgRoot/titan-server (some layouts differ)
227
- const p1 = path.join(full, "bin", binName);
228
- if (fs.existsSync(p1)) return p1;
229
- const p2 = path.join(full, binName);
230
- if (fs.existsSync(p2)) return p2;
231
-
232
- const found = findInExt(full);
233
- if (found) return found;
234
- }
235
- }
236
- return null;
224
+ // Search in .ext
225
+ const searchBin = (dir) => {
226
+ if (!fs.existsSync(dir)) return null;
227
+ const entries = fs.readdirSync(dir);
228
+ for (const e of entries) {
229
+ const full = path.join(dir, e);
230
+ if (fs.statSync(full).isDirectory()) {
231
+ const p1 = path.join(full, "bin", binName);
232
+ if (fs.existsSync(p1)) return p1;
233
+ const p2 = path.join(full, binName);
234
+ if (fs.existsSync(p2)) return p2;
235
+ const found = searchBin(full);
236
+ if (found) return found;
237
+ }
238
+ }
239
+ return null;
237
240
  };
241
+ engineBin = searchBin(extDir);
238
242
 
239
- engineBin = findInExt(extDir);
240
-
241
- // Strategy B: Monorepo fallback (if building inside the titanpl repo)
243
+ // Fallback to monorepo binary (if building in repo)
242
244
  if (!engineBin) {
243
- let current = root;
244
- for (let i = 0; i < 5; i++) {
245
- const potential = path.join(current, "engine", "target", "release", binName);
246
- if (fs.existsSync(potential)) {
247
- engineBin = potential;
248
- break;
249
- }
250
- const parent = path.dirname(current);
251
- if (parent === current) break;
252
- current = parent;
245
+ let curr = root;
246
+ for(let i=0; i<3; i++) {
247
+ const potential = path.join(curr, "engine", "target", "release", binName);
248
+ if (fs.existsSync(potential)) {
249
+ engineBin = potential;
250
+ break;
251
+ }
252
+ curr = path.dirname(curr);
253
253
  }
254
254
  }
255
255
 
256
256
  if (engineBin) {
257
- const linkName = binName; // Keep the original name 'titan-server'
258
- const linkPath = path.join(buildDir, linkName);
259
-
260
- if (!fs.existsSync(linkPath)) {
261
- try {
262
- // Always copy the binary to the root for maximum portability in the 'build' folder
263
- fs.copyFileSync(engineBin, linkPath);
264
- if (process.platform !== "win32") {
265
- fs.chmodSync(linkPath, 0o755);
266
- }
267
- } catch (e) {
268
- console.error(`[Titan] Failed to create titan binary: ${e.message}`);
269
- }
270
- }
257
+ const destBin = path.join(buildDir, binName);
258
+ fs.copyFileSync(engineBin, destBin);
259
+ if (process.platform !== "win32") fs.chmodSync(destBin, 0o755);
271
260
  }
272
261
 
262
+ // Step 10: In production builds, we DON'T use symlinks for node_modules.
263
+ // Instead, the engine knows to look in .ext.
264
+
273
265
  return buildDir;
274
266
  }
275
267
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/packet",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
4
4
  "description": "The bundler for TitanPl servers.",
5
5
  "keywords": [
6
6
  "bundler",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/route",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
4
4
  "description": "Titan routing DSL",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/sdk",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
4
4
  "description": "The official SDK for Titan Planet extensions and testing.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -3,8 +3,10 @@
3
3
  "description": "A powerful TitanPL project",
4
4
  "version": "1.0.0",
5
5
  "extensions": {
6
- "allowWasm": false,
7
- "allowNative": []
6
+ "allowWasm": true,
7
+ "allowNative": [
8
+ "@titanpl/core"
9
+ ]
8
10
  },
9
11
  "build": {
10
12
  "purpose": "test",
@@ -0,0 +1,38 @@
1
+ # TitanPL Native & WebAssembly Extensions
2
+
3
+ One of the definitive features of TitanPL v7+ is its dynamic, zero-configuration native extension bridge. You no longer have to manually define function signatures or types within `titan.json`.
4
+
5
+ ## The Hybrid IPC Native Bridge
6
+
7
+ The `NativeHost` bridge natively detects argument types over IPC at runtime. Whether you pass floating-point numbers (`f64`), complex strings, or JSON-stringified objects:
8
+
9
+ 1. **Dynamic C-ABI Interop:** The host inspects the payload dynamically and generates the correct C-struct register combinations on-the-fly (`f64`, `*const c_char`, combinations).
10
+ 2. **Safe Void execution:** Memory protections natively peek at returned pointer segments, preventing SEGFAULT crashes. `void` returns are safely handled transparently.
11
+
12
+ ### Writing WebAssembly (WASM)
13
+
14
+ Because Titan CLI utilizes `wasm-pack` without unnecessary logs, compiling WebAssembly plugins from Rust is completely silent and incredibly robust.
15
+
16
+ To build a fresh, silent WASM extension:
17
+ ```bash
18
+ titan build ext
19
+ ```
20
+ The CLI suppresses stdout output (`stdio: 'ignore'`) allowing clean build processes unless a fatal compiler failure occurs.
21
+
22
+ ### Best Practices: The `@titanpl/native` Namespace
23
+
24
+ Never use the globally injected `t.*` prefixes in Modern TitanPL scripts (unless deploying backward-compatible code). Instead, simply use the modular native imports:
25
+
26
+ ```js
27
+ // BEFORE (Not Recommended)
28
+ const data = t.fs.readFile("example.txt");
29
+ const hash = t.crypto.hash("sha256", "test");
30
+
31
+ // AFTER (Recommended)
32
+ import { fs, crypto, drift } from "@titanpl/native";
33
+
34
+ const data = fs.readFile("example.txt");
35
+ const hash = crypto.hash("sha256", "test");
36
+ ```
37
+
38
+ By transitioning to `@titanpl/native`, you gain absolute Type Completion (via the newly restructured `d.ts` declaration maps) explicitly tailored to ESM semantics.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-extension",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
4
4
  "description": "A high-performance TitanPL extension.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,6 +11,6 @@
11
11
  "README.md"
12
12
  ],
13
13
  "dependencies": {
14
- "@titanpl/sdk": "7.0.0-beta"
14
+ "@titanpl/sdk": "7.0.1"
15
15
  }
16
16
  }
@@ -6,16 +6,16 @@
6
6
  "template": "js"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "7.0.0-beta",
10
- "@titanpl/route": "7.0.0-beta",
11
- "@titanpl/native": "7.0.0-beta",
12
- "@titanpl/core": "latest",
9
+ "@titanpl/cli": "7.0.1",
10
+ "@titanpl/route": "7.0.1",
11
+ "@titanpl/native": "7.0.1",
12
+ "@titanpl/core": "7.0.0",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "7.0.0-beta"
14
+ "@titanpl/packet": "7.0.1"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@titanpl/engine-linux-x64": "7.0.0-beta",
18
- "@titanpl/engine-win32-x64": "7.0.0-beta"
17
+ "@titanpl/engine-linux-x64": "7.0.1",
18
+ "@titanpl/engine-win32-x64": "7.0.1"
19
19
  },
20
20
  "scripts": {
21
21
  "build": "titan build",
@@ -28,5 +28,5 @@
28
28
  "eslint": "^9.39.2",
29
29
  "eslint-plugin-titanpl": "latest"
30
30
  },
31
- "version": "7.0.0-beta"
31
+ "version": "7.0.1"
32
32
  }
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
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": "7.0.0-beta",
11
- "@titanpl/route": "7.0.0-beta",
12
- "@titanpl/native": "7.0.0-beta",
13
- "@titanpl/core": "latest",
10
+ "@titanpl/cli": "7.0.1",
11
+ "@titanpl/route": "7.0.1",
12
+ "@titanpl/native": "7.0.1",
13
+ "@titanpl/core": "7.0.0",
14
14
  "@titanpl/node": "latest"
15
15
  },
16
16
  "scripts": {
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "7.0.0-beta",
3
+ "version": "7.0.1",
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": "7.0.0-beta",
11
- "@titanpl/route": "7.0.0-beta",
12
- "@titanpl/native": "7.0.0-beta",
13
- "@titanpl/core": "latest",
10
+ "@titanpl/cli": "7.0.1",
11
+ "@titanpl/route": "7.0.1",
12
+ "@titanpl/native": "7.0.1",
13
+ "@titanpl/core": "7.0.0",
14
14
  "@titanpl/node": "latest",
15
15
  "typescript": "^5.0.0"
16
16
  },
@@ -6,18 +6,18 @@
6
6
  "template": "ts"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "7.0.0-beta",
10
- "@titanpl/route": "7.0.0-beta",
11
- "@titanpl/native": "7.0.0-beta",
12
- "@titanpl/core": "latest",
9
+ "@titanpl/cli": "7.0.1",
10
+ "@titanpl/route": "7.0.1",
11
+ "@titanpl/native": "7.0.1",
12
+ "@titanpl/core": "7.0.0",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "7.0.0-beta",
14
+ "@titanpl/packet": "7.0.1",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "optionalDependencies": {
18
18
  "@titanpl/engine-linux-arm64": "2.0.5",
19
- "@titanpl/engine-linux-x64": "7.0.0-beta",
20
- "@titanpl/engine-win32-x64": "7.0.0-beta"
19
+ "@titanpl/engine-linux-x64": "7.0.1",
20
+ "@titanpl/engine-win32-x64": "7.0.1"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "titan build",
@@ -31,5 +31,5 @@
31
31
  "eslint-plugin-titanpl": "latest",
32
32
  "@typescript-eslint/parser": "^8.54.0"
33
33
  },
34
- "version": "7.0.0-beta"
34
+ "version": "7.0.1"
35
35
  }
@@ -1,55 +0,0 @@
1
- Apache License
2
-
3
- Version 2.0, January 2004
4
-
5
- http://www.apache.org/licenses/
6
-
7
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
-
9
- 1. Definitions.
10
-
11
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
-
17
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
-
19
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
-
21
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
-
23
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
-
25
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
-
27
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
-
29
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
-
31
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
-
33
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
-
35
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
-
37
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
-
39
- You must cause any modified files to carry prominent notices stating that You changed the files; and
40
-
41
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
-
43
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
-
45
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
-
47
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
-
49
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
-
51
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
-
53
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
-
55
- END OF TERMS AND CONDITIONS
@@ -1,50 +0,0 @@
1
-
2
- # TypeScript
3
-
4
- [![CI](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml)
5
- [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
6
- [![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
7
- [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://securityscorecards.dev/viewer/?uri=github.com/microsoft/TypeScript)
8
-
9
-
10
- [TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
11
-
12
- Find others who are using TypeScript at [our community page](https://www.typescriptlang.org/community/).
13
-
14
- ## Installing
15
-
16
- For the latest stable version:
17
-
18
- ```bash
19
- npm install -D typescript
20
- ```
21
-
22
- For our nightly builds:
23
-
24
- ```bash
25
- npm install -D typescript@next
26
- ```
27
-
28
- ## Contribute
29
-
30
- There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript.
31
- * [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32
- * Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
33
- * Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
34
- * Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
35
- * Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
36
- * [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
37
-
38
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
39
- the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
40
- with any additional questions or comments.
41
-
42
- ## Documentation
43
-
44
- * [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
45
- * [Programming handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
46
- * [Homepage](https://www.typescriptlang.org/)
47
-
48
- ## Roadmap
49
-
50
- For details on our planned features and future direction, please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
@@ -1,41 +0,0 @@
1
- <!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2
-
3
- ## Security
4
-
5
- Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6
-
7
- If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8
-
9
- ## Reporting Security Issues
10
-
11
- **Please do not report security vulnerabilities through public GitHub issues.**
12
-
13
- Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14
-
15
- If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16
-
17
- You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
-
19
- Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
-
21
- * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
- * Full paths of source file(s) related to the manifestation of the issue
23
- * The location of the affected source code (tag/branch/commit or direct URL)
24
- * Any special configuration required to reproduce the issue
25
- * Step-by-step instructions to reproduce the issue
26
- * Proof-of-concept or exploit code (if possible)
27
- * Impact of the issue, including how an attacker might exploit the issue
28
-
29
- This information will help us triage your report more quickly.
30
-
31
- If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32
-
33
- ## Preferred Languages
34
-
35
- We prefer all communications to be in English.
36
-
37
- ## Policy
38
-
39
- Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40
-
41
- <!-- END MICROSOFT SECURITY.MD BLOCK -->