nx icon indicating copy to clipboard operation
nx copied to clipboard

feat(devkit): allow to customize overwrite mode in generateFiles

Open qortex opened this issue 2 years ago • 20 comments

Adds a new capability to choose how to handle already existing target files when using a generator.

Current Behavior

If a target file already exists, generateFiles overwrites existing files. It is not always the intended behaviour, forcing to have custom code in generators to check for already existing files.

Expected Behavior

A new (optional) argument to generateFiles allows to choose the behavior when a target file already exists: overwrite (current & still default behavior), keep, throw.

Note: nx affected fails on my setup, so could only check by hand and all tests including new tests pass ok on devkit.

qortex avatar Jul 03 '23 12:07 qortex

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2023 10:52am

vercel[bot] avatar Jul 03 '23 12:07 vercel[bot]

@FrozenPandaz @vsavkin @bcabanes Hi, I'm not familiar with the PR review process for Nx. Should this topic be discussed somewhere to get the PR under review? I just submitted it, but maybe I'm missing a step in the process. Thanks for the amazing work on Nx :) Best,

qortex avatar Jul 22 '23 07:07 qortex

Ping Is there something to do to make sure someone is aware of this PR ? @FrozenPandaz @vsavkin @bcabanes

qortex avatar Jul 28 '23 09:07 qortex

Thanks! Should I resolve the conflicts, or do maintainers prefer to do it?

qortex avatar Sep 22 '23 15:09 qortex

@AgentEnder @isaacplmann Happy to move this forward, how should I proceed?

qortex avatar Sep 28 '23 21:09 qortex

@AgentEnder @isaacplmann Any way to move forward?

qortex avatar Oct 05 '23 12:10 qortex

Go ahead and merge the conflicts

isaacplmann avatar Oct 05 '23 13:10 isaacplmann

@isaacplmann Alright, I did I don't know why some builds failed. It doesn't look related to this PR. What do you think?

qortex avatar Oct 12 '23 18:10 qortex

I agree, they look unrelated. I relaunched the CI pipeline

isaacplmann avatar Oct 12 '23 18:10 isaacplmann

How should we move forward @isaacplmann ? Now just linux failed, macos passed 🤔

qortex avatar Oct 16 '23 11:10 qortex

I am unable to rebase + push this up since the fork is on an org account rather than a personal user account. Can you rebase with latest? I think the e2e errors should go away.

AgentEnder avatar Oct 16 '23 21:10 AgentEnder

Ah bummer

Just did rebase + push 🤞

qortex avatar Oct 17 '23 14:10 qortex

Looks like it's related to storybook e2e. Should not block this PR right? Or should I do something? @AgentEnder

qortex avatar Oct 18 '23 10:10 qortex

No, not your fault. We're working on fixing that e2e test.

isaacplmann avatar Oct 18 '23 12:10 isaacplmann

Ok, just rebased and pushed, looks like tests are green now!

qortex avatar Oct 24 '23 13:10 qortex

@FrozenPandaz @vsavkin should we merge that before main moves ahead again? That would be great 😄

qortex avatar Oct 25 '23 07:10 qortex

Test seems to be broken again. How to get this PR merged? We actually need this facility in our workflow. I respect if you don't plan to merge, just please let me know so that I take appropriate action and implement that in our project instead of the Nx repo.

Thanks and good luck for the new releases!

qortex avatar Nov 03 '23 07:11 qortex

@isaacplmann What's the way forward?

qortex avatar Nov 07 '23 14:11 qortex

@qortex thank you so much for your contribution! Will you have time to address the suggested changes, or should I go ahead and fix these, instead?

mandarini avatar Jan 30 '24 17:01 mandarini

Closing in favor of: #26354. We'll get this merged in.

AgentEnder avatar Jun 04 '24 14:06 AgentEnder

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

github-actions[bot] avatar Jun 14 '24 00:06 github-actions[bot]