Skip to content

Conversation

@seanspeaks
Copy link
Contributor

@seanspeaks seanspeaks commented Dec 12, 2025

Summary

  • Fix .env files being included in Lambda deployment packages during frigg deploy
  • Add proper file exclusions to prevent accidental secret exposure

Changes

Root Cause Fix

packages/devtools/infrastructure/domains/shared/utilities/base-definition-factory.js

Added .env* exclusion patterns to both skipEsbuildPackageConfig and functionPackageConfig:

'.env',
'.env.*',
'.env.local',
'.env.*.local',
'**/.env',
'**/.env.*',

<!-- GITHUB_RELEASE PR BODY: prerelease-version -->
# Version

Published prerelease version: `v2.0.0-next.62`

<details>
  <summary>Changelog</summary>

  #### 🐛 Bug Fix
  
  - `@friggframework/devtools`
    - fix: Exclude .env files from serverless package deployment [#518](https://github.com/friggframework/frigg/pull/518) ([@claude](https://github.com/claude) [@seanspeaks](https://github.com/seanspeaks))
  - `@friggframework/core`, `@friggframework/devtools`, `@friggframework/eslint-config`, `@friggframework/prettier-config`, `@friggframework/schemas`, `@friggframework/serverless-plugin`, `@friggframework/test`, `@friggframework/ui`
    - chore: remove stale comment and fix step numbering [#516](https://github.com/friggframework/frigg/pull/516) ([@claude](https://github.com/claude) [@seanspeaks](https://github.com/seanspeaks))
  
  #### Authors: 2
  
  - Claude ([@claude](https://github.com/claude))
  - Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
</details>
<!-- GITHUB_RELEASE PR BODY: prerelease-version -->

The previous patterns were too specific (e.g., .env.development.local)
and missed common variations like .env.development, .env.production,
and .env.local.local. Updated to use .env.* wildcard pattern.
- Add `files` field to package.json to whitelist only necessary files
- Add .npmignore to explicitly exclude .env files and test directory

This prevents .env files from being accidentally included when the
devtools package is published to npm or bundled for deployment.
The base-definition-factory.js was missing .env file exclusions in both
skipEsbuildPackageConfig and functionPackageConfig. This caused local
.env files to be included in deployed Lambda packages.

Added exclusion patterns for:
- .env
- .env.*
- .env.local
- .env.*.local
- **/.env
- **/.env.*

This ensures environment files are never deployed to Lambda, preventing
accidental exposure of secrets.
@seanspeaks seanspeaks changed the base branch from main to next December 12, 2025 01:59
@seanspeaks seanspeaks changed the title fix(vpc): Pass normalized management mode to buildSubnets for correct CIDR generation fix: Exclude .env files from serverless package deployment Dec 12, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
316 Security Hotspots
5.4% Duplication on New Code (required ≤ 3%)
D Reliability Rating on New Code (required ≥ A)
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@seanspeaks seanspeaks added the release Create a release when this pr is merged label Dec 12, 2025
@d-klotz d-klotz merged commit 7dafa19 into next Dec 15, 2025
12 of 26 checks passed
@d-klotz d-klotz deleted the claude/fix-frigg-env-deploy-014RPjyrZmnx4k33iUhiBzdj branch December 15, 2025 14:03
@seanspeaks
Copy link
Contributor Author

🚀 PR was released in v2.0.0-next.62 🚀

@seanspeaks seanspeaks added the prerelease This change is available in a prerelease. label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease This change is available in a prerelease. release Create a release when this pr is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants