-
Notifications
You must be signed in to change notification settings - Fork 67
track NoN files when configured dirs are used, clean before each new run #134
Conversation
addresses opennextjs/opennextjs-netlify#74 |
44ae8af
to
c468b53
Compare
currently this doesnt work in these ways:
|
c468b53
to
556b41b
Compare
Awesome!! 😊 Your approach is interesting! Initially, when I thought about this feature, I imagined that we could a custom But this approach is really neat!! It seems like one downside of this approach vs My personal thoughts regarding
|
babe278
to
08ae629
Compare
@FinnWoelm issue with your cleanup script idea. we purposely fail the plugin if anyone has next-on-netlify manually installed in their project (https://github.com/netlify/netlify-plugin-nextjs/blob/main/index.js#L42). we could change this, but after playing around with writing a custom script, it seems like an unpleasant bandaid that will need urgent replacing. |
i will be starting conversations internally about improving the CLI experience because i do believe now this is a greater CLI issue and one that could impact other plugins. i think the CLI shouldn't be making direct changes to a project's directory. the entire "build" should run in/be output into a tmp directory to avoid messing with a project directly. |
08ae629
to
9d78777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a clever approach!! :)
this is a pass at tracking NoN-moved or NoN-generated files between runs of NoN and cleaning them before a new run.
i don't see a way we can add a "manual" clean option for plugin CLI users. for example, if they build on the CLI four consecutive times, this change should allow them to do that without having to change our file overwrite logic at all. BUT, when they're done building/deploying on the CLI, they will be left with all the NoN files in their .git, as @FinnWoelm pointed out in the original issue that has since been transferred internally. because the plugin will only run on
netlify build
, i don't think adding a "clean" flag/command to NoN will make a difference; there'd be no way for the plugin to access it outside of a build. these users will have to stash or manually delete these files after finishing their builds/deploys. open to ideas here. this may be a greater CLI issue.to-do: