-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust the level of customization for templates #170
Comments
I agree with you, some additional thoughts
Extensions allow users to create their apps based on core - SE-2/Create-eth. So we have some core functionality that I believe we need to restrict to change
Other than that, the more freedom we give devs in configuring the applications, the happier they will be.
So I think it's ok to give them possibility to change these files too. Yes, we want end users to know that it was created using SE-2/Create-eth
Agree, it would be awesome |
I think it will help to have some of the current extensions having some issues related to these limitations, to allow us to check if the final proposed solution helps to fix them. I have in mind these:
|
Agree with all the points from #170 (comment)
I was thinking we give full power and do breaking changes here. Maybe instead of Also thinking more on #167 there are this certain file like Well they do it wrong it would break whole SE-2 but maybe it fine it's on extension developer? In the extension creation docs / CLI we could have special Disclaimer for this kind of files saying be careful while updating these files. `.template.mjs` files which we have till now:Config file:templates/base/packages/nextjs/scaffold.config.ts.template.mjs Full content ovverride:templates/base/README.md.template.mjs Restricted update:templates/base/packages/nextjs/components/Header.tsx.template.mjs Misc Filestemplates/base/packages/nextjs/app/blockexplorer/address/[address]/page.tsx.template.mjs Happy to draft a PR with simple object merge changes and some basic files override like page 🙌 and then we can iterate their |
Thanks all for the feedback!!
I think this is the way. Let's test, tinker, and decide. Maybe we can create a few PRs (including all the changes in a single one might be too hard to test and discuss)
The downside I see with this is that the extensions that just need little changes (most of them?) like extension name + description will have to copy the whole file (maybe too verbose + the default content might change in the future?). Why not have both options? (params + fullOverride) Is it because it's cleaner?
I think here we would probably be fine with a template with 2 arguments, right? Or what do you mean by "total replace"? |
I was also planning to look into this, I'll try to implement it. |
Yeah make sense! I was thinking if we allow then
yeah lets go with this for now 🙌
ohh nvm I was talking about in general files, but yeah for wagmiConfig this make sense! Also love the idea of having
@moltam89 did you already start you start with config objects replace? I was planning to tackle it but maybe I will tackle some general files override with |
Hey @technophile-04, I started working on this. I spent most of my time understanding the current logic and brainstorming possible solutions. Here’s what I have in mind so far:
|
Hey @moltam89, since this a bit core stuff maybe I will create a draft PR and u can help with testing/suggestion 🙌 My initial plan: I think we just need a good object merge util which can be used in any
So if you look rename
So in const config = {
networks: {
hardhat: { ... },
customNetwork: { ... },
}
} We merge this with the default object which we have in So yeah will create a PR and let's tinker/suggest their 🙌 |
Thanks, @technophile-04! I could definitely use some help here. Merging JSONs seemed straightforward initially, but I’ve hit a roadblock. There are comments in the HardhatUserConfig, and I haven’t found a way to preserve them so far. Also, when I tried parsing HardhatUserConfig to merge the extension settings, variables like providerApiKey caused errors. |
This is something we have been balancing out from the beginning with templates files (total customization VS being super strict). I think we should be more clear about what you can customize and what not.
(this conversation was sparked after #167 and similar issues).
An initial approximation:
fullContent
param (if set, it overrides the content of theHome: NextPage
component), but you can still use the existing ones.We also need to consider breaking changes (it might be fine for now if we have to rewrite some stuff on curated extensions).
These are some initial thoughts... very open. Maybe we could make a list grouping templates in categories (total customization vs param customization)
Let's discuss!
The text was updated successfully, but these errors were encountered: