@friggframework/devtools 2.0.0--canary.499.2ef107f.0 → 2.0.0--canary.499.d78661e.0

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.
@@ -238,6 +238,13 @@ describe('Database Validator Utility', () => {
238
238
  expect(result.error).toBe('Ping failed');
239
239
  });
240
240
 
241
+ it('should normalize DocumentDB to MongoDB command', async () => {
242
+ await testDatabaseConnection('mongodb://localhost', 'documentdb');
243
+
244
+ expect(mockClient.$runCommandRaw).toHaveBeenCalledWith({ ping: 1 });
245
+ expect(mockClient.$queryRaw).not.toHaveBeenCalled();
246
+ });
247
+
241
248
  it('should handle PostgreSQL query execution errors', async () => {
242
249
  mockClient.$queryRaw.mockRejectedValue(new Error('Query failed'));
243
250
 
@@ -339,6 +346,13 @@ describe('Database Validator Utility', () => {
339
346
  expect(result.error).toContain('frigg db:setup');
340
347
  });
341
348
 
349
+ it('should map DocumentDB to MongoDB client path', () => {
350
+ const result = checkPrismaClientGenerated('documentdb', '/nonexistent/path');
351
+
352
+ expect(result.generated).toBe(false);
353
+ expect(result.error).toContain('@prisma-mongodb/client');
354
+ });
355
+
342
356
  it('should provide helpful error message suggesting db:setup command', () => {
343
357
  const result = checkPrismaClientGenerated('mongodb', '/nonexistent/path');
344
358
 
@@ -193,6 +193,13 @@ describe('Error Messages Utility', () => {
193
193
  expect(message).toContain('@prisma-postgresql/client');
194
194
  });
195
195
 
196
+ it('should map DocumentDB to MongoDB client package name', () => {
197
+ const message = getPrismaClientNotGeneratedError('documentdb');
198
+
199
+ expect(message).toContain('@prisma-mongodb/client');
200
+ expect(message).toContain('documentdb');
201
+ });
202
+
196
203
  it('should suggest running frigg db:setup', () => {
197
204
  const message = getPrismaClientNotGeneratedError('mongodb');
198
205
 
@@ -62,7 +62,7 @@ function getDatabaseType() {
62
62
  * Uses the same Prisma client configuration as runtime
63
63
  *
64
64
  * @param {string} databaseUrl - Database connection URL (for validation purposes)
65
- * @param {'mongodb'|'postgresql'} dbType - Database type to determine appropriate health check
65
+ * @param {'mongodb'|'postgresql'|'documentdb'} dbType - Database type to determine appropriate health check
66
66
  * @param {number} timeout - Connection timeout in milliseconds (default: 5000)
67
67
  * @returns {Promise<Object>} { connected: boolean, error?: string }
68
68
  */
@@ -79,7 +79,9 @@ async function testDatabaseConnection(databaseUrl, dbType, timeout = 5000) {
79
79
 
80
80
  // Test with database-appropriate health check
81
81
  // MongoDB doesn't support SQL, so we use the native ping command
82
- if (dbType === 'mongodb') {
82
+ const normalizedDbType = dbType === 'documentdb' ? 'mongodb' : dbType;
83
+
84
+ if (normalizedDbType === 'mongodb') {
83
85
  // Use MongoDB's native ping command via $runCommandRaw
84
86
  await client.$runCommandRaw({ ping: 1 });
85
87
  } else {
@@ -109,7 +111,7 @@ async function testDatabaseConnection(databaseUrl, dbType, timeout = 5000) {
109
111
  * Checks if Prisma client is generated for the database type
110
112
  * Checks for the generated client directory in @friggframework/core/generated
111
113
  *
112
- * @param {'mongodb'|'postgresql'} dbType - Database type
114
+ * @param {'mongodb'|'postgresql'|'documentdb'} dbType - Database type
113
115
  * @param {string} projectRoot - Project root directory (used for require.resolve context)
114
116
  * @returns {Object} { generated: boolean, path?: string, error?: string }
115
117
  */
@@ -123,7 +125,8 @@ function checkPrismaClientGenerated(dbType, projectRoot = process.cwd()) {
123
125
  const corePackageDir = path.dirname(corePackagePath);
124
126
 
125
127
  // Check for the generated client directory (same path core uses)
126
- const clientPath = path.join(corePackageDir, 'generated', `prisma-${dbType}`);
128
+ const normalizedDbType = dbType === 'documentdb' ? 'mongodb' : dbType;
129
+ const clientPath = path.join(corePackageDir, 'generated', `prisma-${normalizedDbType}`);
127
130
  const clientIndexPath = path.join(clientPath, 'index.js');
128
131
 
129
132
  if (fs.existsSync(clientIndexPath)) {
@@ -161,7 +161,8 @@ ${chalk.gray('5.')} Verify network/firewall settings
161
161
  * @returns {string} Formatted error message
162
162
  */
163
163
  function getPrismaClientNotGeneratedError(dbType) {
164
- const clientName = `@prisma-${dbType}/client`;
164
+ const normalizedDbType = dbType === 'documentdb' ? 'mongodb' : dbType;
165
+ const clientName = `@prisma-${normalizedDbType}/client`;
165
166
 
166
167
  return `
167
168
  ${chalk.red(`❌ Prisma client not generated for ${dbType}`)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/devtools",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.499.2ef107f.0",
4
+ "version": "2.0.0--canary.499.d78661e.0",
5
5
  "bin": {
6
6
  "frigg": "./frigg-cli/index.js"
7
7
  },
@@ -16,9 +16,9 @@
16
16
  "@babel/eslint-parser": "^7.18.9",
17
17
  "@babel/parser": "^7.25.3",
18
18
  "@babel/traverse": "^7.25.3",
19
- "@friggframework/core": "2.0.0--canary.499.2ef107f.0",
20
- "@friggframework/schemas": "2.0.0--canary.499.2ef107f.0",
21
- "@friggframework/test": "2.0.0--canary.499.2ef107f.0",
19
+ "@friggframework/core": "2.0.0--canary.499.d78661e.0",
20
+ "@friggframework/schemas": "2.0.0--canary.499.d78661e.0",
21
+ "@friggframework/test": "2.0.0--canary.499.d78661e.0",
22
22
  "@hapi/boom": "^10.0.1",
23
23
  "@inquirer/prompts": "^5.3.8",
24
24
  "axios": "^1.7.2",
@@ -46,8 +46,8 @@
46
46
  "validate-npm-package-name": "^5.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@friggframework/eslint-config": "2.0.0--canary.499.2ef107f.0",
50
- "@friggframework/prettier-config": "2.0.0--canary.499.2ef107f.0",
49
+ "@friggframework/eslint-config": "2.0.0--canary.499.d78661e.0",
50
+ "@friggframework/prettier-config": "2.0.0--canary.499.d78661e.0",
51
51
  "aws-sdk-client-mock": "^4.1.0",
52
52
  "aws-sdk-client-mock-jest": "^4.1.0",
53
53
  "jest": "^30.1.3",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "2ef107f34b011aef53330f9c5e4f79316c8fcf3b"
82
+ "gitHead": "d78661e3fc21929c10c5814208923342c6a1af98"
83
83
  }