@aifabrix/builder 2.3.4 → 2.3.5

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/README.md CHANGED
@@ -11,12 +11,6 @@ Local development infrastructure + Azure deployment tool.
11
11
  npm install -g @aifabrix/builder
12
12
  ```
13
13
 
14
- OR
15
-
16
- ```bash
17
- sudo npm install -g @aifabrix/builder
18
- ```
19
-
20
14
  ## Quick Start
21
15
 
22
16
  ```bash
package/bin/aifabrix.js CHANGED
File without changes
package/lib/infra.js CHANGED
@@ -123,7 +123,7 @@ async function startInfra(developerId = null) {
123
123
  // Dev 0: infra-aifabrix-network, Dev > 0: infra-dev{id}-aifabrix-network
124
124
  const networkName = idNum === 0 ? 'infra-aifabrix-network' : `infra-dev${devId}-aifabrix-network`;
125
125
  const composeContent = template({
126
- devId: devId,
126
+ devId: idNum,
127
127
  postgresPort: ports.postgres,
128
128
  redisPort: ports.redis,
129
129
  pgadminPort: ports.pgadmin,
package/lib/secrets.js CHANGED
@@ -438,7 +438,7 @@ async function generateAdminSecretsEnv(secretsPath) {
438
438
  POSTGRES_PASSWORD=${postgresPassword}
439
439
  PGADMIN_DEFAULT_EMAIL=admin@aifabrix.ai
440
440
  PGADMIN_DEFAULT_PASSWORD=${postgresPassword}
441
- REDIS_HOST=local:localhost:6379
441
+ REDIS_HOST=local:redis:6379
442
442
  REDIS_COMMANDER_USER=admin
443
443
  REDIS_COMMANDER_PASSWORD=${postgresPassword}
444
444
  `;
@@ -28,21 +28,32 @@ async function findContainer(serviceName, devId = null) {
28
28
  const developerId = devId || await config.getDeveloperId();
29
29
  const idNum = typeof developerId === 'string' ? parseInt(developerId, 10) : developerId;
30
30
  // Dev 0: aifabrix-{serviceName}, Dev > 0: aifabrix-dev{id}-{serviceName}
31
- const containerNamePattern = idNum === 0
32
- ? `aifabrix-${serviceName}`
33
- : `aifabrix-dev${developerId}-${serviceName}`;
34
- let { stdout } = await execAsync(`docker ps --filter "name=${containerNamePattern}" --format "{{.Names}}"`);
35
- let containerName = stdout.trim();
36
- if (!containerName) {
37
- // Fallback to old naming patterns for backward compatibility
38
- ({ stdout } = await execAsync(`docker ps --filter "name=infra-${serviceName}" --format "{{.Names}}"`));
39
- containerName = stdout.trim();
40
- if (!containerName) {
41
- ({ stdout } = await execAsync(`docker ps --filter "name=aifabrix-${serviceName}" --format "{{.Names}}"`));
42
- containerName = stdout.trim();
31
+ const primaryPattern = idNum === 0 ? `aifabrix-${serviceName}` : `aifabrix-dev${developerId}-${serviceName}`;
32
+
33
+ // Search order expected by tests:
34
+ // 1) primaryPattern
35
+ // 2) infra-{serviceName} (old pattern)
36
+ // 3) aifabrix-{serviceName} (base pattern)
37
+ const patternsToTry = [
38
+ primaryPattern,
39
+ `infra-${serviceName}`,
40
+ `aifabrix-${serviceName}`
41
+ ];
42
+
43
+ for (const pattern of patternsToTry) {
44
+ const { stdout } = await execAsync(`docker ps --filter "name=${pattern}" --format "{{.Names}}"`);
45
+ const names = stdout
46
+ .split('\n')
47
+ .map(s => s.trim())
48
+ .filter(s => s.length > 0);
49
+ const exactMatch = names.find(n => n === pattern);
50
+ if (exactMatch || names[0]) {
51
+ return exactMatch || names[0];
43
52
  }
44
53
  }
45
- return containerName;
54
+
55
+ // Not found with any pattern
56
+ return '';
46
57
  } catch (error) {
47
58
  return null;
48
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aifabrix/builder",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "AI Fabrix Local Fabric & Deployment SDK",
5
5
  "main": "lib/index.js",
6
6
  "bin": {