-
I started building templates for node projects but similar issues could occur with any target. Possibly, there will be a template for the file which defined dependencies, such as Does anyone have a strategy for automating how and when versions of dependencies are updated in the templates? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
I've been using a somewhat dumb script that generates a project, goes into it, run some tool that updates the dependencies where they are specified (in my case The other solution is simply to use an empty suffix for templates in your projects. But Dependabot and friends will still likely choke on Jinja syntax if you use it in the file anyway. |
Beta Was this translation helpful? Give feedback.
-
I wrote retrocookie to solve this problem in the Cookiecutter world. You can use it to copy commits or PRs from a generated project to its template. I'm using it to import Dependabot PRs for the Hypermodern Python template, from a special instance repository. It currently doesn't support copier syntax, but it shouldn't be hard to generalize if anybody wants to work on this. |
Beta Was this translation helpful? Give feedback.
-
I can think on various solutions. I will post them in different comments so they can get voted separately. For example, you can use tasks to generate the file dynamically after copying. |
Beta Was this translation helpful? Give feedback.
-
Just using Jinja, with a smart combination of include, import, macro, set and the from_json filter, you could recover the package.json updated by dependabot. Then use that into your template. |
Beta Was this translation helpful? Give feedback.
-
Ok, I did eventually as mentioned in comment
This makes dependabot's business as usual |
Beta Was this translation helpful? Give feedback.
Ok, I did eventually as mentioned in comment
package.json
are not jinja templates (example)npx json
This makes dependabot's business as usual