@titanpl/cli 5.0.3 → 5.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/cli",
3
- "version": "5.0.3",
3
+ "version": "5.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",
@@ -33,7 +33,7 @@
33
33
  "@titanpl/engine-linux-x64": "2.0.4"
34
34
  },
35
35
  "dependencies": {
36
- "@titanpl/packet": "4.0.1",
36
+ "@titanpl/packet": "4.0.2",
37
37
  "prompts": "^2.4.2",
38
38
  "commander": "^11.0.0",
39
39
  "chalk": "^4.1.2"
@@ -58,9 +58,30 @@ export async function updateCommand() {
58
58
  console.log(chalk.yellow(` ⚠️ Failed to update package.json: ${e.message}`));
59
59
  }
60
60
 
61
- // 2. Refresh Dockerfile and dotfiles from templates
62
- const commonDir = path.resolve(__dirname, '..', '..', '..', '..', 'templates', 'common');
63
- if (fs.existsSync(commonDir)) {
61
+ // 2. Migration: rename titan.json to tanfig.json if needed
62
+ const oldConfigPath = path.join(root, 'titan.json');
63
+ const newConfigPath = path.join(root, 'tanfig.json');
64
+ if (fs.existsSync(oldConfigPath) && !fs.existsSync(newConfigPath)) {
65
+ fs.renameSync(oldConfigPath, newConfigPath);
66
+ console.log(chalk.green(` ✔ Migrated titan.json to tanfig.json`));
67
+ }
68
+
69
+ // 3. Refresh Dockerfile and dotfiles from templates
70
+ let commonDir = null;
71
+ const tryCommonPaths = [
72
+ path.resolve(__dirname, '..', '..', '..', '..', 'templates', 'common'), // Monorepo
73
+ path.resolve(__dirname, '..', '..', 'templates', 'common'), // NPM cli package
74
+ path.resolve(__dirname, '..', '..', '..', 'templates', 'common') // Fallback
75
+ ];
76
+
77
+ for (const p of tryCommonPaths) {
78
+ if (fs.existsSync(p)) {
79
+ commonDir = p;
80
+ break;
81
+ }
82
+ }
83
+
84
+ if (commonDir) {
64
85
  const filesToSync = [
65
86
  ['Dockerfile', 'Dockerfile'],
66
87
  ['_dockerignore', '.dockerignore'],