Skip to content

Commit d5f888d

Browse files
authored
Merge pull request #7052 from umbraco/16/sync
Sync PRs
2 parents b2617b8 + cc556de commit d5f888d

File tree

15 files changed

+119
-97
lines changed

15 files changed

+119
-97
lines changed

16/umbraco-cms/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
* [Extend and customize the editing experience](customizing/overview.md)
143143
* [Project Bellissima](customizing/project-bellissima.md)
144144
* [Setup Your Development Environment](customizing/development-flow/README.md)
145-
* [TypeScript setup](customizing/development-flow/typescript-setup.md)
146145
* [Vite Package Setup](customizing/development-flow/vite-package-setup.md)
146+
* [TypeScript setup](customizing/development-flow/typescript-setup.md)
147147
* [Extension Overview](customizing/extending-overview/README.md)
148148
* [Extension Registry](customizing/extending-overview/extension-registry/README.md)
149149
* [Extension Registration](customizing/extending-overview/extension-registry/extension-registry.md)

16/umbraco-cms/customizing/development-flow/vite-package-setup.md

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,73 +7,71 @@ description: Get started with a Vite Package, setup with TypeScript and Lit
77
Umbraco recommends building extensions with a setup using TypeScript and a build tool such as Vite. Umbraco uses the library Lit for building web components which we will use throughout this guide.
88

99
{% hint style="info" %}
10-
This guide is based on our **general recommendations** for working with and building extensions for the Umbraco backoffice.
11-
12-
You can use **any framework or library**, as you are not limited to the mentioned frameworks.
10+
These are general recommendations for working with and building extensions for the Umbraco backoffice. You can use any framework or library of your choice.
1311
{% endhint %}
1412

15-
## Getting Started With Vite
13+
## Before You Begin
1614

17-
Vite comes with a set of good presets to get you quickly up and running with libraries and languages. For example: Lit, Svelte, and Vanilla Web Components with both JavaScript and TypeScript.
15+
Make sure to read the [Setup Your Development Environment](./) article before continuing.
1816

19-
{% hint style="info" %}
20-
Before following this guide, read the [Setup Your Development Environment](./) article.
21-
{% endhint %}
17+
## Create a Vite Package
18+
19+
Vite comes with a set of good presets to get you quickly up and running with libraries and languages. For example: Lit, Svelte, and Vanilla Web Components with both JavaScript and TypeScript.
2220

23-
1. Open a terminal and navigate to the project folder where you want to create your new Vite Package.
24-
2. Run the following command in the folder to create a new Vite Package:
21+
1. Open your terminal and navigate to the folder where you want to create the new Vite package.
22+
2. Run the following command:
2523

2624
```bash
2725
npm create vite@latest
2826
```
2927

30-
This command will set up your new package and ask you to pick a framework and a compiler.
28+
This command starts a setup prompt.
3129

32-
3. Enter `Client` as both the **Project Name** and **Package name** when prompted.
30+
For this tutorial, it is recommended to use the names given below. However, feel free to choose other names if preferred.
3331

34-
4. Choose **Lit** and **TypeScript** as the framework and language.
32+
3. When prompted:
33+
* Enter **client** as the **Project Name**.
34+
* Select **Lit** as the framework.
35+
* Select **TypeScript** as the variant.
3536

36-
{% hint style="info" %}
37-
For this tutorial, it is recommended to use the names given above. However, feel free to choose other names if preferred.
38-
{% endhint %}
39-
40-
<figure><img src="../../extending/customize-backoffice/development-flow/images/vite-project-cli.jpg" alt=""><figcaption><p>Create vite command choices</p></figcaption></figure>
41-
42-
This creates a new folder called `Client`, sets up our new project, and creates a `package.json` file, which includes the necessary packages. This is where all your source files live.
37+
This creates a new folder called **client** with your project files.
4338

4439
{% hint style="info" %}
45-
Alternatively, you can skip the interactive prompts and use this command:
40+
41+
For Windows environments the command should be slightly different::
4642

4743
```typescript
48-
npm create vite@latest Client -- --template lit-ts
44+
npm create vite@latest client --- --template lit-ts
4945
```
5046

51-
This will create a Vite Package with Lit and TypeScript in a folder called **Client**.
47+
or you will still see the interactive prompts, especially when using PowerShell.
48+
5249
{% endhint %}
5350

54-
5. Navigate to the **Client** project folder and install the required packages:
51+
4. Navigate into the new **client** folder and install the packages:
5552

5653
```bash
54+
cd client
5755
npm install
5856
```
5957

