@friggframework/devtools 2.0.0--canary.710.91495fa.0 → 2.0.0--canary.702.ef0dc8c.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.
Files changed (86) hide show
  1. package/README.md +1 -0
  2. package/frigg-cli/README.md +76 -78
  3. package/frigg-cli/__tests__/unit/commands/build.test.js +3 -0
  4. package/frigg-cli/__tests__/unit/commands/deploy.test.js +27 -30
  5. package/frigg-cli/__tests__/unit/commands/doctor.test.js +6 -10
  6. package/frigg-cli/__tests__/unit/commands/generate-iam.test.js +0 -18
  7. package/frigg-cli/__tests__/unit/commands/install.test.js +341 -601
  8. package/frigg-cli/__tests__/unit/commands/ui.test.js +30 -31
  9. package/frigg-cli/__tests__/unit/commands/validate-wiring.test.js +92 -0
  10. package/frigg-cli/__tests__/unit/dependencies.test.js +2 -6
  11. package/frigg-cli/build-command/index.js +6 -0
  12. package/frigg-cli/deploy-command/index.js +6 -0
  13. package/frigg-cli/generate-command/index.js +0 -1
  14. package/frigg-cli/generate-iam-command.js +0 -1
  15. package/frigg-cli/index.js +23 -10
  16. package/frigg-cli/index.test.js +158 -0
  17. package/frigg-cli/init-command/backend-first-handler.js +531 -395
  18. package/frigg-cli/init-command/index.js +35 -82
  19. package/frigg-cli/install-command/commit-changes.js +8 -40
  20. package/frigg-cli/install-command/environment-variables.js +0 -15
  21. package/frigg-cli/install-command/index.js +21 -96
  22. package/frigg-cli/install-command/install-package.js +4 -77
  23. package/frigg-cli/install-command/integration-file.js +11 -20
  24. package/frigg-cli/install-command/template.js +75 -102
  25. package/frigg-cli/install-command/validate-package.js +4 -36
  26. package/frigg-cli/package.json +1 -1
  27. package/frigg-cli/start-command/index.js +4 -0
  28. package/frigg-cli/start-command/start-command.test.js +3 -0
  29. package/frigg-cli/test/init-command.test.js +2 -9
  30. package/frigg-cli/validate-command/__tests__/init-validation.test.js +63 -0
  31. package/frigg-cli/validate-command/__tests__/integrations-checks.test.js +133 -0
  32. package/frigg-cli/validate-command/__tests__/validate-app-definition.test.js +326 -0
  33. package/frigg-cli/validate-command/__tests__/validate-command.test.js +241 -0
  34. package/frigg-cli/validate-command/__tests__/validate-module-command.test.js +119 -0
  35. package/frigg-cli/validate-command/checks/config.js +468 -0
  36. package/frigg-cli/validate-command/checks/integrations.js +274 -0
  37. package/frigg-cli/validate-command/fixtures/bad-module/index.js +18 -0
  38. package/frigg-cli/validate-command/fixtures/fathom-module/definition.js +76 -0
  39. package/frigg-cli/validate-command/fixtures/fathom-module/index.js +6 -0
  40. package/frigg-cli/validate-command/format-report.js +60 -0
  41. package/frigg-cli/validate-command/index.js +151 -0
  42. package/frigg-cli/validate-command/load-app-definition.js +93 -0
  43. package/frigg-cli/validate-command/load-module-definition.js +64 -0
  44. package/frigg-cli/validate-command/schema-issues.js +154 -0
  45. package/frigg-cli/validate-command/validate-app-definition.js +60 -0
  46. package/frigg-cli/validate-command/validate-module-definition.js +46 -0
  47. package/infrastructure/__tests__/postgres-config.test.js +835 -241
  48. package/infrastructure/__tests__/template-generation.test.js +8 -36
  49. package/infrastructure/app-definition-schema-contract.test.js +607 -0
  50. package/infrastructure/create-frigg-infrastructure.js +4 -1
  51. package/infrastructure/create-frigg-infrastructure.test.js +51 -0
  52. package/infrastructure/docs/POSTGRES-CONFIGURATION.md +60 -118
  53. package/infrastructure/domains/database/aurora-builder.js +2 -13
  54. package/infrastructure/domains/database/aurora-builder.test.js +0 -22
  55. package/infrastructure/domains/health/application/use-cases/__tests__/mismatch-analyzer-method-name.test.js +8 -12
  56. package/infrastructure/domains/health/application/use-cases/__tests__/repair-via-import-use-case.test.js +7 -19
  57. package/infrastructure/domains/health/application/use-cases/run-health-check-use-case.test.js +8 -12
  58. package/infrastructure/domains/health/domain/services/__tests__/import-progress-monitor.test.js +18 -17
  59. package/infrastructure/domains/health/domain/services/__tests__/update-progress-monitor.test.js +2 -12
  60. package/infrastructure/domains/health/infrastructure/adapters/__tests__/orphan-detection-relationship-analysis.test.js +1 -8
  61. package/infrastructure/domains/health/infrastructure/adapters/aws-property-reconciler.test.js +2 -4
  62. package/infrastructure/domains/health/infrastructure/adapters/aws-resource-detector.test.js +0 -10
  63. package/infrastructure/domains/networking/vpc-builder.js +8 -18
  64. package/infrastructure/domains/networking/vpc-builder.test.js +13 -32
  65. package/infrastructure/domains/security/iam-generator.js +5 -112
  66. package/infrastructure/domains/security/iam-generator.test.js +0 -94
  67. package/infrastructure/domains/shared/cloudformation-discovery.test.js +6 -36
  68. package/infrastructure/domains/shared/utilities/base-definition-factory.js +2 -7
  69. package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +0 -21
  70. package/infrastructure/infrastructure-composer.test.js +794 -268
  71. package/infrastructure/integration.test.js +381 -0
  72. package/infrastructure/scripts/build-prisma-layer.test.js +7 -28
  73. package/infrastructure/scripts/build-time-discovery.test.js +3 -18
  74. package/package.json +8 -10
  75. package/frigg-cli/__tests__/unit/commands/init.test.js +0 -688
  76. package/frigg-cli/init-command/deployment-modes.js +0 -7
  77. package/frigg-cli/init-command/safe-path.js +0 -58
  78. package/frigg-cli/init-command/scaffold-dependencies.js +0 -202
  79. package/frigg-cli/install-command/app-definition.js +0 -174
  80. package/frigg-cli/install-command/resolve-module.js +0 -69
  81. package/frigg-cli/templates/backend/README.md +0 -267
  82. package/frigg-cli/templates/backend/env.example +0 -20
  83. package/frigg-cli/templates/backend/gitignore +0 -10
  84. package/frigg-cli/templates/backend/index.js +0 -114
  85. package/frigg-cli/templates/backend/infrastructure.js +0 -20
  86. package/infrastructure/__tests__/scaffold-default-infrastructure.test.js +0 -148
@@ -5,17 +5,6 @@
5
5
  * valid, consistent CloudFormation templates.
6
6
  */
7
7
 
8
- // Never touch AWS or the real Prisma layer from a unit test: discovery returns
9
- // nothing (a fresh account), and the layer build (npm install into
10
- // layers/prisma) is stubbed out.
11
- jest.mock('../domains/shared/resource-discovery', () => ({
12
- ...jest.requireActual('../domains/shared/resource-discovery'),
13
- gatherDiscoveredResources: jest.fn().mockResolvedValue({}),
14
- }));
15
- jest.mock('../domains/shared/utilities/prisma-layer-manager', () => ({
16
- ensurePrismaLayerExists: jest.fn().mockResolvedValue(undefined),
17
- }));
18
-
19
8
  const { composeServerlessDefinition } = require('../infrastructure-composer');
20
9
 
21
10
  describe('CloudFormation Template Generation', () => {
@@ -97,16 +86,11 @@ describe('CloudFormation Template Generation', () => {
97
86
 
98
87
  // Framework-generated resources (created by Serverless Framework, not our builders)
99
88
  const frameworkResources = ['HttpApi', 'HttpApiLogGroup'];
100
- // Serverless names each function's resource `<Name>LambdaFunction`
101
- // (e.g. dbMigrationWorker -> DbMigrationWorkerLambdaFunction).
102
- const functionResources = Object.keys(result.functions || {}).map(
103
- (name) => `${name.charAt(0).toUpperCase()}${name.slice(1)}LambdaFunction`
104
- );
105
89
 
106
- // Verify all Refs point to existing resources, layers, functions or framework resources
90
+ // Verify all Refs point to existing resources, layers, or framework resources
107
91
  refs.forEach(ref => {
108
92
  if (!frameworkResources.includes(ref)) {
109
- expect([...allIds, ...functionResources]).toContain(ref);
93
+ expect(allIds).toContain(ref);
110
94
  }
111
95
  });
112
96
  });
@@ -139,9 +123,7 @@ describe('CloudFormation Template Generation', () => {
139
123
  integrations: [
140
124
  { Definition: { name: 'slack' } }
141
125
  ],
142
- // Discovery is stubbed to an empty account, so the VPC must be
143
- // created explicitly; `auto` with no VPC found is a hard error.
144
- vpc: { enable: true, management: 'create-new' },
126
+ vpc: { enable: true },
145
127
  encryption: { fieldLevelEncryptionMethod: 'kms' }
146
128
  };
147
129
 
@@ -269,9 +251,7 @@ describe('CloudFormation Template Generation', () => {
269
251
  it('should create VPC resources when enabled', async () => {
270
252
  const appDefinition = {
271
253
  name: 'test-app',
272
- // Discovery is stubbed to an empty account, so the VPC must be
273
- // created explicitly; `auto` with no VPC found is a hard error.
274
- vpc: { enable: true, management: 'create-new' },
254
+ vpc: { enable: true },
275
255
  integrations: []
276
256
  };
277
257
 
@@ -284,9 +264,7 @@ describe('CloudFormation Template Generation', () => {
284
264
  it('should create subnets in VPC', async () => {
285
265
  const appDefinition = {
286
266
  name: 'test-app',
287
- // Discovery is stubbed to an empty account, so the VPC must be
288
- // created explicitly; `auto` with no VPC found is a hard error.
289
- vpc: { enable: true, management: 'create-new' },
267
+ vpc: { enable: true },
290
268
  integrations: []
291
269
  };
292
270
 
@@ -299,9 +277,7 @@ describe('CloudFormation Template Generation', () => {
299
277
  it('should create security group in VPC', async () => {
300
278
  const appDefinition = {
301
279
  name: 'test-app',
302
- // Discovery is stubbed to an empty account, so the VPC must be
303
- // created explicitly; `auto` with no VPC found is a hard error.
304
- vpc: { enable: true, management: 'create-new' },
280
+ vpc: { enable: true },
305
281
  integrations: []
306
282
  };
307
283
 
@@ -314,9 +290,7 @@ describe('CloudFormation Template Generation', () => {
314
290
  it('should configure Lambda functions with VPC', async () => {
315
291
  const appDefinition = {
316
292
  name: 'test-app',
317
- // Discovery is stubbed to an empty account, so the VPC must be
318
- // created explicitly; `auto` with no VPC found is a hard error.
319
- vpc: { enable: true, management: 'create-new' },
293
+ vpc: { enable: true },
320
294
  integrations: [
321
295
  { Definition: { name: 'slack' } }
322
296
  ]
@@ -453,9 +427,7 @@ describe('CloudFormation Template Generation', () => {
453
427
  { Definition: { name: 'slack' } },
454
428
  { Definition: { name: 'hubspot' } }
455
429
  ],
456
- // Discovery is stubbed to an empty account, so the VPC must be
457
- // created explicitly; `auto` with no VPC found is a hard error.
458
- vpc: { enable: true, management: 'create-new' },
430
+ vpc: { enable: true },
459
431
  encryption: { useDefaultKMSForFieldLevelEncryption: true },
460
432
  database: {
461
433
  type: 'postgresql',