feat(DEP0150): introduce process-config-mutations-to-separate-config#453
feat(DEP0150): introduce process-config-mutations-to-separate-config#453Green00101 wants to merge 6 commits into
process-config-mutations-to-separate-config#453Conversation
AugustinMauroy
left a comment
There was a problem hiding this comment.
- Missing readme at codemod level (take example on other or read CONTRIBUTING.md)
- run
npm Iat root level to resolve the new npm workspace
|
Hi, thanks for reviewing my PR. I have updated the code based on your comments. |
process-config-mutations-to-separate-config): introduce
AugustinMauroy
left a comment
There was a problem hiding this comment.
that nice. could you also add jsdoc on helper function ?
process-config-mutations-to-separate-config): introduceprocess-config-mutations-to-separate-config
|
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 Because of that, I have been running the checks separately instead:
Could this be why some formatting issues were missed? If so, what would be the recommended way to fix it? |
|
Thanks! I’ve updated the formatting and pushed the changes. |
also on this repo we only lint mean analyse the code but not format it because automatic formater sometime make strange thing |
|
Got it, thanks for clarifying. When I run Maybe this is because I’m using Windows. I’ll fix the formatting issues manually where needed. |
RIght I got it. |
Summary
Adds a DEP0150 migration recipe to handle
process.configmutations after it became immutable in Node.js v19.The recipe handles:
process.configpropertiesdelete process.config...expressionsObject.assign(process.config, ...)callsObject.assign(process.config, ...)calls by rewriting them to copy into a new objectprocess.configusage, which is preserved unchangedCloses #408.
Tests
npm testinrecipes/process-config-mutations-to-separate-configbracket-notation-assignmentbracket-notation-deleteconditional-modificationdirect-assignmentnested-propertynested-write-unchangednew-propertyobject-assign-bareobject-assign-capturedread-onlyThis is my first contribution to this project, so feedback is very welcome. I’m happy to make any changes if needed.