@friggframework/devtools 2.0.0--canary.704.79d9a63.0 → 2.0.0--canary.680.daae24e.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/README.md +0 -14
- package/frigg-cli/README.md +0 -6
- package/frigg-cli/__tests__/unit/dependencies.test.js +5 -3
- package/frigg-cli/index.js +0 -3
- package/frigg-cli/package.json +3 -3
- package/infrastructure/README.md +4 -22
- package/infrastructure/__tests__/management-api-gateway-routes.test.js +335 -0
- package/infrastructure/domains/admin-scripts/admin-script-builder.js +48 -56
- package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +7 -76
- package/infrastructure/domains/database/migration-builder.js +175 -182
- package/infrastructure/domains/database/migration-builder.test.js +5 -36
- package/infrastructure/domains/integration/integration-builder.js +61 -65
- package/infrastructure/domains/integration/integration-builder.test.js +8 -73
- package/infrastructure/domains/parameters/offload-utils.js +1 -0
- package/infrastructure/domains/shared/environment-builder.js +12 -1
- package/infrastructure/domains/shared/environment-builder.test.js +20 -0
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +148 -86
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +87 -96
- package/infrastructure/domains/shared/utilities/logging-config.js +4 -3
- package/infrastructure/domains/shared/utilities/logging-config.test.js +2 -1
- package/infrastructure/infrastructure-composer.test.js +3 -3
- package/package.json +8 -11
- package/frigg-cli/__tests__/unit/utils/node-version.test.js +0 -66
- package/frigg-cli/utils/node-version.js +0 -51
- package/infrastructure/__tests__/package-patterns-composition.test.js +0 -153
- package/infrastructure/domains/shared/utilities/framework-version.js +0 -14
- package/infrastructure/domains/shared/utilities/framework-version.test.js +0 -27
- package/infrastructure/domains/shared/utilities/package-patterns.js +0 -35
- package/infrastructure/domains/shared/utilities/package-patterns.test.js +0 -112
|
@@ -168,21 +168,6 @@ describe('AdminScriptBuilder', () => {
|
|
|
168
168
|
expect(result.resources.AdminScriptQueue.Properties.VisibilityTimeout).toBe(900); // 15 minutes
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
it('registers AdminScriptQueue under custom so frigg start creates it locally', async () => {
|
|
172
|
-
const appDefinition = {
|
|
173
|
-
adminScripts: [{ Definition: { name: 'test-script' } }],
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const result = await adminScriptBuilder.build(appDefinition, {});
|
|
177
|
-
|
|
178
|
-
expect(result.custom.AdminScriptQueue).toBe(
|
|
179
|
-
'${self:service}-${self:provider.stage}-AdminScriptQueue'
|
|
180
|
-
);
|
|
181
|
-
expect(result.resources.AdminScriptQueue.Properties.QueueName).toBe(
|
|
182
|
-
'${self:custom.AdminScriptQueue}'
|
|
183
|
-
);
|
|
184
|
-
});
|
|
185
|
-
|
|
186
171
|
it('should configure AdminScriptQueue redrive policy to InternalErrorQueue', async () => {
|
|
187
172
|
const appDefinition = {
|
|
188
173
|
adminScripts: [
|
|
@@ -285,11 +270,11 @@ describe('AdminScriptBuilder', () => {
|
|
|
285
270
|
result.functions.adminScriptExecutor,
|
|
286
271
|
result.functions.adminScriptRouter,
|
|
287
272
|
]) {
|
|
288
|
-
expect(fn.package.
|
|
273
|
+
expect(fn.package.exclude).toEqual(
|
|
289
274
|
expect.arrayContaining([
|
|
290
|
-
'
|
|
291
|
-
'
|
|
292
|
-
'
|
|
275
|
+
'node_modules/aws-sdk/**',
|
|
276
|
+
'node_modules/@aws-sdk/**',
|
|
277
|
+
'node_modules/@prisma/**',
|
|
293
278
|
])
|
|
294
279
|
);
|
|
295
280
|
}
|
|
@@ -636,21 +621,6 @@ describe('AdminScriptBuilder', () => {
|
|
|
636
621
|
});
|
|
637
622
|
|
|
638
623
|
describe('reports (ReportQueue + reportExecutor)', () => {
|
|
639
|
-
it('registers ReportQueue under custom so frigg start creates it locally', async () => {
|
|
640
|
-
const appDefinition = {
|
|
641
|
-
reports: [{ Definition: { name: 'my-report', version: '1.0.0' } }],
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
const result = await adminScriptBuilder.build(appDefinition, {});
|
|
645
|
-
|
|
646
|
-
expect(result.custom.ReportQueue).toBe(
|
|
647
|
-
'${self:service}-${self:provider.stage}-ReportQueue'
|
|
648
|
-
);
|
|
649
|
-
expect(result.resources.ReportQueue.Properties.QueueName).toBe(
|
|
650
|
-
'${self:custom.ReportQueue}'
|
|
651
|
-
);
|
|
652
|
-
});
|
|
653
|
-
|
|
654
624
|
it('creates ReportQueue + reportExecutor and wires REPORT_QUEUE_URL when reports are present', async () => {
|
|
655
625
|
const appDefinition = {
|
|
656
626
|
reports: [{ Definition: { name: 'my-report', version: '1.0.0' } }],
|
|
@@ -1029,7 +999,7 @@ describe('AdminScriptBuilder nested node_modules (lambda.keepNestedNodeModules)'
|
|
|
1029
999
|
const result = await new AdminScriptBuilder().build(appDefinition(), {});
|
|
1030
1000
|
|
|
1031
1001
|
for (const fn of executorAndRouter(result)) {
|
|
1032
|
-
expect(fn.package.
|
|
1002
|
+
expect(fn.package.exclude).toContain('node_modules/**/node_modules/**');
|
|
1033
1003
|
}
|
|
1034
1004
|
});
|
|
1035
1005
|
|
|
@@ -1040,47 +1010,8 @@ describe('AdminScriptBuilder nested node_modules (lambda.keepNestedNodeModules)'
|
|
|
1040
1010
|
);
|
|
1041
1011
|
|
|
1042
1012
|
for (const fn of executorAndRouter(result)) {
|
|
1043
|
-
expect(fn.package.
|
|
1044
|
-
expect(fn.package.
|
|
1013
|
+
expect(fn.package.exclude).not.toContain('node_modules/**/node_modules/**');
|
|
1014
|
+
expect(fn.package.exclude).toContain('node_modules/**/node_modules/@friggframework/**');
|
|
1045
1015
|
}
|
|
1046
1016
|
});
|
|
1047
1017
|
});
|
|
1048
|
-
|
|
1049
|
-
describe('AdminScriptBuilder function package patterns (ADR-050)', () => {
|
|
1050
|
-
it('emits package.patterns, never include/exclude, on every skipEsbuild function', async () => {
|
|
1051
|
-
const result = await new AdminScriptBuilder().build(
|
|
1052
|
-
{
|
|
1053
|
-
adminScripts: [{ Definition: { name: 'test-script' } }],
|
|
1054
|
-
reports: [{ Definition: { name: 'test-report' } }],
|
|
1055
|
-
},
|
|
1056
|
-
{}
|
|
1057
|
-
);
|
|
1058
|
-
|
|
1059
|
-
const packaged = Object.entries(result.functions).filter(([, fn]) => fn.package);
|
|
1060
|
-
expect(packaged.map(([name]) => name)).toEqual(
|
|
1061
|
-
expect.arrayContaining(['adminScriptExecutor', 'adminScriptRouter'])
|
|
1062
|
-
);
|
|
1063
|
-
for (const [, fn] of packaged) {
|
|
1064
|
-
expect(fn.package).not.toHaveProperty('include');
|
|
1065
|
-
expect(fn.package).not.toHaveProperty('exclude');
|
|
1066
|
-
expect(fn.package.patterns.every((p) => p.startsWith('!'))).toBe(true);
|
|
1067
|
-
expect(fn.package.patterns).toEqual(
|
|
1068
|
-
expect.arrayContaining(['!node_modules/aws-sdk/**', '!.env', '!test/**'])
|
|
1069
|
-
);
|
|
1070
|
-
}
|
|
1071
|
-
});
|
|
1072
|
-
|
|
1073
|
-
it('re-adds the DocumentDB CA file after every exclude', async () => {
|
|
1074
|
-
const result = await new AdminScriptBuilder().build(
|
|
1075
|
-
{
|
|
1076
|
-
adminScripts: [{ Definition: { name: 'test-script' } }],
|
|
1077
|
-
database: { documentDB: { tlsCAFile: './global-bundle.pem' } },
|
|
1078
|
-
},
|
|
1079
|
-
{}
|
|
1080
|
-
);
|
|
1081
|
-
|
|
1082
|
-
const { patterns } = result.functions.adminScriptExecutor.package;
|
|
1083
|
-
expect(patterns[patterns.length - 1]).toBe('global-bundle.pem');
|
|
1084
|
-
expect(patterns.slice(0, -1).every((p) => p.startsWith('!'))).toBe(true);
|
|
1085
|
-
});
|
|
1086
|
-
});
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
const { InfrastructureBuilder, ValidationResult } = require('../shared/base-builder');
|
|
17
17
|
const { isScopedEnvironmentActive } = require('../shared/function-environments');
|
|
18
18
|
const { nestedNodeModulesExcludes } = require('../shared/utilities/nested-node-modules');
|
|
19
|
-
const { toPackagePatterns } = require('../shared/utilities/package-patterns');
|
|
20
19
|
const { MigrationResourceResolver } = require('./migration-resolver');
|
|
21
20
|
const { createEmptyDiscoveryResult, ResourceOwnership } = require('../shared/types');
|
|
22
21
|
|
|
@@ -243,192 +242,186 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
243
242
|
// Migration WORKER package config (needs Prisma CLI WASM files)
|
|
244
243
|
const migrationWorkerPackageConfig = {
|
|
245
244
|
individually: true,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
'**/.swarm/**',
|
|
332
|
-
],
|
|
333
|
-
}),
|
|
245
|
+
exclude: [
|
|
246
|
+
// Exclude Prisma runtime client when using Lambda Layer (but keep CLI folder)
|
|
247
|
+
...(usePrismaLayer ? [
|
|
248
|
+
'node_modules/@prisma/client/**',
|
|
249
|
+
'node_modules/.prisma/**',
|
|
250
|
+
'node_modules/@friggframework/core/generated/**',
|
|
251
|
+
] : []),
|
|
252
|
+
// But KEEP node_modules/prisma/** (the CLI with WASM)
|
|
253
|
+
|
|
254
|
+
...nestedNodeModulesExcludes(appDefinition, usePrismaLayer),
|
|
255
|
+
|
|
256
|
+
// Exclude AWS SDK (provided by Lambda runtime)
|
|
257
|
+
'node_modules/aws-sdk/**',
|
|
258
|
+
'node_modules/@aws-sdk/**',
|
|
259
|
+
|
|
260
|
+
// Exclude build tools
|
|
261
|
+
'node_modules/esbuild/**',
|
|
262
|
+
'node_modules/@esbuild/**',
|
|
263
|
+
'node_modules/typescript/**',
|
|
264
|
+
'node_modules/webpack/**',
|
|
265
|
+
'node_modules/osls/**',
|
|
266
|
+
'node_modules/serverless-esbuild/**',
|
|
267
|
+
'node_modules/serverless-jetpack/**',
|
|
268
|
+
'node_modules/serverless-offline/**',
|
|
269
|
+
'node_modules/serverless-offline-sqs/**',
|
|
270
|
+
'node_modules/serverless-dotenv-plugin/**',
|
|
271
|
+
'node_modules/serverless-kms-grants/**',
|
|
272
|
+
|
|
273
|
+
// Exclude dev dependencies
|
|
274
|
+
'node_modules/@friggframework/test/**',
|
|
275
|
+
'node_modules/@friggframework/eslint-config/**',
|
|
276
|
+
'node_modules/@friggframework/prettier-config/**',
|
|
277
|
+
'node_modules/@friggframework/devtools/**',
|
|
278
|
+
'node_modules/@friggframework/serverless-plugin/**',
|
|
279
|
+
'node_modules/jest/**',
|
|
280
|
+
'node_modules/prettier/**',
|
|
281
|
+
'node_modules/eslint/**',
|
|
282
|
+
|
|
283
|
+
// Exclude non-essential Frigg core modules
|
|
284
|
+
'node_modules/@friggframework/core/generated/prisma-mongodb/**',
|
|
285
|
+
'node_modules/@friggframework/core/integrations/**',
|
|
286
|
+
'node_modules/@friggframework/core/user/**',
|
|
287
|
+
|
|
288
|
+
// Exclude other handlers we don't need (keep db-migration worker)
|
|
289
|
+
'node_modules/@friggframework/core/handlers/routers/auth.js',
|
|
290
|
+
'node_modules/@friggframework/core/handlers/routers/health.js',
|
|
291
|
+
'node_modules/@friggframework/core/handlers/routers/user.js',
|
|
292
|
+
'node_modules/@friggframework/core/handlers/routers/websocket.js',
|
|
293
|
+
'node_modules/@friggframework/core/handlers/routers/integration-*.js',
|
|
294
|
+
'node_modules/@friggframework/core/handlers/workers/integration-*.js',
|
|
295
|
+
|
|
296
|
+
// Exclude wrong OS binaries
|
|
297
|
+
'**/query-engine-darwin*',
|
|
298
|
+
'**/schema-engine-darwin*',
|
|
299
|
+
'**/libquery_engine-darwin*',
|
|
300
|
+
'**/*-darwin-arm64*',
|
|
301
|
+
'**/*-darwin*',
|
|
302
|
+
|
|
303
|
+
// Migration worker DOES need Prisma CLI WASM files (for migrate deploy)
|
|
304
|
+
// Only exclude runtime engine WASM (query engine internals)
|
|
305
|
+
'**/runtime/*.wasm',
|
|
306
|
+
|
|
307
|
+
// Additional size optimizations
|
|
308
|
+
'**/*.map',
|
|
309
|
+
'**/*.md',
|
|
310
|
+
'**/LICENSE*',
|
|
311
|
+
'**/*.d.ts',
|
|
312
|
+
'**/*.d.mts',
|
|
313
|
+
'**/examples/**',
|
|
314
|
+
'**/docs/**',
|
|
315
|
+
'src/**',
|
|
316
|
+
'test/**',
|
|
317
|
+
'layers/**',
|
|
318
|
+
'coverage/**',
|
|
319
|
+
'deploy.log',
|
|
320
|
+
'.env.backup',
|
|
321
|
+
'docker-compose.yml',
|
|
322
|
+
'jest.config.js',
|
|
323
|
+
'jest.unit.config.js',
|
|
324
|
+
'package-lock.json',
|
|
325
|
+
'**/*.test.js',
|
|
326
|
+
'**/*.spec.js',
|
|
327
|
+
'**/.claude-flow/**',
|
|
328
|
+
'**/.swarm/**',
|
|
329
|
+
],
|
|
334
330
|
};
|
|
335
331
|
|
|
336
332
|
// Migration ROUTER package config (lighter, no Prisma CLI needed)
|
|
337
333
|
const migrationRouterPackageConfig = {
|
|
338
334
|
individually: true,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
'**/.swarm/**',
|
|
430
|
-
],
|
|
431
|
-
}),
|
|
335
|
+
exclude: [
|
|
336
|
+
// Exclude Prisma runtime client when using Lambda Layer
|
|
337
|
+
...(usePrismaLayer ? [
|
|
338
|
+
'node_modules/@prisma/client/**',
|
|
339
|
+
'node_modules/.prisma/**',
|
|
340
|
+
'node_modules/@friggframework/core/generated/**',
|
|
341
|
+
] : []),
|
|
342
|
+
|
|
343
|
+
// Router only skips Prisma CLI if Lambda Layer is enabled
|
|
344
|
+
...(usePrismaLayer ? ['node_modules/prisma/**'] : []),
|
|
345
|
+
|
|
346
|
+
...nestedNodeModulesExcludes(appDefinition, usePrismaLayer),
|
|
347
|
+
|
|
348
|
+
// Exclude AWS SDK (provided by Lambda runtime)
|
|
349
|
+
'node_modules/aws-sdk/**',
|
|
350
|
+
'node_modules/@aws-sdk/**',
|
|
351
|
+
|
|
352
|
+
// Exclude build tools
|
|
353
|
+
'node_modules/esbuild/**',
|
|
354
|
+
'node_modules/@esbuild/**',
|
|
355
|
+
'node_modules/typescript/**',
|
|
356
|
+
'node_modules/webpack/**',
|
|
357
|
+
'node_modules/osls/**',
|
|
358
|
+
'node_modules/serverless-esbuild/**',
|
|
359
|
+
'node_modules/serverless-jetpack/**',
|
|
360
|
+
'node_modules/serverless-offline/**',
|
|
361
|
+
'node_modules/serverless-offline-sqs/**',
|
|
362
|
+
'node_modules/serverless-dotenv-plugin/**',
|
|
363
|
+
'node_modules/serverless-kms-grants/**',
|
|
364
|
+
|
|
365
|
+
// Exclude dev dependencies
|
|
366
|
+
'node_modules/@friggframework/test/**',
|
|
367
|
+
'node_modules/@friggframework/eslint-config/**',
|
|
368
|
+
'node_modules/@friggframework/prettier-config/**',
|
|
369
|
+
'node_modules/@friggframework/devtools/**',
|
|
370
|
+
'node_modules/@friggframework/serverless-plugin/**',
|
|
371
|
+
'node_modules/jest/**',
|
|
372
|
+
'node_modules/prettier/**',
|
|
373
|
+
'node_modules/eslint/**',
|
|
374
|
+
|
|
375
|
+
// Exclude non-essential Frigg core modules
|
|
376
|
+
'node_modules/@friggframework/core/generated/prisma-mongodb/**',
|
|
377
|
+
'node_modules/@friggframework/core/integrations/**',
|
|
378
|
+
'node_modules/@friggframework/core/user/**',
|
|
379
|
+
|
|
380
|
+
// Exclude other handlers we don't need (keep db-migration router)
|
|
381
|
+
'node_modules/@friggframework/core/handlers/routers/auth.js',
|
|
382
|
+
'node_modules/@friggframework/core/handlers/routers/health.js',
|
|
383
|
+
'node_modules/@friggframework/core/handlers/routers/user.js',
|
|
384
|
+
'node_modules/@friggframework/core/handlers/routers/websocket.js',
|
|
385
|
+
'node_modules/@friggframework/core/handlers/routers/integration-*.js',
|
|
386
|
+
'node_modules/@friggframework/core/handlers/workers/**',
|
|
387
|
+
|
|
388
|
+
// Exclude wrong OS binaries
|
|
389
|
+
'**/query-engine-darwin*',
|
|
390
|
+
'**/schema-engine-darwin*',
|
|
391
|
+
'**/libquery_engine-darwin*',
|
|
392
|
+
'**/*-darwin-arm64*',
|
|
393
|
+
'**/*-darwin*',
|
|
394
|
+
|
|
395
|
+
// Router doesn't run migrations - exclude ALL WASM files
|
|
396
|
+
'**/runtime/*.wasm',
|
|
397
|
+
'**/*.wasm*',
|
|
398
|
+
|
|
399
|
+
// Additional size optimizations
|
|
400
|
+
'**/*.map',
|
|
401
|
+
'**/*.md',
|
|
402
|
+
'**/LICENSE*',
|
|
403
|
+
'**/*.d.ts',
|
|
404
|
+
'**/*.d.mts',
|
|
405
|
+
'**/test/**',
|
|
406
|
+
'**/tests/**',
|
|
407
|
+
'**/__tests__/**',
|
|
408
|
+
'**/examples/**',
|
|
409
|
+
'**/docs/**',
|
|
410
|
+
'src/**',
|
|
411
|
+
'test/**',
|
|
412
|
+
'layers/**',
|
|
413
|
+
'coverage/**',
|
|
414
|
+
'deploy.log',
|
|
415
|
+
'.env.backup',
|
|
416
|
+
'docker-compose.yml',
|
|
417
|
+
'jest.config.js',
|
|
418
|
+
'jest.unit.config.js',
|
|
419
|
+
'package-lock.json',
|
|
420
|
+
'**/*.test.js',
|
|
421
|
+
'**/*.spec.js',
|
|
422
|
+
'**/.claude-flow/**',
|
|
423
|
+
'**/.swarm/**',
|
|
424
|
+
],
|
|
432
425
|
};
|
|
433
426
|
|
|
434
427
|
// Create migration worker Lambda (triggered by SQS)
|
|
@@ -316,8 +316,8 @@ describe('MigrationBuilder', () => {
|
|
|
316
316
|
it('bundles Prisma runtime when layer disabled', async () => {
|
|
317
317
|
const appDef = { ...baseAppDefinition, usePrismaLambdaLayer: false };
|
|
318
318
|
const result = await builder.build(appDef, {});
|
|
319
|
-
expect(result.functions.dbMigrationWorker.package.
|
|
320
|
-
expect.arrayContaining(['
|
|
319
|
+
expect(result.functions.dbMigrationWorker.package.exclude).not.toEqual(
|
|
320
|
+
expect.arrayContaining(['node_modules/@prisma/client/**'])
|
|
321
321
|
);
|
|
322
322
|
});
|
|
323
323
|
});
|
|
@@ -436,7 +436,7 @@ describe('MigrationBuilder nested node_modules (lambda.keepNestedNodeModules)',
|
|
|
436
436
|
const result = await new MigrationBuilder().build(baseAppDefinition, {});
|
|
437
437
|
|
|
438
438
|
for (const fn of workerAndRouter(result)) {
|
|
439
|
-
expect(fn.package.
|
|
439
|
+
expect(fn.package.exclude).toContain('node_modules/**/node_modules/**');
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
|
|
@@ -447,39 +447,8 @@ describe('MigrationBuilder nested node_modules (lambda.keepNestedNodeModules)',
|
|
|
447
447
|
);
|
|
448
448
|
|
|
449
449
|
for (const fn of workerAndRouter(result)) {
|
|
450
|
-
expect(fn.package.
|
|
451
|
-
expect(fn.package.
|
|
450
|
+
expect(fn.package.exclude).not.toContain('node_modules/**/node_modules/**');
|
|
451
|
+
expect(fn.package.exclude).toContain('node_modules/**/node_modules/@friggframework/**');
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
});
|
|
455
|
-
|
|
456
|
-
describe('MigrationBuilder function package patterns (ADR-050)', () => {
|
|
457
|
-
it('emits package.patterns and individually, never include/exclude', async () => {
|
|
458
|
-
const result = await new MigrationBuilder().build(
|
|
459
|
-
{ database: { postgres: { enable: true } } },
|
|
460
|
-
{}
|
|
461
|
-
);
|
|
462
|
-
|
|
463
|
-
for (const name of ['dbMigrationWorker', 'dbMigrationRouter']) {
|
|
464
|
-
const pkg = result.functions[name].package;
|
|
465
|
-
expect(pkg.individually).toBe(true);
|
|
466
|
-
expect(pkg).not.toHaveProperty('include');
|
|
467
|
-
expect(pkg).not.toHaveProperty('exclude');
|
|
468
|
-
expect(pkg.patterns.every((p) => p.startsWith('!'))).toBe(true);
|
|
469
|
-
expect(pkg.patterns).toEqual(
|
|
470
|
-
expect.arrayContaining([
|
|
471
|
-
'!node_modules/@prisma/client/**',
|
|
472
|
-
'!node_modules/aws-sdk/**',
|
|
473
|
-
])
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// The worker keeps the Prisma CLI (WASM); only the router drops it.
|
|
478
|
-
expect(result.functions.dbMigrationWorker.package.patterns).not.toContain(
|
|
479
|
-
'!node_modules/prisma/**'
|
|
480
|
-
);
|
|
481
|
-
expect(result.functions.dbMigrationRouter.package.patterns).toContain(
|
|
482
|
-
'!node_modules/prisma/**'
|
|
483
|
-
);
|
|
484
|
-
});
|
|
485
|
-
});
|