titanpl 2.0.1 → 2.0.2

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 (42) hide show
  1. package/package.json +1 -1
  2. package/packages/cli/README.md +17 -17
  3. package/packages/cli/index.js +160 -160
  4. package/packages/cli/package.json +5 -5
  5. package/packages/cli/src/commands/build.js +5 -5
  6. package/packages/cli/src/commands/dev.js +12 -12
  7. package/packages/cli/src/commands/init.js +196 -174
  8. package/packages/cli/src/commands/migrate.js +124 -124
  9. package/packages/cli/src/commands/start.js +4 -4
  10. package/packages/cli/src/commands/update.js +90 -90
  11. package/packages/cli/src/engine.js +152 -152
  12. package/packages/engine-darwin-arm64/README.md +13 -13
  13. package/packages/engine-darwin-arm64/package.json +1 -1
  14. package/packages/engine-linux-x64/README.md +11 -11
  15. package/packages/engine-linux-x64/package.json +1 -1
  16. package/packages/engine-win32-x64/README.md +11 -11
  17. package/packages/engine-win32-x64/package.json +1 -1
  18. package/packages/native/README.md +11 -11
  19. package/packages/native/index.d.ts +41 -41
  20. package/packages/native/index.js +39 -39
  21. package/packages/native/package.json +1 -1
  22. package/packages/packet/README.md +11 -11
  23. package/packages/packet/index.js +83 -83
  24. package/packages/packet/js/titan/builder.js +50 -50
  25. package/packages/packet/js/titan/bundle.js +164 -164
  26. package/packages/packet/js/titan/dev.js +14 -8
  27. package/packages/packet/js/titan/error-box.js +277 -277
  28. package/packages/packet/package.json +1 -1
  29. package/packages/packet/ts/titan/bundle.js +227 -227
  30. package/packages/packet/ts/titan/dev.js +14 -9
  31. package/packages/packet/ts/titan/error-box.js +277 -277
  32. package/packages/route/README.md +24 -24
  33. package/packages/route/index.d.ts +16 -16
  34. package/packages/route/index.js +52 -52
  35. package/packages/route/package.json +1 -1
  36. package/templates/common/_gitignore +1 -1
  37. package/templates/extension/package.json +2 -2
  38. package/templates/js/package.json +5 -5
  39. package/templates/rust-js/package.json +4 -4
  40. package/templates/rust-ts/package.json +4 -4
  41. package/templates/ts/package.json +5 -5
  42. package/titanpl-sdk/package.json +1 -1
