@friggframework/devtools 2.0.0--canary.461.6c79fb2.0 → 2.0.0--canary.461.88067ea.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.
@@ -157,6 +157,34 @@ describe('CLI Command: build', () => {
157
157
  delete process.env.TEST_VAR;
158
158
  });
159
159
 
160
+ it('should set SLS_STAGE environment variable to match stage option', async () => {
161
+ await buildCommand({ stage: 'qa' });
162
+
163
+ const call = spawnSync.mock.calls[0];
164
+ const options = call[2];
165
+
166
+ // Verify SLS_STAGE is set for discovery to use
167
+ expect(options.env.SLS_STAGE).toBe('qa');
168
+ });
169
+
170
+ it('should set SLS_STAGE for production stage', async () => {
171
+ await buildCommand({ stage: 'production' });
172
+
173
+ const call = spawnSync.mock.calls[0];
174
+ const options = call[2];
175
+
176
+ expect(options.env.SLS_STAGE).toBe('production');
177
+ });
178
+
179
+ it('should set SLS_STAGE for dev stage', async () => {
180
+ await buildCommand({ stage: 'dev' });
181
+
182
+ const call = spawnSync.mock.calls[0];
183
+ const options = call[2];
184
+
185
+ expect(options.env.SLS_STAGE).toBe('dev');
186
+ });
187
+
160
188
  it('should use infrastructure.js as config file', async () => {
161
189
  await buildCommand({ stage: 'dev' });
162
190
 
@@ -43,6 +43,7 @@ async function buildCommand(options) {
43
43
  env: {
44
44
  ...process.env,
45
45
  NODE_PATH: path.resolve(backendPath, 'node_modules'),
46
+ SLS_STAGE: options.stage, // Set stage for resource discovery
46
47
  }
47
48
  });
48
49
 
@@ -392,6 +392,29 @@ describe('Resource Discovery', () => {
392
392
  );
393
393
  });
394
394
 
395
+ it('should read stage from SLS_STAGE environment variable for CLI integration', async () => {
396
+ // This test documents the contract between frigg CLI and discovery
397
+ // The CLI sets SLS_STAGE environment variable when user passes --stage flag
398
+ process.env.SLS_STAGE = 'qa';
399
+
400
+ const appDefinition = {
401
+ name: 'quo-integrations',
402
+ vpc: { enable: true },
403
+ };
404
+
405
+ await gatherDiscoveredResources(appDefinition);
406
+
407
+ // Verify stage is read from SLS_STAGE
408
+ expect(mockVpcDiscovery.discover).toHaveBeenCalledWith(
409
+ expect.objectContaining({
410
+ serviceName: 'quo-integrations',
411
+ stage: 'qa',
412
+ })
413
+ );
414
+
415
+ delete process.env.SLS_STAGE;
416
+ });
417
+
395
418
  it('should include secrets in SSM discovery by default', async () => {
396
419
  const appDefinition = {
397
420
  ssm: { enable: true },
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.6c79fb2.0",
4
+ "version": "2.0.0--canary.461.88067ea.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.6c79fb2.0",
15
- "@friggframework/test": "2.0.0--canary.461.6c79fb2.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.88067ea.0",
15
+ "@friggframework/test": "2.0.0--canary.461.88067ea.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.6c79fb2.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.6c79fb2.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.88067ea.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.88067ea.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": "6c79fb214a75cd9bfec200a5a5cde9a2ebc51513"
73
+ "gitHead": "88067ea8f87aa8af3de69620e1b3038ee316419b"
74
74
  }