@friggframework/devtools 2.0.0--canary.608.ba60ba6.0 → 2.0.0--canary.608.03436383054a.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.
- package/infrastructure/domains/integration/integration-builder.js +2 -10
- package/infrastructure/domains/integration/integration-builder.test.js +100 -97
- package/infrastructure/domains/security/iam-generator.js +5 -10
- package/infrastructure/domains/security/iam-generator.test.js +19 -22
- package/infrastructure/domains/security/templates/frigg-deployment-iam-stack.yaml +387 -399
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +59 -95
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +27 -73
- package/package.json +7 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base Serverless Definition Factory
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Utility Layer - Hexagonal Architecture
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* Creates the base serverless.yml configuration with core functions,
|
|
7
7
|
* resources, plugins, and provider settings.
|
|
8
8
|
*/
|
|
@@ -11,14 +11,14 @@ const { buildEnvironment } = require('../environment-builder');
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Create base serverless definition with core functions and resources
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* This creates the foundation serverless configuration that all
|
|
16
16
|
* Frigg applications need, including:
|
|
17
17
|
* - Core Lambda functions (auth, user, health, dbMigrate)
|
|
18
18
|
* - Error handling infrastructure (SQS, SNS, CloudWatch)
|
|
19
19
|
* - Prisma Lambda Layer (optional)
|
|
20
20
|
* - Base plugins and esbuild configuration
|
|
21
|
-
*
|
|
21
|
+
*
|
|
22
22
|
* @param {Object} AppDefinition - Application definition
|
|
23
23
|
* @param {Object} appEnvironmentVars - Environment variables from app definition
|
|
24
24
|
* @param {Object} discoveredResources - AWS resources discovered during build
|
|
@@ -39,25 +39,18 @@ function createBaseDefinition(
|
|
|
39
39
|
// Explicitly include project files that handlers need
|
|
40
40
|
include: [
|
|
41
41
|
// Include DocumentDB TLS certificate if configured
|
|
42
|
-
...(AppDefinition.database?.documentDB?.tlsCAFile
|
|
43
|
-
? [
|
|
44
|
-
AppDefinition.database.documentDB.tlsCAFile.replace(
|
|
45
|
-
/^\.\//,
|
|
46
|
-
''
|
|
47
|
-
),
|
|
48
|
-
]
|
|
42
|
+
...(AppDefinition.database?.documentDB?.tlsCAFile
|
|
43
|
+
? [AppDefinition.database.documentDB.tlsCAFile.replace(/^\.\//, '')]
|
|
49
44
|
: []),
|
|
50
45
|
],
|
|
51
46
|
exclude: [
|
|
52
47
|
// Exclude Prisma (provided via Lambda Layer)
|
|
53
|
-
...(usePrismaLayer
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
: []),
|
|
48
|
+
...(usePrismaLayer ? [
|
|
49
|
+
'node_modules/@prisma/**',
|
|
50
|
+
'node_modules/.prisma/**',
|
|
51
|
+
'node_modules/prisma/**',
|
|
52
|
+
'node_modules/@friggframework/core/generated/**',
|
|
53
|
+
] : []),
|
|
61
54
|
|
|
62
55
|
// Exclude AWS SDK (provided by Lambda runtime)
|
|
63
56
|
'node_modules/aws-sdk/**',
|
|
@@ -126,14 +119,12 @@ function createBaseDefinition(
|
|
|
126
119
|
'node_modules/@aws-sdk/**',
|
|
127
120
|
|
|
128
121
|
// Exclude Prisma (provided via Lambda Layer)
|
|
129
|
-
...(usePrismaLayer
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
]
|
|
136
|
-
: []),
|
|
122
|
+
...(usePrismaLayer ? [
|
|
123
|
+
'node_modules/@prisma/**',
|
|
124
|
+
'node_modules/.prisma/**',
|
|
125
|
+
'node_modules/prisma/**',
|
|
126
|
+
'node_modules/@friggframework/core/generated/**',
|
|
127
|
+
] : []),
|
|
137
128
|
|
|
138
129
|
// Exclude nested node_modules from symlinked frigg packages (for npm link development)
|
|
139
130
|
'node_modules/@friggframework/core/node_modules/**',
|
|
@@ -183,17 +174,12 @@ function createBaseDefinition(
|
|
|
183
174
|
useDotenv: process.argv.includes('offline'),
|
|
184
175
|
provider: {
|
|
185
176
|
name: AppDefinition.provider || 'aws',
|
|
186
|
-
...(process.env.AWS_PROFILE && {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
runtime: 'nodejs22.x', // Node.js 22.x (latest Lambda runtime with AWS SDK v3)
|
|
190
|
-
timeout: 29, // Set to 29s to give buffer before API Gateway's 30s timeout
|
|
177
|
+
...(process.env.AWS_PROFILE && { profile: process.env.AWS_PROFILE }),
|
|
178
|
+
runtime: 'nodejs22.x', // Node.js 22.x (latest Lambda runtime with AWS SDK v3)
|
|
179
|
+
timeout: 29, // Set to 29s to give buffer before API Gateway's 30s timeout
|
|
191
180
|
region,
|
|
192
181
|
stage: '${opt:stage}',
|
|
193
|
-
environment: buildEnvironment(
|
|
194
|
-
appEnvironmentVars,
|
|
195
|
-
discoveredResources
|
|
196
|
-
),
|
|
182
|
+
environment: buildEnvironment(appEnvironmentVars, discoveredResources),
|
|
197
183
|
iamRoleStatements: [
|
|
198
184
|
{
|
|
199
185
|
Effect: 'Allow',
|
|
@@ -240,9 +226,7 @@ function createBaseDefinition(
|
|
|
240
226
|
plugins: [
|
|
241
227
|
'serverless-esbuild',
|
|
242
228
|
// Only load dotenv plugin for offline mode
|
|
243
|
-
...(process.argv.includes('offline')
|
|
244
|
-
? ['serverless-dotenv-plugin']
|
|
245
|
-
: []),
|
|
229
|
+
...(process.argv.includes('offline') ? ['serverless-dotenv-plugin'] : []),
|
|
246
230
|
'serverless-offline-sqs',
|
|
247
231
|
'serverless-offline',
|
|
248
232
|
'@friggframework/serverless-plugin',
|
|
@@ -258,32 +242,33 @@ function createBaseDefinition(
|
|
|
258
242
|
external: [
|
|
259
243
|
'@aws-sdk/*',
|
|
260
244
|
'aws-sdk',
|
|
261
|
-
...(usePrismaLayer
|
|
262
|
-
|
|
263
|
-
|
|
245
|
+
...(usePrismaLayer ? [
|
|
246
|
+
'@prisma/client',
|
|
247
|
+
'prisma',
|
|
248
|
+
'.prisma/*',
|
|
249
|
+
] : []),
|
|
264
250
|
],
|
|
265
251
|
packager: 'npm',
|
|
266
252
|
keepNames: true,
|
|
267
|
-
keepOutputDirectory: true,
|
|
253
|
+
keepOutputDirectory: true, // Keep .esbuild directory to prevent ENOENT errors during packaging
|
|
268
254
|
exclude: [
|
|
269
255
|
'aws-sdk',
|
|
270
256
|
'@aws-sdk/*',
|
|
271
|
-
...(usePrismaLayer ? [
|
|
257
|
+
...(usePrismaLayer ? [
|
|
258
|
+
'@prisma/client',
|
|
259
|
+
'prisma',
|
|
260
|
+
] : []),
|
|
272
261
|
],
|
|
273
262
|
// Reduce file scanning overhead - tell esbuild to skip these during watch/scan but still bundle them
|
|
274
263
|
watch: {
|
|
275
|
-
ignore: [
|
|
276
|
-
'node_modules/@aws-sdk/**',
|
|
277
|
-
'node_modules/@babel/**',
|
|
278
|
-
'node_modules/@smithy/**',
|
|
279
|
-
],
|
|
264
|
+
ignore: ['node_modules/@aws-sdk/**', 'node_modules/@babel/**', 'node_modules/@smithy/**']
|
|
280
265
|
},
|
|
281
266
|
},
|
|
282
267
|
'serverless-offline': {
|
|
283
268
|
httpPort: 3001,
|
|
284
269
|
lambdaPort: 4001,
|
|
285
270
|
websocketPort: 3002,
|
|
286
|
-
location: '.',
|
|
271
|
+
location: '.', // Set base directory for handler resolution to current directory
|
|
287
272
|
skipCacheInvalidation: false,
|
|
288
273
|
},
|
|
289
274
|
'serverless-offline-sqs': {
|
|
@@ -298,12 +283,9 @@ function createBaseDefinition(
|
|
|
298
283
|
},
|
|
299
284
|
functions: {
|
|
300
285
|
auth: {
|
|
301
|
-
handler:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
layers: [{ Ref: 'PrismaLambdaLayer' }],
|
|
305
|
-
}),
|
|
306
|
-
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
286
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/auth.handler',
|
|
287
|
+
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
288
|
+
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
307
289
|
package: skipEsbuildPackageConfig,
|
|
308
290
|
events: [
|
|
309
291
|
{ httpApi: { path: '/api/integrations', method: 'ANY' } },
|
|
@@ -317,24 +299,16 @@ function createBaseDefinition(
|
|
|
317
299
|
],
|
|
318
300
|
},
|
|
319
301
|
user: {
|
|
320
|
-
handler:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
layers: [{ Ref: 'PrismaLambdaLayer' }],
|
|
324
|
-
}),
|
|
325
|
-
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
302
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/user.handler',
|
|
303
|
+
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
304
|
+
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
326
305
|
package: skipEsbuildPackageConfig,
|
|
327
|
-
events: [
|
|
328
|
-
{ httpApi: { path: '/user/{proxy+}', method: 'ANY' } },
|
|
329
|
-
],
|
|
306
|
+
events: [{ httpApi: { path: '/user/{proxy+}', method: 'ANY' } }],
|
|
330
307
|
},
|
|
331
308
|
health: {
|
|
332
|
-
handler:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
layers: [{ Ref: 'PrismaLambdaLayer' }],
|
|
336
|
-
}),
|
|
337
|
-
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
309
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/health.handler',
|
|
310
|
+
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
311
|
+
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
338
312
|
package: skipEsbuildPackageConfig,
|
|
339
313
|
events: [
|
|
340
314
|
{ httpApi: { path: '/health', method: 'GET' } },
|
|
@@ -342,38 +316,27 @@ function createBaseDefinition(
|
|
|
342
316
|
],
|
|
343
317
|
},
|
|
344
318
|
reporting: {
|
|
345
|
-
handler:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
layers: [{ Ref: 'PrismaLambdaLayer' }],
|
|
349
|
-
}),
|
|
350
|
-
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
319
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/reporting.handler',
|
|
320
|
+
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
321
|
+
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
351
322
|
package: skipEsbuildPackageConfig,
|
|
352
323
|
events: [
|
|
353
324
|
{ httpApi: { path: '/api/v2/reports', method: 'GET' } },
|
|
354
|
-
{
|
|
355
|
-
httpApi: {
|
|
356
|
-
path: '/api/v2/reports/{proxy+}',
|
|
357
|
-
method: 'GET',
|
|
358
|
-
},
|
|
359
|
-
},
|
|
325
|
+
{ httpApi: { path: '/api/v2/reports/{proxy+}', method: 'GET' } },
|
|
360
326
|
],
|
|
361
327
|
},
|
|
362
328
|
// Note: dbMigrate removed - MigrationBuilder now handles migration infrastructure
|
|
363
329
|
// See: packages/devtools/infrastructure/domains/database/migration-builder.js
|
|
364
330
|
},
|
|
365
|
-
layers: usePrismaLayer
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
}
|
|
376
|
-
: {},
|
|
331
|
+
layers: usePrismaLayer ? {
|
|
332
|
+
prisma: {
|
|
333
|
+
path: 'layers/prisma',
|
|
334
|
+
name: '${self:service}-prisma-${sls:stage}',
|
|
335
|
+
description: 'Prisma runtime client only (NO CLI) with rhel-openssl-3.0.x binaries (~10-15MB). CLI packaged separately in dbMigrate function.',
|
|
336
|
+
compatibleRuntimes: ['nodejs20.x', 'nodejs22.x'],
|
|
337
|
+
retain: false,
|
|
338
|
+
},
|
|
339
|
+
} : {},
|
|
377
340
|
resources: {
|
|
378
341
|
Resources: {
|
|
379
342
|
InternalErrorQueue: {
|
|
@@ -456,3 +419,4 @@ function createBaseDefinition(
|
|
|
456
419
|
module.exports = {
|
|
457
420
|
createBaseDefinition,
|
|
458
421
|
};
|
|
422
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tests for Base Definition Factory
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Tests creation of base serverless configuration
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -20,11 +20,7 @@ describe('Base Definition Factory', () => {
|
|
|
20
20
|
const appEnvironmentVars = {};
|
|
21
21
|
const discoveredResources = {};
|
|
22
22
|
|
|
23
|
-
const result = createBaseDefinition(
|
|
24
|
-
appDefinition,
|
|
25
|
-
appEnvironmentVars,
|
|
26
|
-
discoveredResources
|
|
27
|
-
);
|
|
23
|
+
const result = createBaseDefinition(appDefinition, appEnvironmentVars, discoveredResources);
|
|
28
24
|
|
|
29
25
|
expect(result.service).toBe('test-app');
|
|
30
26
|
expect(result.frameworkVersion).toBe('>=3.17.0');
|
|
@@ -56,9 +52,7 @@ describe('Base Definition Factory', () => {
|
|
|
56
52
|
const result = createBaseDefinition({}, {}, {});
|
|
57
53
|
|
|
58
54
|
expect(result.provider.region).toBe('eu-west-1');
|
|
59
|
-
expect(result.custom['serverless-offline-sqs'].region).toBe(
|
|
60
|
-
'eu-west-1'
|
|
61
|
-
);
|
|
55
|
+
expect(result.custom['serverless-offline-sqs'].region).toBe('eu-west-1');
|
|
62
56
|
});
|
|
63
57
|
|
|
64
58
|
it('should default to us-east-1 region', () => {
|
|
@@ -98,12 +92,8 @@ describe('Base Definition Factory', () => {
|
|
|
98
92
|
it('should configure auth function correctly', () => {
|
|
99
93
|
const result = createBaseDefinition({}, {}, {});
|
|
100
94
|
|
|
101
|
-
expect(result.functions.auth.handler).toBe(
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
expect(result.functions.auth.layers).toEqual([
|
|
105
|
-
{ Ref: 'PrismaLambdaLayer' },
|
|
106
|
-
]);
|
|
95
|
+
expect(result.functions.auth.handler).toBe('node_modules/@friggframework/core/handlers/routers/auth.handler');
|
|
96
|
+
expect(result.functions.auth.layers).toEqual([{ Ref: 'PrismaLambdaLayer' }]);
|
|
107
97
|
expect(result.functions.auth.events).toHaveLength(3);
|
|
108
98
|
});
|
|
109
99
|
|
|
@@ -119,21 +109,15 @@ describe('Base Definition Factory', () => {
|
|
|
119
109
|
|
|
120
110
|
expect(result.layers.prisma).toBeDefined();
|
|
121
111
|
expect(result.layers.prisma.path).toBe('layers/prisma');
|
|
122
|
-
expect(result.layers.prisma.description).toContain(
|
|
123
|
-
'runtime client only'
|
|
124
|
-
);
|
|
112
|
+
expect(result.layers.prisma.description).toContain('runtime client only');
|
|
125
113
|
});
|
|
126
114
|
|
|
127
115
|
it('should include error handling resources', () => {
|
|
128
116
|
const result = createBaseDefinition({}, {}, {});
|
|
129
117
|
|
|
130
118
|
expect(result.resources.Resources.InternalErrorQueue).toBeDefined();
|
|
131
|
-
expect(
|
|
132
|
-
|
|
133
|
-
).toBeDefined();
|
|
134
|
-
expect(
|
|
135
|
-
result.resources.Resources.InternalErrorBridgePolicy
|
|
136
|
-
).toBeDefined();
|
|
119
|
+
expect(result.resources.Resources.InternalErrorBridgeTopic).toBeDefined();
|
|
120
|
+
expect(result.resources.Resources.InternalErrorBridgePolicy).toBeDefined();
|
|
137
121
|
expect(result.resources.Resources.ApiGatewayAlarm5xx).toBeDefined();
|
|
138
122
|
});
|
|
139
123
|
|
|
@@ -141,12 +125,12 @@ describe('Base Definition Factory', () => {
|
|
|
141
125
|
const result = createBaseDefinition({}, {}, {});
|
|
142
126
|
|
|
143
127
|
const snsPermission = result.provider.iamRoleStatements.find(
|
|
144
|
-
|
|
128
|
+
stmt => stmt.Action.includes('sns:Publish')
|
|
145
129
|
);
|
|
146
130
|
expect(snsPermission).toBeDefined();
|
|
147
131
|
|
|
148
132
|
const sqsPermission = result.provider.iamRoleStatements.find(
|
|
149
|
-
|
|
133
|
+
stmt => stmt.Action.includes('sqs:SendMessage')
|
|
150
134
|
);
|
|
151
135
|
expect(sqsPermission).toBeDefined();
|
|
152
136
|
|
|
@@ -164,9 +148,7 @@ describe('Base Definition Factory', () => {
|
|
|
164
148
|
// serverless-dotenv-plugin is conditionally loaded only in offline mode
|
|
165
149
|
expect(result.plugins).toContain('serverless-offline-sqs');
|
|
166
150
|
expect(result.plugins).toContain('serverless-offline');
|
|
167
|
-
expect(result.plugins).toContain(
|
|
168
|
-
'@friggframework/serverless-plugin'
|
|
169
|
-
);
|
|
151
|
+
expect(result.plugins).toContain('@friggframework/serverless-plugin');
|
|
170
152
|
});
|
|
171
153
|
|
|
172
154
|
it('should configure esbuild correctly', () => {
|
|
@@ -194,26 +176,16 @@ describe('Base Definition Factory', () => {
|
|
|
194
176
|
|
|
195
177
|
const result = createBaseDefinition({}, appEnvironmentVars, {});
|
|
196
178
|
|
|
197
|
-
expect(result.provider.environment.API_KEY).toBe(
|
|
198
|
-
|
|
199
|
-
);
|
|
200
|
-
expect(result.provider.environment.CUSTOM_VAR).toBe(
|
|
201
|
-
"${env:CUSTOM_VAR, ''}"
|
|
202
|
-
);
|
|
179
|
+
expect(result.provider.environment.API_KEY).toBe("${env:API_KEY, ''}");
|
|
180
|
+
expect(result.provider.environment.CUSTOM_VAR).toBe("${env:CUSTOM_VAR, ''}");
|
|
203
181
|
});
|
|
204
182
|
|
|
205
183
|
it('should add standard Frigg environment variables', () => {
|
|
206
184
|
const result = createBaseDefinition({}, {}, {});
|
|
207
185
|
|
|
208
|
-
expect(result.provider.environment.FRIGG_STACK).toBe(
|
|
209
|
-
|
|
210
|
-
);
|
|
211
|
-
expect(result.provider.environment.FRIGG_STAGE).toBe(
|
|
212
|
-
'${self:provider.stage}'
|
|
213
|
-
);
|
|
214
|
-
expect(result.provider.environment.FRIGG_REGION).toBe(
|
|
215
|
-
'${self:provider.region}'
|
|
216
|
-
);
|
|
186
|
+
expect(result.provider.environment.FRIGG_STACK).toBe('${self:service}');
|
|
187
|
+
expect(result.provider.environment.FRIGG_STAGE).toBe('${self:provider.stage}');
|
|
188
|
+
expect(result.provider.environment.FRIGG_REGION).toBe('${self:provider.region}');
|
|
217
189
|
});
|
|
218
190
|
|
|
219
191
|
it('should add KMS key ARN from discovered resources', () => {
|
|
@@ -223,9 +195,7 @@ describe('Base Definition Factory', () => {
|
|
|
223
195
|
|
|
224
196
|
const result = createBaseDefinition({}, {}, discoveredResources);
|
|
225
197
|
|
|
226
|
-
expect(result.provider.environment.KMS_KEY_ARN).toBe(
|
|
227
|
-
'arn:aws:kms:us-east-1:123:key/abc'
|
|
228
|
-
);
|
|
198
|
+
expect(result.provider.environment.KMS_KEY_ARN).toBe('arn:aws:kms:us-east-1:123:key/abc');
|
|
229
199
|
});
|
|
230
200
|
|
|
231
201
|
it('should add database connection info from discovered resources', () => {
|
|
@@ -236,23 +206,18 @@ describe('Base Definition Factory', () => {
|
|
|
236
206
|
|
|
237
207
|
const result = createBaseDefinition({}, {}, discoveredResources);
|
|
238
208
|
|
|
239
|
-
expect(result.provider.environment.DATABASE_HOST).toBe(
|
|
240
|
-
'db.example.com'
|
|
241
|
-
);
|
|
209
|
+
expect(result.provider.environment.DATABASE_HOST).toBe('db.example.com');
|
|
242
210
|
expect(result.provider.environment.DATABASE_PORT).toBe('5432');
|
|
243
211
|
});
|
|
244
212
|
|
|
245
213
|
it('should add database secret ARN from discovered resources', () => {
|
|
246
214
|
const discoveredResources = {
|
|
247
|
-
databaseSecretArn:
|
|
248
|
-
'arn:aws:secretsmanager:us-east-1:123:secret:db',
|
|
215
|
+
databaseSecretArn: 'arn:aws:secretsmanager:us-east-1:123:secret:db',
|
|
249
216
|
};
|
|
250
217
|
|
|
251
218
|
const result = createBaseDefinition({}, {}, discoveredResources);
|
|
252
219
|
|
|
253
|
-
expect(result.provider.environment.DATABASE_SECRET_ARN).toBe(
|
|
254
|
-
'arn:aws:secretsmanager:us-east-1:123:secret:db'
|
|
255
|
-
);
|
|
220
|
+
expect(result.provider.environment.DATABASE_SECRET_ARN).toBe('arn:aws:secretsmanager:us-east-1:123:secret:db');
|
|
256
221
|
});
|
|
257
222
|
|
|
258
223
|
it('should configure serverless-offline ports', () => {
|
|
@@ -260,23 +225,15 @@ describe('Base Definition Factory', () => {
|
|
|
260
225
|
|
|
261
226
|
expect(result.custom['serverless-offline'].httpPort).toBe(3001);
|
|
262
227
|
expect(result.custom['serverless-offline'].lambdaPort).toBe(4001);
|
|
263
|
-
expect(result.custom['serverless-offline'].websocketPort).toBe(
|
|
264
|
-
3002
|
|
265
|
-
);
|
|
228
|
+
expect(result.custom['serverless-offline'].websocketPort).toBe(3002);
|
|
266
229
|
});
|
|
267
230
|
|
|
268
231
|
it('should configure serverless-offline-sqs for LocalStack', () => {
|
|
269
232
|
const result = createBaseDefinition({}, {}, {});
|
|
270
233
|
|
|
271
|
-
expect(result.custom['serverless-offline-sqs'].endpoint).toBe(
|
|
272
|
-
|
|
273
|
-
);
|
|
274
|
-
expect(result.custom['serverless-offline-sqs'].accessKeyId).toBe(
|
|
275
|
-
'root'
|
|
276
|
-
);
|
|
277
|
-
expect(
|
|
278
|
-
result.custom['serverless-offline-sqs'].secretAccessKey
|
|
279
|
-
).toBe('root');
|
|
234
|
+
expect(result.custom['serverless-offline-sqs'].endpoint).toBe('http://localhost:4566');
|
|
235
|
+
expect(result.custom['serverless-offline-sqs'].accessKeyId).toBe('root');
|
|
236
|
+
expect(result.custom['serverless-offline-sqs'].secretAccessKey).toBe('root');
|
|
280
237
|
});
|
|
281
238
|
|
|
282
239
|
it('should set package.individually to true', () => {
|
|
@@ -298,9 +255,7 @@ describe('Base Definition Factory', () => {
|
|
|
298
255
|
const result = createBaseDefinition({}, {}, {});
|
|
299
256
|
|
|
300
257
|
expect(result.layers.prisma).toBeDefined();
|
|
301
|
-
expect(result.functions.auth.layers).toEqual([
|
|
302
|
-
{ Ref: 'PrismaLambdaLayer' },
|
|
303
|
-
]);
|
|
258
|
+
expect(result.functions.auth.layers).toEqual([{ Ref: 'PrismaLambdaLayer' }]);
|
|
304
259
|
expect(result.functions.auth.package.exclude).toEqual(
|
|
305
260
|
expect.arrayContaining([
|
|
306
261
|
'node_modules/@prisma/**',
|
|
@@ -334,10 +289,9 @@ describe('Base Definition Factory', () => {
|
|
|
334
289
|
|
|
335
290
|
it('defaults to usePrismaLayer=true when omitted', () => {
|
|
336
291
|
const result = createBaseDefinition({}, {}, {});
|
|
337
|
-
expect(result.functions.auth.layers).toEqual([
|
|
338
|
-
{ Ref: 'PrismaLambdaLayer' },
|
|
339
|
-
]);
|
|
292
|
+
expect(result.functions.auth.layers).toEqual([{ Ref: 'PrismaLambdaLayer' }]);
|
|
340
293
|
});
|
|
341
294
|
});
|
|
342
295
|
});
|
|
343
296
|
});
|
|
297
|
+
|
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.608.
|
|
4
|
+
"version": "2.0.0--canary.608.03436383054a.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@babel/eslint-parser": "^7.18.9",
|
|
26
26
|
"@babel/parser": "^7.25.3",
|
|
27
27
|
"@babel/traverse": "^7.25.3",
|
|
28
|
-
"@friggframework/core": "2.0.0--canary.608.
|
|
29
|
-
"@friggframework/schemas": "2.0.0--canary.608.
|
|
30
|
-
"@friggframework/test": "2.0.0--canary.608.
|
|
28
|
+
"@friggframework/core": "2.0.0--canary.608.03436383054a.0",
|
|
29
|
+
"@friggframework/schemas": "2.0.0--canary.608.03436383054a.0",
|
|
30
|
+
"@friggframework/test": "2.0.0--canary.608.03436383054a.0",
|
|
31
31
|
"@hapi/boom": "^10.0.1",
|
|
32
32
|
"@inquirer/prompts": "^5.3.8",
|
|
33
33
|
"axios": "^1.18.0",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"validate-npm-package-name": "^5.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@friggframework/eslint-config": "2.0.0--canary.608.
|
|
59
|
-
"@friggframework/prettier-config": "2.0.0--canary.608.
|
|
58
|
+
"@friggframework/eslint-config": "2.0.0--canary.608.03436383054a.0",
|
|
59
|
+
"@friggframework/prettier-config": "2.0.0--canary.608.03436383054a.0",
|
|
60
60
|
"aws-sdk-client-mock": "^4.1.0",
|
|
61
61
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
62
62
|
"jest": "^30.1.3",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "03436383054a3ee70bd4de8f13a1907890a627da"
|
|
92
92
|
}
|