@ezetgalaxy/titan 25.11.8 → 25.12.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 (2) hide show
  1. package/index.js +13 -9
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -200,7 +200,8 @@ function startProd() {
200
200
  // TITAN UPDATE — Upgrade titan/ runtime
201
201
  // ------------------------------------------
202
202
  function updateTitan() {
203
- const projectTitan = path.join(process.cwd(), "titan");
203
+ const projectRoot = process.cwd();
204
+ const projectTitan = path.join(projectRoot, "titan");
204
205
  const cliTitan = path.join(__dirname, "templates", "titan");
205
206
 
206
207
  if (!fs.existsSync(projectTitan)) {
@@ -211,27 +212,30 @@ function updateTitan() {
211
212
 
212
213
  console.log(cyan("Titan: Updating runtime files..."));
213
214
 
214
- // Backup old titan folder
215
- const backupDir = path.join(process.cwd(), `titan_backup_${Date.now()}`);
215
+ const backupDir = path.join(projectRoot, `titan_backup_${Date.now()}`);
216
216
  fs.renameSync(projectTitan, backupDir);
217
-
218
217
  console.log(green(`✔ Backup created → ${backupDir}`));
219
218
 
220
219
  copyDir(cliTitan, projectTitan);
221
- copyDir(templateDir, target);
220
+
221
+ const projectTemplateRoot = path.join(__dirname, "templates");
222
222
 
223
223
  [".gitignore", ".dockerignore", "Dockerfile"].forEach((file) => {
224
- const src = path.join(templateDir, file);
225
- const dest = path.join(target, file);
226
- if (fs.existsSync(src)) fs.copyFileSync(src, dest);
227
- });
224
+ const src = path.join(projectTemplateRoot, file);
225
+ const dest = path.join(projectRoot, file);
228
226
 
227
+ if (fs.existsSync(src)) {
228
+ fs.copyFileSync(src, dest);
229
+ console.log(green(`✔ Updated ${file}`));
230
+ }
231
+ });
229
232
 
230
233
  console.log(green("✔ Titan runtime updated successfully!"));
231
234
  console.log(cyan("Your project now has the latest Titan features."));
232
235
  }
233
236
 
234
237
 
238
+
235
239
  // ROUTER
236
240
  switch (cmd) {
237
241
  case "init":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezetgalaxy/titan",
3
- "version": "25.11.8",
3
+ "version": "25.12.0",
4
4
  "description": "JavaScript backend framework that compiles your JS into a Rust + Axum server.",
5
5
  "license": "ISC",
6
6
  "author": "ezetgalaxy",
@@ -49,4 +49,4 @@
49
49
  "chokidar": "^5.0.0",
50
50
  "esbuild": "^0.27.1"
51
51
  }
52
- }
52
+ }