@friggframework/devtools 2.0.0--canary.461.12ba2eb.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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
//
|
|
596
|
-
//
|
|
597
|
-
//
|
|
598
|
-
|
|
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
|
});
|
|
@@ -183,31 +183,26 @@ describe('MigrationBuilder', () => {
|
|
|
183
183
|
|
|
184
184
|
const result = await builder.build(appDef, {});
|
|
185
185
|
|
|
186
|
-
// Both migration functions should have package
|
|
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
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
expect(
|
|
200
|
-
expect(
|
|
201
|
-
expect(
|
|
202
|
-
expect(
|
|
203
|
-
expect(
|
|
204
|
-
|
|
205
|
-
//
|
|
206
|
-
const routerPackage = result.functions.dbMigrationRouter.package;
|
|
207
|
-
expect(routerPackage.individually).toBe(true);
|
|
208
|
-
expect(routerPackage.exclude).toBeDefined();
|
|
209
|
-
expect(routerPackage.exclude).toContain('test/**');
|
|
210
|
-
expect(routerPackage.exclude).toContain('node_modules/**/node_modules/**');
|
|
190
|
+
// They should share the same config object (migrationPackageConfig)
|
|
191
|
+
expect(result.functions.dbMigrationWorker.package).toBe(result.functions.dbMigrationRouter.package);
|
|
192
|
+
|
|
193
|
+
// Verify the shared package config has critical exclusions for size optimization
|
|
194
|
+
const packageConfig = result.functions.dbMigrationWorker.package;
|
|
195
|
+
expect(packageConfig.individually).toBe(true);
|
|
196
|
+
expect(Array.isArray(packageConfig.exclude)).toBe(true);
|
|
197
|
+
|
|
198
|
+
// Critical exclusions to prevent Lambda size limit errors
|
|
199
|
+
expect(packageConfig.exclude).toContain('test/**');
|
|
200
|
+
expect(packageConfig.exclude).toContain('**/*.test.js');
|
|
201
|
+
expect(packageConfig.exclude).toContain('node_modules/**/node_modules/**');
|
|
202
|
+
expect(packageConfig.exclude).toContain('node_modules/esbuild/**');
|
|
203
|
+
expect(packageConfig.exclude).toContain('node_modules/typescript/**');
|
|
204
|
+
expect(packageConfig.exclude).toContain('node_modules/@friggframework/devtools/**');
|
|
205
|
+
expect(packageConfig.exclude).toContain('src/**'); // Migration handlers don't need backend source
|
|
211
206
|
});
|
|
212
207
|
|
|
213
208
|
it('should add queue URL to environment', async () => {
|
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.
|
|
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.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
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.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
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": "
|
|
73
|
+
"gitHead": "499527f5e554f19da6d79c9cfa9f3d2e77857467"
|
|
74
74
|
}
|