58+
{% hint style="warning" %}
6059
Before proceeding, ensure that you install the version of the Backoffice package compatible with your Umbraco installation. You can find the appropriate version on the [@umbraco-cms/backoffice npm page](https://www.npmjs.com/package/@umbraco-cms/backoffice).
60+
{% endhint %}
6161

62-
6. Install the Backoffice package using the following command:
62+
5. Install the Umbraco Backoffice package:
6363

6464
```bash
6565
npm install -D @umbraco-cms/backoffice
6666
```
6767

68-
{% hint style="info" %}
69-
To avoid installing Umbraco’s sub-dependencies such as TinyMCE and Monaco Editor, you can add the `--legacy-peer-deps` flag:
70-
{% endhint %}
68+
6. To avoid installing additional dependencies such as TinyMCE or Monaco Editor,use the `--legacy-peer-deps` flag:
7169

7270
```bash
7371
npm install --legacy-peer-deps -D @umbraco-cms/backoffice
7472
```
7573

76-
Using this flag will disable Intellisense for external references.
74+
This disables IntelliSense for external references but keeps the install lean.
7775

7876
7. Open the `tsconfig.json` file.
7977
8. Add the array `types` inside `compilerOptions`, with the entry of `@umbraco-cms/backoffice/extension-types`:
@@ -89,7 +87,7 @@ Using this flag will disable Intellisense for external references.
8987
}
9088
```
9189

92-
9. Create a new file called `vite.config.ts` in the folder and insert the following code:
90+
9. Create a new `vite.config.ts` file in the **client** folder:
9391

9492
{% code title="vite.config.ts" lineNumbers="true" %}
9593
```ts
@@ -101,44 +99,42 @@ export default defineConfig({
10199
entry: "src/my-element.ts", // your web component source file
102100
formats: ["es"],
103101
},
104-
outDir: "../App_Plugins/Client", // all compiled files will be placed here
102+
outDir: "../App_Plugins/client", // all compiled files will be placed here
105103
emptyOutDir: true,
106104
sourcemap: true,
107105
rollupOptions: {
108106
external: [/^@umbraco/], // ignore the Umbraco Backoffice package in the build
109107
},
110108
},
111-
base: "/App_Plugins/Client/", // the base path of the app in the browser (used for assets)
109+
base: "/App_Plugins/client/", // the base path of the app in the browser (used for assets)
112110
});
113111
```
114112
{% endcode %}
115113

116-
{% hint style="info" %}
117-
The `outDir` parameter specifies where the compiled files are placed. In this example, they are stored in the `App_Plugins/Client` folder. If you are working with a different structure, such as a Razor Class Library (RCL) project, update this path to `wwwroot`.
118-
{% endhint %}
114+
The `outDir` parameter specifies where the compiled files are placed. In this example, they are stored in the `App_Plugins/client` folder. If you are working with a different structure, such as a Razor Class Library (RCL) project, update this path to `wwwroot`.
119115

120116
This alters the Vite default output into a **library mode**, where the output is a JavaScript file with the same name as the `name` attribute in `package.json`. The name is `client.js` if you followed this tutorial with no changes.
121117

122118
The source code that is compiled lives in the `src` folder of your package folder and that is where you can see a `my-element.ts` file. You can confirm that this file is the one specified as our entry on the Vite config file that we recently created.
123119

124-
{% hint style="info" %}
125120
The `build:lib:entry` parameter can accept an array which will allow you to export multiple files during the build. You can read more about [Vite's build options here](https://vitejs.dev/config/build-options.html#build-lib).
126-
{% endhint %}
127121

128-
Build the `ts` file in the `Client` folder so we can use it in our package:
122+
10. Build the `ts` file in the **client** folder:
129123

130124
```bash
131125
npm run build
132126
```
133127

134128
## Watch for changes and build
135129

136-
If you like to continuously work on the package and have each change built, you can add a `watch`script in your `package.json` with `vite build --watch`. The example below indicates where in the structure this change should be implemented:
130+
To continuously work on the package and have each change built, add a `watch`script in your `package.json` with `vite build --watch`.
131+
132+
The example below indicates where in the structure this change should be implemented:
137133

138134
{% code title="package.json" lineNumbers="true" %}
139135
```json
140136
{
141-
"name": "Client",
137+
"name": "client",
142138
...
143139
"scripts": {
144140
"watch": "vite build --watch"
@@ -148,15 +144,15 @@ If you like to continuously work on the package and have each change built, you
148144
```
149145
{% endcode %}
150146

151-
Then in the terminal, you can run `npm run watch`.
147+
Run `npm run watch` in the terminal.
152148

153149
## Umbraco Package declaration
154150

155-
Declare your package to Umbraco via a file called `umbraco-package.json`. This should be added at the root of your package. In this guide, it is inside the `Client/public` folder so that Vite automatically copies it over every time it builds.
151+
Declare your package to Umbraco via a file called `umbraco-package.json`. This should be added in the `public` folder under the root of your package. Once built the `umbraco-package.json` file should be located at `/App_Plugins/` or `/App_Plugins/{YourPackageName}` for Umbraco to detect it.
156152

157153
This example declares a Dashboard as part of your Package, using the Vite example element.
158154

159-
{% code title="Client/public/umbraco-package.json" lineNumbers="true" %}
155+
{% code title="client/public/umbraco-package.json" lineNumbers="true" %}
160156
```json
161157
{
162158
"$schema": "../../umbraco-package-schema.json",
@@ -167,7 +163,7 @@ This example declares a Dashboard as part of your Package, using the Vite exampl
167163
"type": "dashboard",
168164
"alias": "My.Dashboard.MyExtension",
169165
"name": "My Dashboard",
170-
"element": "/App_Plugins/Client/client.js",
166+
"element": "/App_Plugins/client/client.js",
171167
"elementName": "my-element",
172168
"meta": {
173169
"label": "My Dashboard",
@@ -194,9 +190,9 @@ Learn more about the abilities of the manifest file in the [Umbraco Package Mani
194190
195191
#### Testing your package
196192
197-
To be able to test your package, you will need to run your site.
193+
To test your package, run your site.
198194
199-
Before you do this, you need to make sure to run `npm run build` to compile your TypeScript files and copy them to the `App_Plugins/Client` folder.
195+
Before doing this, make sure to run `npm run build` to compile your TypeScript files and copy them to the `App_Plugins/client` folder.
200196
201197
{% hint style="warning" %}
202198
If you try to include some of these resources via Visual Studio (VS), then make sure not to include TypeScript files. Otherwise, VS will try to include a few lines on your `.csproj` file to compile the TypeScript code that exists in your project folder. When you run your website, VS will try to compile these files and fail.
@@ -206,7 +202,7 @@ The final result looks like this:
206202
207203
<figure><img src="../../.gitbook/assets/Vite_Package_Setup_Dashboard (1).png" alt=""><figcaption><p>My dashboard</p></figcaption></figure>
208204
209-
Back in the `src/my-element.ts` file, you can update the `styles` property to make any styling changes. You can change the `background-color` of the `button` to white so it is more visible:
205+
In the `src/my-element.ts` file, update the `styles` property to make any styling changes. You can change the `background-color` of the `button` to white so it is more visible:
210206
211207
```css
212208
button {

16/umbraco-cms/customizing/extending-overview/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ description: Getting started with backoffice setup and configurations
44

55
# Extension Overview
66

7-
The Backoffice architecture is based on Extensions, making different parts of the UI extendable. Enabling you to append, replace, or remove parts.
7+
The backoffice architecture is based on Extensions, making different parts of the UI extendable. Enabling you to append, replace, or remove parts.
88

99
<figure><img src="../../.gitbook/assets/backoffice-overview-customizations.png" alt=""><figcaption></figcaption></figure>
1010

11-
In this section you can find the common terms, concepts and guides used to extend the Umbraco backoffice.
11+
In this section, you can find the common terms, concepts and guides used to extend the Umbraco backoffice.
1212

1313
## [Extension Registry](extension-registry/)
1414

15-
How to registere extensions or manipulate others.
15+
How to register extensions or manipulate others.
1616

1717
## [Extension Types](extension-types/)
1818

19-
An overview of the different ways to append funcationtlity.
19+
An overview of the different ways to append functionality.

16/umbraco-cms/customizing/extending-overview/extension-registry/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ The extension registry is a global registry that can be accessed and changed at
1414

1515
Each Extension Manifest has to declare its type, this is used to determine where it hooks into the system. It also looks at what data is required to declare within it.
1616

17-
## [Replace, Exclude or Unregistere](./#replace-exclude-or-unregistere)
17+
## [Replace, Exclude, or Unregister](replace-exclude-or-unregister.md)
1818

1919
Once you understand how to declare your own, you may want to replace or remove existing.

16/umbraco-cms/customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ UmbExtensionRegistry.exclude('Umb.WorkspaceAction.Document.SaveAndPreview');
5454

5555
## Unregister
5656

57-
You can also choose to unregister an extension, this is only preferred if you registered the extension and are in control of the flow. If its not your Extension please seek to use the `Overwrites` or `Exclude` feature.
57+
You can also choose to unregister an extension, this is only preferred if you registered the extension and are in control of the flow. If it's not your Extension please seek to use the `Overwrites` or `Exclude` feature.
5858

5959
```typescript
60-
import { UmbExtensionRegistry } from '@umbraco-cms/backoffice/extension-api';
60+
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
6161

62-
UmbExtensionRegistry.unregister('My.WorkspaceAction.AutoFillWithUnicorns');
62+
umbExtensionsRegistry.unregister('My.WorkspaceAction.AutoFillWithUnicorns');
6363
```
6464

6565
This will not prevent the Extension from being registered again.

16/umbraco-cms/customizing/extending-overview/extension-types/backoffice-entry-point.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: The Backoffice Entry Point extension type is used to run some JavaS
44

55
# Backoffice Entry Point
66

7-
This manifest declares a single JavaScript file that will be loaded and run when the Backoffice starts. In other words this can be used as an entry point for a package.
7+
This manifest declares a single JavaScript file that will be loaded and run when the Backoffice starts. In other words, this can be used as an entry point for a package.
88

99
The `backofficeEntryPoint` extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the `backofficeEntryPoint` to load in the external libraries to be shared by all your extensions. Additionally, **global CSS files** can also be used in the `backofficeEntryPoint` extension.
1010

@@ -43,14 +43,14 @@ import type { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api'
4343
/**
4444
* Perform any initialization logic when the Backoffice starts
4545
*/
46-
export const onInit: UmbEntryPointOnInit = (host, extensionsRegistry) => {
46+
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
4747
// Your initialization logic here
4848
}
4949

5050
/**
5151
* Perform any cleanup logic when the Backoffice and/or the package is unloaded
5252
*/
53-
export const onUnload: UmbEntryPointOnUnload = (host, extensionsRegistry) => {
53+
export const onUnload: UmbEntryPointOnUnload = (host, extensionRegistry) => {
5454
// Your cleanup logic here
5555
}
5656
```
@@ -78,14 +78,14 @@ const manifest: UmbExtensionManifest = {
7878
}
7979
};
8080

81-
export const onInit: UmbEntryPointOnInit = (host, extensionsRegistry) => {
81+
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
8282
// Register the extension
8383
extensionRegistry.register(manifest);
8484
}
8585

86-
export const onUnload: UmbEntryPointOnUnload = (host, extensionsRegistry) => {
86+
export const onUnload: UmbEntryPointOnUnload = (host, extensionRegistry) => {
8787
// Unregister the extension (optional)
88-
extension.unregister(manifest);
88+
extensionRegistry.unregister(manifest);
8989
}
9090
```
9191
{% endcode %}
@@ -139,7 +139,7 @@ const manifests: Array<UmbExtensionManifest> = [
139139
...
140140
];
141141

142-
export const onInit: UmbEntryPointOnInit = (host, extensionsRegistry) => {
142+
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
143143
// Register the extensions
144144
extensionRegistry.registerMany(manifests);
145145
}

16/umbraco-cms/fundamentals/code/creating-forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: "Information on creating forms in Umbraco"
88
Creating forms requires that you know your way around .NET Core MVC. So if you are familiar with adding view models, views and controllers you are ready to make your first form.
99

1010
{% hint style="info" %}
11-
You can also use [Umbraco forms](https://umbraco.com/products/umbraco-forms/). It lets you and/or your editors create and handle forms in the backoffice. This includes setting up validation, redirecting and storing and sending form data. Great UI, extendable and supported by Umbraco HQ.
11+
You can also use [Umbraco forms](https://umbraco.com/products/add-ons/forms/). It lets you and/or your editors create and handle forms in the backoffice. This includes setting up validation, redirecting and storing and sending form data. Great UI, extendable and supported by Umbraco HQ.
1212
{% endhint %}
1313

1414
In this example we'll create a basic contact form containing a name, email and message field.

16/umbraco-cms/fundamentals/setup/install/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ description: Instructions on installing Umbraco on various platforms using vario
44

55
# Installation
66

7+
## Install the latest .NET Software Development Kit (SDK)
8+
9+
Before you install Umbraco, you must ensure that you can run it on your machine.
10+
11+
* Identify and install the latest [.NET SDK](https://dotnet.microsoft.com/download).
12+
713
## Install Umbraco using CLI
814

9-
The fastest way to get the latest version of Umbraco up and running is using the command line (CLI).
15+
The fastest way to get the latest version of Umbraco up and running is by using the command line (CLI).
1016

1117
1. Open your command line.
1218
2. Install the Umbraco templates:
@@ -52,7 +58,7 @@ Members of the Umbraco Community have created a website that makes the installat
5258

5359
## Alternative Methods for Installing Umbraco
5460

55-
There are numerous ways to install Umbraco. Below, you can find links to different installation methods that will help you easily install and set up Umbraco projects.&#x20;
61+
There are numerous ways to install Umbraco. Below, you can find links to different installation methods that will help you install and set up Umbraco projects.
5662

5763
### [.NET CLI installation](install-umbraco-with-templates.md)
5864

0 commit comments

Comments
 (0)