refactor: remove dotenv dependency and use env.ts pattern #446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refactor: remove dotenv dependency and use env.ts pattern
Summary
This PR removes the
dotenvdependency fromgraphql/serverand migrates to the existingenv.ts/merge.tspattern used throughout the codebase. The server already usesgetEnvOptions()from@constructive-io/graphql-env, so thedotenv/configimport was redundant.Changes:
import 'dotenv/config'fromserver.tsandcreate-bucket.tscreate-bucket.tsto usegetEnvOptions()for CDN configurationdotenvdependency frompackage.jsongraphql/server/.envfile (contained hardcoded dev credentials)AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYaliases topgpm/env/src/env.tsfor standard AWS env var compatibility.envand.env.localto root.gitignoreReview & Testing Checklist for Human
PGHOST,PGUSER, etc.) or viapgpm.config.js/pgpm.jsonconfig filespnpm bucket:createingraphql/serverwith appropriate env vars set to verify S3/MinIO bucket creation still worksPGDATABASEwas being ignored - confirm this is resolved by settingPGDATABASE=mydband verifying the server connects to the correct databaseAWS_ACCESS_KEYandAWS_ACCESS_KEY_IDwork correctly (same for secret key)Recommended test plan:
Notes
__fixtures__/sqitch/were intentionally left unchanged as they are not part of the pnpm workspaceLink to Devin run: https://app.devin.ai/sessions/6f190395b28142c48b03080c67ec8b59
Requested by: Dan Lynch (@pyramation)