@friggframework/devtools 2.0.0--canary.461.2db86ce.0 → 2.0.0--canary.461.499527f.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.
@@ -156,7 +156,10 @@ class AuroraBuilder extends InfrastructureBuilder {
156
156
  SecretStringTemplate: JSON.stringify({ username: dbConfig.username || 'postgres' }),
157
157
  GenerateStringKey: 'password',
158
158
  PasswordLength: 32,
159
- ExcludeCharacters: '"@/\\',
159
+ // Exclude URL-special characters for Prisma connection string compatibility
160
+ // Prisma docs: https://www.prisma.io/docs/reference/database-reference/connection-urls#special-characters
161
+ // Exclude: " @ : / ? # [ ] % \ (all have special meaning in URLs or need escaping)
162
+ ExcludeCharacters: '"@:/?#[]%\\\\',
160
163
  },
161
164
  Tags: [
162
165
  { Key: 'Name', Value: '${self:service}-${self:provider.stage}-db-secret' },
@@ -288,7 +291,10 @@ class AuroraBuilder extends InfrastructureBuilder {
288
291
  SecretStringTemplate: JSON.stringify({ username: dbConfig.username || 'postgres' }),
289
292
  GenerateStringKey: 'password',
290
293
  PasswordLength: 32,
291
- ExcludeCharacters: '"@/\\\\',
294
+ // Exclude URL-special characters for Prisma connection string compatibility
295
+ // Prisma docs: https://www.prisma.io/docs/reference/database-reference/connection-urls#special-characters
296
+ // Exclude: " @ : / ? # [ ] % \ (all have special meaning in URLs or need escaping)
297
+ ExcludeCharacters: '"@:/?#[]%\\\\',
292
298
  },
293
299
  Tags: [
294
300
  { Key: 'Name', Value: '${self:service}-${self:provider.stage}-db-secret' },
@@ -572,7 +572,7 @@ describe('AuroraBuilder', () => {
572
572
  expect(jsonOutput).not.toContain('[object Object]');
573
573
  });
574
574
 
575
- it('should properly escape ExcludeCharacters for valid JSON in CloudFormation template', async () => {
575
+ it('should exclude URL-special characters from password generation for Prisma compatibility', async () => {
576
576
  const appDefinition = {
577
577
  database: {
578
578
  postgres: {
@@ -591,18 +591,15 @@ describe('AuroraBuilder', () => {
591
591
  const result = await auroraBuilder.build(appDefinition, discoveredResources);
592
592
 
593
593
  const excludeChars = result.resources.FriggDBSecret.Properties.GenerateSecretString.ExcludeCharacters;
594
-
595
- // Should properly escape the backslash so it's valid JSON
596
- // In JavaScript string: '"@/\\' represents the string: "@/\
597
- // When serialized to JSON, backslash must be doubled: '"@/\\'
598
- expect(excludeChars).toBe('"@/\\\\');
599
-
594
+
595
+ // Must exclude URL-special characters that would break Prisma connection strings
596
+ // Prisma docs: https://www.prisma.io/docs/reference/database-reference/connection-urls#special-characters
597
+ // These characters have special meaning in URLs and must be excluded or the password must be URL-encoded
598
+ // Exclude: " @ : / ? # [ ] % (and \ for JSON escaping)
599
+ expect(excludeChars).toBe('"@:/?#[]%\\\\');
600
+
600
601
  // Verify it can be JSON-stringified without errors
601
602
  expect(() => JSON.stringify(result.resources.FriggDBSecret)).not.toThrow();
602
-
603
- // Verify the JSON output has the correct escape sequence
604
- const jsonOutput = JSON.stringify(result.resources.FriggDBSecret);
605
- expect(jsonOutput).toContain('\\"@/\\\\\\\\'); // In JSON string: "\"@/\\\\"
606
603
  });
607
604
  });
608
605
  });
@@ -186,7 +186,7 @@ describe('MigrationBuilder', () => {
186
186
  // Both migration functions should have the same package config
187
187
  expect(result.functions.dbMigrationWorker.package).toBeDefined();
188
188
  expect(result.functions.dbMigrationRouter.package).toBeDefined();
189
-
189
+
190
190
  // They should share the same config object (migrationPackageConfig)
191
191
  expect(result.functions.dbMigrationWorker.package).toBe(result.functions.dbMigrationRouter.package);
192
192
 
@@ -194,7 +194,7 @@ describe('MigrationBuilder', () => {
194
194
  const packageConfig = result.functions.dbMigrationWorker.package;
195
195
  expect(packageConfig.individually).toBe(true);
196
196
  expect(Array.isArray(packageConfig.exclude)).toBe(true);
197
-
197
+
198
198
  // Critical exclusions to prevent Lambda size limit errors
199
199
  expect(packageConfig.exclude).toContain('test/**');
200
200
  expect(packageConfig.exclude).toContain('**/*.test.js');
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.461.2db86ce.0",
4
+ "version": "2.0.0--canary.461.499527f.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.835.0",
7
7
  "@aws-sdk/client-kms": "^3.835.0",
@@ -11,8 +11,8 @@
11
11
  "@babel/eslint-parser": "^7.18.9",
12
12
  "@babel/parser": "^7.25.3",
13
13
  "@babel/traverse": "^7.25.3",
14
- "@friggframework/schemas": "2.0.0--canary.461.2db86ce.0",
15
- "@friggframework/test": "2.0.0--canary.461.2db86ce.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.499527f.0",
15
+ "@friggframework/test": "2.0.0--canary.461.499527f.0",
16
16
  "@hapi/boom": "^10.0.1",
17
17
  "@inquirer/prompts": "^5.3.8",
18
18
  "axios": "^1.7.2",
@@ -34,8 +34,8 @@
34
34
  "serverless-http": "^2.7.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@friggframework/eslint-config": "2.0.0--canary.461.2db86ce.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.2db86ce.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.499527f.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.499527f.0",
39
39
  "aws-sdk-client-mock": "^4.1.0",
40
40
  "aws-sdk-client-mock-jest": "^4.1.0",
41
41
  "jest": "^30.1.3",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "2db86ce72c7e8f37cfcf3576560288dd2322065e"
73
+ "gitHead": "499527f5e554f19da6d79c9cfa9f3d2e77857467"
74
74
  }