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