titanpl 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Titan Planet is a JavaScript-first backend framework that embeds JS actions into a Rust + Axum server and ships as a single native binary. Routes are compiled to static metadata; only actions run in the embedded JS runtime. No Node.js. No event loop in production.",
5
5
  "license": "ISC",
6
6
  "author": "ezetgalaxy",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/cli",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "The unified CLI for Titan Planet. Use it to create, manage, build, and deploy high-performance backend projects.",
5
5
  "keywords": [
6
6
  "titanpl",
@@ -21,12 +21,12 @@
21
21
  "tit": "./index.js"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@titanpl/engine-win32-x64": "2.0.3",
25
- "@titanpl/engine-linux-x64": "2.0.3",
26
- "@titanpl/engine-darwin-arm64": "2.0.3"
24
+ "@titanpl/engine-win32-x64": "2.0.4",
25
+ "@titanpl/engine-linux-x64": "2.0.4",
26
+ "@titanpl/engine-darwin-arm64": "2.0.4"
27
27
  },
28
28
  "dependencies": {
29
- "@titanpl/packet": "2.0.3",
29
+ "@titanpl/packet": "2.0.4",
30
30
  "prompts": "^2.4.2",
31
31
  "commander": "^11.0.0",
32
32
  "chalk": "^4.1.2"
@@ -99,8 +99,27 @@ export async function initCommand(projectName, templateName) {
99
99
  let templateDir = path.resolve(__dirname, '..', '..', '..', '..', 'templates', selectedTemplate);
100
100
  let commonDir = path.resolve(__dirname, '..', '..', '..', '..', 'templates', 'common');
101
101
 
102
+ const tryPaths = [
103
+ // 1. Monorepo root / titanpl package root
104
+ { t: path.resolve(__dirname, '..', '..', '..', '..', 'templates', selectedTemplate), c: path.resolve(__dirname, '..', '..', '..', '..', 'templates', 'common') },
105
+ // 2. Published CLI package (global install / npm package)
106
+ { t: path.resolve(__dirname, '..', '..', 'templates', selectedTemplate), c: path.resolve(__dirname, '..', '..', 'templates', 'common') },
107
+ // 3. Fallback: one dir up? Just in case
108
+ { t: path.resolve(__dirname, '..', '..', '..', 'templates', selectedTemplate), c: path.resolve(__dirname, '..', '..', '..', 'templates', 'common') }
109
+ ];
110
+
111
+ let found = false;
112
+ for (const paths of tryPaths) {
113
+ if (fs.existsSync(paths.t) && fs.existsSync(paths.c)) {
114
+ templateDir = paths.t;
115
+ commonDir = paths.c;
116
+ found = true;
117
+ break;
118
+ }
119
+ }
120
+
102
121
  // Robust monorepo/fallback template search: look upwards from cwd
103
- if (!fs.existsSync(templateDir) || !fs.existsSync(commonDir)) {
122
+ if (!found) {
104
123
  let searchDir = process.cwd();
105
124
  while (searchDir !== path.parse(searchDir).root) {
106
125
  const potentialTemplateDir = path.join(searchDir, 'templates', selectedTemplate);
@@ -108,6 +127,7 @@ export async function initCommand(projectName, templateName) {
108
127
  if (fs.existsSync(potentialTemplateDir) && fs.existsSync(potentialCommonDir)) {
109
128
  templateDir = potentialTemplateDir;
110
129
  commonDir = potentialCommonDir;
130
+ found = true;
111
131
  break;
112
132
  }
113
133
  const sdkPotentialTemplateDir = path.join(searchDir, 'titanpl-sdk', 'templates', selectedTemplate);
@@ -115,13 +135,14 @@ export async function initCommand(projectName, templateName) {
115
135
  if (fs.existsSync(sdkPotentialTemplateDir) && fs.existsSync(sdkPotentialCommonDir)) {
116
136
  templateDir = sdkPotentialTemplateDir;
117
137
  commonDir = sdkPotentialCommonDir;
138
+ found = true;
118
139
  break;
119
140
  }
120
141
  searchDir = path.dirname(searchDir);
121
142
  }
122
143
  }
123
144
 
124
- if (!fs.existsSync(templateDir) || !fs.existsSync(commonDir)) {
145
+ if (!found) {
125
146
  console.log(chalk.red(`✖ Error finding template paths. Are you in a valid Titan monorepo?`));
126
147
  process.exit(1);
127
148
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/engine-darwin-arm64",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "os": [
5
5
  "darwin"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/engine-linux-x64",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "os": [
5
5
  "linux"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/engine-win32-x64",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "os": [
5
5
  "win32"
6
6
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/native",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Titan native utilities package",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titanpl/packet",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
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": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Titan routing DSL",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{name}}",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A Titan Planet extension",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "@titanpl/core": "latest",
19
19
  "chokidar": "^5.0.0",
20
20
  "esbuild": "^0.27.2",
21
- "titanpl-sdk": "2.0.3"
21
+ "titanpl-sdk": "2.0.4"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@tgrv/microgravity": "latest"
@@ -6,12 +6,12 @@
6
6
  "template": "js"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "2.0.3",
10
- "@titanpl/route": "2.0.3",
11
- "@titanpl/native": "2.0.3",
9
+ "@titanpl/cli": "2.0.4",
10
+ "@titanpl/route": "2.0.4",
11
+ "@titanpl/native": "2.0.4",
12
12
  "@titanpl/core": "latest",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "2.0.3"
14
+ "@titanpl/packet": "2.0.4"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "titan build",
@@ -24,5 +24,5 @@
24
24
  "eslint": "^9.39.2",
25
25
  "eslint-plugin-titanpl": "latest"
26
26
  },
27
- "version": "2.0.3"
27
+ "version": "2.0.4"
28
28
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A Titan Planet server",
5
5
  "type": "module",
6
6
  "titan": {
7
7
  "template": "rust-js"
8
8
  },
9
9
  "dependencies": {
10
- "@titanpl/cli": "2.0.3",
11
- "@titanpl/route": "2.0.3",
12
- "@titanpl/native": "2.0.3",
10
+ "@titanpl/cli": "2.0.4",
11
+ "@titanpl/route": "2.0.4",
12
+ "@titanpl/native": "2.0.4",
13
13
  "@titanpl/core": "latest",
14
14
  "@titanpl/node": "latest"
15
15
  },
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "titanpl",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A Titan Planet server (Rust + TypeScript)",
5
5
  "type": "module",
6
6
  "titan": {
7
7
  "template": "rust-ts"
8
8
  },
9
9
  "dependencies": {
10
- "@titanpl/cli": "2.0.3",
11
- "@titanpl/route": "2.0.3",
12
- "@titanpl/native": "2.0.3",
10
+ "@titanpl/cli": "2.0.4",
11
+ "@titanpl/route": "2.0.4",
12
+ "@titanpl/native": "2.0.4",
13
13
  "@titanpl/core": "latest",
14
14
  "@titanpl/node": "latest",
15
15
  "typescript": "^5.0.0"
@@ -6,12 +6,12 @@
6
6
  "template": "ts"
7
7
  },
8
8
  "dependencies": {
9
- "@titanpl/cli": "2.0.3",
10
- "@titanpl/route": "2.0.3",
11
- "@titanpl/native": "2.0.3",
9
+ "@titanpl/cli": "2.0.4",
10
+ "@titanpl/route": "2.0.4",
11
+ "@titanpl/native": "2.0.4",
12
12
  "@titanpl/core": "latest",
13
13
  "@titanpl/node": "latest",
14
- "@titanpl/packet": "2.0.3",
14
+ "@titanpl/packet": "2.0.4",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "eslint-plugin-titanpl": "latest",
27
27
  "@typescript-eslint/parser": "^8.54.0"
28
28
  },
29
- "version": "2.0.3"
29
+ "version": "2.0.4"
30
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "titanpl-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Development SDK for Titan Planet. Provides TypeScript type definitions for the global 't' runtime object and a 'lite' test-harness runtime for building and verifying extensions.",
5
5
  "main": "index.js",
6
6
  "type": "module",