-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[V15] Updated dotnet template for Umbraco Packages with Bellisima #17108
Open
warrenbuckley
wants to merge
20
commits into
umbraco:v15/dev
Choose a base branch
from
warrenbuckley:v15/dotnet-package-bellisima
base: v15/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+176
−221
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
605e611
[WIP] Create Umbraco/Bellissima Package
leekelleher 5ab1338
Removes existing 'UmbracoPackage'
warrenbuckley 02fb723
Rename existing UmbracoPackageRCL to UmbracoPackage
warrenbuckley 50d8bb1
Drop the mentions of RCL in the identifiers
warrenbuckley 55b0bf9
CodeQL GitHub Action is complaining due to V15 wanting v9 .NET
warrenbuckley 9a649d0
Merge remote-tracking branch 'origin/contrib' into v15/dotnet-package…
warrenbuckley 87c968a
Rename UmbracoPackage template to UmbracoExtension
warrenbuckley b65b77c
Remove package lock as npm install by the OS should generate this and…
warrenbuckley c1c695a
Move JS clientside stuff into a folder called Client
warrenbuckley daa820d
Add in .VSCode recommened extensions file to get the useful Lit Exten…
warrenbuckley e724482
For now remove the example dashboard & prop editor
warrenbuckley 58ccd12
Add a simple entrypoint
warrenbuckley b143174
Fix path for primary output after rename
warrenbuckley 7319c86
Use link suggested from Lotte
warrenbuckley 5cb7c28
Use backofficeEntryPoint as entryPoint is deprecated
warrenbuckley cc51289
Update the umbraco-package.json to opt into telemetry as per PR sugge…
warrenbuckley 7851e4f
Improve commented code to include a link to docs
warrenbuckley 48281a4
Improve readme from suggestions
warrenbuckley f03d7b8
Updates package.json to use latest Vite & TS
warrenbuckley 76052c0
Adds the base property suggestion from Jacob & puts in a comment as t…
warrenbuckley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"runem.lit-plugin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "PROJECT_NAME_KEBABCASE_FOR_NPM", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "tsc && vite build --watch", | ||
"build": "tsc && vite build" | ||
}, | ||
"devDependencies": { | ||
"@umbraco-cms/backoffice": "^UMBRACO_VERSION_FROM_TEMPLATE", | ||
"typescript": "^5.5.3", | ||
"vite": "^5.4.8" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
templates/UmbracoExtension/Client/public/umbraco-package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "../../umbraco-package-schema.json", | ||
"id": "UmbracoExtension", | ||
"name": "UmbracoExtension", | ||
"version": "0.0.0", | ||
"allowPackageTelemetry": true, | ||
"extensions": [ | ||
{ | ||
"name": "UmbracoExtension EntryPoint", | ||
"alias": "PROJECT_NAME_KEBABCASE_FOR_NPM.entrypoint", | ||
"type": "backofficeEntryPoint", | ||
"js": "/App_Plugins/UmbracoExtension/PROJECT_NAME_KEBABCASE_FOR_NPM.js" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api'; | ||
|
||
// load up the manifests here | ||
export const onInit: UmbEntryPointOnInit = (_host, _extensionRegistry) => { | ||
|
||
console.log('Hello from my extension 🎉'); | ||
|
||
// We can use extensionRegistry to register one or manifests/extensions via code | ||
// as opposed to a very long umbraco-package.json file | ||
// https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-types/backoffice-entry-point | ||
//_extensionRegistry.registerMany([ | ||
//]); | ||
|
||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"experimentalDecorators": true, | ||
"useDefineForClassFields": false, | ||
"module": "ESNext", | ||
"lib": [ "ES2020", "DOM", "DOM.Iterable" ], | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"isolatedModules": true, | ||
"moduleDetection": "force", | ||
"noEmit": true, | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": [ "src" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { defineConfig } from "vite"; | ||
|
||
export default defineConfig({ | ||
build: { | ||
lib: { | ||
entry: "src/entrypoint.ts", // Entrypoint file (registers other manifests) | ||
formats: ["es"], | ||
fileName: "PROJECT_NAME_KEBABCASE_FOR_NPM", | ||
}, | ||
outDir: "../wwwroot/App_Plugins/UmbracoExtension", // your web component will be saved in this location | ||
emptyOutDir: true, | ||
sourcemap: true, | ||
rollupOptions: { | ||
external: [/^@umbraco/], | ||
}, | ||
}, | ||
|
||
// Used to allow serving SVG, images & other assets from /Client/public | ||
// Such as <img src="/logo.jpg" /> | ||
// or | ||
// import imageUrl from '/logo.jpg'; | ||
// <img src=${imageUrl} /> | ||
base: '/App_Plugins/UmbracoExtension', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
_ _ _ | ||
| | | | | | | ||
__| | ___ | |_ _ __ ___| |_ _ __ _____ __ | ||
/ _` |/ _ \| __| '_ \ / _ \ __| | '_ \ / _ \ \ /\ / / | ||
| (_| | (_) | |_| | | | __/ |_ | | | | __/\ V V / | ||
\__,_|\___/ \__|_| |_|\___|\__| |_| |_|\___| \_/\_/ _ _ | ||
| | | | (_) | ||
_ _ _ __ ___ | |__ _ __ __ _ ___ ___ _____ _| |_ ___ _ __ ___ _ ___ _ __ | ||
| | | | '_ ` _ \| '_ \| '__/ _` |/ __/ _ \ / _ \ \/ / __/ _ \ '_ \/ __| |/ _ \| '_ \ | ||
| |_| | | | | | | |_) | | | (_| | (_| (_) | | __/> <| || __/ | | \__ \ | (_) | | | | | ||
\__,_|_| |_| |_|_.__/|_| \__,_|\___\___/ \___/_/\_\\__\___|_| |_|___/_|\___/|_| |_| | ||
|
||
|
||
== Requirements == | ||
* Node LTS Version 20.17.0+ | ||
* Use a tool such as NVM (Node Version Manager) for your OS to help manage multiple versions of Node | ||
|
||
== Node Version Manager tools == | ||
* https://github.com/coreybutler/nvm-windows | ||
* https://github.com/nvm-sh/nvm | ||
* https://docs.volta.sh/guide/getting-started | ||
|
||
== Steps == | ||
* Open a terminal inside the `\Client` folder | ||
* Run `npm install` to install all the dependencies | ||
* Run `npm run build` to build the project | ||
* The build output is copied to `wwwroot\App_Plugins\UmbracoExtension\PROJECT_NAME_KEBABCASE_FOR_NPM.js` | ||
|
||
== File Watching == | ||
* Add this Razor Class Library Project as a project reference to an Umbraco Website project | ||
* From the `\Client` folder run the command `npm run watch` this will monitor the changes to the *.ts files and rebuild the project | ||
* With the Umbraco website project running the Razor Class Library Project will refresh the browser when the build is complete | ||
|
||
== Suggestion == | ||
* Use VSCode as the editor of choice as it has good tooling support for TypeScript and it will recommend a VSCode Extension for good Lit WebComponent completions | ||
|
||
== Other Resources == | ||
* Umbraco Docs - https://docs.umbraco.com/umbraco-cms/customizing/extend-and-customize-editing-experience |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
templates/UmbracoPackage/.template.config/dotnetcli.host.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like both would work, but the example you have in your entry point file looks more like the
bundle
type than thebackofficeEntryPoint
type. Maybe someone on the Backoffice team has thoughts on this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK Bundles is for registering manifests only, where an entrypoint you may do other logic inside it.
Such as to do the AUTH stuff with the C# OpenAPI spec or perhaps unregister/exclude extensions etc...
But lets wait for someone from the frontend core crew to chime in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nielslyngsoe @iOvergaard any thoughts ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @warrenbuckley
I would say use the EntryPoint for what the entry point is needed for, but do not use it to registere more manifests. For that its better to use the Bundle.
Main reason begin a bundle knows the extensions it registres. Meaning if later and that could be milliseconds later, it knows how to unregisters it self. Useful if someone decides to unregister it.
So my opinion would be, in order to be the most correct as you can, then make both, one bundle and one entry point so people can see how the can execute code up front and use the bundle to lead the way for more extensions. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have got the facts correct, @warrenbuckley. I would recommend sticking with the
backofficeEntryPoint
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems overkill don't you think @nielslyngsoe & @iOvergaard to have the following and is more concepts to teach/get across unless this really is THE WAY
umbraco-package.json -> backofficeEntryPoint -> bundle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm you got everything right in your above comment. :-)
But I would still suggest this style:
umbraco-package.json -> bundle -> backofficeEntryPoint
Meaning anything additionally begin added would go to the bundle:
umbraco-package.json -> bundle -> dashboard
In this way avoiding to use the entry-point to do registration of other extension-manifest. Meaning the entry-point is purely needed for the act of running some JS code. Then if people then dont need to run code, they can ignore that specific type.
I think that is the most correct style.
This is based on an interest in registering extensions via JS. If you dont mind doing it in JSON. Then you can skip the bundle, to do additional registrations as of the umbraco-package.json.
But my point begin, I'm not a fan of show casing people that they should registere extensions by calling
extensionRegistry.registerMany