Skip to content

Commit 021c178

Browse files
Merge branch 'contrib' into v15/dev
2 parents b8b96f0 + 9056851 commit 021c178

File tree

4 files changed

+38
-118
lines changed

4 files changed

+38
-118
lines changed

.github/BUILD.md

Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,15 @@
44

55
In order to use Umbraco as a CMS and build your website with it, you should not build it yourself. If you're reading this then you're trying to contribute to Umbraco or you're debugging a complex issue.
66

7-
- Are you about to [create a pull request for Umbraco][contribution guidelines]?
8-
- Are you trying to get to the bottom of a problem in your existing Umbraco installation?
7+
- Are you about to [create a pull request for Umbraco][contribution guidelines]?
8+
- Are you trying to get to the bottom of a problem in your existing Umbraco installation?
99

1010
If the answer is yes, please read on. Otherwise, make sure to head on over [to the download page](https://our.umbraco.com/download) and start using Umbraco CMS as intended.
1111

1212
## Table of contents
1313

1414
↖️ You can jump to any section by using the "table of contents" button ( ![Table of contents icon](img/tableofcontentsicon.svg) ) above.
1515

16-
## Getting Started:
17-
To run umbraco, we first need to initialize the client git submodule:
18-
* Execute `git submodule update --init` to get the files into Umbraco.Web.UI.Client project
19-
* If you are going to work on the Backoffice, you can either go to the Umbraco.Web.UI.Client folder and check out a new branch or set it up in your IDE, which will allow you to commit to each repository simultaneously:
20-
* **Rider**: Preferences -> Version Control -> Directory Mappings -> Click the '+' sign
21-
* If you get a white page delete Umbraco.Cms.StaticAssets\wwwroot\umbraco folder and run `npm ci && npm run build:for:cms` inside Umbraco.Web.UI.Client folder to clear out any leftover files from older versions.
22-
23-
### Latest version
24-
* If you want to get the latest changes from the client repository, run `git submodule update` again which will pull the latest main branch.
25-
26-
2716
## Debugging source locally
2817

2918
Did you read ["Are you sure"](#are-you-sure)?
@@ -32,29 +21,34 @@ Did you read ["Are you sure"](#are-you-sure)?
3221

3322
If you want to run a build without debugging, see [Building from source](#building-from-source) below. This runs the build in the same way it is run on our build servers.
3423

24+
> [!NOTE]
25+
> The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to [disable caching in the browser (check "Disable cache" on the "Network" tab of developer tools)][disable browser caching] to help you to see the changes you're making.
26+
3527
#### Debugging with VS Code
3628

3729
In order to build the Umbraco source code locally with Visual Studio Code, first make sure you have the following installed.
3830

39-
* [Visual Studio Code](https://code.visualstudio.com/)
40-
* [dotnet SDK v7+](https://dotnet.microsoft.com/en-us/download)
41-
* [Node.js v14+](https://nodejs.org/en/download/)
42-
* npm v7+ (installed with Node.js)
43-
* [Git command line](https://git-scm.com/download/)
31+
- [Visual Studio Code](https://code.visualstudio.com/)
32+
- [dotnet SDK v9+](https://dotnet.microsoft.com/en-us/download)
33+
- [Node.js v20+](https://nodejs.org/en/download/)
34+
- npm v10+ (installed with Node.js)
35+
- [Git command line](https://git-scm.com/download/)
4436

4537
Open the root folder of the repository in Visual Studio Code.
4638

47-
To build the front end you'll need to open the command pallet (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and run `>Tasks: Run Task` followed by `Client Watch` and then run the `Client Build` task in the same way.
39+
To build the front end you'll need to open the command pallet (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and run `>Tasks: Run Task` followed by `Client Build`.
4840

4941
You can also run the tasks manually on the command line:
5042

5143
```
5244
cd src\Umbraco.Web.UI.Client
5345
npm i
54-
npm run dev
46+
npm run build:for:cms
5547
```
5648

57-
If you just want to build the UI Client to `Umbraco.Web.UI` then instead of running `dev`, you can do: `npm run build`.
49+
If you just want to watch the UI Client to `Umbraco.Web.UI` then instead of running `build:for:cms`, you can do: `npm run dev:mock`. This will launch the Vite dev server on http://localhost:5173 and watch for changes with mocked API responses.
50+
51+
You can also run `npm run dev:server` to run the Vite server against a local Umbraco instance. In this case, you need to have the .NET project running and accept connections from the Vite server. Please see the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
5852

5953
The login screen is a different frontend build, for that one you can run it as follows:
6054

@@ -66,12 +60,6 @@ npm run dev
6660

6761
If you just want to build the Login screen to `Umbraco.Web.UI` then instead of running `dev`, you can do: `npm run build`.
6862

69-
**The initial Gulp build might take a long time - don't worry, this will be faster on subsequent runs.**
70-
71-
You might run into [Gulp quirks](#gulp-quirks).
72-
73-
The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to [disable caching in the browser (check "Disable cache" on the "Network" tab of developer tools)][disable browser caching] to help you to see the changes you're making.
74-
7563
To run the C# portion of the project, either hit <kbd>F5</kbd> to begin debugging, or manually using the command line:
7664

7765
```
@@ -86,24 +74,18 @@ When the page eventually loads in your web browser, you can follow the installer
8674

8775
In order to build the Umbraco source code locally with Visual Studio, first make sure you have the following installed.
8876

89-
* [Visual Studio 2022 v17+ with .NET 7+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
90-
* [Node.js v14+](https://nodejs.org/en/download/)
91-
* npm v7+ (installed with Node.js)
92-
* [Git command line](https://git-scm.com/download/)
77+
- [Visual Studio 2022 v17+ with .NET 7+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
78+
- [Node.js v20+](https://nodejs.org/en/download/)
79+
- npm v10+ (installed with Node.js)
80+
- [Git command line](https://git-scm.com/download/)
9381

9482
The easiest way to get started is to open `umbraco.sln` in Visual Studio.
9583

96-
To build the front end, you'll first need to run `cd src\Umbraco.Web.UI.Client && npm install` in the command line (or `cd src\Umbraco.Web.UI.Client; npm install` in PowerShell). Then find the Task Runner Explorer (View → Other Windows → Task Runner Explorer) and run the `build` task under `Gulpfile.js`. You may need to refresh the Task Runner Explorer before the tasks load.
97-
98-
If you're working on the backoffice, you may wish to run the `dev` command instead while you're working with it, so changes are copied over to the appropriate directories and you can refresh your browser to view the results of your changes.
84+
Umbraco is a C# based codebase, which is mostly ASP.NET Core MVC based. You can make changes, build them in Visual Studio, and hit <kbd>F5</kbd> to see the result. There are two web projects in the solution, `Umbraco.Web.UI.Client` and `Umbraco.Web.UI.Login`. They each have their own build process and can be run separately. The `Umbraco.Web.UI` project is the main project that hosts the back office and login screen. This is the project you will want to run to see your changes. It will automatically restore and build the client projects when you run it.
9985

100-
**The initial Gulp build might take a long time - don't worry, this will be faster on subsequent runs.**
86+
If you want to watch the UI Client to `Umbraco.Web.UI` then you can open a terminal in `src/Umbraco.Web.UI.Client` where you can run `npm run dev:mock` manually. This will launch the Vite dev server on http://localhost:5173 and watch for changes with mocked API responses.
10187

102-
You might run into [Gulp quirks](#gulp-quirks).
103-
104-
The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to [disable caching in the browser (check "Disable cache" on the "Network" tab of developer tools)][disable browser caching] to help you to see the changes you're making.
105-
106-
"The rest" is a C# based codebase, which is mostly ASP.NET Core MVC based. You can make changes, build them in Visual Studio, and hit <kbd>F5</kbd> to see the result.
88+
You can also run `npm run dev:server` to run the Vite server against a local Umbraco instance. In this case, you need to have the .NET project running and accept connections from the Vite server. Please see the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
10789

10890
**The initial C# build might take a _really_ long time (seriously, go and make a cup of coffee!) - but don't worry, this will be faster on subsequent runs.**
10991

@@ -115,7 +97,7 @@ Did you read ["Are you sure"](#are-you-sure)?
11597

11698
Do note that this is only required if you want to test out your custom changes in a separate site (not the one in the Umbraco.Web.UI), if you just want to test your changes you can run the included test site using: `dotnet run` from `src/Umbraco.Web.UI/`
11799

118-
You may want to build a set of NuGet packages with your changes, this can be done using the dotnet pack command.
100+
You may want to build a set of NuGet packages with your changes, this can be done using the dotnet pack command.
119101

120102
First enter the root of the project in a command line environment, and then use the following command to build the NuGet packages:
121103

@@ -127,31 +109,33 @@ You can then add these as a local NuGet feed using the following command:
127109

128110
`dotnet nuget add source <Path to Build.Out folder> -n MyLocalFeed`
129111

130-
This will add a local nuget feed with the name "MyLocalFeed" and you'll now be able to use your custom built NuGet packages.
112+
This will add a local nuget feed with the name "MyLocalFeed" and you'll now be able to use your custom built NuGet packages.
131113

132114
### Cleaning up
133115

134116
Once the solution has been used to run a site, one may want to "reset" the solution in order to run a fresh new site again.
135117

136118
The easiest way to do this by deleting the following files and folders:
137-
* src/Umbraco.Web.UI/appsettings.json
138-
* src/Umbraco.Web.UI/umbraco/Data
139119

140-
You only have to remove the connection strings from the appsettings, but removing the data folder ensures that the sqlite database gets deleted too.
120+
- src/Umbraco.Web.UI/appsettings.json
121+
- src/Umbraco.Web.UI/umbraco/Data
122+
123+
You only have to remove the connection strings from the appsettings, but removing the data folder ensures that the sqlite database gets deleted too.
141124

142125
Next time you run a build the `appsettings.json` file will be re-created in its default state.
143126

144127
This will leave media files and views around, but in most cases, it will be enough.
145128

146129
To perform a more complete clear, you will want to also delete the content of the media, views, scripts... directories.
147130

148-
The following command will force remove all untracked files and directories, whether they are ignored by Git or not. Combined with `git reset` it can recreate a pristine working directory.
131+
The following command will force remove all untracked files and directories, whether they are ignored by Git or not. Combined with `git reset` it can recreate a pristine working directory.
149132

150133
git clean -xdf .
151134

152135
For git documentation see:
153-
* git [clean](<https://git-scm.com/docs/git-clean>)
154-
* git [reset](<https://git-scm.com/docs/git-reset>)
136+
137+
- git [clean](https://git-scm.com/docs/git-clean)
138+
- git [reset](https://git-scm.com/docs/git-reset)
155139

156140
## Azure DevOps
157141

@@ -165,18 +149,6 @@ The produced artifacts are published in a container that can be downloaded from
165149

166150
Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details).
167151

168-
### Gulp Quirks
169-
170-
You may need to run the following commands to set up gulp properly:
171-
172-
```
173-
npm cache clean --force
174-
npm ci
175-
npm run build
176-
```
177-
178-
179-
180-
[ contribution guidelines]: CONTRIBUTING.md "Read the guide to contributing for more details on contributing to Umbraco"
181-
[ starter kits ]: https://our.umbraco.com/packages/?category=Starter%20Kits&version=9 "Browse starter kits available for v9 on Our "
152+
[ contribution guidelines]: CONTRIBUTING.md "Read the guide to contributing for more details on contributing to Umbraco"
153+
[ starter kits ]: https://our.umbraco.com/packages/?category=Starter%20Kits&version=9 "Browse starter kits available for v9 on Our "
182154
[ disable browser caching ]: https://techwiser.com/disable-cache-google-chrome-firefox "Instructions on how to disable browser caching in Chrome and Firefox"

.vscode/tasks.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@
2727
"promptOnClose": true,
2828
"group": "build",
2929
"type": "npm",
30-
"script": "build",
30+
"script": "build:for:cms",
3131
"path": "src/Umbraco.Web.UI.Client/",
32-
"problemMatcher": [
33-
"$gulp-tsc"
34-
]
32+
"problemMatcher": []
3533
},
3634
{
3735
"label": "Client Watch",
@@ -41,9 +39,7 @@
4139
"type": "npm",
4240
"script": "dev",
4341
"path": "src/Umbraco.Web.UI.Client/",
44-
"problemMatcher": [
45-
"$gulp-tsc"
46-
]
42+
"problemMatcher": []
4743
},
4844
{
4945
"label": "Dotnet build",

src/Umbraco.Core/PropertyEditors/Validators/DateTimeValidator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.ComponentModel.DataAnnotations;
2-
using System.Globalization;
32
using Umbraco.Cms.Core.Models.Validation;
43
using Umbraco.Extensions;
54

@@ -26,7 +25,7 @@ public IEnumerable<ValidationResult> Validate(object? value, string? valueType,
2625
yield break;
2726
}
2827

29-
if (DateTime.TryParse(value.ToString(), CultureInfo.InvariantCulture, out DateTime dt) == false)
28+
if (DateTime.TryParse(value.ToString(), out DateTime dt) == false)
3029
{
3130
yield return new ValidationResult(
3231
$"The string value {value} cannot be parsed into a DateTime",

tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/Validators/DateTimeValidatorTests.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)