-
Notifications
You must be signed in to change notification settings - Fork 20
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
Consider supporting zome only repositories #249
Comments
I would like some clarification just to better understand your proposal. At the moment, the repositories scaffolded to be used as modules rather than webhapps still contain a
I am not sure about this, since we would still need to keep the "fake" What do you think about having a separate command i.e |
Mmm yes you are mostly right. But why would we need to keep the What would |
I'm seeking a better understanding on whether it's still appropriate to use |
I agree with the decision to no longer require the |
Yeah that's right. I have a method of generating DNA manifests in nix https://github.com/holochain-open-dev/infrastructure/blob/97a15932e38a3a0db5ce5b48b4989508bf91bb46/nix/fixtures/module-repo/zome/zome.nix#L18 that allows me to generate fake DNAs as needed without needing a dna.yaml file. So in the repository where the zome lives, there is no happ.yaml or dna.yaml but you can still test your app. In the consuming repositories, there you include the zomes into your dna.yaml to actually build your app, like this. Do you have any other questions about the pattern? |
I see, this is quite new to me I am curious to know how the proposed method is different from what I have used before from this guide. Do they both achieve the same goal? |
Also another question regarding this; the fake manifests getting generated are only useful for testing within the zome's repository context, right? |
Well, in the proposed method, you don't need actual dna.yaml or happ.yaml files, you can "fake them" in nix files so that you decide what to include and when. In zome only sweettest, I can create a DNA bundle only with the zome I want to test, which means I can test only that given zome with its integrity.
Yes exactly, that's the main purpose. |
I see, so for such repos, the scaffolding tool should not be generating these manifest files, this is the only change required from the cli as far as I understand. Or should "faking" the manifests in nix be handled by scaffolding as well? |
Close, but not really what I mean. If the command What I'd like to change is that in repos where there's no I don't think the faking the manifests in nix should be handled by the scaffolding tool no. As a matter of fact I'm scaffolding them myself in the custom template for holochain-open-dev. |
I see, so for such repos, the workflow would remain the same except for the fact that no How about the |
Yes same, they will never get created. |
Great, I can add this functionality, probably as an optional flag passed to |
Hmmm how is that going to change the behavior of |
Yes, this change will also be made, I am just considering the user who scaffolds a web-app that is intended to be used as a module, the project that gets generated should not have these manifest files by default and there shouldn't be any instruction to run Do you think this is not necessary and they can manually delete these files to turn their hApp into a module? |
Ah no that is already covered with the module template, which already scaffolds only the zomes and tells you not to scaffold DNAs. It's cool that this can be done without needing to change the code for the scaffolding tool! |
Ahh I see, no need to handle this on scaffolding then |
@guillemcordoba, I've conducted an in-depth review of the issue and would like to share my findings: The generation of A significant dependency exists between the ZomeFileTree and DnaFileTree structures. This coupling is particularly evident in functions tasked with scaffolding entry, link types, and collections, where the DNA manifest is referenced. Decoupling these components, or at least providing a default implementation for DnaFileTree in the absence of a DNA manifest, would likely require extensive refactoring. I'm curious if such an approach has been considered in your proposal, especially since addressing the initial issue you identified might not fully resolve the problem, given the presence of similar issues elsewhere in the code. I'm keen to hear your thoughts on this analysis. |
Currently the scaffolding tool only supports repositories with at least one
happ.yaml
and onedna.yaml
. This covers the majority of projects, which are just web-happs that need to produce a.webhapp
package to be published somewhere.A lot of the repositories I work on don't fulfill that criteria, as they are just modules, so they only output a single zome. In these kinds of repositories, running
hc-scaffold entry-type
results inError: No app manifest (happ.yaml) was found in this directory tree
, because the scaffolding tool first looks for the happ and then the DNA to discover all the zomes in which the entry-type could be created.This means that I need to keep a
dna.yaml
and ahapp.yaml
files in my repositories which are kind of "fake", as in they are only used to allow the scaffolding tool to discover the only zome in my repository. Maybe if the scaffolding tool could first scan for happs, fall back to find DNAs, and lastly fall back to finding zomes, it would improve the developer experience in these kinds of repositores.What do you think @c12i ?
The text was updated successfully, but these errors were encountered: