https://discord.umbraco.com logo
#package-development
Kevins lovely dotnet new template Q's
# package-development
w

warrenbuckley

02/02/2024, 1:03 PM
One for @kevinjump Trying out your lovely dotnet new template and getting this lovely node error (I switched to using LTS version of node) Any thoughts 🧡 ? https://cdn.discordapp.com/attachments/882984798719729704/1202962562984050738/image.png?ex=65cf5d30&is=65bce830&hm=4354b863cb99c326b01b019244c4725e6dec23836e065d5d5f5a846928058be9&
Do I need to do anything special or did I miss a step ?
k

kevinjump

02/02/2024, 1:05 PM
i think you need
--force
the umbraco ui library is coming from somewhere odd, so for any npm install type commands you need to add --force.
w

warrenbuckley

02/02/2024, 1:07 PM
OK trying a new template dotnet new to see if I get the issue again (assume your template script for the restore is using --force then)
k

kevinjump

02/02/2024, 1:07 PM
yes it does
w

warrenbuckley

02/02/2024, 1:07 PM
πŸ‘ & now its happier πŸ˜„
Suggestion for script to detect node version and moan at you to use a newer one and exit out early perhaps ?
Did you run into this issue with long path issue when building ?
Copy code
Error        System.InvalidOperationException: The item metadata "%(FullPath)" cannot be applied to the path "C:\Users\warren.buckley\.nuget\packages\umbraco.cms.staticassets\14.0.0--preview004\staticwebassets\umbraco\backoffice\packages\core\property-editor\uis\collection-view\config\bulk-action-permissions\property-editor-ui-collection-view-bulk-action-permissions.element.d.ts". Path: C:\Users\warren.buckley\.nuget\packages\umbraco.cms.staticassets\14.0.0--preview004\staticwebassets\umbraco\backoffice\packages\core\property-editor\uis\collection-view\config\bulk-action-permissions\property-editor-ui-collection-view-bulk-action-permissions.element.d.ts exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
https://cdn.discordapp.com/attachments/1202962563256553544/1202964702745862184/image.png?ex=65cf5f2f&is=65bcea2f&hm=29c992918ae2701b7f0dd88ea0d41b30ab4fb550b70a4f19049044c814ee078e&
OK easy fix - but maybe something that others may stumble across
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry > New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` > -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Other suggestion update the JSON schema path in `Project.Client/assets/public/umbraco-package.json`to the schema file at the root of the Website project
Copy code
"$schema": "../../../Project.Website/umbraco-package-schema.json",
j

Jacob Overgaard

02/02/2024, 1:29 PM
we are tracking it as well, @warrenbuckley :https://github.com/umbraco/Umbraco.CMS.Backoffice/issues/1167
w

warrenbuckley

02/02/2024, 1:30 PM
Yeh I think it just needs to be one of those things Jacob
k

kevinjump

02/02/2024, 1:34 PM
πŸ™‚ - yes - looking to do a couple of small updates to the template today (nothing major) - will look at the warning stuff.
on the schema I don't want to reference the website project (even though that's where it ends up, because i want to build projects that ultimemtly don't need the website file 😦 - there is a bug , i think there should be a copy of that file put into the client project, so going to look at that, but thinking might put a umbraco issue in asking for that file to be written in one of the other libraries so it can end up in your client project wehn you refrence them.
Also - i have sort of moved to an entry point only approach, so you never actuall touch the umbraco-package.json file once its setup πŸ™‚
w

warrenbuckley

02/02/2024, 1:51 PM
Yeh I saw, but makes for easily discoverabilty IMO to get collecptions when you poke around in that JSON file
So register or discover the types of extensions via JSON schema, move over into registration approach if you then want to
k

kevinjump

02/02/2024, 3:36 PM
humm, requirements page says you need node 20.11.0 - but i've been using v18.18.0 fine ?
w

warrenbuckley

02/02/2024, 3:44 PM
Yeh I was on an ancient v10 for some projects I am on
j

Jacob Overgaard

02/05/2024, 8:08 AM
v20 is LTS, that's why we recommend that version
w

warrenbuckley

02/05/2024, 9:23 PM
Another feedback for you Kevin The dotnet new template if you give it a project name like
Umbraco.Community.NewThingy
then the scaffolding in the JS files for classnames complains as
.
not valid in JS classnames
k

kevinjump

02/05/2024, 9:24 PM
yes - i seem to remember this is there is something you can do in a template for that. i will take a look.
done. v0.0.8 - (its a rename of the base name really, with some bits changed in the .ts files)
w

warrenbuckley

02/06/2024, 8:06 AM
Will give it a spin at lunch today.
And kudos πŸŽ‰for being so fast !!!
@kevinjump any idea what I am doing wrong ?! The JS vite build is watching with
npm run watch
from the
assets
folder inside the Client folder I am then running the site directly from Visual Studio but the changes just dont get picked up. Any thoughts on what I might have done wrong mate ?! https://cdn.discordapp.com/attachments/1202962563256553544/1204361590800121896/image.png?ex=65d47423&is=65c1ff23&hm=524681def37c6487b1f8e01f835ac8de9688d4588528234d3200b95883393947&
Hmmm I think it might be because its not watching the
public
folder
Now need to figure out when updating files in this folder that it can copy it over to wwwroot/app_plugins/packagename/
j

Jacob Overgaard

02/06/2024, 10:10 AM
@warrenbuckley seems you can patch vite config yourself to accomplish that: https://github.com/vitejs/vite/issues/4970
I think it's an okay compromise that vite doesn't do this out of the box
k

kevinjump

02/06/2024, 10:28 AM
no that works for me, do you have your browsers devtools open ? (because it might be chrome caching js files) ?
using the starter kit, vite is writing to wwwroot/app_plugins/packagename, but that project is a RCL, and the website has a dependency on that, so when the files get updated from the watch command into the RCL folder, its .net and the browser link doing the update, so its not vite watch you have to check its, visual studio's browser link
w

warrenbuckley

02/06/2024, 1:47 PM
Is it .NET Hot Reload or more specifically Visual Studio Browser Link stuff (wondering if I have some setting disabled?)
2 Views