@friggframework/devtools 2.0.0--canary.517.8e1c21c.0 → 2.0.0--canary.517.0ff3ee0.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.
@@ -70,10 +70,10 @@ class AdminScriptBuilder extends InfrastructureBuilder {
70
70
  this.createAdminScriptQueue(result);
71
71
 
72
72
  // Create Lambda function for script execution
73
- this.createScriptExecutorFunction(result, usePrismaLayer);
73
+ this.createScriptExecutorFunction(appDefinition, result, usePrismaLayer);
74
74
 
75
75
  // Create API routes for script management
76
- this.createAdminScriptRoutes(result, usePrismaLayer);
76
+ this.createAdminScriptRoutes(appDefinition, result, usePrismaLayer);
77
77
 
78
78
  // Phase 2: Create EventBridge Scheduler resources
79
79
  if (adminConfig.enableScheduling) {
@@ -125,11 +125,11 @@ class AdminScriptBuilder extends InfrastructureBuilder {
125
125
  console.log(' ✓ Created AdminScriptQueue');
126
126
  }
127
127
 
128
- createScriptExecutorFunction(result, usePrismaLayer) {
128
+ createScriptExecutorFunction(appDefinition, result, usePrismaLayer) {
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
+ package: this.skipEsbuildPackageConfig(appDefinition, usePrismaLayer),
133
133
  ...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
134
134
  timeout: 900, // 15 minutes max
135
135
  memorySize: 1024,
@@ -145,11 +145,11 @@ class AdminScriptBuilder extends InfrastructureBuilder {
145
145
  console.log(' ✓ Created adminScriptExecutor function');
146
146
  }
147
147
 
148
- createAdminScriptRoutes(result, usePrismaLayer) {
148
+ createAdminScriptRoutes(appDefinition, result, usePrismaLayer) {
149
149
  result.functions.adminScriptRouter = {
150
150
  handler: 'node_modules/@friggframework/admin-scripts/src/infrastructure/admin-script-router.handler',
151
151
  skipEsbuild: true,
152
- package: this.skipEsbuildPackageConfig(usePrismaLayer),
152
+ package: this.skipEsbuildPackageConfig(appDefinition, usePrismaLayer),
153
153
  ...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
154
154
  timeout: 30,
155
155
  events: [
@@ -181,8 +181,14 @@ class AdminScriptBuilder extends InfrastructureBuilder {
181
181
 
182
182
  // Without this, the skipEsbuild functions package the whole node_modules
183
183
  // closure (aws-sdk, Prisma, dev deps) and blow past Lambda's 250 MB limit.
184
- skipEsbuildPackageConfig(usePrismaLayer) {
184
+ // Mirrors the exclusions the framework's other node_modules handlers use.
185
+ skipEsbuildPackageConfig(appDefinition, usePrismaLayer) {
186
+ const tlsCAFile = appDefinition?.database?.documentDB?.tlsCAFile;
185
187
  return {
188
+ include: [
189
+ // Handlers connect to the DB, so ship the DocumentDB CA cert.
190
+ ...(tlsCAFile ? [tlsCAFile.replace(/^\.\//, '')] : []),
191
+ ],
186
192
  exclude: [
187
193
  'node_modules/aws-sdk/**',
188
194
  'node_modules/@aws-sdk/**',
@@ -212,10 +218,13 @@ class AdminScriptBuilder extends InfrastructureBuilder {
212
218
  'node_modules/serverless-offline-sqs/**',
213
219
  'node_modules/serverless-dotenv-plugin/**',
214
220
  'node_modules/serverless-kms-grants/**',
221
+ // Never deploy secrets or the lockfile.
215
222
  '.env',
216
223
  '.env.*',
217
224
  '**/.env',
218
225
  '**/.env.*',
226
+ '.frigg-credentials.json',
227
+ 'package-lock.json',
219
228
  'test/**',
220
229
  'layers/**',
221
230
  'coverage/**',
@@ -268,12 +277,14 @@ class AdminScriptBuilder extends InfrastructureBuilder {
268
277
  },
269
278
  };
270
279
 
271
- result.environment.SCHEDULER_PROVIDER = 'aws';
272
-
273
- // Router-scoped, not shared provider env: broadcasting these resource
274
- // references to every function creates CloudFormation circular deps.
280
+ // Router-scoped, not shared provider env. Two reasons: broadcasting the
281
+ // resource references to every function creates CloudFormation circular
282
+ // deps; and SCHEDULER_PROVIDER='aws' is only valid for the admin-script
283
+ // adapter (the router's sole consumer) core's scheduler factory, used
284
+ // by integration Lambdas, rejects 'aws', so it must not leak app-wide.
275
285
  result.functions.adminScriptRouter.environment = {
276
286
  ...(result.functions.adminScriptRouter.environment || {}),
287
+ SCHEDULER_PROVIDER: 'aws',
277
288
  SCHEDULER_ROLE_ARN: {
278
289
  'Fn::GetAtt': ['AdminScriptSchedulerRole', 'Arn'],
279
290
  },
@@ -389,12 +389,13 @@ describe('AdminScriptBuilder', () => {
389
389
  expect(result.resources.AdminScriptScheduleGroup).toBeDefined();
390
390
  expect(result.resources.AdminScriptScheduleGroup.Type).toBe('AWS::Scheduler::ScheduleGroup');
391
391
 
392
- // SCHEDULER_PROVIDER is a constant and stays on the shared env.
393
- expect(result.environment.SCHEDULER_PROVIDER).toBe('aws');
394
-
395
- // Resource-reference env vars are scoped to the router function (not
396
- // the shared provider env) to avoid CloudFormation circular deps.
392
+ // Scheduler env vars are scoped to the router function (not the
393
+ // shared provider env): resource refs would create CloudFormation
394
+ // circular deps, and SCHEDULER_PROVIDER='aws' would break core's
395
+ // scheduler factory (rejects 'aws') for every other Lambda.
397
396
  const routerEnv = result.functions.adminScriptRouter.environment;
397
+ expect(routerEnv.SCHEDULER_PROVIDER).toBe('aws');
398
+ expect(result.environment.SCHEDULER_PROVIDER).toBeUndefined();
398
399
  expect(routerEnv.SCHEDULER_ROLE_ARN).toEqual({
399
400
  'Fn::GetAtt': ['AdminScriptSchedulerRole', 'Arn'],
400
401
  });
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.8e1c21c.0",
4
+ "version": "2.0.0--canary.517.0ff3ee0.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.8e1c21c.0",
29
- "@friggframework/schemas": "2.0.0--canary.517.8e1c21c.0",
30
- "@friggframework/test": "2.0.0--canary.517.8e1c21c.0",
28
+ "@friggframework/core": "2.0.0--canary.517.0ff3ee0.0",
29
+ "@friggframework/schemas": "2.0.0--canary.517.0ff3ee0.0",
30
+ "@friggframework/test": "2.0.0--canary.517.0ff3ee0.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.8e1c21c.0",
59
- "@friggframework/prettier-config": "2.0.0--canary.517.8e1c21c.0",
58
+ "@friggframework/eslint-config": "2.0.0--canary.517.0ff3ee0.0",
59
+ "@friggframework/prettier-config": "2.0.0--canary.517.0ff3ee0.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": "8e1c21cfab6708ab3456516f2e3520eeb12e8c14"
91
+ "gitHead": "0ff3ee04ee7a6effd37adbd756be25eae7dc1fc7"
92
92
  }