@friggframework/devtools 2.0.0-next.53 → 2.0.0-next.54

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 (32) hide show
  1. package/frigg-cli/README.md +13 -14
  2. package/frigg-cli/__tests__/unit/commands/db-setup.test.js +267 -166
  3. package/frigg-cli/__tests__/unit/utils/database-validator.test.js +45 -14
  4. package/frigg-cli/__tests__/unit/utils/error-messages.test.js +44 -3
  5. package/frigg-cli/db-setup-command/index.js +75 -22
  6. package/frigg-cli/deploy-command/index.js +6 -3
  7. package/frigg-cli/utils/database-validator.js +18 -5
  8. package/frigg-cli/utils/error-messages.js +84 -12
  9. package/infrastructure/README.md +28 -0
  10. package/infrastructure/domains/database/migration-builder.js +26 -20
  11. package/infrastructure/domains/database/migration-builder.test.js +27 -0
  12. package/infrastructure/domains/integration/integration-builder.js +17 -13
  13. package/infrastructure/domains/integration/integration-builder.test.js +23 -0
  14. package/infrastructure/domains/networking/vpc-builder.js +240 -18
  15. package/infrastructure/domains/networking/vpc-builder.test.js +711 -13
  16. package/infrastructure/domains/networking/vpc-resolver.js +221 -40
  17. package/infrastructure/domains/networking/vpc-resolver.test.js +318 -18
  18. package/infrastructure/domains/security/kms-builder.js +55 -6
  19. package/infrastructure/domains/security/kms-builder.test.js +19 -1
  20. package/infrastructure/domains/shared/cloudformation-discovery.js +310 -13
  21. package/infrastructure/domains/shared/cloudformation-discovery.test.js +395 -0
  22. package/infrastructure/domains/shared/providers/aws-provider-adapter.js +41 -6
  23. package/infrastructure/domains/shared/providers/aws-provider-adapter.test.js +39 -0
  24. package/infrastructure/domains/shared/resource-discovery.js +17 -5
  25. package/infrastructure/domains/shared/resource-discovery.test.js +36 -0
  26. package/infrastructure/domains/shared/utilities/base-definition-factory.js +30 -20
  27. package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +43 -0
  28. package/infrastructure/infrastructure-composer.js +11 -3
  29. package/infrastructure/scripts/build-prisma-layer.js +153 -78
  30. package/infrastructure/scripts/build-prisma-layer.test.js +27 -11
  31. package/layers/prisma/.build-complete +3 -0
  32. package/package.json +7 -7
@@ -298,37 +298,36 @@ frigg db:setup --generate-only
298
298
  ```
299
299
 
300
300
  **What it does:**
301
- 1. Detects database type from DATABASE_URL or option
302
- 2. Validates DATABASE_URL format
303
- 3. Generates Prisma client for the detected database type
304
- 4. Tests database connection
305
- 5. Pushes Prisma schema to database (creates tables/collections)
306
- 6. Runs any pending data migrations
301
+ 1. Detects database type (MongoDB, AWS DocumentDB, or PostgreSQL) from the app definition and `DATABASE_URL`
302
+ 2. Validates that `DATABASE_URL` exists and is not empty
303
+ 3. Generates the correct Prisma client (DocumentDB reuses the MongoDB client)
304
+ 4. Checks Prisma migration state for the selected database
305
+ 5. Runs `prisma migrate` for PostgreSQL or `prisma db push` for MongoDB/DocumentDB
306
+ 6. Prints next steps (database connectivity health checks now happen during `frigg start`)
307
307
 
308
308
  **Options:**
309
- - `--mongodb` - Force MongoDB configuration
309
+ - `--mongodb` - Force MongoDB-compatible configuration (also applies to AWS DocumentDB)
310
310
  - `--postgresql` - Force PostgreSQL configuration
311
311
  - `--generate-only` - Only generate Prisma client, don't push schema
312
- - `--skip-connection-test` - Skip database connection validation
312
+ - `--verbose` - Show detailed progress and Prisma output
313
313
 
314
- **Example Output:**
314
+ **Example Output (MongoDB/DocumentDB):**
315
315
  ```
316
316
  🗄️ Setting up database...
317
317
  ✓ DATABASE_URL found
318
- ✓ Database type detected: mongodb
318
+ ✓ Database type detected: AWS DocumentDB (MongoDB-compatible)
319
319
  ✓ Generating Prisma client for mongodb...
320
320
  ✓ Prisma client generated successfully
321
- ✓ Testing database connection...
322
- ✓ Connection successful
323
321
  ✓ Pushing schema to database...
324
322
  ✓ Database schema synchronized
325
323
 
326
324
  Database setup complete!
327
325
  ```
328
326
 
327
+ > **AWS DocumentDB notes:** Use a MongoDB-style connection string that includes `tls=true`, `replicaSet=rs0`, and `retryWrites=false`. The CLI automatically treats `database.documentDB.enable` as MongoDB-compatible during setup.
328
+
329
329
  **Error Handling:**
330
- - Validates DATABASE_URL format for each database type
331
- - Tests connection before attempting schema push
330
+ - Validates `DATABASE_URL` format for each database type
332
331
  - Provides helpful error messages for:
333
332
  - Connection timeout
334
333
  - Invalid credentials