-
Notifications
You must be signed in to change notification settings - Fork 3
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
Investigate deleting files before generating models #10
Comments
Copied from @abjerner's comment #7 (comment):
Copied from @abjerner's comment #7 (comment):
|
I have been running my local site (where this package is installed) via IIS (as per https://our.umbraco.com/documentation/Fundamentals/Setup/Install/iis) but just letting it run directly from IIS and a web browser (not using the "Debug" option in VS2022), so I haven't noticed any issues... Maybe in terms of dealing with "obsolete" files, there is another way to alert devs that file is out-of-date, without having to delete it directly. Perhaps via the additional generation of some sort of "status" file? Ex: {
"ModelsGenerated": [
"MyDoctypeA",
"MyDocTypeB",
"..."
],
"ObsoleteFilesToDelete": [
"OldDoctypeA.generated.cs",
"OldDocTypeB.generated.cs",
"..."
]
} Just a thought... |
Hi @hfloyd I've now updated the source generator to look through the models directory and delete all I suspect keeping a JSON file to track the generated files could lead to a few problems - eg. when working multiple developers on the same repo. The delete logic can be enabled or disabled via the If you do run your site from VS or via <ItemGroup>
<Compile Remove="Models\Umbraco\**\*.generated.cs"/>
<Compile Include="Models\Umbraco\**\*.generated.cs" Watch="false" />
</ItemGroup> This seems to address the issues I described earlier 😍 I haven't pushed a new release yet, but I'd imagine I'm doing that a bit alter today. |
@abjerner Cool! I'll have to test it once I remove some Doctypes ;-) |
See: #7 (comment)
The text was updated successfully, but these errors were encountered: