-
Notifications
You must be signed in to change notification settings - Fork 812
CMS: Adds new article on umbraco-extension
#7076
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5611919
docs: merges typescript-setup.md into development-flow/README.md and …
iOvergaard 6ef67d4
docs: updates prerequisites from nodejs 20 to 22
iOvergaard 3af9c32
docs: adds a new article on how to use the umbraco-extension template
iOvergaard 7850943
docs: adds a link to new article
iOvergaard a11f164
Update 16/umbraco-cms/customizing/development-flow/README.md
iOvergaard e2854a2
docs: adds link to the menu to the new article and removes deleted ar…
iOvergaard ec0c596
docs: adds explanation to what `-ex` does
iOvergaard 7a773fe
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
iOvergaard 7a2b958
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
iOvergaard 0c9326c
Update 16/umbraco-cms/customizing/development-flow/README.md
eshanrnh 7040027
Update 16/umbraco-cms/customizing/development-flow/README.md
eshanrnh 421c052
Update 16/umbraco-cms/customizing/development-flow/README.md
eshanrnh feca1d5
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh b3f03f3
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 81a4691
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh dac5c05
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh c605851
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh dd60c75
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 42cbbab
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 65df018
Update 16/umbraco-cms/customizing/development-flow/vite-package-setup.md
eshanrnh 484be50
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 148abd1
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 1dcf50d
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh ccf8e82
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh b912660
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh c77faea
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 4829193
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh c75d14b
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh cbc3daf
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 336ba54
Update 16/umbraco-cms/customizing/development-flow/umbraco-extension-…
eshanrnh 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 hidden or 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 hidden or 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
16 changes: 0 additions & 16 deletions
16
16/umbraco-cms/customizing/development-flow/typescript-setup.md
This file was deleted.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
16/umbraco-cms/customizing/development-flow/umbraco-extension-template.md
This file contains hidden or 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,96 @@ | ||
| --- | ||
| description: Use the `umbraco-extension` dotnet template to create a new Umbraco extension | ||
|
Check warning on line 2 in 16/umbraco-cms/customizing/development-flow/umbraco-extension-template.md
|
||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| # Umbraco Extension Template | ||
|
|
||
| Umbraco provides a dotnet template to help you get started with building extensions for the Umbraco backoffice. This template sets up a new project with all the necessary files and configurations to build an extension. The template is called `umbraco-extension` and can be used to create a new Umbraco extension project with a single command. | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Prerequisites | ||
| - [.NET SDK](https://dotnet.microsoft.com/download) version 9.0 or later | ||
|
Check failure on line 10 in 16/umbraco-cms/customizing/development-flow/umbraco-extension-template.md
|
||
| - [Node.js](https://nodejs.org/en/download/) version 22 or later | ||
|
|
||
| ## Install the Umbraco Extension Template | ||
| To install the Umbraco extension template, run the following command in your terminal: | ||
|
|
||
| ```bash | ||
| dotnet new install Umbraco.Templates | ||
| ``` | ||
|
|
||
| This command installs the `umbraco` and `umbraco-extension` templates, which you can use to create new Umbraco and Umbraco extension projects. You may already have this installed, if you have created a new Umbraco project using the `dotnet new umbraco` command. | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Create a New Umbraco Extension | ||
| To create a new Umbraco extension project, run the following command in your terminal. It should be executed in a folder where you want to create the new project, for example in the root of your solution: | ||
|
|
||
| ```bash | ||
| dotnet new umbraco-extension -n MyExtension -ex | ||
| ``` | ||
|
|
||
| This command creates a new folder called `MyExtension` with the following files and folders: | ||
| - `MyExtension.csproj`: The project file for the extension. | ||
| - `Client`: A folder containing the source code for the extension. | ||
| - `tsconfig.json`: The TypeScript configuration file. | ||
| - `vite.config.ts`: The Vite configuration file. | ||
| - `package.json`: The Node.js package configuration file. | ||
| - `README.md`: A readme file with instructions on how to build and run the extension. | ||
|
|
||
| ### Include the Extension in your Umbraco Project | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To include the extension in your Umbraco project, you need to add a reference to the extension project in your Umbraco project. You can do this by right-clicking on the **Dependencies** node in your Umbraco project and selecting **Add Reference**. Then select the `MyExtension` project and click **OK**. | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Build and Run the Extension | ||
|
|
||
| To build and run the extension, you need to install the dependencies and start the Vite development server. You can do this by running the following commands in the `Client` folder of your extension project: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| {% hint style="info" %} | ||
| The project will also automatically build when you run the Umbraco project. You can also run the Vite development server in watch mode by running the following command: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| npm run watch | ||
| ``` | ||
| {% endhint %} | ||
|
|
||
| This command compiles the TypeScript files and copies them over to the output folder in `wwwroot`. You can then run your Umbraco project and see the extension in action. | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Publish the Project | ||
|
|
||
| The output files should automatically be copied to the `wwwroot` folder of your Umbraco project. They should also be included in the publish process when you publish your Umbraco project. You can publish your Umbraco project using the following command: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| dotnet publish -c Release | ||
iOvergaard marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## Publish as a Package | ||
|
|
||
| To publish your extension as a package, you need to create a NuGet package. You can do this by running the following command in the root folder of your extension project: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| dotnet pack -c Release | ||
iOvergaard marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| This command creates a NuGet package in the `bin/Release` folder of your extension project. You can then publish this package to a NuGet feed or share it with others. | ||
|
|
||
| The `umbraco-extension` template is opinionated until a certain point. It is a starting point for building extensions for the Umbraco backoffice. The template includes a basic structure and configuration for building extensions, but you can customize it to fit your needs. You can add additional files, folders, and configurations as needed. | ||
|
|
||
| To publish your extension as an Umbraco Package, you need some additional files. You can read more about that in the [Umbraco Package documentation](../../customizing/umbraco-package.md). | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### The Opinionated Starter Kit | ||
|
|
||
| One other option is to use the [Opinionated Umbraco Package Starter Template](https://github.com/LottePitcher/opinionated-package-starter). This is a template that includes all the files and configurations needed to build an Umbraco package. It builds on top of the `umbraco-extension` template and includes additional files and configurations for building Umbraco packages. This template is a great starting point for building Umbraco packages and includes everything you need to get started. | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You can install this template by running the following command in your terminal: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| dotnet new install Umbraco.Community.Templates.PackageStarter | ||
| ``` | ||
|
|
||
| Then you can create a new package project by running the following command: | ||
eshanrnh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| dotnet new umbracopackagestarter -n YourPackageName -an "Your Name" -gu "YourGitHubUsername" -gr "YourGitHubRepoName" | ||
| ``` | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.