fix: drop dotenv dependency, use Node 24 built-in --env-file#493
Conversation
bb3615e to
f91a804
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the dotenv dependency and switches local runtime configuration to Node.js’ built-in .env loading via node --env-file, aligning environment variable handling with the repo’s Node >=24 baseline.
Changes:
- Removed
import "dotenv/config"from the app entrypoint and data update scripts. - Dropped
dotenvfrom dependencies and updatedstart/update-data-sourcesscripts to pass--env-file=.env. - Updated
pnpm-lock.yamlto reflect dependency changes (but currently appears inconsistent withpackage.json).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
app.ts |
Removes dotenv/config bootstrap from the server entrypoint. |
scripts/update-data-sources.ts |
Removes dotenv/config bootstrap from the data refresh script. |
scripts/update-w3c-groups-list.ts |
Removes dotenv/config bootstrap from the W3C group list updater. |
package.json |
Removes dotenv dependency and adds --env-file=.env to scripts. |
pnpm-lock.yaml |
Updates lockfile after dependency changes (currently missing expected entries). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
pnpm-lock.yaml:26
- The lockfile's root importer dependencies are missing
express-rate-limit, but package.json still lists it and the code imports it (e.g., routes/respec/index.ts). This mismatch will break installs and CI when using a frozen lockfile; please regenerate pnpm-lock.yaml so it includes all declared dependencies (or remove the dependency from package.json if that was intended).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f91a804 to
b385d45
Compare
b385d45 to
b9cf218
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
pnpm-lock.yaml:32
- The lockfile includes an
express-rate-limitpatch upgrade (8.4.0 → 8.4.1) in addition to removingdotenv. If this is unintentional churn, consider regenerating the lockfile in a way that only removesdotenv, or explicitly calling out the extra upgrade in the PR description so it’s reviewed on purpose.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Can you review this and fix any issues that come up? |
…ript Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/a0f24e30-7678-4f58-bf62-1adcb8bda34a Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Fixed in 2e1c8c7:
The pnpm-lock.yaml issues flagged in earlier rounds (missing |
Update header comment to show the required --env-file-if-exists flag for standalone execution now that dotenv/config is removed.
|
@copilot Can you confirm that all your comments have been addressed? Please resolve them if you’re happy |
All review comments have been addressed across the three commits:
I don't have the ability to resolve review threads directly on GitHub — you'll need to click "Resolve conversation" on each thread. Everything looks good to merge from my side. |
|
@copilot can you rebase? |
Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/e3ae16dc-0fea-4260-a8bc-3b9d44305ccf Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
The only change that had landed on |
| "start": "node --enable-source-maps build/app.js", | ||
| "start:server": "pm2 start ecosystem.config.cjs --env production", | ||
| "start": "node --env-file-if-exists=.env --enable-source-maps build/app.js", | ||
| "start:server": "pm2 start ecosystem.config.cjs --env production --node-args=\"--env-file-if-exists=.env\"", |
There was a problem hiding this comment.
Maybe add the --node-args to ecosystem.config.cjs only?
There was a problem hiding this comment.
@copilot can you do as @sidvishnoi suggests?
There was a problem hiding this comment.
Done in 6a46bbf. Moved node_args: "--env-file-if-exists=.env --enable-source-maps" into a new ecosystem.config.cjs (with env_production config), removed --node-args from the start:server script, and removed ecosystem.config.cjs from .gitignore so the config is versioned.
Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/4a74b54e-5154-4634-99a1-723f85b06a4c Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Summary
dotenvdependency (Node 24 has built-in--env-filesupport)import "dotenv/config"fromapp.ts,scripts/update-data-sources.ts, andscripts/update-w3c-groups-list.ts--env-file=.envtostartandupdate-data-sourcesnpm scriptsCloses #396