@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.
- package/frigg-cli/README.md +13 -14
- package/frigg-cli/__tests__/unit/commands/db-setup.test.js +267 -166
- package/frigg-cli/__tests__/unit/utils/database-validator.test.js +45 -14
- package/frigg-cli/__tests__/unit/utils/error-messages.test.js +44 -3
- package/frigg-cli/db-setup-command/index.js +75 -22
- package/frigg-cli/deploy-command/index.js +6 -3
- package/frigg-cli/utils/database-validator.js +18 -5
- package/frigg-cli/utils/error-messages.js +84 -12
- package/infrastructure/README.md +28 -0
- package/infrastructure/domains/database/migration-builder.js +26 -20
- package/infrastructure/domains/database/migration-builder.test.js +27 -0
- package/infrastructure/domains/integration/integration-builder.js +17 -13
- package/infrastructure/domains/integration/integration-builder.test.js +23 -0
- package/infrastructure/domains/networking/vpc-builder.js +240 -18
- package/infrastructure/domains/networking/vpc-builder.test.js +711 -13
- package/infrastructure/domains/networking/vpc-resolver.js +221 -40
- package/infrastructure/domains/networking/vpc-resolver.test.js +318 -18
- package/infrastructure/domains/security/kms-builder.js +55 -6
- package/infrastructure/domains/security/kms-builder.test.js +19 -1
- package/infrastructure/domains/shared/cloudformation-discovery.js +310 -13
- package/infrastructure/domains/shared/cloudformation-discovery.test.js +395 -0
- package/infrastructure/domains/shared/providers/aws-provider-adapter.js +41 -6
- package/infrastructure/domains/shared/providers/aws-provider-adapter.test.js +39 -0
- package/infrastructure/domains/shared/resource-discovery.js +17 -5
- package/infrastructure/domains/shared/resource-discovery.test.js +36 -0
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +30 -20
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +43 -0
- package/infrastructure/infrastructure-composer.js +11 -3
- package/infrastructure/scripts/build-prisma-layer.js +153 -78
- package/infrastructure/scripts/build-prisma-layer.test.js +27 -11
- package/layers/prisma/.build-complete +3 -0
- package/package.json +7 -7
package/frigg-cli/README.md
CHANGED
|
@@ -298,37 +298,36 @@ frigg db:setup --generate-only
|
|
|
298
298
|
```
|
|
299
299
|
|
|
300
300
|
**What it does:**
|
|
301
|
-
1. Detects database type
|
|
302
|
-
2. Validates DATABASE_URL
|
|
303
|
-
3. Generates Prisma client
|
|
304
|
-
4.
|
|
305
|
-
5.
|
|
306
|
-
6.
|
|
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
|
-
- `--
|
|
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:
|
|
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
|