@@ -1,277 +1,277 @@
1
- /**
2
- * Error Box Renderer
3
- * Renders errors in a Next.js-style red terminal box
4
- */
5
-
6
- import fs from 'fs';
7
- import path from 'path';
8
- import { createRequire } from 'module';
9
- import { execSync } from 'child_process';
10
- import { fileURLToPath } from 'url';
11
-
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
-
15
- // Simple color function using ANSI escape codes
16
- const red = (text) => `\x1b[31m${text}\x1b[0m`;
17
-
18
- /**
19
- * Wraps text to fit within a specified width
20
- * @param {string} text - Text to wrap
21
- * @param {number} maxWidth - Maximum width per line
22
- * @returns {string[]} Array of wrapped lines
23
- */
24
-
25
- function getTitanVersion() {
26
- try {
27
- const require = createRequire(import.meta.url);
28
- const pkgPath = require.resolve("titanpl/package.json");
29
- return JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version;
30
- } catch (e) {
31
- try {
32
- let cur = __dirname;
33
- for (let i = 0; i < 5; i++) {
34
- const pkgPath = path.join(cur, "package.json");
35
- if (fs.existsSync(pkgPath)) {
36
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
37
- if (pkg.name === "titanpl") return pkg.version;
38
- }
39
- cur = path.join(cur, "..");
40
- }
41
- } catch (e2) { }
42
-
43
- try {
44
- const output = execSync("titan --version", { encoding: "utf-8" }).trim();
45
- const match = output.match(/v(\d+\.\d+\.\d+)/);
46
- if (match) return match[1];
47
- } catch (e3) { }
48
- }
49
- return "0.1.0";
50
- }
51
-
52
- function wrapText(text, maxWidth) {
53
- if (!text) return [''];
54
-
55
- const lines = text.split('\n');
56
- const wrapped = [];
57
-
58
- for (const line of lines) {
59
- if (line.length <= maxWidth) {
60
- wrapped.push(line);
61
- continue;
62
- }
63
-
64
- // Word wrap logic
65
- const words = line.split(' ');
66
- let currentLine = '';
67
-
68
- for (const word of words) {
69
- const testLine = currentLine ? `${currentLine} ${word}` : word;
70
-
71
- if (testLine.length <= maxWidth) {
72
- currentLine = testLine;
73
- } else {
74
- if (currentLine) {
75
- wrapped.push(currentLine);
76
- }
77
- // If single word is too long, force split it
78
- if (word.length > maxWidth) {
79
- let remaining = word;
80
- while (remaining.length > maxWidth) {
81
- wrapped.push(remaining.substring(0, maxWidth));
82
- remaining = remaining.substring(maxWidth);
83
- }
84
- currentLine = remaining;
85
- } else {
86
- currentLine = word;
87
- }
88
- }
89
- }
90
-
91
- if (currentLine) {
92
- wrapped.push(currentLine);
93
- }
94
- }
95
-
96
- return wrapped.length > 0 ? wrapped : [''];
97
- }
98
-
99
- /**
100
- * Pads text to fit within box width
101
- * @param {string} text - Text to pad
102
- * @param {number} width - Target width
103
- * @returns {string} Padded text
104
- */
105
- function padLine(text, width) {
106
- const padding = width - text.length;
107
- return text + ' '.repeat(Math.max(0, padding));
108
- }
109
-
110
- /**
111
- * Renders an error in a Next.js-style red box
112
- * @param {Object} errorInfo - Error information
113
- * @param {string} errorInfo.title - Error title (e.g., "Build Error")
114
- * @param {string} errorInfo.file - File path where error occurred
115
- * @param {string} errorInfo.message - Error message
116
- * @param {string} [errorInfo.location] - Error location (e.g., "at hello.js:3:1")
117
- * @param {number} [errorInfo.line] - Line number
118
- * @param {number} [errorInfo.column] - Column number
119
- * @param {string} [errorInfo.codeFrame] - Code frame showing error context
120
- * @param {string} [errorInfo.suggestion] - Recommended fix
121
- */
122
- /**
123
- * Renders an error in a Next.js-style red box
124
- * @param {Object} errorInfo - Error information
125
- * @param {string} errorInfo.title - Error title (e.g., "Build Error")
126
- * @param {string} errorInfo.file - File path where error occurred
127
- * @param {string} errorInfo.message - Error message
128
- * @param {string} [errorInfo.location] - Error location (e.g., "at hello.js:3:1")
129
- * @param {number} [errorInfo.line] - Line number
130
- * @param {number} [errorInfo.column] - Column number
131
- * @param {string} [errorInfo.codeFrame] - Code frame showing error context
132
- * @param {string} [errorInfo.suggestion] - Recommended fix
133
- */
134
- export function renderErrorBox(errorInfo) {
135
- const boxWidth = 72;
136
- const contentWidth = boxWidth - 4; // Account for "│ " and " │"
137
-
138
- const lines = [];
139
-
140
- // Add title
141
- if (errorInfo.title) {
142
- lines.push(bold(errorInfo.title));
143
- }
144
-
145
- // Add file path
146
- if (errorInfo.file) {
147
- lines.push(errorInfo.file);
148
- }
149
-
150
- // Add message
151
- if (errorInfo.message) {
152
- lines.push('');
153
- lines.push(...wrapText(errorInfo.message, contentWidth));
154
- }
155
-
156
- // Add location
157
- if (errorInfo.location) {
158
- lines.push(gray(errorInfo.location));
159
- } else if (errorInfo.file && errorInfo.line !== undefined) {
160
- const loc = `at ${errorInfo.file}:${errorInfo.line}${errorInfo.column !== undefined ? `:${errorInfo.column}` : ''}`;
161
- lines.push(gray(loc));
162
- }
163
-
164
- // Add code frame if available
165
- if (errorInfo.codeFrame) {
166
- lines.push(''); // Empty line for separation
167
- const frameLines = errorInfo.codeFrame.split('\n');
168
- for (const frameLine of frameLines) {
169
- lines.push(frameLine);
170
- }
171
- }
172
-
173
- // Add suggestion if available
174
- if (errorInfo.suggestion) {
175
- lines.push(''); // Empty line for separation
176
- lines.push(...wrapText('Recommended fix: ' + errorInfo.suggestion, contentWidth));
177
- }
178
-
179
- // Add Footer with Branding
180
- lines.push('');
181
- const version = getTitanVersion()
182
- lines.push(gray(`⏣ Titan Planet ${version}`));
183
-
184
- // Build the box
185
- const topBorder = '┌' + '─'.repeat(boxWidth - 2) + '┐';
186
- const bottomBorder = '└' + '─'.repeat(boxWidth - 2) + '┘';
187
-
188
-
189
- const boxLines = [
190
- red(topBorder),
191
- ...lines.map(line => {
192
- // Strip ANSI codes for padding calculation if any were added
193
- const plainLine = line.replace(/\x1b\[\d+m/g, '');
194
- const padding = ' '.repeat(Math.max(0, contentWidth - plainLine.length));
195
- return red('│ ') + line + padding + red(' │');
196
- }),
197
- red(bottomBorder)
198
- ];
199
-
200
- return boxLines.join('\n');
201
- }
202
-
203
- // Internal formatting helpers
204
- function gray(t) { return `\x1b[90m${t}\x1b[0m`; }
205
- function bold(t) { return `\x1b[1m${t}\x1b[0m`; }
206
-
207
- /**
208
- * Parses esbuild error and extracts relevant information
209
- * @param {Object} error - esbuild error object
210
- * @returns {Object} Parsed error information
211
- */
212
- export function parseEsbuildError(error) {
213
- const errorInfo = {
214
- title: 'Build Error',
215
- file: error.location?.file || 'unknown',
216
- message: error.text || error.message || 'Unknown error',
217
- line: error.location?.line,
218
- column: error.location?.column,
219
- location: null,
220
- codeFrame: null,
221
- suggestion: error.notes?.[0]?.text || null
222
- };
223
-
224
- // Format location
225
- if (error.location) {
226
- const { file, line, column } = error.location;
227
- errorInfo.location = `at ${file}:${line}:${column}`;
228
-
229
- // Format code frame if lineText is available
230
- if (error.location.lineText) {
231
- const lineText = error.location.lineText;
232
- // Ensure column is at least 1 to prevent negative values
233
- const col = Math.max(0, (column || 1) - 1);
234
- const pointer = ' '.repeat(col) + '^';
235
- errorInfo.codeFrame = `${line} | ${lineText}\n${' '.repeat(String(line).length)} | ${pointer}`;
236
- }
237
- }
238
-
239
- return errorInfo;
240
- }
241
-
242
- /**
243
- * Parses Node.js syntax error and extracts relevant information
244
- * @param {Error} error - Node.js error object
245
- * @param {string} [file] - File path (if known)
246
- * @returns {Object} Parsed error information
247
- */
248
- export function parseNodeError(error, file = null) {
249
- const errorInfo = {
250
- title: 'Syntax Error',
251
- file: file || 'unknown',
252
- message: error.message || 'Unknown error',
253
- location: null,
254
- suggestion: null
255
- };
256
-
257
- // Try to extract line and column from error message
258
- const locationMatch = error.message.match(/\((\d+):(\d+)\)/) ||
259
- error.stack?.match(/:(\d+):(\d+)/);
260
-
261
- if (locationMatch) {
262
- const line = parseInt(locationMatch[1]);
263
- const column = parseInt(locationMatch[2]);
264
- errorInfo.line = line;
265
- errorInfo.column = column;
266
- errorInfo.location = `at ${errorInfo.file}:${line}:${column}`;
267
- }
268
-
269
- // Extract suggestion from error message if available
270
- if (error.message.includes('expected')) {
271
- errorInfo.suggestion = 'Check for missing or misplaced syntax elements';
272
- } else if (error.message.includes('Unexpected token')) {
273
- errorInfo.suggestion = 'Remove or fix the unexpected token';
274
- }
275
-
276
- return errorInfo;
277
- }
1
+ /**
2
+ * Error Box Renderer
3
+ * Renders errors in a Next.js-style red terminal box
4
+ */
5
+
6
+ import fs from 'fs';
7
+ import path from 'path';
8
+ import { createRequire } from 'module';
9
+ import { execSync } from 'child_process';
10
+ import { fileURLToPath } from 'url';
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+
15
+ // Simple color function using ANSI escape codes
16
+ const red = (text) => `\x1b[31m${text}\x1b[0m`;
17
+
18
+ /**
19
+ * Wraps text to fit within a specified width
20
+ * @param {string} text - Text to wrap
21
+ * @param {number} maxWidth - Maximum width per line
22
+ * @returns {string[]} Array of wrapped lines
23
+ */
24
+
25
+ function getTitanVersion() {
26
+ try {
27
+ const require = createRequire(import.meta.url);
28
+ const pkgPath = require.resolve("titanpl/package.json");
29
+ return JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version;
30
+ } catch (e) {
31
+ try {
32
+ let cur = __dirname;
33
+ for (let i = 0; i < 5; i++) {
34
+ const pkgPath = path.join(cur, "package.json");
35
+ if (fs.existsSync(pkgPath)) {
36
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
37
+ if (pkg.name === "titanpl") return pkg.version;
38
+ }
39
+ cur = path.join(cur, "..");
40
+ }
41
+ } catch (e2) { }
42
+
43
+ try {
44
+ const output = execSync("titan --version", { encoding: "utf-8" }).trim();
45
+ const match = output.match(/v(\d+\.\d+\.\d+)/);
46
+ if (match) return match[1];
47
+ } catch (e3) { }
48
+ }
49
+ return "0.1.0";
50
+ }
51
+
52
+ function wrapText(text, maxWidth) {
53
+ if (!text) return [''];
54
+
55
+ const lines = text.split('\n');
56
+ const wrapped = [];
57
+
58
+ for (const line of lines) {
59
+ if (line.length <= maxWidth) {
60
+ wrapped.push(line);
61
+ continue;
62
+ }
63
+
64
+ // Word wrap logic
65
+ const words = line.split(' ');
66
+ let currentLine = '';
67
+
68
+ for (const word of words) {
69
+ const testLine = currentLine ? `${currentLine} ${word}` : word;
70
+
71
+ if (testLine.length <= maxWidth) {
72
+ currentLine = testLine;
73
+ } else {
74
+ if (currentLine) {
75
+ wrapped.push(currentLine);
76
+ }
77
+ // If single word is too long, force split it
78
+ if (word.length > maxWidth) {
79
+ let remaining = word;
80
+ while (remaining.length > maxWidth) {
81
+ wrapped.push(remaining.substring(0, maxWidth));
82
+ remaining = remaining.substring(maxWidth);
83
+ }
84
+ currentLine = remaining;
85
+ } else {
86
+ currentLine = word;
87
+ }
88
+ }
89
+ }
90
+
91
+ if (currentLine) {
92
+ wrapped.push(currentLine);
93
+ }
94
+ }
95
+
96
+ return wrapped.length > 0 ? wrapped : [''];
97
+ }
98
+
99
+ /**
100
+ * Pads text to fit within box width
101
+ * @param {string} text - Text to pad
102
+ * @param {number} width - Target width
103
+ * @returns {string} Padded text
104
+ */
105
+ function padLine(text, width) {
106
+ const padding = width - text.length;
107
+ return text + ' '.repeat(Math.max(0, padding));
108
+ }
109
+
110
+ /**
111
+ * Renders an error in a Next.js-style red box
112
+ * @param {Object} errorInfo - Error information
113
+ * @param {string} errorInfo.title - Error title (e.g., "Build Error")
114
+ * @param {string} errorInfo.file - File path where error occurred
115
+ * @param {string} errorInfo.message - Error message
116
+ * @param {string} [errorInfo.location] - Error location (e.g., "at hello.js:3:1")
117
+ * @param {number} [errorInfo.line] - Line number
118
+ * @param {number} [errorInfo.column] - Column number
119
+ * @param {string} [errorInfo.codeFrame] - Code frame showing error context
120
+ * @param {string} [errorInfo.suggestion] - Recommended fix
121
+ */
122
+ /**
123
+ * Renders an error in a Next.js-style red box
124
+ * @param {Object} errorInfo - Error information
125
+ * @param {string} errorInfo.title - Error title (e.g., "Build Error")
126
+ * @param {string} errorInfo.file - File path where error occurred
127
+ * @param {string} errorInfo.message - Error message
128
+ * @param {string} [errorInfo.location] - Error location (e.g., "at hello.js:3:1")
129
+ * @param {number} [errorInfo.line] - Line number
130
+ * @param {number} [errorInfo.column] - Column number
131
+ * @param {string} [errorInfo.codeFrame] - Code frame showing error context
132
+ * @param {string} [errorInfo.suggestion] - Recommended fix
133
+ */
134
+ export function renderErrorBox(errorInfo) {
135
+ const boxWidth = 72;
136
+ const contentWidth = boxWidth - 4; // Account for "│ " and " │"
137
+
138
+ const lines = [];
139
+
140
+ // Add title
141
+ if (errorInfo.title) {
142
+ lines.push(bold(errorInfo.title));
143
+ }
144
+
145
+ // Add file path
146
+ if (errorInfo.file) {
147
+ lines.push(errorInfo.file);
148
+ }
149
+
150
+ // Add message
151
+ if (errorInfo.message) {
152
+ lines.push('');
153
+ lines.push(...wrapText(errorInfo.message, contentWidth));
154
+ }
155
+
156
+ // Add location
157
+ if (errorInfo.location) {
158
+ lines.push(gray(errorInfo.location));
159
+ } else if (errorInfo.file && errorInfo.line !== undefined) {
160
+ const loc = `at ${errorInfo.file}:${errorInfo.line}${errorInfo.column !== undefined ? `:${errorInfo.column}` : ''}`;
161
+ lines.push(gray(loc));
162
+ }
163
+
164
+ // Add code frame if available
165
+ if (errorInfo.codeFrame) {
166
+ lines.push(''); // Empty line for separation
167
+ const frameLines = errorInfo.codeFrame.split('\n');
168
+ for (const frameLine of frameLines) {
169
+ lines.push(frameLine);
170
+ }
171
+ }
172
+
173
+ // Add suggestion if available
174
+ if (errorInfo.suggestion) {
175
+ lines.push(''); // Empty line for separation
176
+ lines.push(...wrapText('Recommended fix: ' + errorInfo.suggestion, contentWidth));
177
+ }
178
+
179
+ // Add Footer with Branding
180
+ lines.push('');
181
+ const version = getTitanVersion()
182
+ lines.push(gray(`⏣ Titan Planet ${version}`));
183
+
184
+ // Build the box
185
+ const topBorder = '┌' + '─'.repeat(boxWidth - 2) + '┐';
186
+ const bottomBorder = '└' + '─'.repeat(boxWidth - 2) + '┘';
187
+
188
+
189
+ const boxLines = [
190
+ red(topBorder),
191
+ ...lines.map(line => {
192
+ // Strip ANSI codes for padding calculation if any were added
193
+ const plainLine = line.replace(/\x1b\[\d+m/g, '');
194
+ const padding = ' '.repeat(Math.max(0, contentWidth - plainLine.length));
195
+ return red('│ ') + line + padding + red(' │');
196
+ }),
197
+ red(bottomBorder)
198
+ ];
199
+
200
+ return boxLines.join('\n');
201
+ }
202
+
203
+ // Internal formatting helpers
204
+ function gray(t) { return `\x1b[90m${t}\x1b[0m`; }
205
+ function bold(t) { return `\x1b[1m${t}\x1b[0m`; }
206
+
207
+ /**
208
+ * Parses esbuild error and extracts relevant information
209
+ * @param {Object} error - esbuild error object
210
+ * @returns {Object} Parsed error information
211
+ */
212
+ export function parseEsbuildError(error) {
213
+ const errorInfo = {
214
+ title: 'Build Error',
215
+ file: error.location?.file || 'unknown',
216
+ message: error.text || error.message || 'Unknown error',
217
+ line: error.location?.line,
218
+ column: error.location?.column,
219
+ location: null,
220
+ codeFrame: null,
221
+ suggestion: error.notes?.[0]?.text || null
222
+ };
223
+
224
+ // Format location
225
+ if (error.location) {
226
+ const { file, line, column } = error.location;
227
+ errorInfo.location = `at ${file}:${line}:${column}`;
228
+
229
+ // Format code frame if lineText is available
230
+ if (error.location.lineText) {
231
+ const lineText = error.location.lineText;
232
+ // Ensure column is at least 1 to prevent negative values
233
+ const col = Math.max(0, (column || 1) - 1);
234
+ const pointer = ' '.repeat(col) + '^';
235
+ errorInfo.codeFrame = `${line} | ${lineText}\n${' '.repeat(String(line).length)} | ${pointer}`;
236
+ }
237
+ }
238
+
239
+ return errorInfo;
240
+ }
241
+
242
+ /**
243
+ * Parses Node.js syntax error and extracts relevant information
244
+ * @param {Error} error - Node.js error object
245
+ * @param {string} [file] - File path (if known)
246
+ * @returns {Object} Parsed error information
247
+ */
248
+ export function parseNodeError(error, file = null) {
249
+ const errorInfo = {
250
+ title: 'Syntax Error',
251
+ file: file || 'unknown',
252
+ message: error.message || 'Unknown error',
253
+ location: null,
254
+ suggestion: null
255
+ };
256
+
257
+ // Try to extract line and column from error message
258
+ const locationMatch = error.message.match(/\((\d+):(\d+)\)/) ||
259
+ error.stack?.match(/:(\d+):(\d+)/);
260
+
261
+ if (locationMatch) {
262
+ const line = parseInt(locationMatch[1]);
263
+ const column = parseInt(locationMatch[2]);
264
+ errorInfo.line = line;
265
+ errorInfo.column = column;
266
+ errorInfo.location = `at ${errorInfo.file}:${line}:${column}`;
267
+ }
268
+
269
+ // Extract suggestion from error message if available
270
+ if (error.message.includes('expected')) {
271
+ errorInfo.suggestion = 'Check for missing or misplaced syntax elements';
272
+ } else if (error.message.includes('Unexpected token')) {
273
+ errorInfo.suggestion = 'Remove or fix the unexpected token';
274
+ }
275
+
276
+ return errorInfo;
277
+ }
@@ -1,24 +1,24 @@
1
- # @titanpl/route
2
-
3
- The declarative Routing DSL for Titan Planet.
4
-
5
- ## What it works (What it does)
6
- This is a zero-runtime-overhead DSL used to define your backend API routes. It captures routing metadata that the Titan engine uses to static-map requests directly to your actions.
7
-
8
- ## How it works
9
- Import `t` and use it to define your endpoints.
10
-
11
- ```javascript
12
- import t from "@titanpl/route";
13
-
14
- // Define an action-based route
15
- t.post("/hello").action("hello"); // pass a json payload { "name": "titan" }
16
-
17
- // Define a direct reply route
18
- t.get("/").reply("Ready to land on Titan Planet 🚀");
19
-
20
- // Configure the server
21
- t.start(5100, "Titan Running!");
22
- ```
23
-
24
- **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.
1
+ # @titanpl/route
2
+
3
+ The declarative Routing DSL for Titan Planet.
4
+
5
+ ## What it works (What it does)
6
+ This is a zero-runtime-overhead DSL used to define your backend API routes. It captures routing metadata that the Titan engine uses to static-map requests directly to your actions.
7
+
8
+ ## How it works
9
+ Import `t` and use it to define your endpoints.
10
+
11
+ ```javascript
12
+ import t from "@titanpl/route";
13
+
14
+ // Define an action-based route
15
+ t.post("/hello").action("hello"); // pass a json payload { "name": "titan" }
16
+
17
+ // Define a direct reply route
18
+ t.get("/").reply("Ready to land on Titan Planet 🚀");
19
+
20
+ // Configure the server
21
+ t.start(5100, "Titan Running!");
22
+ ```
23
+
24
+ **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.
@@ -1,16 +1,16 @@
1
- export interface RouteBuilder {
2
- reply(value: any): void;
3
- action(name: string): void;
4
- }
5
-
6
- export interface TitanRoute {
7
- get(route: string): RouteBuilder;
8
- post(route: string): RouteBuilder;
9
- put(route: string): RouteBuilder;
10
- delete(route: string): RouteBuilder;
11
- log(module: string, msg: string): void;
12
- start(port?: number, msg?: string, threads?: number, stack_mb?: number): void;
13
- }
14
-
15
- declare const t: TitanRoute;
16
- export default t;
1
+ export interface RouteBuilder {
2
+ reply(value: any): void;
3
+ action(name: string): void;
4
+ }
5
+
6
+ export interface TitanRoute {
7
+ get(route: string): RouteBuilder;
8
+ post(route: string): RouteBuilder;
9
+ put(route: string): RouteBuilder;
10
+ delete(route: string): RouteBuilder;
11
+ log(module: string, msg: string): void;
12
+ start(port?: number, msg?: string, threads?: number, stack_mb?: number): void;
13
+ }
14
+
15
+ declare const t: TitanRoute;
16
+ export default t;