Skip to content

feat(DEP0150): introduce process-config-mutations-to-separate-config#453

Open
Green00101 wants to merge 6 commits into
nodejs:mainfrom
Green00101:fix/dep0150-process-config
Open

feat(DEP0150): introduce process-config-mutations-to-separate-config#453
Green00101 wants to merge 6 commits into
nodejs:mainfrom
Green00101:fix/dep0150-process-config

Conversation

@Green00101
Copy link
Copy Markdown

Summary

Adds a DEP0150 migration recipe to handle process.config mutations after it became immutable in Node.js v19.
The recipe handles:

  • Direct assignments to process.config properties
  • Nested property assignments
  • Bracket notation assignments
  • delete process.config... expressions
  • Bare Object.assign(process.config, ...) calls
  • Captured Object.assign(process.config, ...) calls by rewriting them to copy into a new object
  • Read-only process.config usage, which is preserved unchanged

Closes #408.

Tests

  • Ran npm test in recipes/process-config-mutations-to-separate-config
  • Added tests:
    • bracket-notation-assignment
    • bracket-notation-delete
    • conditional-modification
    • direct-assignment
    • nested-property
    • nested-write-unchanged
    • new-property
    • object-assign-bare
    • object-assign-captured
    • read-only

This is my first contribution to this project, so feedback is very welcome. I’m happy to make any changes if needed.

Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Missing readme at codemod level (take example on other or read CONTRIBUTING.md)
  2. run npm I at root level to resolve the new npm workspace

Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
@Green00101
Copy link
Copy Markdown
Author

Hi, thanks for reviewing my PR.

I have updated the code based on your comments.
Please let me know if anything else needs to be changed.

@AugustinMauroy AugustinMauroy requested a review from a team May 7, 2026 13:29
@AugustinMauroy AugustinMauroy changed the title fix(DEP0150): preserve formatting when commenting process.config mutations feat(process-config-mutations-to-separate-config): introduce May 7, 2026
@AugustinMauroy AugustinMauroy added the awaiting reviewer Author has responded and needs action from the reviewer label May 7, 2026
Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that nice. could you also add jsdoc on helper function ?

Comment thread recipes/process-config-mutations-to-separate-config/README.md Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts Outdated
Copy link
Copy Markdown
Member

@brunocroh brunocroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@JakobJingleheimer JakobJingleheimer changed the title feat(process-config-mutations-to-separate-config): introduce feat(DEP0150): introduce process-config-mutations-to-separate-config May 7, 2026
@JakobJingleheimer JakobJingleheimer added the dep:19.x Migrate a deprecation for node 19.x label May 7, 2026
@Green00101
Copy link
Copy Markdown
Author

Thanks for taking the time to review my PR.

I have updated the code according to your feedback.

I also noticed that I had several formatting issues. When I tried to run node --run pre-commit, I got the following error: Missing script: "lint:fix;", even though I can see "lint:fix": "biome lint --fix ./" in package.json.

Because of that, I have been running the checks separately instead:

node --run lint:fix
node --run type-check
node --run test

Could this be why some formatting issues were missed? If so, what would be the recommended way to fix it?

Comment thread recipes/process-config-mutations-to-separate-config/src/workflow.ts
@Green00101
Copy link
Copy Markdown
Author

Thanks!

I’ve updated the formatting and pushed the changes.

Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

@AugustinMauroy
Copy link
Copy Markdown
Member

Thanks for taking the time to review my PR.

I have updated the code according to your feedback.

I also noticed that I had several formatting issues. When I tried to run node --run pre-commit, I got the following error: Missing script: "lint:fix;", even though I can see "lint:fix": "biome lint --fix ./" in package.json.

Because of that, I have been running the checks separately instead:

node --run lint:fix node --run type-check node --run test

Could this be why some formatting issues were missed? If so, what would be the recommended way to fix it?

Missing script: "lint:fix;" it's not supposed to do that.

also on this repo we only lint mean analyse the code but not format it because automatic formater sometime make strange thing

@Green00101
Copy link
Copy Markdown
Author

Green00101 commented May 8, 2026

Got it, thanks for clarifying.

When I run node --run pre-commit, it shows:

PS C:\userland-migrations> node --run pre-commit
Missing script: "lint:fix;" for C:\userland-migrations\package.json

Available scripts are:
  lint:fix: biome lint --fix ./
  lint: biome lint ./
  pre-commit: node --run lint:fix; node --run type-check; node --run test
  test: npm run test --workspaces
  type-check: tsgo --noEmit

Maybe this is because I’m using Windows.

I’ll fix the formatting issues manually where needed.

@AugustinMauroy
Copy link
Copy Markdown
Member

Got it, thanks for clarifying.

When I run node --run pre-commit, it shows:

PS C:\userland-migrations> node --run pre-commit
Missing script: "lint:fix;" for C:\userland-migrations\package.json

Available scripts are:
  lint:fix: biome lint --fix ./
  lint: biome lint ./
  pre-commit: node --run lint:fix; node --run type-check; node --run test
  test: npm run test --workspaces
  type-check: tsgo --noEmit

Maybe this is because I’m using Windows.

I’ll fix the formatting issues manually where needed.

RIght I got it. command; otherCommand syntax doesn't work for windows you can open an second pr for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewer Author has responded and needs action from the reviewer dep:19.x Migrate a deprecation for node 19.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing the value of process.config

4 participants