Testing an Extension in the Source Code
# contributing
w
Question for HQ & Core Collab Team In the repo and Umbraco.Cms.UI.Client folder/project, I want to add a test/sample extension to test to see if there is a bug and use it to debug against. I see we have the **examples **folder, but where can I put an umbraco-package.json and transpiel my TS files into a folder shoved into App_Plugins. How do you the team work or test the flow of custom extensions, work as you expect and that you can consume the right constants, context and other things exported in the modules.
Maybe @Jacob Overgaard @Niels Lyngsø or @Jason might have some thoughts on this...
To give further context, I want to test out a custom block list view. As in V15.0 I can't get values from the settings block to use in my custom block view component/markup So I thought jump into source code and debug with the source code
n
the specific examples /index.ts should be seen as a manifest bundle. it exports the manifests for that example.. through that you can declare what you need.. so we are skipping the umbraco-package.json in the example case. and its a good case, we use the examples for the same.. see the block custom view one as good inspiration. 🙂
j
I usually test umbraco-package.json files through the Umbraco.Web.UI project, @Warren Buckley. Just create an App_Plugins folder in there and launch the project.
w
So to clarify @Niels Lyngsø & @Jacob Overgaard * Create App_Plugins in Umbraco.Web.UI project * Copy chosen folder from /examples into App_Plugins folder * Create a umbraco-package.json file that is of type bundle that points to the index file? Surely I need to get the TS files through the compiler - where is Vite currently dumping these files out at as JS files?
j
It isn't, the examples folder is used with the vite dev server itself
I'm not sure what you want to test
umbraco-package.json is one thing, so just make that in the dotnet project and make a vite project in there if you will
w
I wanted to use the
block-preview
from the examples folder and thought surely you had some workflow to test/use them
j
Oh, so you mean from the Vite dev server. Yeah, when you create the example you will get a manifest file, which you can just import somewhere in the backoffice afaik
w
I will look later on tonight - head in something else atm
2 Views