@friggframework/devtools 2.0.0--canary.461.cdfbcf7.0 → 2.0.0--canary.461.3bae110.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/database/migration-builder.js +4 -3
- package/infrastructure/domains/database/migration-builder.test.js +5 -2
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +2 -100
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +5 -21
- package/package.json +6 -6
|
@@ -108,9 +108,10 @@ class MigrationBuilder extends InfrastructureBuilder {
|
|
|
108
108
|
'**/libquery_engine-darwin*',
|
|
109
109
|
'**/*-darwin-arm64*',
|
|
110
110
|
'**/*-darwin*',
|
|
111
|
-
// Exclude WASM
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
// Exclude ALL WASM files - migration worker/router don't need Prisma CLI
|
|
112
|
+
// Only dbMigrate function needs Prisma CLI WASM files
|
|
113
|
+
'**/runtime/*.wasm',
|
|
114
|
+
'**/*.wasm*',
|
|
114
115
|
'src/**',
|
|
115
116
|
'test/**',
|
|
116
117
|
'layers/**',
|
|
@@ -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');
|
|
@@ -203,6 +203,9 @@ describe('MigrationBuilder', () => {
|
|
|
203
203
|
expect(packageConfig.exclude).toContain('node_modules/typescript/**');
|
|
204
204
|
expect(packageConfig.exclude).toContain('node_modules/@friggframework/devtools/**');
|
|
205
205
|
expect(packageConfig.exclude).toContain('src/**'); // Migration handlers don't need backend source
|
|
206
|
+
|
|
207
|
+
// Should NOT exclude generated Prisma clients/schemas - worker needs them
|
|
208
|
+
expect(packageConfig.exclude).not.toContain('node_modules/@friggframework/core/generated/**');
|
|
206
209
|
});
|
|
207
210
|
|
|
208
211
|
it('should add queue URL to environment', async () => {
|
|
@@ -276,106 +276,8 @@ function createBaseDefinition(
|
|
|
276
276
|
{ httpApi: { path: '/health/{proxy+}', method: 'GET' } },
|
|
277
277
|
],
|
|
278
278
|
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
// DO NOT use Prisma layer - this function includes Prisma CLI separately
|
|
282
|
-
skipEsbuild: true, // Handlers in node_modules don't need bundling
|
|
283
|
-
timeout: 300, // 5 minutes for long-running migrations
|
|
284
|
-
memorySize: 1024, // Extra memory for Prisma CLI and migration operations
|
|
285
|
-
reservedConcurrency: 1, // Prevent concurrent migrations (CRITICAL for data safety)
|
|
286
|
-
description: 'Runs database migrations via Prisma CLI (invoke manually from CI/CD or triggers). Prisma CLI bundled separately.',
|
|
287
|
-
package: {
|
|
288
|
-
individually: true,
|
|
289
|
-
exclude: [
|
|
290
|
-
// Exclude ALL nested node_modules
|
|
291
|
-
'node_modules/**/node_modules/**',
|
|
292
|
-
|
|
293
|
-
// Exclude AWS SDK (provided by Lambda runtime)
|
|
294
|
-
'node_modules/aws-sdk/**',
|
|
295
|
-
'node_modules/@aws-sdk/**',
|
|
296
|
-
|
|
297
|
-
// Exclude build tools (not needed for migrations)
|
|
298
|
-
'node_modules/esbuild/**',
|
|
299
|
-
'node_modules/@esbuild/**',
|
|
300
|
-
'node_modules/typescript/**',
|
|
301
|
-
'node_modules/webpack/**',
|
|
302
|
-
'node_modules/osls/**',
|
|
303
|
-
'node_modules/serverless-esbuild/**',
|
|
304
|
-
'node_modules/serverless-jetpack/**',
|
|
305
|
-
'node_modules/serverless-offline/**',
|
|
306
|
-
'node_modules/serverless-offline-sqs/**',
|
|
307
|
-
'node_modules/serverless-dotenv-plugin/**',
|
|
308
|
-
'node_modules/serverless-kms-grants/**',
|
|
309
|
-
|
|
310
|
-
// Exclude dev dependencies
|
|
311
|
-
'node_modules/@friggframework/test/**',
|
|
312
|
-
'node_modules/@friggframework/eslint-config/**',
|
|
313
|
-
'node_modules/@friggframework/prettier-config/**',
|
|
314
|
-
'node_modules/@friggframework/devtools/**',
|
|
315
|
-
'node_modules/@friggframework/serverless-plugin/**',
|
|
316
|
-
'node_modules/jest/**',
|
|
317
|
-
'node_modules/prettier/**',
|
|
318
|
-
'node_modules/eslint/**',
|
|
319
|
-
|
|
320
|
-
// Exclude MongoDB Prisma client (only need PostgreSQL)
|
|
321
|
-
'node_modules/@friggframework/core/generated/prisma-mongodb/**',
|
|
322
|
-
|
|
323
|
-
// Exclude non-essential Frigg modules
|
|
324
|
-
'node_modules/@friggframework/core/integrations/**',
|
|
325
|
-
'node_modules/@friggframework/core/user/**',
|
|
326
|
-
'node_modules/@friggframework/core/handlers/routers/**',
|
|
327
|
-
'node_modules/@friggframework/core/handlers/workers/**',
|
|
328
|
-
|
|
329
|
-
// Exclude wrong OS binaries
|
|
330
|
-
'**/query-engine-darwin*',
|
|
331
|
-
'**/schema-engine-darwin*',
|
|
332
|
-
'**/libquery_engine-darwin*',
|
|
333
|
-
'**/*-darwin-arm64*',
|
|
334
|
-
'**/*-darwin*',
|
|
335
|
-
|
|
336
|
-
// Exclude WASM engines (but keep Prisma CLI WASM files in build/)
|
|
337
|
-
// Note: Prisma CLI needs prisma/build/prisma_schema_build_bg.wasm for migrations
|
|
338
|
-
'**/runtime/*.wasm', // Exclude query engine WASM (unused with binary engines)
|
|
339
|
-
// DO NOT exclude **/*.wasm* - Prisma CLI needs build/*.wasm files!
|
|
340
|
-
|
|
341
|
-
// Exclude backend source (dbMigrate doesn't need it)
|
|
342
|
-
'src/**', // OK to exclude for migration handler only
|
|
343
|
-
'test/**',
|
|
344
|
-
'layers/**',
|
|
345
|
-
'coverage/**',
|
|
346
|
-
|
|
347
|
-
// Exclude local dev files
|
|
348
|
-
'deploy.log',
|
|
349
|
-
'.env.backup',
|
|
350
|
-
'docker-compose.yml',
|
|
351
|
-
'jest.config.js',
|
|
352
|
-
'jest.unit.config.js',
|
|
353
|
-
'package-lock.json',
|
|
354
|
-
|
|
355
|
-
// Exclude docs and metadata
|
|
356
|
-
'**/*.md',
|
|
357
|
-
'**/*.map',
|
|
358
|
-
'**/LICENSE*',
|
|
359
|
-
'**/*.d.ts',
|
|
360
|
-
'**/*.d.mts',
|
|
361
|
-
'**/*.test.js',
|
|
362
|
-
'**/*.spec.js',
|
|
363
|
-
'**/.claude-flow/**',
|
|
364
|
-
'**/.swarm/**',
|
|
365
|
-
],
|
|
366
|
-
},
|
|
367
|
-
maximumEventAge: 60,
|
|
368
|
-
maximumRetryAttempts: 0,
|
|
369
|
-
tags: {
|
|
370
|
-
Purpose: 'DatabaseMigration',
|
|
371
|
-
ManagedBy: 'Frigg',
|
|
372
|
-
},
|
|
373
|
-
environment: {
|
|
374
|
-
CI: '1',
|
|
375
|
-
PRISMA_HIDE_UPDATE_MESSAGE: '1',
|
|
376
|
-
PRISMA_MIGRATE_SKIP_SEED: '1',
|
|
377
|
-
},
|
|
378
|
-
},
|
|
279
|
+
// Note: dbMigrate removed - MigrationBuilder now handles migration infrastructure
|
|
280
|
+
// See: packages/devtools/infrastructure/domains/database/migration-builder.js
|
|
379
281
|
},
|
|
380
282
|
layers: {
|
|
381
283
|
prisma: {
|
|
@@ -85,7 +85,8 @@ describe('Base Definition Factory', () => {
|
|
|
85
85
|
expect(result.functions.auth).toBeDefined();
|
|
86
86
|
expect(result.functions.user).toBeDefined();
|
|
87
87
|
expect(result.functions.health).toBeDefined();
|
|
88
|
-
|
|
88
|
+
// dbMigrate removed - MigrationBuilder now handles migration infrastructure
|
|
89
|
+
expect(result.functions.dbMigrate).toBeUndefined();
|
|
89
90
|
});
|
|
90
91
|
|
|
91
92
|
it('should configure auth function correctly', () => {
|
|
@@ -96,28 +97,11 @@ describe('Base Definition Factory', () => {
|
|
|
96
97
|
expect(result.functions.auth.events).toHaveLength(3);
|
|
97
98
|
});
|
|
98
99
|
|
|
99
|
-
it('should
|
|
100
|
+
it('should NOT include legacy dbMigrate function', () => {
|
|
100
101
|
const result = createBaseDefinition({}, {}, {});
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
expect(result.functions.dbMigrate
|
|
104
|
-
expect(result.functions.dbMigrate.reservedConcurrency).toBe(1);
|
|
105
|
-
expect(result.functions.dbMigrate.esbuild).toBe(false);
|
|
106
|
-
expect(result.functions.dbMigrate.layers).toBeUndefined(); // No Prisma layer
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('should NOT exclude Prisma CLI WASM files from dbMigrate function', () => {
|
|
110
|
-
const result = createBaseDefinition({}, {}, {});
|
|
111
|
-
|
|
112
|
-
const excludeList = result.functions.dbMigrate.package.exclude;
|
|
113
|
-
|
|
114
|
-
// Should exclude WASM files from runtime/ (query engine WASM)
|
|
115
|
-
expect(excludeList).toContain('**/runtime/*.wasm');
|
|
116
|
-
|
|
117
|
-
// But should NOT exclude build/*.wasm files (Prisma CLI needs prisma_schema_build_bg.wasm)
|
|
118
|
-
expect(excludeList).not.toContain('**/*.wasm*');
|
|
119
|
-
expect(excludeList).not.toContain('**/*.wasm');
|
|
120
|
-
expect(excludeList).not.toContain('**/build/*.wasm');
|
|
103
|
+
// dbMigrate is legacy - MigrationBuilder handles migration infrastructure
|
|
104
|
+
expect(result.functions.dbMigrate).toBeUndefined();
|
|
121
105
|
});
|
|
122
106
|
|
|
123
107
|
it('should include Prisma Lambda Layer', () => {
|
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.3bae110.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.3bae110.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.3bae110.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.3bae110.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.3bae110.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": "3bae110e4204ee66a40379dbd6990f1cff767e54"
|
|
74
74
|
}
|