@friggframework/devtools 2.0.0--canary.517.837ee90.0 → 2.0.0--canary.517.8e1c21c.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.
@@ -129,6 +129,7 @@ class AdminScriptBuilder extends InfrastructureBuilder {
129
129
  result.functions.adminScriptExecutor = {
130
130
  handler: 'node_modules/@friggframework/admin-scripts/src/infrastructure/script-executor-handler.handler',
131
131
  skipEsbuild: true,
132
+ package: this.skipEsbuildPackageConfig(usePrismaLayer),
132
133
  ...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
133
134
  timeout: 900, // 15 minutes max
134
135
  memorySize: 1024,
@@ -148,6 +149,7 @@ class AdminScriptBuilder extends InfrastructureBuilder {
148
149
  result.functions.adminScriptRouter = {
149
150
  handler: 'node_modules/@friggframework/admin-scripts/src/infrastructure/admin-script-router.handler',
150
151
  skipEsbuild: true,
152
+ package: this.skipEsbuildPackageConfig(usePrismaLayer),
151
153
  ...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
152
154
  timeout: 30,
153
155
  events: [
@@ -177,6 +179,52 @@ class AdminScriptBuilder extends InfrastructureBuilder {
177
179
  console.log(' ✓ Created adminScriptRouter function');
178
180
  }
179
181
 
182
+ // Without this, the skipEsbuild functions package the whole node_modules
183
+ // closure (aws-sdk, Prisma, dev deps) and blow past Lambda's 250 MB limit.
184
+ skipEsbuildPackageConfig(usePrismaLayer) {
185
+ return {
186
+ exclude: [
187
+ 'node_modules/aws-sdk/**',
188
+ 'node_modules/@aws-sdk/**',
189
+ ...(usePrismaLayer
190
+ ? [
191
+ 'node_modules/@prisma/**',
192
+ 'node_modules/.prisma/**',
193
+ 'node_modules/prisma/**',
194
+ 'node_modules/@friggframework/core/generated/**',
195
+ ]
196
+ : []),
197
+ 'node_modules/**/node_modules/**',
198
+ 'node_modules/@friggframework/test/**',
199
+ 'node_modules/@friggframework/eslint-config/**',
200
+ 'node_modules/@friggframework/prettier-config/**',
201
+ 'node_modules/jest/**',
202
+ 'node_modules/prettier/**',
203
+ 'node_modules/eslint/**',
204
+ 'node_modules/esbuild/**',
205
+ 'node_modules/@esbuild/**',
206
+ 'node_modules/typescript/**',
207
+ 'node_modules/webpack/**',
208
+ 'node_modules/osls/**',
209
+ 'node_modules/serverless-esbuild/**',
210
+ 'node_modules/serverless-jetpack/**',
211
+ 'node_modules/serverless-offline/**',
212
+ 'node_modules/serverless-offline-sqs/**',
213
+ 'node_modules/serverless-dotenv-plugin/**',
214
+ 'node_modules/serverless-kms-grants/**',
215
+ '.env',
216
+ '.env.*',
217
+ '**/.env',
218
+ '**/.env.*',
219
+ 'test/**',
220
+ 'layers/**',
221
+ 'coverage/**',
222
+ '**/*.test.js',
223
+ '**/*.spec.js',
224
+ ],
225
+ };
226
+ }
227
+
180
228
  createSchedulerResources(appDefinition, result) {
181
229
  // Constructed ARN, not Fn::GetAtt: a GetAtt edge to the executor closes a
182
230
  // CloudFormation circular dependency via the shared Lambda execution role.
@@ -257,6 +257,29 @@ describe('AdminScriptBuilder', () => {
257
257
  expect(result.functions.adminScriptExecutor.memorySize).toBe(1024);
258
258
  });
259
259
 
260
+ it('should exclude aws-sdk/Prisma from the skipEsbuild function packages', async () => {
261
+ const appDefinition = {
262
+ adminScripts: [{ Definition: { name: 'test-script' } }],
263
+ };
264
+
265
+ const result = await adminScriptBuilder.build(appDefinition, {});
266
+
267
+ // Regression: without a package config the skipEsbuild functions
268
+ // package the whole node_modules and exceed Lambda's 250 MB limit.
269
+ for (const fn of [
270
+ result.functions.adminScriptExecutor,
271
+ result.functions.adminScriptRouter,
272
+ ]) {
273
+ expect(fn.package.exclude).toEqual(
274
+ expect.arrayContaining([
275
+ 'node_modules/aws-sdk/**',
276
+ 'node_modules/@aws-sdk/**',
277
+ 'node_modules/@prisma/**',
278
+ ])
279
+ );
280
+ }
281
+ });
282
+
260
283
  it('should attach Prisma layer to adminScriptExecutor', async () => {
261
284
  const appDefinition = {
262
285
  adminScripts: [
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.517.837ee90.0",
4
+ "version": "2.0.0--canary.517.8e1c21c.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.517.837ee90.0",
29
- "@friggframework/schemas": "2.0.0--canary.517.837ee90.0",
30
- "@friggframework/test": "2.0.0--canary.517.837ee90.0",
28
+ "@friggframework/core": "2.0.0--canary.517.8e1c21c.0",
29
+ "@friggframework/schemas": "2.0.0--canary.517.8e1c21c.0",
30
+ "@friggframework/test": "2.0.0--canary.517.8e1c21c.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.517.837ee90.0",
59
- "@friggframework/prettier-config": "2.0.0--canary.517.837ee90.0",
58
+ "@friggframework/eslint-config": "2.0.0--canary.517.8e1c21c.0",
59
+ "@friggframework/prettier-config": "2.0.0--canary.517.8e1c21c.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": "837ee90500d8b87fbe9d904c1b64d0f1ce8b8f7a"
91
+ "gitHead": "8e1c21cfab6708ab3456516f2e3520eeb12e8c14"
92
92
  }