@hed-hog/cli 0.0.59 → 0.0.61

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/cli",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "description": "HedHog CLI tool",
5
5
  "author": "HedHog",
6
6
  "private": false,
@@ -1076,6 +1076,34 @@ CMD ["sh", "-c", "${startCmd}"]
1076
1076
  filter: (input) => String(input || '').trim(),
1077
1077
  when: (answers) => (answers.apps || []).includes('admin'),
1078
1078
  },
1079
+ {
1080
+ type: 'input',
1081
+ name: 'apiDomain',
1082
+ message: 'Enter the API external URL (used for ADMIN_API_BASE_URL):',
1083
+ default: (answers) => {
1084
+ const domain = String(answers.domain || '').trim();
1085
+ const appName = String(answers.appName || '').trim();
1086
+ if (!domain)
1087
+ return '';
1088
+ const base = domain.startsWith(`${appName}.`)
1089
+ ? domain.slice(appName.length + 1)
1090
+ : domain;
1091
+ return `https://${appName}-api.${base}`;
1092
+ },
1093
+ filter: (input) => String(input || '').trim(),
1094
+ validate: (input) => String(input || '').trim().length > 0 || 'API domain is required',
1095
+ when: (answers) => (answers.apps || []).includes('admin') &&
1096
+ String(answers.domain || '').trim().length > 0,
1097
+ },
1098
+ {
1099
+ type: 'input',
1100
+ name: 'jwtExpiresIn',
1101
+ message: 'JWT token expiry for API (API_JWT_EXPIRES_IN):',
1102
+ default: '7d',
1103
+ filter: (input) => String(input || '').trim(),
1104
+ validate: (input) => String(input || '').trim().length > 0 || 'JWT expiry is required',
1105
+ when: (answers) => (answers.apps || []).includes('api'),
1106
+ },
1079
1107
  {
1080
1108
  type: 'checkbox',
1081
1109
  name: 'selectedInfraServices',
@@ -2466,8 +2494,18 @@ temp
2466
2494
  }
2467
2495
  async getRootPath(cwd) {
2468
2496
  let currentPath = cwd;
2497
+ const hedHogFileName = 'hedhog.json';
2498
+ if (!(0, fs_1.existsSync)(pathModule.join(currentPath, hedHogFileName))) {
2499
+ await this.fileSystem.writeJsonFile(pathModule.join(cwd, hedHogFileName), {
2500
+ libraries: [],
2501
+ installed: false,
2502
+ developerMode: false,
2503
+ buildCache: {},
2504
+ });
2505
+ return cwd;
2506
+ }
2469
2507
  while (true) {
2470
- if ((0, fs_1.existsSync)(pathModule.join(currentPath, 'hedhog.json'))) {
2508
+ if ((0, fs_1.existsSync)(pathModule.join(currentPath, hedHogFileName))) {
2471
2509
  return currentPath;
2472
2510
  }
2473
2511
  const parentPath = pathModule.dirname(currentPath);