genbox 1.0.24 → 1.0.25

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.
@@ -420,8 +420,12 @@ function displayResolvedConfig(resolved) {
420
420
  console.log(` • ${infra.name} (${infra.mode})`);
421
421
  }
422
422
  }
423
- console.log('');
424
- console.log(` ${chalk_1.default.bold('Database:')} ${resolved.database.mode}${resolved.database.source ? ` (from ${resolved.database.source})` : ''}`);
423
+ // Only show database info if there are backend apps
424
+ const hasBackendApps = resolved.apps.some(a => a.type === 'backend' || a.name === 'api');
425
+ if (hasBackendApps && resolved.database.mode !== 'none') {
426
+ console.log('');
427
+ console.log(` ${chalk_1.default.bold('Database:')} ${resolved.database.mode}${resolved.database.source ? ` (from ${resolved.database.source})` : ''}`);
428
+ }
425
429
  if (Object.keys(resolved.env).length > 0) {
426
430
  console.log('');
427
431
  console.log(` ${chalk_1.default.bold('Environment:')}`);
@@ -279,6 +279,10 @@ class ConfigLoader {
279
279
  }
280
280
  /**
281
281
  * Deep merge objects
282
+ *
283
+ * Special handling:
284
+ * - 'version' field is never overwritten (prevents v4 -> v1 downgrades)
285
+ * - Empty objects don't overwrite non-empty objects
282
286
  */
283
287
  deepMerge(target, source) {
284
288
  for (const key of Object.keys(source)) {
@@ -286,6 +290,21 @@ class ConfigLoader {
286
290
  const targetValue = target[key];
287
291
  if (sourceValue === undefined)
288
292
  continue;
293
+ // Never overwrite version field - workspace config takes precedence
294
+ if (key === 'version' && targetValue !== undefined)
295
+ continue;
296
+ // Don't overwrite non-empty objects with empty objects
297
+ if (typeof sourceValue === 'object' &&
298
+ sourceValue !== null &&
299
+ !Array.isArray(sourceValue) &&
300
+ Object.keys(sourceValue).length === 0 &&
301
+ typeof targetValue === 'object' &&
302
+ targetValue !== null &&
303
+ !Array.isArray(targetValue) &&
304
+ Object.keys(targetValue).length > 0) {
305
+ // Skip - don't let empty {} overwrite populated object
306
+ continue;
307
+ }
289
308
  if (typeof sourceValue === 'object' &&
290
309
  sourceValue !== null &&
291
310
  !Array.isArray(sourceValue) &&
@@ -520,33 +520,37 @@ class ProfileResolver {
520
520
  }
521
521
  }
522
522
  }
523
- // Add database URL
524
- if (database.mode === 'local') {
525
- env['MONGODB_URI'] = `mongodb://localhost:27017/${config.project.name}`;
526
- }
527
- else if (database.url) {
528
- env['MONGODB_URI'] = database.url;
529
- }
530
- // Add infrastructure URLs
531
- for (const infra of infrastructure) {
532
- if (infra.mode === 'local') {
533
- switch (infra.type) {
534
- case 'cache':
535
- env['REDIS_URL'] = `redis://localhost:${infra.port || 6379}`;
536
- break;
537
- case 'queue':
538
- env['RABBITMQ_URL'] = `amqp://localhost:${infra.port || 5672}`;
539
- break;
540
- }
523
+ // Only add database/infrastructure URLs if there are backend apps that need them
524
+ const hasBackendApps = apps.some(a => a.type === 'backend' || a.name === 'api');
525
+ if (hasBackendApps) {
526
+ // Add database URL
527
+ if (database.mode === 'local') {
528
+ env['MONGODB_URI'] = `mongodb://localhost:27017/${config.project.name}`;
541
529
  }
542
- else if (infra.url) {
543
- switch (infra.type) {
544
- case 'cache':
545
- env['REDIS_URL'] = infra.url;
546
- break;
547
- case 'queue':
548
- env['RABBITMQ_URL'] = infra.url;
549
- break;
530
+ else if (database.url) {
531
+ env['MONGODB_URI'] = database.url;
532
+ }
533
+ // Add infrastructure URLs
534
+ for (const infra of infrastructure) {
535
+ if (infra.mode === 'local') {
536
+ switch (infra.type) {
537
+ case 'cache':
538
+ env['REDIS_URL'] = `redis://localhost:${infra.port || 6379}`;
539
+ break;
540
+ case 'queue':
541
+ env['RABBITMQ_URL'] = `amqp://localhost:${infra.port || 5672}`;
542
+ break;
543
+ }
544
+ }
545
+ else if (infra.url) {
546
+ switch (infra.type) {
547
+ case 'cache':
548
+ env['REDIS_URL'] = infra.url;
549
+ break;
550
+ case 'queue':
551
+ env['RABBITMQ_URL'] = infra.url;
552
+ break;
553
+ }
550
554
  }
551
555
  }
552
556
  }
@@ -2,29 +2,95 @@
2
2
  /**
3
3
  * Random name generator for Genbox environments
4
4
  * Generates memorable names using adjective-noun combinations
5
+ * ~150 adjectives x ~150 nouns = ~22,500 unique combinations
5
6
  */
6
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TOTAL_COMBINATIONS = void 0;
7
9
  exports.generateRandomName = generateRandomName;
8
10
  exports.generateNameSuggestions = generateNameSuggestions;
9
11
  const adjectives = [
10
- 'swift', 'calm', 'bold', 'keen', 'warm',
11
- 'cool', 'bright', 'quick', 'smart', 'fresh',
12
- 'wild', 'free', 'pure', 'soft', 'sharp',
13
- 'kind', 'brave', 'proud', 'fair', 'wise',
14
- 'gold', 'silver', 'azure', 'coral', 'amber',
15
- 'jade', 'ruby', 'pearl', 'ivory', 'onyx',
16
- 'misty', 'sunny', 'windy', 'rainy', 'snowy',
17
- 'lucky', 'happy', 'merry', 'jolly', 'lively',
12
+ // Colors & Shades
13
+ 'red', 'blue', 'green', 'gold', 'silver', 'bronze', 'copper', 'amber',
14
+ 'coral', 'ivory', 'onyx', 'jade', 'ruby', 'pearl', 'azure', 'cobalt',
15
+ 'crimson', 'scarlet', 'violet', 'indigo', 'teal', 'cyan', 'magenta',
16
+ 'golden', 'rusty', 'dusty', 'misty', 'frosty', 'snowy', 'icy',
17
+ // Weather & Nature
18
+ 'sunny', 'windy', 'rainy', 'stormy', 'cloudy', 'foggy', 'hazy',
19
+ 'balmy', 'breezy', 'dewy', 'humid', 'arid', 'polar', 'tropic',
20
+ // Temperature & Light
21
+ 'warm', 'cool', 'cold', 'hot', 'bright', 'dim', 'dark', 'light',
22
+ 'glowing', 'shiny', 'glossy', 'matte', 'vivid', 'pale', 'deep',
23
+ // Size & Shape
24
+ 'tiny', 'small', 'big', 'giant', 'vast', 'wide', 'narrow', 'tall',
25
+ 'short', 'long', 'round', 'flat', 'curved', 'steep', 'slim', 'broad',
26
+ // Speed & Movement
27
+ 'swift', 'quick', 'fast', 'rapid', 'slow', 'steady', 'still', 'calm',
28
+ 'wild', 'fierce', 'gentle', 'smooth', 'rough', 'bumpy', 'fluid',
29
+ // Character & Mood
30
+ 'bold', 'brave', 'keen', 'wise', 'smart', 'clever', 'witty', 'sharp',
31
+ 'kind', 'fair', 'proud', 'humble', 'noble', 'royal', 'grand', 'prime',
32
+ 'happy', 'merry', 'jolly', 'lively', 'peppy', 'zesty', 'perky', 'chirpy',
33
+ 'lucky', 'plucky', 'spunky', 'funky', 'groovy', 'snappy', 'zippy',
34
+ // Quality & State
35
+ 'fresh', 'crisp', 'clean', 'pure', 'clear', 'free', 'open', 'safe',
36
+ 'solid', 'stable', 'sturdy', 'strong', 'tough', 'hardy', 'robust',
37
+ 'sleek', 'slick', 'neat', 'tidy', 'trim', 'lean', 'fit', 'agile',
38
+ // Time & Age
39
+ 'new', 'young', 'early', 'late', 'ancient', 'modern', 'future', 'prime',
40
+ 'fresh', 'ripe', 'mature', 'seasoned', 'timely', 'eternal', 'lasting',
41
+ // Sound & Texture
42
+ 'silent', 'quiet', 'loud', 'sonic', 'soft', 'hard', 'dense', 'hollow',
43
+ 'fuzzy', 'fluffy', 'silky', 'velvet', 'smooth', 'grainy', 'sandy',
44
+ // Taste & Smell (abstract)
45
+ 'sweet', 'tangy', 'spicy', 'minty', 'zesty', 'savory', 'rich', 'mellow',
46
+ // Position & Direction
47
+ 'upper', 'lower', 'inner', 'outer', 'central', 'polar', 'lateral',
48
+ 'north', 'south', 'east', 'west', 'coastal', 'alpine', 'lunar', 'solar',
18
49
  ];
19
50
  const nouns = [
20
- 'fox', 'owl', 'wolf', 'hawk', 'bear',
21
- 'deer', 'hare', 'lynx', 'seal', 'dove',
22
- 'oak', 'pine', 'elm', 'ash', 'birch',
23
- 'maple', 'cedar', 'willow', 'sage', 'fern',
24
- 'river', 'lake', 'creek', 'brook', 'pond',
25
- 'peak', 'vale', 'ridge', 'cliff', 'mesa',
26
- 'moon', 'star', 'sun', 'cloud', 'wind',
27
- 'storm', 'frost', 'dawn', 'dusk', 'wave',
51
+ // Animals - Land
52
+ 'fox', 'wolf', 'bear', 'deer', 'elk', 'moose', 'hare', 'rabbit',
53
+ 'lynx', 'puma', 'tiger', 'lion', 'panther', 'jaguar', 'leopard',
54
+ 'horse', 'zebra', 'buffalo', 'bison', 'ox', 'ram', 'goat', 'sheep',
55
+ 'badger', 'otter', 'beaver', 'marten', 'ferret', 'mink', 'stoat',
56
+ 'squirrel', 'chipmunk', 'hedgehog', 'porcupine', 'armadillo',
57
+ // Animals - Birds
58
+ 'owl', 'hawk', 'eagle', 'falcon', 'raven', 'crow', 'jay', 'finch',
59
+ 'robin', 'sparrow', 'wren', 'lark', 'dove', 'pigeon', 'swan', 'crane',
60
+ 'heron', 'stork', 'pelican', 'albatross', 'condor', 'vulture', 'kite',
61
+ 'osprey', 'harrier', 'kestrel', 'merlin', 'shrike', 'oriole', 'thrush',
62
+ // Animals - Water
63
+ 'seal', 'walrus', 'whale', 'dolphin', 'shark', 'orca', 'salmon', 'trout',
64
+ 'bass', 'pike', 'perch', 'carp', 'tuna', 'marlin', 'barracuda',
65
+ 'squid', 'octopus', 'crab', 'lobster', 'shrimp', 'oyster', 'clam',
66
+ // Trees & Plants
67
+ 'oak', 'pine', 'elm', 'ash', 'birch', 'maple', 'cedar', 'spruce',
68
+ 'willow', 'poplar', 'aspen', 'alder', 'beech', 'cherry', 'walnut',
69
+ 'cypress', 'juniper', 'hemlock', 'sequoia', 'redwood', 'mahogany',
70
+ 'sage', 'fern', 'moss', 'ivy', 'vine', 'reed', 'bamboo', 'palm',
71
+ 'cactus', 'lotus', 'lily', 'rose', 'tulip', 'orchid', 'iris', 'daisy',
72
+ // Landforms & Geography
73
+ 'peak', 'summit', 'ridge', 'cliff', 'bluff', 'mesa', 'butte', 'dune',
74
+ 'vale', 'glen', 'dale', 'dell', 'gorge', 'canyon', 'ravine', 'gulch',
75
+ 'plain', 'prairie', 'meadow', 'field', 'grove', 'forest', 'jungle',
76
+ 'island', 'atoll', 'reef', 'cape', 'bay', 'cove', 'inlet', 'fjord',
77
+ // Water Bodies
78
+ 'river', 'stream', 'creek', 'brook', 'spring', 'falls', 'rapids',
79
+ 'lake', 'pond', 'pool', 'lagoon', 'marsh', 'swamp', 'delta', 'estuary',
80
+ 'ocean', 'sea', 'gulf', 'strait', 'channel', 'tide', 'wave', 'surf',
81
+ // Sky & Space
82
+ 'moon', 'sun', 'star', 'comet', 'meteor', 'nova', 'nebula', 'quasar',
83
+ 'cloud', 'storm', 'rain', 'snow', 'frost', 'hail', 'mist', 'fog',
84
+ 'wind', 'gale', 'breeze', 'gust', 'draft', 'zephyr', 'monsoon',
85
+ 'dawn', 'dusk', 'noon', 'night', 'twilight', 'aurora', 'eclipse',
86
+ // Stones & Minerals
87
+ 'stone', 'rock', 'boulder', 'pebble', 'gravel', 'sand', 'clay', 'chalk',
88
+ 'crystal', 'gem', 'diamond', 'emerald', 'sapphire', 'topaz', 'opal',
89
+ 'granite', 'marble', 'slate', 'quartz', 'flint', 'obsidian', 'basalt',
90
+ // Misc Nature
91
+ 'flame', 'ember', 'spark', 'blaze', 'torch', 'beacon', 'flare',
92
+ 'shadow', 'shade', 'glint', 'gleam', 'shimmer', 'glimmer', 'flash',
93
+ 'echo', 'whisper', 'murmur', 'rustle', 'ripple', 'rumble', 'thunder',
28
94
  ];
29
95
  function randomElement(array) {
30
96
  return array[Math.floor(Math.random() * array.length)];
@@ -39,12 +105,20 @@ function generateRandomName() {
39
105
  return `${adjective}-${noun}`;
40
106
  }
41
107
  /**
42
- * Generate multiple random name suggestions
108
+ * Generate multiple unique random name suggestions
43
109
  */
44
110
  function generateNameSuggestions(count = 3) {
45
111
  const names = new Set();
46
- while (names.size < count) {
112
+ // Prevent infinite loop if requesting more than possible combinations
113
+ const maxAttempts = count * 10;
114
+ let attempts = 0;
115
+ while (names.size < count && attempts < maxAttempts) {
47
116
  names.add(generateRandomName());
117
+ attempts++;
48
118
  }
49
119
  return Array.from(names);
50
120
  }
121
+ /**
122
+ * Total possible unique combinations
123
+ */
124
+ exports.TOTAL_COMBINATIONS = adjectives.length * nouns.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {