@friggframework/devtools 2.0.0--canary.419.99533fd.0 → 2.0.0--canary.416.a2540c3.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.
@@ -12,11 +12,13 @@ const { uiCommand } = require('./ui-command');
12
12
  const program = new Command();
13
13
 
14
14
  program
15
- .command('init [templateName]')
15
+ .command('init [projectName]')
16
16
  .description('Initialize a new Frigg application')
17
- .option('-t, --template <template>', 'template to use', 'backend-only')
18
- .option('-n, --name <name>', 'project name')
19
- .option('-d, --directory <directory>', 'target directory')
17
+ .option('-m, --mode <mode>', 'deployment mode (embedded|standalone)')
18
+ .option('--frontend', 'include demo frontend')
19
+ .option('--no-frontend', 'skip demo frontend')
20
+ .option('-f, --force', 'overwrite existing directory')
21
+ .option('-v, --verbose', 'enable verbose output')
20
22
  .action(initCommand);
21
23
 
22
24
  program
@@ -27,7 +27,7 @@ infrastructure/
27
27
  ├── AWS-DISCOVERY-TROUBLESHOOTING.md # AWS discovery troubleshooting
28
28
  ├── DEPLOYMENT-INSTRUCTIONS.md # General deployment instructions
29
29
  ├── README-TESTING.md # Testing strategy documentation
30
- ├──
30
+ ├──
31
31
  ├── cloudformation/ # CloudFormation templates
32
32
  │ ├── monitoring-infrastructure.yaml # Enhanced monitoring (Phase 3)
33
33
  │ ├── cdn-infrastructure.yaml # CDN and UI distribution (Phase 3)
@@ -60,79 +60,71 @@ infrastructure/
60
60
  #### 1. Serverless Template Generator (`serverless-template.js`)
61
61
 
62
62
  Generates complete serverless.yml configurations with:
63
-
64
- - VPC configuration and resource discovery
65
- - KMS encryption for field-level encryption
66
- - SSM Parameter Store integration
67
- - Integration-specific functions and queues
68
- - WebSocket support for real-time features
63
+ - VPC configuration and resource discovery
64
+ - KMS encryption for field-level encryption
65
+ - SSM Parameter Store integration
66
+ - Integration-specific functions and queues
67
+ - WebSocket support for real-time features
69
68
 
70
69
  #### 2. AWS Discovery (`aws-discovery.js`)
71
70
 
72
71
  Automatically discovers existing AWS resources:
73
-
74
- - Default VPC and security groups
75
- - Private subnets for Lambda functions
76
- - Customer-managed KMS keys
77
- - Route tables for VPC endpoints
72
+ - Default VPC and security groups
73
+ - Private subnets for Lambda functions
74
+ - Customer-managed KMS keys
75
+ - Route tables for VPC endpoints
78
76
 
79
77
  #### 3. Build-Time Discovery (`build-time-discovery.js`)
80
78
 
81
79
  Integrates AWS discovery into the build process:
82
-
83
- - Pre-build hook for serverless deployments
84
- - Environment variable injection
85
- - Template variable replacement
86
- - Error handling and fallback values
80
+ - Pre-build hook for serverless deployments
81
+ - Environment variable injection
82
+ - Template variable replacement
83
+ - Error handling and fallback values
87
84
 
88
85
  ### Phase 3 Infrastructure
89
86
 
90
87
  #### 1. Enhanced Monitoring (`cloudformation/monitoring-infrastructure.yaml`)
91
88
 
92
89
  Production-ready monitoring with:
93
-
94
- - Code generation service monitoring
95
- - UI distribution monitoring
96
- - Advanced CloudWatch dashboards
97
- - Custom metrics and alarms
90
+ - Code generation service monitoring
91
+ - UI distribution monitoring
92
+ - Advanced CloudWatch dashboards
93
+ - Custom metrics and alarms
98
94
 
99
95
  #### 2. CDN Infrastructure (`cloudformation/cdn-infrastructure.yaml`)
100
96
 
101
97
  CloudFront distribution for UI packages:
102
-
103
- - S3 bucket for multi-framework UI packages
104
- - CloudFront distribution with custom domains
105
- - Lambda function for package deployment
106
- - API Gateway for package management
98
+ - S3 bucket for multi-framework UI packages
99
+ - CloudFront distribution with custom domains
100
+ - Lambda function for package deployment
101
+ - API Gateway for package management
107
102
 
108
103
  #### 3. Code Generation Infrastructure (`cloudformation/codegen-infrastructure.yaml`)
109
104
 
110
105
  Serverless code generation platform:
111
-
112
- - SQS queue for generation requests
113
- - Lambda function with AI/ML integration
114
- - DynamoDB tracking table
115
- - S3 storage for templates and generated code
116
- - ElastiCache for template caching
106
+ - SQS queue for generation requests
107
+ - Lambda function with AI/ML integration
108
+ - DynamoDB tracking table
109
+ - S3 storage for templates and generated code
110
+ - ElastiCache for template caching
117
111
 
118
112
  #### 4. Advanced Alerting (`cloudformation/alerting-infrastructure.yaml`)
119
113
 
120
114
  Multi-channel alerting system:
121
-
122
- - Multiple SNS topics for alert severity levels
123
- - Lambda function for alert processing
124
- - PagerDuty and Slack integration
125
- - Composite alarms for system health
126
- - Advanced metrics collection
115
+ - Multiple SNS topics for alert severity levels
116
+ - Lambda function for alert processing
117
+ - PagerDuty and Slack integration
118
+ - Composite alarms for system health
119
+ - Advanced metrics collection
127
120
 
128
121
  #### 5. Deployment Pipeline (`cloudformation/deployment-pipeline.yaml`)
129
122
 
130
123
  CI/CD pipeline for automated deployments:
131
-
132
- - CodePipeline with GitHub integration
133
- - CodeBuild projects for backend and UI
134
- - Multi-stage deployment workflow
135
- - Integration testing and approval gates
124
+ - CodePipeline with GitHub integration
125
+ - CodeBuild projects for backend and UI
126
+ - Multi-stage deployment workflow
127
+ - Integration testing and approval gates
136
128
 
137
129
  ## Configuration Options
138
130
 
@@ -143,7 +135,7 @@ const appDefinition = {
143
135
  // Basic configuration
144
136
  name: 'my-frigg-app',
145
137
  provider: 'aws',
146
-
138
+
147
139
  // VPC configuration
148
140
  vpc: {
149
141
  enable: true,
@@ -152,22 +144,22 @@ const appDefinition = {
152
144
  subnetIds: [...], // Optional: custom subnets
153
145
  enableVPCEndpoints: true // Optional: create VPC endpoints
154
146
  },
155
-
147
+
156
148
  // KMS encryption
157
149
  encryption: {
158
150
  useDefaultKMSForFieldLevelEncryption: true
159
151
  },
160
-
152
+
161
153
  // SSM Parameter Store
162
154
  ssm: {
163
155
  enable: true
164
156
  },
165
-
157
+
166
158
  // WebSocket support (Phase 3)
167
159
  websockets: {
168
160
  enable: true
169
161
  },
170
-
162
+
171
163
  // Integrations
172
164
  integrations: [
173
165
  { Definition: { name: 'hubspot' } },
@@ -203,8 +195,10 @@ SERVICE_NAME=my-frigg-app
203
195
  const { composeServerlessDefinition } = require('./serverless-template');
204
196
 
205
197
  const appDefinition = {
206
- name: 'my-app',
207
- integrations: [{ Definition: { name: 'hubspot' } }],
198
+ name: 'my-app',
199
+ integrations: [
200
+ { Definition: { name: 'hubspot' } }
201
+ ]
208
202
  };
209
203
 
210
204
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -215,11 +209,13 @@ const serverlessConfig = await composeServerlessDefinition(appDefinition);
215
209
 
216
210
  ```javascript
217
211
  const appDefinition = {
218
- name: 'secure-app',
219
- vpc: { enable: true },
220
- encryption: { useDefaultKMSForFieldLevelEncryption: true },
221
- ssm: { enable: true },
222
- integrations: [{ Definition: { name: 'salesforce' } }],
212
+ name: 'secure-app',
213
+ vpc: { enable: true },
214
+ encryption: { useDefaultKMSForFieldLevelEncryption: true },
215
+ ssm: { enable: true },
216
+ integrations: [
217
+ { Definition: { name: 'salesforce' } }
218
+ ]
223
219
  };
224
220
 
225
221
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -229,10 +225,12 @@ const serverlessConfig = await composeServerlessDefinition(appDefinition);
229
225
 
230
226
  ```javascript
231
227
  const appDefinition = {
232
- name: 'realtime-app',
233
- websockets: { enable: true },
234
- vpc: { enable: true },
235
- integrations: [{ Definition: { name: 'slack' } }],
228
+ name: 'realtime-app',
229
+ websockets: { enable: true },
230
+ vpc: { enable: true },
231
+ integrations: [
232
+ { Definition: { name: 'slack' } }
233
+ ]
236
234
  };
237
235
 
238
236
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -261,21 +259,19 @@ npm test -- --watch
261
259
  ### Test Categories
262
260
 
263
261
  1. **Unit Tests**: Test individual components
264
-
265
- - AWS discovery utilities
266
- - Serverless template generation
267
- - IAM policy generation
262
+ - AWS discovery utilities
263
+ - Serverless template generation
264
+ - IAM policy generation
268
265
 
269
266
  2. **Integration Tests**: Test end-to-end workflows
270
-
271
- - Complete discovery and template generation
272
- - Plugin integration
273
- - Phase 3 infrastructure validation
267
+ - Complete discovery and template generation
268
+ - Plugin integration
269
+ - Phase 3 infrastructure validation
274
270
 
275
271
  3. **Performance Tests**: Validate infrastructure limits
276
- - CloudFormation template sizes
277
- - Resource count limits
278
- - Cross-stack dependencies
272
+ - CloudFormation template sizes
273
+ - Resource count limits
274
+ - Cross-stack dependencies
279
275
 
280
276
  ### Mock Data
281
277
 
@@ -283,12 +279,11 @@ Tests use mock AWS resources to avoid real AWS API calls:
283
279
 
284
280
  ```javascript
285
281
  const mockAWSResources = {
286
- defaultVpcId: 'vpc-12345678',
287
- defaultSecurityGroupId: 'sg-12345678',
288
- privateSubnetId1: 'subnet-private-1',
289
- privateSubnetId2: 'subnet-private-2',
290
- defaultKmsKeyId:
291
- 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012',
282
+ defaultVpcId: 'vpc-12345678',
283
+ defaultSecurityGroupId: 'sg-12345678',
284
+ privateSubnetId1: 'subnet-private-1',
285
+ privateSubnetId2: 'subnet-private-2',
286
+ defaultKmsKeyId: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'
292
287
  };
293
288
  ```
294
289
 
@@ -298,18 +293,18 @@ const mockAWSResources = {
298
293
 
299
294
  The infrastructure requires specific IAM permissions for AWS resource discovery and deployment:
300
295
 
301
- - **EC2**: Describe VPCs, subnets, security groups, route tables
302
- - **KMS**: List keys, describe keys
303
- - **STS**: Get caller identity
304
- - **CloudFormation**: Full access for stack operations
305
- - **Lambda**: Function management
306
- - **API Gateway**: API management
307
- - **S3**: Bucket and object operations (including tagging)
308
- - **DynamoDB**: Table operations
309
- - **SQS**: Queue operations
310
- - **SNS**: Topic operations
311
- - **CloudWatch**: Metrics and alarms
312
- - **IAM**: Role and policy management
296
+ - **EC2**: Describe VPCs, subnets, security groups, route tables
297
+ - **KMS**: List keys, describe keys
298
+ - **STS**: Get caller identity
299
+ - **CloudFormation**: Full access for stack operations
300
+ - **Lambda**: Function management
301
+ - **API Gateway**: API management
302
+ - **S3**: Bucket and object operations (including tagging)
303
+ - **DynamoDB**: Table operations
304
+ - **SQS**: Queue operations
305
+ - **SNS**: Topic operations
306
+ - **CloudWatch**: Metrics and alarms
307
+ - **IAM**: Role and policy management
313
308
 
314
309
  ### Best Practices
315
310
 
@@ -353,8 +348,6 @@ serverless print
353
348
  aws cloudformation validate-template --template-body file://template.json
354
349
  ```
355
350
 
356
- - **Connectivity to external services (e.g., databases):** If your Lambda functions in a VPC cannot connect to external services, ensure that the `FriggLambdaSecurityGroup` has the correct **egress** rules to allow outbound traffic on the required ports (e.g., port 27017 for MongoDB).
357
-
358
351
  #### Infrastructure Test Failures
359
352
 
360
353
  ```bash
@@ -371,22 +364,19 @@ npm run test:debug
371
364
  ### Performance Optimization
372
365
 
373
366
  #### Lambda Cold Starts
374
-
375
- - Use provisioned concurrency for critical functions
376
- - Optimize function size and dependencies
377
- - Monitor cold start metrics
367
+ - Use provisioned concurrency for critical functions
368
+ - Optimize function size and dependencies
369
+ - Monitor cold start metrics
378
370
 
379
371
  #### VPC Performance
380
-
381
- - Use VPC endpoints to reduce NAT Gateway costs
382
- - Monitor ENI creation/deletion times
383
- - Consider Lambda@Edge for global distribution
372
+ - Use VPC endpoints to reduce NAT Gateway costs
373
+ - Monitor ENI creation/deletion times
374
+ - Consider Lambda@Edge for global distribution
384
375
 
385
376
  #### Cost Optimization
386
-
387
- - Use S3 Intelligent Tiering
388
- - Configure CloudWatch log retention
389
- - Monitor and alert on unexpected usage
377
+ - Use S3 Intelligent Tiering
378
+ - Configure CloudWatch log retention
379
+ - Monitor and alert on unexpected usage
390
380
 
391
381
  ## Contributing
392
382
 
@@ -415,17 +405,17 @@ npm run test:debug
415
405
 
416
406
  ## Support
417
407
 
418
- - **Documentation**: See `PHASE3-DEPLOYMENT-GUIDE.md` for detailed deployment instructions
419
- - **Testing**: See `README-TESTING.md` for testing strategy
420
- - **Troubleshooting**: See `AWS-DISCOVERY-TROUBLESHOOTING.md` for common issues
421
- - **Issues**: Create GitHub issues for bugs and feature requests
422
- - **Discussions**: Use GitHub Discussions for questions and ideas
408
+ - **Documentation**: See `PHASE3-DEPLOYMENT-GUIDE.md` for detailed deployment instructions
409
+ - **Testing**: See `README-TESTING.md` for testing strategy
410
+ - **Troubleshooting**: See `AWS-DISCOVERY-TROUBLESHOOTING.md` for common issues
411
+ - **Issues**: Create GitHub issues for bugs and feature requests
412
+ - **Discussions**: Use GitHub Discussions for questions and ideas
423
413
 
424
414
  ## Related Documentation
425
415
 
426
- - [Phase 3 Deployment Guide](./PHASE3-DEPLOYMENT-GUIDE.md)
427
- - [Testing Strategy](./README-TESTING.md)
428
- - [AWS Discovery Troubleshooting](./AWS-DISCOVERY-TROUBLESHOOTING.md)
429
- - [IAM Policy Templates](./IAM-POLICY-TEMPLATES.md)
430
- - [VPC Configuration](./VPC-CONFIGURATION.md)
431
- - [WebSocket Configuration](./WEBSOCKET-CONFIGURATION.md)
416
+ - [Phase 3 Deployment Guide](./PHASE3-DEPLOYMENT-GUIDE.md)
417
+ - [Testing Strategy](./README-TESTING.md)
418
+ - [AWS Discovery Troubleshooting](./AWS-DISCOVERY-TROUBLESHOOTING.md)
419
+ - [IAM Policy Templates](./IAM-POLICY-TEMPLATES.md)
420
+ - [VPC Configuration](./VPC-CONFIGURATION.md)
421
+ - [WebSocket Configuration](./WEBSOCKET-CONFIGURATION.md)
@@ -450,13 +450,6 @@ const createVPCInfrastructure = (AppDefinition) => {
450
450
  CidrIp: '0.0.0.0/0',
451
451
  Description: 'DNS UDP',
452
452
  },
453
- {
454
- IpProtocol: 'tcp',
455
- FromPort: 27017,
456
- ToPort: 27017,
457
- CidrIp: '0.0.0.0/0',
458
- Description: 'MongoDB outbound',
459
- },
460
453
  ],
461
454
  Tags: [
462
455
  {
@@ -12,9 +12,11 @@ const AVAILABLE_COMMANDS = [
12
12
  description: 'Initialize a new Frigg project',
13
13
  usage: 'frigg init [project-name]',
14
14
  options: [
15
- { name: '--template', description: 'Template to use (serverless, express)' },
16
- { name: '--skip-install', description: 'Skip npm install' },
17
- { name: '--force', description: 'Overwrite existing directory' }
15
+ { name: '--mode <mode>', description: 'Deployment mode (embedded|standalone)' },
16
+ { name: '--frontend', description: 'Include demo frontend' },
17
+ { name: '--no-frontend', description: 'Skip demo frontend' },
18
+ { name: '--force', description: 'Overwrite existing directory' },
19
+ { name: '--verbose', description: 'Enable verbose output' }
18
20
  ]
19
21
  },
20
22
  {
@@ -114,14 +114,24 @@ class FriggCLIIntegration {
114
114
 
115
115
  /**
116
116
  * Initialize a new project using CLI
117
- */
117
+ */
118
118
  async initProject(projectDirectory, options = {}) {
119
119
  const args = [projectDirectory]
120
120
 
121
- if (options.template) {
122
- args.push('--template', options.template)
121
+ if (options.mode) {
122
+ args.push('--mode', options.mode)
123
123
  }
124
-
124
+
125
+ if (options.frontend === false) {
126
+ args.push('--no-frontend')
127
+ } else if (options.frontend === true) {
128
+ args.push('--frontend')
129
+ }
130
+
131
+ if (options.force) {
132
+ args.push('--force')
133
+ }
134
+
125
135
  if (options.verbose) {
126
136
  args.push('--verbose')
127
137
  }
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.419.99533fd.0",
4
+ "version": "2.0.0--canary.416.a2540c3.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.835.0",
7
7
  "@aws-sdk/client-kms": "^3.835.0",
@@ -9,8 +9,8 @@
9
9
  "@babel/eslint-parser": "^7.18.9",
10
10
  "@babel/parser": "^7.25.3",
11
11
  "@babel/traverse": "^7.25.3",
12
- "@friggframework/schemas": "2.0.0--canary.419.99533fd.0",
13
- "@friggframework/test": "2.0.0--canary.419.99533fd.0",
12
+ "@friggframework/schemas": "2.0.0--canary.416.a2540c3.0",
13
+ "@friggframework/test": "2.0.0--canary.416.a2540c3.0",
14
14
  "@hapi/boom": "^10.0.1",
15
15
  "@inquirer/prompts": "^5.3.8",
16
16
  "axios": "^1.7.2",
@@ -32,8 +32,8 @@
32
32
  "serverless-http": "^2.7.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@friggframework/eslint-config": "2.0.0--canary.419.99533fd.0",
36
- "@friggframework/prettier-config": "2.0.0--canary.419.99533fd.0",
35
+ "@friggframework/eslint-config": "2.0.0--canary.416.a2540c3.0",
36
+ "@friggframework/prettier-config": "2.0.0--canary.416.a2540c3.0",
37
37
  "prettier": "^2.7.1",
38
38
  "serverless": "3.39.0",
39
39
  "serverless-dotenv-plugin": "^6.0.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "99533fda0918f6050d72721b0389e9c20da2dda2"
68
+ "gitHead": "a2540c34c11afdb3dc06ae76d53811a2522ff36d"
69
69
  }