Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
192eb2699b | ||
|
|
ff85abd403 |
@@ -1,3 +0,0 @@
|
||||
**/*
|
||||
!**/bin/**
|
||||
!**/obj/**
|
||||
@@ -1,15 +1,36 @@
|
||||
# [Choice] .NET version: 6.0, 3.1, 6.0-bullseye, 3.1-bullseye, 6.0-focal, 3.1-focal
|
||||
ARG VARIANT=6.0-bullseye
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
|
||||
# [Choice] .NET Core version: 5.0, 3.1, 2.1
|
||||
ARG VARIANT=3.1
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/dotnetcore:0-${VARIANT}
|
||||
|
||||
# [Choice] Node.js version: none, lts/*, 18, 16, 14
|
||||
ARG NODE_VERSION="none"
|
||||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||
# [Option] Install Node.js
|
||||
ARG INSTALL_NODE="true"
|
||||
ARG NODE_VERSION="lts/*"
|
||||
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||
|
||||
# [Option] Install Azure CLI
|
||||
ARG INSTALL_AZURE_CLI="false"
|
||||
COPY library-scripts/azcli-debian.sh /tmp/library-scripts/
|
||||
RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-debian.sh; fi \
|
||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||
|
||||
# Install SQL Tools: SQLPackage and sqlcmd
|
||||
COPY mssql/installSQLtools.sh installSQLtools.sh
|
||||
RUN bash ./installSQLtools.sh \
|
||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||
|
||||
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi
|
||||
|
||||
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
# Following added by Warren...
|
||||
# Needed to add as Gifsicle used by gulp-imagemin does not ship a Linux binary and has to be compiled from source
|
||||
# And this Linux package is needed in order to build it
|
||||
# https://github.com/imagemin/imagemin-gifsicle/issues/40#issuecomment-616487214
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends dh-autoreconf chromium-browser
|
||||
|
||||
# [Optional] Uncomment this line to install global node packages.
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
@@ -21,7 +42,7 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
|
||||
# Needing to set unsafe-perm as root is the user setup
|
||||
# https://docs.npmjs.com/cli/v6/using-npm/config#unsafe-perm
|
||||
# Default: false if running as root, true otherwise (we are ROOT)
|
||||
#RUN npm -g config set user vscode && npm -g config set unsafe-perm
|
||||
RUN npm -g config set user vscode && npm -g config set unsafe-perm
|
||||
|
||||
# Generate and trust a local developer certificate for Kestrel
|
||||
# This is needed for Kestrel to bind on https
|
||||
|
||||
@@ -1,25 +1,41 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/dotnet-mssql
|
||||
{
|
||||
"name": "C# (.NET) Umbraco & SMTP4Dev",
|
||||
"name": "C# (.NET) and MS SQL",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspace",
|
||||
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"omnisharp.defaultLaunchSolution": "umbraco.sln",
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"mssql.connections": [
|
||||
{
|
||||
"server": "localhost,1433",
|
||||
"database": "",
|
||||
"authenticationType": "SqlLogin",
|
||||
"user": "sa",
|
||||
"password": "P@ssw0rd",
|
||||
"emptyPasswordInput": false,
|
||||
"savePassword": false,
|
||||
"profileName": "mssql-container"
|
||||
}
|
||||
],
|
||||
"omnisharp.defaultLaunchSolution": "umbraco-netcore-only.sln",
|
||||
"omnisharp.enableDecompilationSupport": true,
|
||||
"omnisharp.enableRoslynAnalyzers": true
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp"
|
||||
"ms-dotnettools.csharp",
|
||||
"ms-mssql.mssql"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [9000, 5000, 25]
|
||||
// 1433 for SQL if you want to connect from local into the one running inside the container
|
||||
// Can connect to the SQL Server running in the image on local with 'host.docker.internal' as hostname
|
||||
"forwardPorts": [1433, 9000, 5000, 25],
|
||||
|
||||
// [Optional] To reuse of your local HTTPS dev cert:
|
||||
//
|
||||
@@ -40,4 +56,6 @@
|
||||
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
|
||||
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
|
||||
|
||||
// postCreateCommand.sh parameters: $1=SA password, $2=dacpac path, $3=sql script(s) path
|
||||
"postCreateCommand": "bash .devcontainer/mssql/postCreateCommand.sh 'P@ssw0rd' './bin/Debug/' './.devcontainer/mssql/'"
|
||||
}
|
||||
|
||||
@@ -6,10 +6,15 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
# [Choice] .NET version: 6.0, 3.1, 6.0-bullseye, 3.1-bullseye, 6.0-focal, 3.1-focal
|
||||
VARIANT: 6.0-bullseye
|
||||
# [Choice] Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
|
||||
VARIANT: 5.0
|
||||
# Options
|
||||
INSTALL_NODE: "true"
|
||||
NODE_VERSION: "lts/*"
|
||||
INSTALL_AZURE_CLI: "false"
|
||||
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
|
||||
USER_UID: 1000
|
||||
USER_GID: 1000
|
||||
|
||||
volumes:
|
||||
- ..:/workspace:cached
|
||||
@@ -17,6 +22,9 @@ services:
|
||||
# Overrides default command so things don't shut down after the process ends.
|
||||
command: sleep infinity
|
||||
|
||||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
||||
network_mode: service:db
|
||||
|
||||
# Uncomment the next line to use a non-root user for all processes.
|
||||
# user: vscode
|
||||
|
||||
@@ -26,8 +34,7 @@ services:
|
||||
# DotNetCore ENV Variables
|
||||
# https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0#environment-variables
|
||||
environment:
|
||||
- ConnectionStrings__umbracoDbDSN=Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True
|
||||
- ConnectionStrings__umbracoDbDSN_ProviderName=Microsoft.Data.Sqlite
|
||||
- ConnectionStrings__umbracoDbDSN=server=localhost;database=UmbracoUnicore;user id=sa;password='P@ssw0rd'
|
||||
- Umbraco__CMS__Unattended__InstallUnattended=true
|
||||
- Umbraco__CMS__Unattended__UnattendedUserName=Admin
|
||||
- Umbraco__CMS__Unattended__UnattendedUserEmail=test@umbraco.com
|
||||
@@ -36,6 +43,16 @@ services:
|
||||
- Umbraco__CMS__Global__Smtp__Port=25
|
||||
- Umbraco__CMS__Global__Smtp__From=noreply@umbraco.test
|
||||
|
||||
db:
|
||||
image: mcr.microsoft.com/mssql/server:2019-latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
SA_PASSWORD: P@ssw0rd
|
||||
ACCEPT_EULA: Y
|
||||
|
||||
# Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
|
||||
smtp4dev:
|
||||
image: rnwood/smtp4dev:v3
|
||||
restart: always
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/azcli.md
|
||||
#
|
||||
# Syntax: ./azcli-debian.sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install curl, apt-transport-https, lsb-release, or gpg if missing
|
||||
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
|
||||
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
|
||||
apt-get update
|
||||
fi
|
||||
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
|
||||
fi
|
||||
|
||||
# Install the Azure CLI
|
||||
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list
|
||||
curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
|
||||
apt-get update
|
||||
apt-get install -y azure-cli
|
||||
echo "Done!"
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
This will generate a blank database when the container is spun up
|
||||
that you can use to connect to for the SQL configuration in the web installer flow
|
||||
|
||||
---- NOTE ----
|
||||
Any .sql files in this folder will be executed
|
||||
Along with any .dacpac will be restored as databases
|
||||
See postCreateCommand.sh for specifics
|
||||
*/
|
||||
CREATE DATABASE UmbracoUnicore;
|
||||
GO
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
set -echo
|
||||
echo "Installing mssql-tools"
|
||||
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
|
||||
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
|
||||
CODENAME=$(lsb_release -cs)
|
||||
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-${DISTRO}-${CODENAME}-prod ${CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
ACCEPT_EULA=Y apt-get -y install unixodbc-dev msodbcsql17 libunwind8 mssql-tools
|
||||
|
||||
echo "Installing sqlpackage"
|
||||
curl -sSL -o sqlpackage.zip "https://aka.ms/sqlpackage-linux"
|
||||
mkdir /opt/sqlpackage
|
||||
unzip sqlpackage.zip -d /opt/sqlpackage
|
||||
rm sqlpackage.zip
|
||||
chmod a+x /opt/sqlpackage/sqlpackage
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
dacpac="false"
|
||||
sqlfiles="false"
|
||||
SApassword=$1
|
||||
dacpath=$2
|
||||
sqlpath=$3
|
||||
|
||||
echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
|
||||
for i in {1..60};
|
||||
do
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "SQL server ready"
|
||||
break
|
||||
else
|
||||
echo "Not ready yet..."
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
rm testsqlconnection.sql
|
||||
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dacpac="true"
|
||||
echo "Found dacpac $f"
|
||||
fi
|
||||
done
|
||||
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
sqlfiles="true"
|
||||
echo "Found SQL file $f"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $sqlfiles == "true" ]
|
||||
then
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
echo "Executing $f"
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i $f
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $dacpac == "true" ]
|
||||
then
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dbname=$(basename $f ".dacpac")
|
||||
echo "Deploying dacpac $f"
|
||||
/opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword
|
||||
fi
|
||||
done
|
||||
fi
|
||||
+19
-8
@@ -282,7 +282,7 @@ dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR___
|
||||
|
||||
# All public/protected/protected_internal constant fields must be PascalCase
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal, internal, private
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.required_modifiers = const
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.symbols = public_protected_constant_fields_group
|
||||
@@ -356,13 +356,24 @@ dotnet_naming_rule.parameters_rule.symbols = parameters_group
|
||||
dotnet_naming_rule.parameters_rule.style = camel_case_style
|
||||
dotnet_naming_rule.parameters_rule.severity = warning
|
||||
|
||||
# Private static fields use camelCase and start with s_
|
||||
dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private
|
||||
dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static, shared
|
||||
dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field
|
||||
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.symbols = private_static_field_symbols
|
||||
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.style = camel_case_and_prefix_with_s_underscore_style
|
||||
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.severity = warning
|
||||
dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.required_prefix = s_
|
||||
dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.capitalization = camel_case
|
||||
|
||||
# Instance fields use camelCase and are prefixed with '_'
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = warning
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
|
||||
dotnet_naming_symbols.instance_fields.applicable_kinds = field
|
||||
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
||||
dotnet_naming_style.instance_field_style.required_prefix = _
|
||||
dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private
|
||||
dotnet_naming_symbols.private_field_symbols.applicable_kinds = field
|
||||
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = private_field_symbols
|
||||
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.style = camel_case_and_prefix_with_underscore_style
|
||||
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.severity = warning
|
||||
dotnet_naming_style.camel_case_and_prefix_with_underscore_style.required_prefix = _
|
||||
dotnet_naming_style.camel_case_and_prefix_with_underscore_style.capitalization = camel_case
|
||||
|
||||
##########################################
|
||||
# License
|
||||
@@ -397,4 +408,4 @@ dotnet_naming_style.instance_field_style.required_prefix = _
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
##########################################
|
||||
##########################################
|
||||
+19
-102
@@ -1,99 +1,33 @@
|
||||
# Umbraco CMS Build
|
||||
# Umbraco CMS Build
|
||||
|
||||
## Are you sure?
|
||||
|
||||
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.
|
||||
|
||||
- Are you about to [create a pull request for Umbraco][contribution guidelines]?
|
||||
- Are you about to create a pull request for Umbraco?
|
||||
- Are you trying to get to the bottom of a problem in your existing Umbraco installation?
|
||||
|
||||
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.
|
||||
|
||||
## Table of contents
|
||||
**Table of contents**
|
||||
|
||||
↖️ You can jump to any section by using the "table of contents" button (  ) above.
|
||||
[Building from source](#building-from-source)
|
||||
* [The quick build](#quick)
|
||||
* [Build infrastructure](#build-infrastructure)
|
||||
* [Properties](#properties)
|
||||
* [GetUmbracoVersion](#getumbracoversion)
|
||||
* [SetUmbracoVersion](#setumbracoversion)
|
||||
* [Build](#build)
|
||||
* [Build-UmbracoDocs](#build-umbracodocs)
|
||||
* [Verify-NuGet](#verify-nuget)
|
||||
* [Cleaning up](#cleaning-up)
|
||||
|
||||
[Azure DevOps](#azure-devops)
|
||||
|
||||
## Debugging source locally
|
||||
[Quirks](#quirks)
|
||||
* [Powershell quirks](#powershell-quirks)
|
||||
* [Git quirks](#git-quirks)
|
||||
|
||||
Did you read ["Are you sure"](#are-you-sure)?
|
||||
|
||||
[More details about contributing to Umbraco and how to use the GitHub tooling can be found in our guide to contributing.][contribution guidelines]
|
||||
|
||||
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.
|
||||
|
||||
#### Debugging with VS Code
|
||||
|
||||
In order to build the Umbraco source code locally with Visual Studio Code, first make sure you have the following installed.
|
||||
|
||||
* [Visual Studio Code](https://code.visualstudio.com/)
|
||||
* [dotnet SDK v6.0.2+](https://dotnet.microsoft.com/en-us/download)
|
||||
* [Node.js v14+](https://nodejs.org/en/download/)
|
||||
* npm v7+ (installed with Node.js)
|
||||
* [Git command line](https://git-scm.com/download/)
|
||||
|
||||
Open the root folder of the repository in Visual Studio Code.
|
||||
|
||||
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.
|
||||
|
||||
You can also run the tasks manually on the command line:
|
||||
|
||||
```
|
||||
cd src\Umbraco.Web.UI.Client
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
cd src\Umbraco.Web.UI.Client
|
||||
npm install
|
||||
gulp dev
|
||||
```
|
||||
|
||||
**The initial Gulp build might take a long time - don't worry, this will be faster on subsequent runs.**
|
||||
|
||||
You might run into [Gulp quirks](#gulp-quirks).
|
||||
|
||||
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.
|
||||
|
||||
To run the C# portion of the project, either hit <kbd>F5</kbd> to begin debugging, or manually using the command line:
|
||||
|
||||
```
|
||||
dotnet watch --project .\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj
|
||||
```
|
||||
|
||||
**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.**
|
||||
|
||||
When the page eventually loads in your web browser, you can follow the installer to set up a database for debugging. You may also wish to install a [starter kit][starter kits] to ease your debugging.
|
||||
|
||||
#### Debugging with Visual Studio
|
||||
|
||||
In order to build the Umbraco source code locally with Visual Studio, first make sure you have the following installed.
|
||||
|
||||
* [Visual Studio 2019 v16.8+ with .NET 6.0.2+](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)
|
||||
* [Node.js v14+](https://nodejs.org/en/download/)
|
||||
* npm v7+ (installed with Node.js)
|
||||
* [Git command line](https://git-scm.com/download/)
|
||||
|
||||
The easiest way to get started is to open `umbraco.sln` in Visual Studio.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
**The initial Gulp build might take a long time - don't worry, this will be faster on subsequent runs.**
|
||||
|
||||
You might run into [Gulp quirks](#gulp-quirks).
|
||||
|
||||
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.
|
||||
|
||||
"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.
|
||||
|
||||
**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.**
|
||||
|
||||
When the page eventually loads in your web browser, you can follow the installer to set up a database for debugging. You may also wish to install a [starter kit][starter kits] to ease your debugging.
|
||||
|
||||
## Building from source
|
||||
|
||||
@@ -104,14 +38,13 @@ Did you read ["Are you sure"](#are-you-sure)?
|
||||
To build Umbraco, fire up PowerShell and move to Umbraco's repository root (the directory that contains `src`, `build`, `LICENSE.md`...). There, trigger the build with the following command:
|
||||
|
||||
build/build.ps1
|
||||
|
||||
|
||||
If you only see a build.bat-file, you're probably on the wrong branch. If you switch to the correct branch (v8/contrib) the file will appear and you can build it.
|
||||
|
||||
You might run into [Powershell quirks](#powershell-quirks).
|
||||
|
||||
If it runs without errors; Hooray! Now you can continue with [the next step](CONTRIBUTING.md#how-do-i-begin) and open the solution and build it.
|
||||
|
||||
|
||||
### Build Infrastructure
|
||||
|
||||
The Umbraco Build infrastructure relies on a PowerShell object. The object can be retrieved with:
|
||||
@@ -212,7 +145,7 @@ To perform a more complete clear, you will want to also delete the content of th
|
||||
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.
|
||||
|
||||
git clean -xdf .
|
||||
|
||||
|
||||
For git documentation see:
|
||||
* git [clean](<https://git-scm.com/docs/git-clean>)
|
||||
* git [reset](<https://git-scm.com/docs/git-reset>)
|
||||
@@ -281,19 +214,3 @@ The best solution is to unblock the Zip file before un-zipping: right-click the
|
||||
### Git Quirks
|
||||
|
||||
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).
|
||||
|
||||
### Gulp Quirks
|
||||
|
||||
You may need to run the following commands to set up gulp properly:
|
||||
|
||||
```
|
||||
npm cache clean --force
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
|
||||
|
||||
[ contribution guidelines]: CONTRIBUTING.md "Read the guide to contributing for more details on contributing to Umbraco"
|
||||
[ starter kits ]: https://our.umbraco.com/packages/?category=Starter%20Kits&version=9 "Browse starter kits available for v9 on Our "
|
||||
[ disable browser caching ]: https://techwiser.com/disable-cache-google-chrome-firefox "Instructions on how to disable browser caching in Chrome and Firefox"
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# Umbraco Code of Conduct
|
||||
|
||||
## Preamble
|
||||
|
||||
We are the friendly CMS. And our friendliness stems from our values. That's why we have set for ourselves, Umbraco HQ, and the community, five values to guide us in everything we do:
|
||||
|
||||
* Trust - We believe in and empower people
|
||||
* Respect - We treat others as we would like to be treated
|
||||
* Open - We share our thoughts and knowledge
|
||||
* Hungry - We want to do things better, best is next
|
||||
* Friendly - We want to build long-lasting relationships
|
||||
|
||||
With these values in mind, we want to offer the Umbraco community a code of conduct that specifies a baseline standard of behavior so that people with different social values and communication styles can work together.
|
||||
|
||||
This code of conduct is based on the widely used Contributor Covenant, as described in [https://www.contributor-covenant.org/](https://www.contributor-covenant.org/)
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders (e.g. Meetup & festival organizers, moderators, maintainers, ...) are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
Specific enforcement steps are listed in the [Code of Conduct Enforcement Guidelines](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT_ENFORCEMENT.md) document which is an appendix of this document, updated and maintained by the Code of Conduct Team.
|
||||
|
||||
## Scope
|
||||
This Code of Conduct applies within all community spaces and events supported by Umbraco HQ or using the Umbraco name. It also applies when an individual is officially representing the community in public spaces.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior, may be reported at [conduct@umbraco.com](mailto:conduct@umbraco.com). All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
Or alternatively, you can reach out directly to any of the team members behind the address above:
|
||||
|
||||
* Sebastiaan Janssen (He, Him - Languages spoken: English, Dutch, Danish(Read)) [sebastiaan@umbraco.com](mailto:sebastiaan@umbraco.com)
|
||||
* Ilham Boulghallat (She, Her - Languages spoken: English, French, Arabic) [ilham@umbraco.com](mailto:ilham@umbraco.com)
|
||||
* Arnold Visser (He, Him - Languages spoken: English, Dutch) [arnold@umbraco.com](mailto:arnold@umbraco.com)
|
||||
* Emma Burstow (She, Her - Languages spoken: English) [ema@umbraco.com](mailto:ema@umbraco.com)
|
||||
|
||||
The review process is done with full respect for the privacy and security of the reporter of any incident.
|
||||
|
||||
People with a conflict of interest should exclude themselves or if necessary be excluded by the other team members.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
**1. Correction**
|
||||
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
**2. Warning**
|
||||
Community Impact: A violation through a single incident or series of actions.
|
||||
|
||||
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
**3. Temporary Ban**
|
||||
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
**4. Permanent Ban**
|
||||
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
Consequence: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
|
||||
|
||||
This Code of Conduct will be maintained and reviewed by the team listed above.
|
||||
@@ -0,0 +1,57 @@
|
||||
# Umbraco Code of Conduct Enforcement guidelines - Consequence Ladder
|
||||
|
||||
These are the steps followed by the [Umbraco Code of Conduct Team](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT.md) when we respond to an issue or incident brought to our attention by a community member.
|
||||
|
||||
This is an appendix to the Code of Conduct and is updated and maintained by the Code of Conduct Team.
|
||||
|
||||
To make sure that all reports will be reviewed and investigated promptly and fairly, as highlighted in the Umbraco Code of Conduct, we are following [Mozilla’s Consequence Ladder approach](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md).
|
||||
|
||||
This approach helps the Team enforce the Code of Conduct in a structured manner and can be used as a way of communicating escalation. Each time the Team takes an action (warning, ban) the individual is made aware of future consequences. The Team can either follow the order of the levels in the ladder or decide to jump levels. When needed, the team can go directly to a permanent ban.
|
||||
|
||||
**Level 0: No Action**
|
||||
Recommendations do not indicate a violation of the Code of Conduct.
|
||||
|
||||
**Level 1: Simple Warning Issued**
|
||||
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior.
|
||||
|
||||
**Level 2: Warning**
|
||||
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* Communication of next-level consequences if behaviors are repeated (according to this ladder).
|
||||
|
||||
**Level 3: Warning + Mandatory Cooling Off Period (Access Retained)**
|
||||
A private warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* Request to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
|
||||
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
|
||||
* Require they do not interact with others in the report, or those who they suspect are involved in the report.
|
||||
* Suggestions for 'out of office' type of message on platforms, to reduce curiosity, or suspicion among those not involved.
|
||||
|
||||
**Level 4: Temporary Ban (Access Revoked)**
|
||||
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* 3-6 months imposed break.
|
||||
* All accounts deactivated, or blocked during this time (Our, HQ Slack if applicable).
|
||||
* Require to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
|
||||
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
|
||||
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) suspended. (onboarding/reapplication required outside of this process)
|
||||
* No attendance at Umbraco events during the ban period.
|
||||
* Not allowed to enter Umbraco HQ offices during the ban period.
|
||||
* Permission to use the MVP title, if applicable, is revoked during this ban period.
|
||||
* The community leaders running events and other initiatives are informed of the ban.
|
||||
|
||||
**Level 5: Permanent Ban**
|
||||
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
|
||||
|
||||
* All accounts deactivated permanently.
|
||||
* No attendance at Umbraco events going forward.
|
||||
* Not allowed to enter Umbraco HQ offices permanently.
|
||||
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) permanently suspended.
|
||||
* Permission to use the MVP title, if applicable, revoked.
|
||||
* The community leaders running events and other initiatives are informed of the ban.
|
||||
|
||||
|
||||
Sources:
|
||||
* [Mozilla Code of Conduct - Enforcement Consequence Ladder](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md)
|
||||
* [Drupal Conflict Resolution Policy and Process](https://www.drupal.org/conflict-resolution)
|
||||
* [Django Code of Conduct - Enforcement Manual](https://www.djangoproject.com/conduct/enforcement-manual/)
|
||||
+149
-185
@@ -2,131 +2,192 @@
|
||||
|
||||
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
|
||||
|
||||
These contribution guidelines are mostly just that - guidelines, not rules. This is what we've found to work best over the years, but if you choose to ignore them, we still love you! 💖 Use your best judgement, and feel free to propose changes to this document in a pull request.
|
||||
The following is a set of guidelines, for contributing to Umbraco CMS.
|
||||
|
||||
## Coding not your thing? Or want more ways to contribute?
|
||||
These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
This document covers contributing to the codebase of the CMS but [the community site has plenty of inspiration for other ways to get involved.][get involved]
|
||||
Remember, we're a friendly bunch and are happy with whatever contribution you might provide. Below are guidelines for success that we've gathered over the years. If you choose to ignore them then we still love you 💖.
|
||||
|
||||
If you don't feel you'd like to make code changes here, you can visit our [documentation repository][docs repo] and use your experience to contribute to making the docs we have, even better.
|
||||
**Code of conduct**
|
||||
|
||||
We also encourage community members to feel free to comment on others' pull requests and issues - the expertise we have is not limited to the Core Collaborators and HQ. So, if you see something on the issue tracker or pull requests you feel you can add to, please don't be shy.
|
||||
This project and everyone participating in it, is governed by the [our Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Sebastiaan Janssen - sj@umbraco.dk](mailto:sj@umbraco.dk).
|
||||
|
||||
## Table of contents
|
||||
**Table of contents**
|
||||
|
||||
- [Before you start](#before-you-start)
|
||||
* [Code of Conduct](#code-of-conduct)
|
||||
* [What can I contribute?](#what-can-i-contribute)
|
||||
+ [Making larger changes](#making-larger-changes)
|
||||
+ [Pull request or package?](#pull-request-or-package)
|
||||
+ [Ownership and copyright](#ownership-and-copyright)
|
||||
- [Finding your first issue: Up for grabs](#finding-your-first-issue-up-for-grabs)
|
||||
- [Making your changes](#making-your-changes)
|
||||
+ [Keeping your Umbraco fork in sync with the main repository](#keeping-your-umbraco-fork-in-sync-with-the-main-repository)
|
||||
+ [Style guide](#style-guide)
|
||||
+ [Questions?](#questions)
|
||||
- [Creating a pull request](#creating-a-pull-request)
|
||||
- [The review process](#the-review-process)
|
||||
* [Dealing with requested changes](#dealing-with-requested-changes)
|
||||
+ [No longer available?](#no-longer-available)
|
||||
* [The Core Collaborators team](#the-core-collaborators-team)
|
||||
[Contributing code changes](#contributing-code-changes)
|
||||
* [Guidelines for contributions we welcome](#guidelines-for-contributions-we-welcome)
|
||||
* [Ownership and copyright](#ownership-and-copyright)
|
||||
* [What can I start with?](#what-can-i-start-with)
|
||||
* [How do I begin?](#how-do-i-begin)
|
||||
* [Pull requests](#pull-requests)
|
||||
|
||||
## Before you start
|
||||
[Reviews](#reviews)
|
||||
* [Styleguides](#styleguides)
|
||||
* [The Core Contributors](#the-core-contributors-team)
|
||||
* [Questions?](#questions)
|
||||
|
||||
[Working with the code](#working-with-the-code)
|
||||
* [Building Umbraco from source code](#building-umbraco-from-source-code)
|
||||
* [Working with the source code](#working-with-the-source-code)
|
||||
* [Making changes after the PR is open](#making-changes-after-the-pr-is-open)
|
||||
* [Which branch should I target for my contributions?](#which-branch-should-i-target-for-my-contributions)
|
||||
* [Keeping your Umbraco fork in sync with the main repository](#keeping-your-umbraco-fork-in-sync-with-the-main-repository)
|
||||
|
||||
### Code of Conduct
|
||||
## Contributing code changes
|
||||
|
||||
This project and everyone participating in it, is governed by the [our Code of Conduct][code of conduct].
|
||||
This document gives you a quick overview on how to get started.
|
||||
|
||||
### What can I contribute?
|
||||
### Guidelines for contributions we welcome
|
||||
|
||||
We categorise pull requests (PRs) into two categories:
|
||||
Not all changes are wanted, so on occasion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valuable time.
|
||||
|
||||
| PR type | Definition |
|
||||
| --------- | ------------------------------------------------------------ |
|
||||
| Small PRs | Bug fixes and small improvements - can be recognized by seeing a small number of changes and possibly a small number of new files. |
|
||||
| Large PRs | New features and large refactorings - can be recognized by seeing a large number of changes, plenty of new files, updates to package manager files (NuGet’s packages.config, NPM’s packages.json, etc.). |
|
||||
We have [documented what we consider small and large changes](CONTRIBUTION_GUIDELINES.md). Make sure to talk to us before making large changes, so we can ensure that you don't put all your hard work into something we would not be able to merge.
|
||||
|
||||
We’re usually able to handle small PRs pretty quickly. A community volunteer will do the initial review and flag it for Umbraco HQ as “community tested”. If everything looks good, it will be merged pretty quickly [as per the described process][review process].
|
||||
|
||||
We would love to follow the same process for larger PRs but this is not always possible due to time limitations and priorities that need to be aligned. We don’t want to put up any barriers, but this document should set the correct expectations.
|
||||
|
||||
Not all changes are wanted, so on occasion we might close a PR without merging it but if we do, we will give you feedback why we can't accept your changes. **So make sure to [talk to us before making large changes][making larger changes]**, so we can ensure that you don't put all your hard work into something we would not be able to merge.
|
||||
|
||||
#### Making larger changes
|
||||
|
||||
[making larger changes]: #making-larger-changes
|
||||
|
||||
Please make sure to describe your larger ideas in an [issue (bugs)][issues] or [discussion (new features)][discussions], it helps to put in mock up screenshots or videos. If the change makes sense for HQ to include in Umbraco CMS we will leave you some feedback on how we’d like to see it being implemented.
|
||||
|
||||
If a larger pull request is encouraged by Umbraco HQ, the process will be similar to what is described in the small PRs process above, we strive to feedback within 14 days. Finalizing and merging the PR might take longer though as it will likely need to be picked up by the development team to make sure everything is in order. We’ll keep you posted on the progress.
|
||||
|
||||
#### Pull request or package?
|
||||
|
||||
[pr or package]: #pull-request-or-package
|
||||
|
||||
If you're unsure about whether your changes belong in the core Umbraco CMS or if you should turn your idea into a package instead, make sure to [talk to us][making larger changes].
|
||||
|
||||
If it doesn’t fit in CMS right now, we will likely encourage you to make it into a package instead. A package is a great way to check out popularity of a feature, learn how people use it, validate good usability and fix bugs. Eventually, a package could "graduate" to be included in the CMS.
|
||||
Remember, it is always worth working on an issue from the `Up for grabs` list or even asking for some feedback before you send us a PR. This way, your PR will not be closed as unwanted.
|
||||
|
||||
#### Ownership and copyright
|
||||
|
||||
It is your responsibility to make sure that you're allowed to share the code you're providing us. For example, you should have permission from your employer or customer to share code.
|
||||
It is your responsibility to make sure that you're allowed to share the code you're providing us.
|
||||
For example, you should have permission from your employer or customer to share code.
|
||||
|
||||
Similarly, if your contribution is copied or adapted from somewhere else, make sure that the license allows you to reuse that for a contribution to Umbraco-CMS.
|
||||
|
||||
If you're not sure, leave a note on your contribution and we will be happy to guide you.
|
||||
|
||||
When your contribution has been accepted, it will be [MIT licensed][MIT license] from that time onwards.
|
||||
When your contribution has been accepted, it will be [MIT licensed](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/LICENSE.md) from that time onwards.
|
||||
|
||||
## Finding your first issue: Up for grabs
|
||||
### What can I start with?
|
||||
|
||||
Umbraco HQ will regularly mark newly created issues on the issue tracker with [the `community/up-for-grabs` tag][up for grabs issues]. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
|
||||
Unsure where to begin contributing to Umbraco? You can start by looking through [these `Up for grabs` issues](https://github.com/umbraco/Umbraco-CMS/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs+)
|
||||
|
||||
If you do start working on something, make sure to leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
|
||||
|
||||
## Making your changes
|
||||
### How do I begin?
|
||||
|
||||
Great question! The short version goes like this:
|
||||
|
||||
1. **Fork**
|
||||
* **Fork** - create a fork of [`Umbraco-CMS` on GitHub](https://github.com/umbraco/Umbraco-CMS)
|
||||
|
||||
Create a fork of [`Umbraco-CMS` on GitHub][Umbraco CMS repo]
|
||||
|
||||

|
||||
|
||||
1. **Clone**
|
||||

|
||||
|
||||
When GitHub has created your fork, you can clone it in your favorite Git tool
|
||||
|
||||

|
||||
|
||||
1. **Switch to the correct branch**
|
||||
* **Clone** - when GitHub has created your fork, you can clone it in your favorite Git tool
|
||||
|
||||
Switch to the `v10/contrib` branch
|
||||

|
||||
|
||||
1. **Build**
|
||||
* **Switch to the correct branch** - switch to the `v9/contrib` branch
|
||||
* **Build** - build your fork of Umbraco locally as described in [building Umbraco from source code](BUILD.md)
|
||||
* **Change** - make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback](#questions)
|
||||
* **Commit** - done? Yay! 🎉 **Important:** create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case `12345`. When you have a branch, commit your changes. Don't commit to `v9/contrib`, create a new branch first.
|
||||
* **Push** - great, now you can push the changes up to your fork on GitHub
|
||||
* **Create pull request** - exciting! You're ready to show us your changes (or not quite ready, you just need some feedback to progress - you can now make use of GitHub's draft pull request status, detailed [here](https://github.blog/2019-02-14-introducing-draft-pull-requests/)). GitHub has picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
|
||||
|
||||
Build your fork of Umbraco locally as described in the build documentation: you can [debug with Visual Studio Code][build - debugging with code] or [with Visual Studio][build - debugging with vs].
|
||||

|
||||
|
||||
1. **Branch**
|
||||
### Pull requests
|
||||
The most successful pull requests usually look a like this:
|
||||
|
||||
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `v10/contrib`, create a new branch first.
|
||||
* Fill in the required template (shown when starting a PR on GitHub), and link your pull request to an issue on the [issue tracker,](https://github.com/umbraco/Umbraco-CMS/issues) if applicable.
|
||||
* Include screenshots and animated GIFs in your pull request whenever possible.
|
||||
* Unit tests, while optional, are awesome. Thank you!
|
||||
* New code is commented with documentation from which [the reference documentation](https://our.umbraco.com/documentation/Reference/) is generated.
|
||||
|
||||
1. **Change**
|
||||
Again, these are guidelines, not strict requirements. However, the more information that you give to us, the more we have to work with when considering your contributions. Good documentation of a pull request can really speed up the time it takes to review and merge your work!
|
||||
|
||||
Make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback][questions].
|
||||
## Reviews
|
||||
|
||||
1. **Commit and push**
|
||||
You've sent us your first contribution - congratulations! Now what?
|
||||
|
||||
Done? Yay! 🎉
|
||||
The [pull request team](#the-pr-team) can now start reviewing your proposed changes and give you feedback on them. If it's not perfect, we'll either fix up what we need or we can request that you make some additional changes.
|
||||
|
||||
Remember to commit to your new `temp` branch, and don't commit to `v10/contrib`. Then you can push the changes up to your fork on GitHub.
|
||||
We have [a process in place which you can read all about](REVIEW_PROCESS.md). The very abbreviated version is:
|
||||
|
||||
#### Keeping your Umbraco fork in sync with the main repository
|
||||
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
|
||||
- Your PR will get a reply within 48 hours
|
||||
- An in-depth reply will be added within at most 2 weeks
|
||||
- The PR will be either merged or rejected within at most 4 weeks
|
||||
- Sometimes it is difficult to meet these timelines and we'll talk to you if this is the case.
|
||||
|
||||
Once you've already got a fork and cloned your fork locally, you can skip steps 1 and 2 going forward. Just remember to keep your fork up to date before making further changes.
|
||||
### Styleguides
|
||||
|
||||
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
|
||||
|
||||
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
|
||||
|
||||
### The Core Contributors team
|
||||
|
||||
The Core Contributors team consists of one member of Umbraco HQ, [Sebastiaan](https://github.com/nul800sebastiaan), who gets assistance from the following community members who have comitted to volunteering their free time:
|
||||
|
||||
- [Nathan Woulfe](https://github.com/nathanwoulfe)
|
||||
- [Joe Glombek](https://github.com/glombek)
|
||||
- [Laura Weatherhead](https://github.com/lssweatherhead)
|
||||
- [Michael Latouche](https://github.com/mikecp)
|
||||
- [Owain Williams](https://github.com/OwainWilliams)
|
||||
|
||||
|
||||
These wonderful people aim to provide you with a first reply to your PR, review and test out your changes and on occasions, they might ask more questions. If they are happy with your work, they'll let Umbraco HQ know by approving the PR. Hq will have final sign-off and will check the work again before it is merged.
|
||||
|
||||
### Questions?
|
||||
|
||||
You can get in touch with [the core contributors team](#the-core-contributors-team) in multiple ways; we love open conversations and we are a friendly bunch. No question you have is stupid. Any question you have usually helps out multiple people with the same question. Ask away:
|
||||
|
||||
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward.
|
||||
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.com/forum/contributing-to-umbraco-cms/) forum. The team monitors that one closely, so one of us will be on hand and ready to point you in the right direction.
|
||||
|
||||
## Working with the code
|
||||
|
||||
### Building Umbraco from source code
|
||||
|
||||
In order to build the Umbraco source code locally, first make sure you have the following installed.
|
||||
|
||||
* [Visual Studio 2019 v16.8+ (with .NET Core 3.0)](https://visualstudio.microsoft.com/vs/)
|
||||
* [Node.js v10+](https://nodejs.org/en/download/)
|
||||
* npm v6.4.1+ (installed with Node.js)
|
||||
* [Git command line](https://git-scm.com/download/)
|
||||
|
||||
The easiest way to get started is to open `src\umbraco.sln` in Visual Studio 2019 (version 16.3 or higher, [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). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
|
||||
|
||||
Alternatively, you can run `build.ps1` from the Powershell command line, which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.
|
||||
|
||||

|
||||
|
||||
After this build completes, you should be able to hit `F5` in Visual Studio to build and run the project. A IISExpress webserver will start and the Umbraco installer will pop up in your browser. Follow the directions there to get a working Umbraco install up and running.
|
||||
|
||||
### Working with the source code
|
||||
|
||||
Some parts of our source code are over 10 years old now. And when we say "old", we mean "mature" of course!
|
||||
|
||||
There are two big areas that you should know about:
|
||||
|
||||
1. The Umbraco backoffice is a extensible AngularJS app and requires you to run a `gulp dev` command 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.
|
||||
You may need to run the following commands to set up gulp properly:
|
||||
```
|
||||
npm cache clean --force
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
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 to help you to see the changes you're making.
|
||||
|
||||
2. "The rest" is a C# based codebase, which is mostly ASP.NET MVC based. You can make changes, build them in Visual Studio, and hit `F5` to see the result.
|
||||
|
||||
To find the general areas for something you're looking to fix or improve, have a look at the following two parts of the API documentation.
|
||||
|
||||
* [The AngularJS based backoffice files](https://apidocs.umbraco.com/v9/ui#/api) (to be found in `src\Umbraco.Web.UI.Client\src`)
|
||||
* [The C# application](https://apidocs.umbraco.com/v9/csharp/)
|
||||
|
||||
### Which branch should I target for my contributions?
|
||||
|
||||
We like to use [Gitflow as much as possible](https://jeffkreeftmeijer.com/git-flow/), but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `v9/contrib`. If you are working on v9, this is the branch you should be targetting. For v8 contributions, please target 'v8/contrib'
|
||||
|
||||
Please note: we are no longer accepting features for v7 but will continue to merge bug fixes as and when they arise.
|
||||
|
||||

|
||||
|
||||
### Making changes after the PR is open
|
||||
|
||||
If you make the corrections we ask for in the same branch and push them to your fork again, the pull request automatically updates with the additional commit(s) so we can review it again. If all is well, we'll merge the code and your commits are forever part of Umbraco!
|
||||
|
||||
### Keeping your Umbraco fork in sync with the main repository
|
||||
|
||||
We recommend you to sync with our repository before you submit your pull request. That way, you can fix any potential merge conflicts and make our lives a little bit easier.
|
||||
|
||||
Also, if you have submitted a pull request three weeks ago and want to work on something new, you'll want to get the latest code to build against of course.
|
||||
|
||||
To sync your fork with this original one, you'll have to add the upstream url. You only have to do this once:
|
||||
|
||||
@@ -138,110 +199,13 @@ Then when you want to get the changes from the main repository:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rebase upstream/v10/contrib
|
||||
git rebase upstream/v9/contrib
|
||||
```
|
||||
|
||||
In this command we're syncing with the `v10/contrib` branch, but you can of course choose another one if needed.
|
||||
In this command we're syncing with the `v9/contrib` branch, but you can of course choose another one if needed.
|
||||
|
||||
[More information on how this works can be found on the thoughtbot blog.][sync fork ext]
|
||||
(More info on how this works: [http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated](http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated))
|
||||
|
||||
#### Style guide
|
||||
### And finally
|
||||
|
||||
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
|
||||
|
||||
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
|
||||
|
||||
#### Questions?
|
||||
[questions]: #questions
|
||||
|
||||
You can get in touch with [the core contributors team][core collabs] in multiple ways; we love open conversations and we are a friendly bunch. No question you have is stupid. Any question you have usually helps out multiple people with the same question. Ask away:
|
||||
|
||||
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward.
|
||||
- If you want to ask questions on some code you've already written you can create a draft pull request, [detailed in a GitHub blog post][draft prs].
|
||||
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"][contrib forum] forum. The team monitors that one closely, so one of us will be on hand and ready to point you in the right direction.
|
||||
|
||||
## Creating a pull request
|
||||
|
||||
Exciting! You're ready to show us your changes.
|
||||
|
||||
We recommend you to [sync with our repository][sync fork] before you submit your pull request. That way, you can fix any potential merge conflicts and make our lives a little bit easier.
|
||||
|
||||
GitHub will have picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
|
||||

|
||||
|
||||
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `v10/contrib`. If you are working on v9, this is the branch you should be targeting.
|
||||
|
||||
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
|
||||
|
||||
## The review process
|
||||
[review process]: #the-review-process
|
||||
|
||||
You've sent us your first contribution - congratulations! Now what?
|
||||
|
||||
The [Core Collaborators team][Core collabs] can now start reviewing your proposed changes and give you feedback on them. If it's not perfect, we'll either fix up what we need or we can request that you make some additional changes.
|
||||
|
||||
You will get an initial automated reply from our [Friendly Umbraco Robot, Umbrabot][Umbrabot], to acknowledge that we’ve seen your PR and we’ll pick it up as soon as we can. You can take this opportunity to double check everything is in order based off the handy checklist Umbrabot provides.
|
||||
|
||||
You will get feedback as soon as the [Core Collaborators team][Core collabs] can after opening the PR. You’ll most likely get feedback within a couple of weeks. Then there are a few possible outcomes:
|
||||
|
||||
- Your proposed change is awesome! We merge it in and it will be included in the next minor release of Umbraco
|
||||
- If the change is a high priority bug fix, we will cherry-pick it into the next patch release as well so that we can release it as soon as possible
|
||||
- Your proposed change is awesome but needs a bit more work, we’ll give you feedback on the changes we’d like to see
|
||||
- Your proposed change is awesome but... not something we’re looking to include at this point. We’ll close your PR and the related issue (we’ll be nice about it!). See [making larger changes][making larger changes] and [pull request or package?][pr or package]
|
||||
|
||||
### Dealing with requested changes
|
||||
|
||||
If you make the corrections we ask for in the same branch and push them to your fork again, the pull request automatically updates with the additional commit(s) so we can review it again. If all is well, we'll merge the code and your commits are forever part of Umbraco!
|
||||
|
||||
#### No longer available?
|
||||
|
||||
We understand you have other things to do and can't just drop everything to help us out.
|
||||
|
||||
So if we’re asking for your help to improve the PR we’ll wait for two weeks to give you a fair chance to make changes. We’ll ask for an update if we don’t hear back from you after that time.
|
||||
|
||||
If we don’t hear back from you for 4 weeks, we’ll close the PR so that it doesn’t just hang around forever. You’re very welcome to re-open it once you have some more time to spend on it.
|
||||
|
||||
There will be times that we really like your proposed changes and we’ll finish the final improvements we’d like to see ourselves. You still get the credits and your commits will live on in the git repository.
|
||||
|
||||
### The Core Collaborators team
|
||||
[Core collabs]: #the-core-collaborators-team
|
||||
|
||||
The Core Contributors team consists of one member of Umbraco HQ, [Sebastiaan][Sebastiaan], who gets assistance from the following community members who have committed to volunteering their free time:
|
||||
|
||||
- [Nathan Woulfe][Nathan Woulfe]
|
||||
- [Joe Glombek][Joe Glombek]
|
||||
- [Laura Weatherhead][Laura Weatherhead]
|
||||
- [Michael Latouche][Michael Latouche]
|
||||
- [Owain Williams][Owain Williams]
|
||||
|
||||
|
||||
These wonderful people aim to provide you with a reply to your PR, review and test out your changes and on occasions, they might ask more questions. If they are happy with your work, they'll let Umbraco HQ know by approving the PR. HQ will have final sign-off and will check the work again before it is merged.
|
||||
|
||||
<!-- Reference links for easy updating -->
|
||||
|
||||
<!-- Local -->
|
||||
|
||||
[MIT license]: ../LICENSE.md "Umbraco's license declaration"
|
||||
[build - debugging with vs]: BUILD.md#debugging-with-visual-studio "Details on building and debugging Umbraco with Visual Studio"
|
||||
[build - debugging with code]: BUILD.md#debugging-with-vs-code "Details on building and debugging Umbraco with Visual Studio Code"
|
||||
|
||||
<!-- External -->
|
||||
|
||||
[Nathan Woulfe]: https://github.com/nathanwoulfe "Nathan's GitHub profile"
|
||||
[Joe Glombek]: https://github.com/glombek "Joe's GitHub profile"
|
||||
[Laura Weatherhead]: https://github.com/lssweatherhead "Laura's GitHub profile"
|
||||
[Michael Latouche]: https://github.com/mikecp "Michael's GitHub profile"
|
||||
[Owain Williams]: https://github.com/OwainWilliams "Owain's GitHub profile"
|
||||
[Sebastiaan]: https://github.com/nul800sebastiaan "Senastiaan's GitHub profile"
|
||||
[ Umbrabot ]: https://github.com/umbrabot
|
||||
[git flow]: https://jeffkreeftmeijer.com/git-flow/ "An explanation of git flow"
|
||||
[sync fork ext]: http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated "Details on keeping a git fork updated"
|
||||
[draft prs]: https://github.blog/2019-02-14-introducing-draft-pull-requests/ "Github's blog post providing details on draft pull requests"
|
||||
[contrib forum]: https://our.umbraco.com/forum/contributing-to-umbraco-cms/
|
||||
[get involved]: https://community.umbraco.com/get-involved/
|
||||
[docs repo]: https://github.com/umbraco/UmbracoDocs
|
||||
[code of conduct]: https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md
|
||||
[up for grabs issues]: https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs
|
||||
[Umbraco CMS repo]: https://github.com/umbraco/Umbraco-CMS
|
||||
[issues]: https://github.com/umbraco/Umbraco-CMS/issues
|
||||
[discussions]: https://github.com/umbraco/Umbraco-CMS/discussions
|
||||
We welcome all kinds of contributions to this repository. If you don't feel you'd like to make code changes here, you can visit our [documentation repository](https://github.com/umbraco/UmbracoDocs) and use your experience to contribute to making the docs we have, even better. We also encourage community members to feel free to comment on others' pull requests and issues - the expertise we have is not limited to the Core Contributors and HQ. So, if you see something on the issue tracker or pull requests you feel you can add to, please don't be shy.
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# Contributing to Umbraco CMS
|
||||
|
||||
When you’re considering creating a pull request for Umbraco CMS, we will categorize them in two different sizes, small and large.
|
||||
|
||||
The process for both sizes is very similar, as [explained in the contribution document](CONTRIBUTING.md#how-do-i-begin).
|
||||
|
||||
## Small PRs
|
||||
Bug fixes and small improvements - can be recognized by seeing a small number of changes and possibly a small number of new files.
|
||||
|
||||
We’re usually able to handle small PRs pretty quickly. A community volunteer will do the initial review and flag it for Umbraco HQ as “community tested”. If everything looks good, it will be merged pretty quickly [as per the described process](REVIEW_PROCESS.md).
|
||||
|
||||
### Up for grabs
|
||||
|
||||
Umbraco HQ will regularly mark newly created issues on the issue tracker with the `Up for grabs` tag. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
|
||||
|
||||
If you do start working on something, make sure to leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
|
||||
|
||||
## Large PRs
|
||||
New features and large refactorings - can be recognized by seeing a large number of changes, plenty of new files, updates to package manager files (NuGet’s packages.config, NPM’s packages.json, etc.).
|
||||
|
||||
We would love to follow the same process for larger PRs but this is not always possible due to time limitations and priorities that need to be aligned. We don’t want to put up any barriers, but this document should set the correct expectations.
|
||||
|
||||
Please make sure to describe your idea in an issue, it helps to put in mockup screenshots or videos.
|
||||
|
||||
If the change makes sense for HQ to include in Umbraco CMS we will leave you some feedback on how we’d like to see it being implemented.
|
||||
|
||||
If a larger pull request is encouraged by Umbraco HQ, the process will be similar to what is described in the [small PRs process](#small-prs) above, we strive to feedback within 14 days. Finalizing and merging the PR might take longer though as it will likely need to be picked up by the development team to make sure everything is in order. We’ll keep you posted on the progress.
|
||||
|
||||
It is highly recommended that you speak to the HQ before making large, complex changes.
|
||||
|
||||
### Pull request or package?
|
||||
|
||||
If it doesn’t fit in CMS right now, we will likely encourage you to make it into a package instead. A package is a great way to check out popularity of a feature, learn how people use it, validate good usability and fix bugs.
|
||||
|
||||
Eventually, a package could "graduate" to be included in the CMS.
|
||||
@@ -6,7 +6,7 @@ body:
|
||||
- type: input
|
||||
id: "version"
|
||||
attributes:
|
||||
label: "Which Umbraco version are you using? (Please write the *exact* version, example: 10.1.0)"
|
||||
label: "Which *exact* Umbraco version are you using? For example: 9.0.1 - don't just write v9"
|
||||
description: "Use the help icon in the Umbraco backoffice to find the version you're using"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# New backoffice
|
||||
|
||||
> **Warning**:
|
||||
> This is an early WIP and is set not to be packable since we don't want to release this yet. There will be breaking changes in these projects.
|
||||
|
||||
This solution folder contains the projects for the new backoffice. If you're looking to fix or improve the existing CMS, this is not the place to do it, although we do very much appreciate your efforts.
|
||||
|
||||
### Project structure
|
||||
|
||||
Since the new backoffice API is still very much a work in progress, we've created new projects for the new backoffice API:
|
||||
|
||||
* Umbrao.Cms.ManagementApi - The "presentation layer" for the management API
|
||||
* "New" versions of existing projects, should be merged with the existing projects when the new API is released:
|
||||
* Umbraco.New.Cms.Core
|
||||
* Umbraco.New.Cms.Infrastructure
|
||||
* Umbraco.New.Cms.Web.Common
|
||||
|
||||
This also means that we have to use "InternalsVisibleTo" for the new projects since these should be able to access the internal classes since they will when they get merged.
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
# [Umbraco CMS](https://umbraco.com) · [](../LICENSE.md) [](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [](CONTRIBUTING.md) [](https://twitter.com/intent/follow?screen_name=umbraco) [](https://discord.gg/umbraco)
|
||||
# [Umbraco CMS](https://umbraco.com) · [](../LICENSE.md) [](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [](CONTRIBUTING.md) [](https://twitter.com/intent/follow?screen_name=umbraco)
|
||||
|
||||
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
|
||||
|
||||
@@ -15,7 +15,7 @@ See the official [Umbraco website](https://umbraco.com) for an introduction, cor
|
||||
- [Community](#join-the-umbraco-community)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
Please also see our [Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
|
||||
Please also see our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -25,7 +25,7 @@ If you want to DIY, then you can [download Umbraco]((https://our.umbraco.com/dow
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation for Umbraco CMS can be found [on Our Umbraco](https://docs.umbraco.com/). The source for the Umbraco docs is [open source as well](https://github.com/umbraco/UmbracoDocs) and we're happy to look at your documentation contributions.
|
||||
The documentation for Umbraco CMS can be found [on Our Umbraco](https://our.umbraco.com/documentation/). The source for the Umbraco docs is [open source as well](https://github.com/umbraco/UmbracoDocs) and we're happy to look at your documentation contributions.
|
||||
|
||||
## Join the Umbraco community
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Review process
|
||||
|
||||
You're an awesome person and have sent us your contribution in the form of a pull request! It's now time to relax for a bit and wait for our response.
|
||||
|
||||
In order to set some expectations, here's what happens next.
|
||||
|
||||
## Review process
|
||||
|
||||
You will get an initial reply within 48 hours (workdays) to acknowledge that we’ve seen your PR and we’ll pick it up as soon as we can.
|
||||
|
||||
You will get feedback within at most 14 days after opening the PR. You’ll most likely get feedback sooner though. Then there are a few possible outcomes:
|
||||
|
||||
- Your proposed change is awesome! We merge it in and it will be included in the next minor release of Umbraco
|
||||
- If the change is a high priority bug fix, we will cherry-pick it into the next patch release as well so that we can release it as soon as possible
|
||||
- Your proposed change is awesome but needs a bit more work, we’ll give you feedback on the changes we’d like to see
|
||||
- Your proposed change is awesome but.. not something we’re looking to include at this point. We’ll close your PR and the related issue (we’ll be nice about it!)
|
||||
|
||||
## Are you still available?
|
||||
|
||||
We understand you have other things to do and can't just drop everything to help us out.
|
||||
So if we’re asking for your help to improve the PR we’ll wait for two weeks to give you a fair chance to make changes. We’ll ask for an update if we don’t hear back from you after that time.
|
||||
|
||||
If we don’t hear back from you for 4 weeks, we’ll close the PR so that it doesn’t just hang around forever. You’re very welcome to re-open it once you have some more time to spend on it.
|
||||
|
||||
There will be times that we really like your proposed changes and we’ll finish the final improvements we’d like to see ourselves. You still get the credits and your commits will live on in the git repository.
|
||||
@@ -5,5 +5,4 @@ paths:
|
||||
|
||||
paths-ignore:
|
||||
- '**/node_modules'
|
||||
- 'src/Umbraco.Web.UI/wwwroot'
|
||||
- 'src/Umbraco.Cms.StaticAssets/wwwroot'
|
||||
- 'src/Umbraco.Web.UI/wwwroot'
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z" fill="#57606A"></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 462 B |
@@ -1,58 +0,0 @@
|
||||
name: Add issues to review project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
get-user-type:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
ignored: ${{ steps.set-output.outputs.ignored }}
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install node-fetch@2
|
||||
- uses: actions/github-script@v5
|
||||
name: "Determing HQ user or not"
|
||||
id: set-output
|
||||
with:
|
||||
script: |
|
||||
const fetch = require('node-fetch');
|
||||
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/users/IsIgnoredUser', {
|
||||
method: 'post',
|
||||
body: JSON.stringify('${{ github.event.issue.user.login }}'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
var isIgnoredUser = true;
|
||||
try {
|
||||
if(response.status === 200) {
|
||||
const data = await response.text();
|
||||
isIgnoredUser = data === "true";
|
||||
} else {
|
||||
console.log("Returned data not indicate success:", response.status);
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
};
|
||||
core.setOutput("ignored", isIgnoredUser);
|
||||
console.log("Ignored is", isIgnoredUser);
|
||||
add-to-project:
|
||||
permissions:
|
||||
repository-projects: write # for actions/add-to-project
|
||||
if: needs.get-user-type.outputs.ignored == 'false'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get-user-type]
|
||||
steps:
|
||||
- uses: actions/add-to-project@main
|
||||
with:
|
||||
project-url: https://github.com/orgs/${{ github.repository_owner }}/projects/21
|
||||
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
|
||||
@@ -2,59 +2,28 @@ name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*/dev'
|
||||
- '*/contrib'
|
||||
branches: ['*/dev','*/contrib']
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches:
|
||||
- '*/dev'
|
||||
- '*/contrib'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
dotnetVersion: 6.x
|
||||
dotnetIncludePreviewVersions: false
|
||||
solution: umbraco.sln
|
||||
buildConfiguration: SkipTests
|
||||
DOTNET_NOLOGO: true
|
||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||
branches: ['*/dev','*/contrib']
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/analyze to upload SARIF results
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
config-file: ./.github/config/codeql-config.yml
|
||||
|
||||
- name: Use .NET ${{ env.dotnetVersion }}
|
||||
uses: actions/setup-dotnet@v2
|
||||
with:
|
||||
dotnet-version: ${{ env.dotnetVersion }}
|
||||
include-prerelease: ${{ env.dotnetIncludePreviewVersions }}
|
||||
|
||||
- name: Run dotnet restore
|
||||
run: dotnet restore ${{ env.solution }}
|
||||
|
||||
- name: Run dotnet build
|
||||
run: dotnet build ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-restore -p:ContinuousIntegrationBuild=true
|
||||
- name: dotnet build
|
||||
run: dotnet build umbraco-netcore-only.sln
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
name: issue-first-response
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
send-response:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install node-fetch@2
|
||||
- name: Fetch random comment 🗣️ and add it to the issue
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fetch = require('node-fetch')
|
||||
|
||||
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
|
||||
method: 'post',
|
||||
body: JSON.stringify({
|
||||
repo: '${{ github.repository }}',
|
||||
number: '${{ github.event.number }}',
|
||||
actor: '${{ github.actor }}',
|
||||
commentType: 'opened-issue-first-comment'
|
||||
}),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const data = await response.text();
|
||||
|
||||
if(response.status === 200 && data !== '') {
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: data
|
||||
});
|
||||
} else {
|
||||
console.log("Status code did not indicate success:", response.status);
|
||||
console.log("Returned data:", data);
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
name: pr-first-response
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
send-response:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Fetch random comment 🗣️ and add it to the PR
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
|
||||
method: 'post',
|
||||
body: JSON.stringify({
|
||||
repo: '${{ github.repository }}',
|
||||
number: '${{ github.event.number }}',
|
||||
actor: '${{ github.actor }}',
|
||||
commentType: 'opened-pr-first-comment'
|
||||
}),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const data = await response.text();
|
||||
|
||||
if(response.status === 200 && data !== '') {
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: data
|
||||
});
|
||||
} else {
|
||||
console.log("Returned data not indicate success.");
|
||||
|
||||
if(response.status !== 200) {
|
||||
console.log("Status code:", response.status)
|
||||
}
|
||||
|
||||
console.log("Returned data:", data);
|
||||
|
||||
if(data === '') {
|
||||
console.log("An empty response usually indicates that either no comment was found or the actor user was not eligible for getting an automated response (HQ users are not getting auto-responses).")
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
name: labeled-up-for-grabs-first-comment
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
send-response:
|
||||
if: github.event.label.name == 'community/up-for-grabs'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install node-fetch@2
|
||||
- name: Fetch comment 🗣️ and add it to the issue
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fetch = require('node-fetch');
|
||||
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
|
||||
method: 'post',
|
||||
body: JSON.stringify({
|
||||
repo: '${{ github.repository }}',
|
||||
number: '${{ github.event.issue.number }}',
|
||||
actor: '${{ github.event.issue.user.login }}',
|
||||
commentType: 'labeled-up-for-grabs-first-comment'
|
||||
}),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const data = await response.text();
|
||||
|
||||
if(response.status === 200 && data !== '') {
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: data
|
||||
});
|
||||
} else {
|
||||
console.log("Returned data not indicate success.");
|
||||
|
||||
if(response.status !== 200) {
|
||||
console.log("Status code:", response.status)
|
||||
}
|
||||
|
||||
console.log("Returned data:", data);
|
||||
|
||||
if(data === '') {
|
||||
console.log("An empty response usually indicates that either no comment was found or the actor user was not eligible for getting an automated response (HQ users are not getting auto-responses).")
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
};
|
||||
+44
-47
@@ -37,70 +37,67 @@ _NCrunch_*/
|
||||
tools/NDepend/
|
||||
[Tt]est[Rr]esult*
|
||||
[Bb]uild[Ll]og.*
|
||||
[Ss]ource
|
||||
[Ss]andbox
|
||||
[sS]ource
|
||||
[sS]andbox
|
||||
node_modules
|
||||
lib-bower
|
||||
*.psess
|
||||
*.vspx
|
||||
NDependOut/
|
||||
NDependOut/*
|
||||
QueryResult.htm
|
||||
tools/docfx/
|
||||
tools/docfx/*
|
||||
|
||||
# Ignore rule for clearing out Belle (avoid rebuilding all the time)
|
||||
preserve.belle
|
||||
|
||||
# Ignore rule for output of generated documentation files from grunt docserve
|
||||
/src/Umbraco.Web.UI.Docs/api/
|
||||
/src/Umbraco.Web.UI.Docs/package-lock.json
|
||||
|
||||
# csharp-docs
|
||||
/build/csharp-docs/api/
|
||||
/build/csharp-docs/_site/
|
||||
src/Umbraco.Web.UI.Docs/api
|
||||
src/Umbraco.Web.UI.Docs/package-lock.json
|
||||
|
||||
# Build
|
||||
/build.out/
|
||||
/build.tmp/
|
||||
/build/hooks/
|
||||
/build/temp/
|
||||
build.out/
|
||||
build.tmp/
|
||||
build/hooks/
|
||||
build/temp/
|
||||
|
||||
# Build output
|
||||
/build/docs.zip
|
||||
/build/ui-docs.zip
|
||||
/build/csharp-docs.zip
|
||||
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/
|
||||
build/docs.zip
|
||||
build/ui-docs.zip
|
||||
build/csharp-docs.zip
|
||||
build/ApiDocs/*
|
||||
build/ApiDocs/Output/*
|
||||
src/ApiDocs/api/*
|
||||
|
||||
# Environment specific data
|
||||
/src/Umbraco.Web.UI.Client/[Bb]uild/
|
||||
/src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
|
||||
/src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
|
||||
/src/Umbraco.Web.UI.Client/TESTS-*.xml
|
||||
/src/Umbraco.Web.UI/wwwroot/[Mm]edia/
|
||||
/src/Umbraco.Web.UI/App_Code/
|
||||
/src/Umbraco.Web.UI/App_Plugins/
|
||||
/src/Umbraco.Web.UI/[Uu]mbraco/[Dd]ata/
|
||||
/src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ogs/
|
||||
/src/Umbraco.Web.UI/[Uu]mbraco/[Mm]odels/
|
||||
/src/Umbraco.Web.UI/Views/
|
||||
!/src/Umbraco.Web.UI/Views/Partials/blocklist/
|
||||
!/src/Umbraco.Web.UI/Views/Partials/grid/
|
||||
!/src/Umbraco.Web.UI/Views/_ViewImports.cshtml
|
||||
/src/Umbraco.Web.UI/appsettings.json
|
||||
/src/Umbraco.Web.UI/appsettings.Development.json
|
||||
/src/Umbraco.Web.UI/appsettings.Local.json
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/*
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
|
||||
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
|
||||
src/Umbraco.Web.UI.Client/TESTS-*.xml
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Dd]ata/*
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ogs
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Mm]odels/*
|
||||
src/Umbraco.Web.UI/appsettings.Development.json
|
||||
src/Umbraco.Web.UI/appsettings.json
|
||||
src/Umbraco.Web.UI/appsettings.Local.json
|
||||
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/assets/*
|
||||
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/js/*
|
||||
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/lib/*
|
||||
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/views/*
|
||||
src/Umbraco.Web.UI/wwwroot/Media/*
|
||||
src/Umbraco.Web.UI/Smidge/
|
||||
|
||||
# Tests
|
||||
/tests/Umbraco.Tests.AcceptanceTest/.env
|
||||
/tests/Umbraco.Tests.Integration.SqlCe/DatabaseContextTests.sdf
|
||||
/tests/Umbraco.Tests.Integration.SqlCe/[Uu]mbraco/[Dd]ata/TEMP/
|
||||
/tests/Umbraco.Tests.Integration/appsettings.Tests.Local.json
|
||||
/tests/Umbraco.Tests.Integration/TEMP/
|
||||
/tests/Umbraco.Tests.Integration/[Uu]mbraco/[Dd]ata/
|
||||
/tests/Umbraco.Tests.Integration/[Uu]mbraco/[Ll]ogs/
|
||||
/tests/Umbraco.Tests.Integration/Views/
|
||||
/tests/Umbraco.Tests.UnitTests/[Uu]mbraco/[Dd]ata/TEMP/
|
||||
cypress.env.json
|
||||
tests/Umbraco.Tests.AcceptanceTest/cypress/screenshots/
|
||||
tests/Umbraco.Tests.AcceptanceTest/cypress/support/chainable.ts
|
||||
tests/Umbraco.Tests.AcceptanceTest/cypress/videos/
|
||||
tests/Umbraco.Tests.Integration.SqlCe/DatabaseContextTests.sdf
|
||||
tests/Umbraco.Tests.Integration.SqlCe/umbraco/Data/TEMP/
|
||||
tests/Umbraco.Tests.Integration/TEMP/*
|
||||
tests/Umbraco.Tests.Integration/umbraco/Data/
|
||||
tests/Umbraco.Tests.Integration/umbraco/logs/
|
||||
tests/Umbraco.Tests.Integration/Views/
|
||||
tests/Umbraco.Tests.UnitTests/umbraco/Data/TEMP/
|
||||
|
||||
# Ignore auto-generated schema
|
||||
/src/Umbraco.Cms/appsettings-schema.json
|
||||
/src/Umbraco.Web.UI/appsettings-schema.json
|
||||
/tests/Umbraco.Tests.Integration/appsettings-schema.json
|
||||
src/Umbraco.Web.UI/umbraco/config/appsettings-schema.json
|
||||
|
||||
+2
-3
@@ -50,7 +50,6 @@ dotnet_analyzer_diagnostic.category-StyleCop.CSharp.LayoutRules.severity = sugge
|
||||
|
||||
dotnet_diagnostic.SA1636.severity = none # SA1636: File header copyright text should match
|
||||
dotnet_diagnostic.SA1101.severity = none # PrefixLocalCallsWithThis - stylecop appears to be ignoring dotnet_style_qualification_for_*
|
||||
dotnet_diagnostic.SA1309.severity = none # FieldNamesMustNotBeginWithUnderscore
|
||||
|
||||
dotnet_diagnostic.SA1503.severity = warning # BracesMustNotBeOmitted
|
||||
dotnet_diagnostic.SA1117.severity = warning # ParametersMustBeOnSameLineOrSeparateLines
|
||||
@@ -71,8 +70,8 @@ dotnet_diagnostic.SA1132.severity = warning # DoNotCombineFields
|
||||
dotnet_diagnostic.SA1134.severity = warning # AttributesMustNotShareLine
|
||||
dotnet_diagnostic.SA1106.severity = warning # CodeMustNotContainEmptyStatements
|
||||
dotnet_diagnostic.SA1312.severity = warning # VariableNamesMustBeginWithLowerCaseLetter
|
||||
dotnet_diagnostic.SA1310.severity = warning # FieldNamesMustNotContainUnderscore
|
||||
dotnet_diagnostic.SA1303.severity = warning # ConstFieldNamesMustBeginWithUpperCaseLetter
|
||||
dotnet_diagnostic.SA1310.severity = warning # FieldNamesMustNotContainUnderscore
|
||||
dotnet_diagnostic.SA1130.severity = warning # UseLambdaSyntax
|
||||
dotnet_diagnostic.SA1405.severity = warning # DebugAssertMustProvideMessageText
|
||||
dotnet_diagnostic.SA1205.severity = warning # PartialElementsMustDeclareAccess
|
||||
@@ -80,4 +79,4 @@ dotnet_diagnostic.SA1306.severity = warning # FieldNamesMustBeginWithLowerCaseLe
|
||||
dotnet_diagnostic.SA1209.severity = warning # UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives
|
||||
dotnet_diagnostic.SA1216.severity = warning # UsingStaticDirectivesMustBePlacedAtTheCorrectLocation
|
||||
dotnet_diagnostic.SA1133.severity = warning # DoNotCombineAttributes
|
||||
dotnet_diagnostic.SA1135.severity = warning # UsingDirectivesMustBeQualified
|
||||
dotnet_diagnostic.SA1135.severity = warning # UsingDirectivesMustBeQualified
|
||||
|
||||
Vendored
+3
-2
@@ -9,8 +9,9 @@
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "Dotnet build",
|
||||
"program": "dotnet",
|
||||
"args": ["run"],
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/src/Umbraco.Web.UI/bin/Debug/net5.0/Umbraco.Web.UI.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/Umbraco.Web.UI",
|
||||
"stopAtEntry": false,
|
||||
"requireExactSource": false,
|
||||
|
||||
Vendored
+1
-14
@@ -33,18 +33,6 @@
|
||||
"$gulp-tsc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Client Watch",
|
||||
"detail": "runs npm run dev for Umbraco.Web.UI.Client",
|
||||
"promptOnClose": true,
|
||||
"group": "build",
|
||||
"type": "npm",
|
||||
"script": "dev",
|
||||
"path": "src/Umbraco.Web.UI.Client/",
|
||||
"problemMatcher": [
|
||||
"$gulp-tsc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Dotnet build",
|
||||
"detail": "Dotnet build of SLN",
|
||||
@@ -54,7 +42,7 @@
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/umbraco.sln",
|
||||
"${workspaceFolder}/src/umbraco-netcore-only.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
@@ -69,7 +57,6 @@
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
|
||||
+4
-50
@@ -1,53 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Company>Umbraco HQ</Company>
|
||||
<Authors>Umbraco</Authors>
|
||||
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
|
||||
<Product>Umbraco CMS</Product>
|
||||
<PackageProjectUrl>https://umbraco.com/</PackageProjectUrl>
|
||||
<PackageIconUrl>https://umbraco.com/dist/nuget/logo-small.png</PackageIconUrl>
|
||||
<PackageIcon>icon.png</PackageIcon>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageTags>umbraco</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Nullable>enable</Nullable>
|
||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- SourceLink -->
|
||||
<PropertyGroup>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Package Validation -->
|
||||
<PropertyGroup>
|
||||
<EnablePackageValidation>true</EnablePackageValidation>
|
||||
<PackageValidationBaselineVersion>10.0.0</PackageValidationBaselineVersion>
|
||||
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
|
||||
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
<PackageReference Include="Umbraco.Code" Version="2.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildThisFileDirectory)icon.png" Pack="true" PackagePath="" Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Package references and additional files which are consumed by all projects -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="4.1.0">
|
||||
<id>Umbraco.Cms.SqlCe</id>
|
||||
<version>9.0.0</version>
|
||||
<title>Umbraco Cms Sql Ce Add-on</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://umbraco.com/</projectUrl>
|
||||
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the SQL CE assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project.</description>
|
||||
<summary>Contains the SQL CE assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
|
||||
<dependencies>
|
||||
|
||||
<group targetFramework="netstandard2.0">
|
||||
<!--
|
||||
note: dependencies are specified as [x.y.z,x.999999) eg [2.1.0,2.999999) and NOT [2.1.0,3.0.0) because
|
||||
the latter would pick anything below 3.0.0 and that includes prereleases such as 3.0.0-alpha, and we do
|
||||
not want this to happen as the alpha of the next major is, really, the next major already.
|
||||
-->
|
||||
<dependency id="Umbraco.Cms.Core" version="[$version$]" />
|
||||
<dependency id="Umbraco.SqlServerCE" version="[4.0.0.1,4.999999)" /> <!-- Hack it is only available in framework, but we need it on netstandard -->
|
||||
</group>
|
||||
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- libs -->
|
||||
<file src="$BuildTmp$\SqlCe\Umbraco.Persistence.SqlCe.dll" target="lib\netstandard2.0\Umbraco.Persistence.SqlCe.dll" />
|
||||
<file src="$BuildTmp$\SqlCe\System.Data.SqlServerCe.dll" target="lib\netstandard2.0\System.Data.SqlServerCe.dll" /> <!-- Hack because the file from the package is only added to net472 projects -->
|
||||
|
||||
<!-- docs -->
|
||||
<file src="$BuildTmp$\SqlCe\Umbraco.Persistence.SqlCe.xml" target="lib\netstandard2.0\Umbraco.Persistence.SqlCe.xml" />
|
||||
|
||||
<!-- symbols -->
|
||||
<file src="$BuildTmp$\SqlCe\Umbraco.Persistence.SqlCe.pdb" target="lib\netstandard2.0\Umbraco.Persistence.SqlCe.pdb" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="4.1.0">
|
||||
<id>Umbraco.Cms.StaticAssets</id>
|
||||
<version>9.0.0</version>
|
||||
<title>Umbraco Cms Static Assets</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://umbraco.com/</projectUrl>
|
||||
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the static assets that is required to run Umbraco CMS.</description>
|
||||
<summary>Contains the static assets that is required to run Umbraco CMS.</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- Content -->
|
||||
<file src="$BuildTmp$\WebApp\wwwroot\umbraco\**\*.*" target="content\wwwroot\umbraco" />
|
||||
<file src="$BuildTmp$\WebApp\umbraco\**\*.*" target="content\umbraco" />
|
||||
|
||||
<!-- UmbracoCms props and targets used to copy the content into the solution -->
|
||||
<file src="buildTransitive\**" target="buildTransitive\" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="4.1.0">
|
||||
<id>Umbraco.Cms</id>
|
||||
<version>9.0.0</version>
|
||||
<title>Umbraco Cms</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://umbraco.com/</projectUrl>
|
||||
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Installs Umbraco Cms in your Visual Studio ASP.NET Core project</description>
|
||||
<summary>Installs Umbraco Cms in your Visual Studio ASP.NET Core project</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
|
||||
<dependencies>
|
||||
<group targetFramework="net5.0">
|
||||
<dependency id="Umbraco.Cms.Web.Website" version="[$version$]" />
|
||||
<dependency id="Umbraco.Cms.Web.BackOffice" version="[$version$]" />
|
||||
<dependency id="Umbraco.Cms.StaticAssets" version="[$version$]" />
|
||||
</group>
|
||||
</dependencies>
|
||||
<!--
|
||||
We can't use content files, as the files need to be copied into the solution, links/shortcuts to the files
|
||||
are not good enough
|
||||
-->
|
||||
<contentFiles />
|
||||
</metadata>
|
||||
<files>
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\is-cache\**;wwwroot\ms-cache\**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,99 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<ContentFilesPath>$(MSBuildThisFileDirectory)..\content\umbraco\**\*.*</ContentFilesPath>
|
||||
<ContentWwwrootFilesPath>$(MSBuildThisFileDirectory)..\content\wwwroot\umbraco\**\*.*</ContentWwwrootFilesPath>
|
||||
<UmbracoWwwrootName Condition="'$(UmbracoWwwrootName)' == ''">umbraco</UmbracoWwwrootName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Data\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\mediacache\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**;</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CopyUmbracoAssets" BeforeTargets="BeforeBuild">
|
||||
<ItemGroup>
|
||||
<ContentFiles Include="$(ContentFilesPath)" />
|
||||
<ContentWwwrootFiles Include="$(ContentWwwrootFilesPath)" />
|
||||
</ItemGroup>
|
||||
<Message Text="Copying Umbraco content files: $(ContentFilesPath) - #@(ContentFiles->Count()) files" Importance="high" />
|
||||
<Message Text="Copying Umbraco wwwroot content files: $(ContentWwwrootFilesPath) - #@(ContentWwwrootFiles->Count()) files" Importance="high" />
|
||||
<Copy
|
||||
SourceFiles="@(ContentFiles)"
|
||||
DestinationFiles="@(ContentFiles->'$(MSBuildProjectDirectory)\umbraco\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
<Copy
|
||||
SourceFiles="@(ContentWwwrootFiles)"
|
||||
DestinationFiles="@(ContentWwwrootFiles->'$(MSBuildProjectDirectory)\wwwroot\$(UmbracoWwwrootName)\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="IncludeAppPluginsContent" BeforeTargets="GetCopyToOutputDirectoryItems;GetCopyToPublishDirectoryItems;">
|
||||
<ItemGroup>
|
||||
<_AppPluginsFiles Include="App_Plugins\**" />
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_AppPluginsFiles)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="PreserveNewest"
|
||||
CopyToPublishDirectory="PreserveNewest"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
The set of files to publish is generated really early and doesn't currently account for files added by targets e.g. BeforeBuild.
|
||||
A fix was put in place in Web SDK to update for wwwwroot in case someone runs npm build etc in a target, we're borrowing their trick.
|
||||
https://github.com/dotnet/sdk/blob/e2b2b1a4ac56c955b84d62fe71cda3b6f258b42b/src/WebSdk/Publish/Targets/ComputeTargets/Microsoft.NET.Sdk.Publish.ComputeFiles.targets
|
||||
-->
|
||||
<Target Name="IncludeUmbracoFolderContent" BeforeTargets="GetCopyToOutputDirectoryItems;GetCopyToPublishDirectoryItems;">
|
||||
<ItemGroup>
|
||||
<_UmbracoFolderFiles Include="umbraco\config\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\PartialViewMacros\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoBackOffice\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoInstall\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\Licenses\**" />
|
||||
|
||||
<!-- This could be handled in deploy if it's not already -->
|
||||
<_UmbracoFolderFiles Include="umbraco\Deploy\**" />
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_UmbracoFolderFiles)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="PreserveNewest"
|
||||
CopyToPublishDirectory="PreserveNewest"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
<Target Name="ClearUmbracoAssets" BeforeTargets="Clean">
|
||||
<ItemGroup>
|
||||
<UmbracoConfigPackageDir Include="$(MSBuildProjectDirectory)\umbraco\config\" />
|
||||
<UmbracoPartialViewMacrosPackageDir Include="$(MSBuildProjectDirectory)\umbraco\PartialViewMacros\" />
|
||||
<UmbracoUmbracoBackOfficeMacrosDir Include="$(MSBuildProjectDirectory)\umbraco\UmbracoBackOffice\" />
|
||||
<UmbracoUmbracoInstallDir Include="$(MSBuildProjectDirectory)\umbraco\UmbracoInstall\" />
|
||||
<UmbracoUmbracoWebsiteMacrosDir Include="$(MSBuildProjectDirectory)\umbraco\UmbracoWebsite\" />
|
||||
<WwwrootUmbracoPackageDir Include="$(MSBuildProjectDirectory)\wwwroot\$(UmbracoWwwrootName)\" />
|
||||
</ItemGroup>
|
||||
<Message Text="Clear old umbraco data" Importance="high" />
|
||||
<RemoveDir Directories="@(UmbracoConfigPackageDir)" />
|
||||
<RemoveDir Directories="@(UmbracoPartialViewMacrosPackageDir)" />
|
||||
<RemoveDir Directories="@(UmbracoUmbracoBackOfficeMacrosDir)" />
|
||||
<RemoveDir Directories="@(UmbracoUmbracoInstallDir)" />
|
||||
<RemoveDir Directories="@(UmbracoUmbracoWebsiteMacrosDir)" />
|
||||
<RemoveDir Directories="@(WwwrootUmbracoPackageDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="IncludeUmbracoRazorFiles" BeforeTargets="ResolveRazorGenerateInputs">
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
+583
-626
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
|
||||
# this script should be dot-sourced into the build.ps1 scripts
|
||||
# right after the parameters declaration
|
||||
# ie
|
||||
# . "$PSScriptRoot\build-bootstrap.ps1"
|
||||
|
||||
# THIS FILE IS DISTRIBUTED AS PART OF UMBRACO.BUILD
|
||||
# DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION
|
||||
|
||||
# ################################################################
|
||||
# BOOTSTRAP
|
||||
# ################################################################
|
||||
|
||||
# reset errors
|
||||
$error.Clear()
|
||||
|
||||
# ensure we have temp folder for downloads
|
||||
$scriptRoot = "$PSScriptRoot"
|
||||
$scriptTemp = "$scriptRoot\temp"
|
||||
if (-not (test-path $scriptTemp)) { mkdir $scriptTemp > $null }
|
||||
|
||||
# get NuGet
|
||||
$cache = 4
|
||||
$nuget = "$scriptTemp\nuget.exe"
|
||||
# ensure the correct NuGet-source is used. This one is used by Umbraco
|
||||
$nugetsourceUmbraco = "https://www.myget.org/F/umbracoprereleases/api/v3/index.json"
|
||||
if (-not $local)
|
||||
{
|
||||
$source = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
|
||||
if ((test-path $nuget) -and ((ls $nuget).CreationTime -lt [DateTime]::Now.AddDays(-$cache)))
|
||||
{
|
||||
Remove-Item $nuget -force -errorAction SilentlyContinue > $null
|
||||
}
|
||||
if (-not (test-path $nuget))
|
||||
{
|
||||
Write-Host "Download NuGet..."
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Invoke-WebRequest $source -OutFile $nuget
|
||||
if (-not $?) { throw "Failed to download NuGet." }
|
||||
}
|
||||
}
|
||||
elseif (-not (test-path $nuget))
|
||||
{
|
||||
throw "Failed to locate NuGet.exe."
|
||||
}
|
||||
|
||||
# NuGet notes
|
||||
# As soon as we use -ConfigFile, NuGet uses that file, and only that file, and does not
|
||||
# merge configuration from system level. See comments in NuGet.Client solution, class
|
||||
# NuGet.Configuration.Settings, method LoadDefaultSettings.
|
||||
# For NuGet to merge configurations, it needs to "find" the file in the current directory,
|
||||
# or above. Which means we cannot really use -ConfigFile but instead have to have Umbraco's
|
||||
# NuGet.config file at root, and always run NuGet.exe while at root or in a directory below
|
||||
# root.
|
||||
|
||||
$solutionRoot = "$scriptRoot\.."
|
||||
$testPwd = [System.IO.Path]::GetFullPath($pwd.Path) + "\"
|
||||
$testRoot = [System.IO.Path]::GetFullPath($solutionRoot) + "\"
|
||||
if (-not $testPwd.ToLower().StartsWith($testRoot.ToLower()))
|
||||
{
|
||||
throw "Cannot run outside of the solution's root."
|
||||
}
|
||||
|
||||
# get the build system
|
||||
if (-not $local)
|
||||
{
|
||||
$params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease", "-Source", $nugetsourceUmbraco
|
||||
&$nuget install Umbraco.Build @params
|
||||
if (-not $?) { throw "Failed to download Umbraco.Build." }
|
||||
}
|
||||
|
||||
# ensure we have the build system
|
||||
$ubuildPath = ls "$scriptTemp\Umbraco.Build.*" | sort -property CreationTime -descending | select -first 1
|
||||
if (-not $ubuildPath)
|
||||
{
|
||||
throw "Failed to locate the build system."
|
||||
}
|
||||
|
||||
# boot the build system
|
||||
# this creates $global:ubuild
|
||||
return &"$ubuildPath\ps\Boot.ps1"
|
||||
|
||||
# at that point the build.ps1 script must boot the build system
|
||||
# eg
|
||||
# $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."),
|
||||
# @{ Local = $local; With7Zip = $false; WithNode = $false },
|
||||
# @{ continue = $continue })
|
||||
# if (-not $?) { throw "Failed to boot the build system." }
|
||||
#
|
||||
# and it's good practice to report
|
||||
# eg
|
||||
# Write-Host "Umbraco.Whatever Build"
|
||||
# Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
|
||||
|
||||
# eof
|
||||
+559
@@ -0,0 +1,559 @@
|
||||
|
||||
param (
|
||||
# get, don't execute
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Alias("g")]
|
||||
[switch] $get = $false,
|
||||
|
||||
# run local, don't download, assume everything is ready
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Alias("l")]
|
||||
[Alias("loc")]
|
||||
[switch] $local = $false,
|
||||
|
||||
# enable docfx
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Alias("doc")]
|
||||
[switch] $docfx = $false,
|
||||
|
||||
# keep the build directories, don't clear them
|
||||
[Parameter(Mandatory=$false)]
|
||||
[Alias("c")]
|
||||
[Alias("cont")]
|
||||
[switch] $continue = $false,
|
||||
|
||||
# execute a command
|
||||
[Parameter(Mandatory=$false, ValueFromRemainingArguments=$true)]
|
||||
[String[]]
|
||||
$command
|
||||
)
|
||||
|
||||
# ################################################################
|
||||
# BOOTSTRAP
|
||||
# ################################################################
|
||||
|
||||
# create and boot the buildsystem
|
||||
$ubuild = &"$PSScriptRoot\build-bootstrap.ps1"
|
||||
if (-not $?) { return }
|
||||
$ubuild.Boot($PSScriptRoot,
|
||||
@{ Local = $local; WithDocFx = $docfx },
|
||||
@{ Continue = $continue })
|
||||
if ($ubuild.OnError()) { return }
|
||||
|
||||
Write-Host "Umbraco Cms Build"
|
||||
Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
|
||||
|
||||
# ################################################################
|
||||
# TASKS
|
||||
# ################################################################
|
||||
|
||||
$ubuild.DefineMethod("SetMoreUmbracoVersion",
|
||||
{
|
||||
param ( $semver )
|
||||
|
||||
$port = "" + $semver.Major + $semver.Minor + ("" + $semver.Patch).PadLeft(2, '0')
|
||||
Write-Host "Update port in launchSettings.json to $port"
|
||||
$filePath = "$($this.SolutionRoot)\src\Umbraco.Web.UI\Properties\launchSettings.json"
|
||||
$this.ReplaceFileText($filePath, `
|
||||
"http://localhost:(\d+)?", `
|
||||
"http://localhost:$port")
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("SandboxNode",
|
||||
{
|
||||
$global:node_path = $env:path
|
||||
$nodePath = $this.BuildEnv.NodePath
|
||||
$gitExe = (Get-Command git).Source
|
||||
if (-not $gitExe) { $gitExe = (Get-Command git).Path }
|
||||
$gitPath = [System.IO.Path]::GetDirectoryName($gitExe)
|
||||
$env:path = "$nodePath;$gitPath"
|
||||
|
||||
$global:node_nodepath = $this.ClearEnvVar("NODEPATH")
|
||||
$global:node_npmcache = $this.ClearEnvVar("NPM_CONFIG_CACHE")
|
||||
$global:node_npmprefix = $this.ClearEnvVar("NPM_CONFIG_PREFIX")
|
||||
|
||||
# https://github.com/gruntjs/grunt-contrib-connect/issues/235
|
||||
$this.SetEnvVar("NODE_NO_HTTP2", "1")
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("RestoreNode",
|
||||
{
|
||||
$env:path = $node_path
|
||||
|
||||
$this.SetEnvVar("NODEPATH", $node_nodepath)
|
||||
$this.SetEnvVar("NPM_CONFIG_CACHE", $node_npmcache)
|
||||
$this.SetEnvVar("NPM_CONFIG_PREFIX", $node_npmprefix)
|
||||
|
||||
$ignore = $this.ClearEnvVar("NODE_NO_HTTP2")
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("CompileBelle",
|
||||
{
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$log = "$($this.BuildTemp)\belle.log"
|
||||
|
||||
|
||||
Write-Host "Compile Belle"
|
||||
Write-Host "Logging to $log"
|
||||
|
||||
# get a temp clean node env (will restore)
|
||||
$this.SandboxNode()
|
||||
|
||||
# stupid PS is going to gather all "warnings" in $error
|
||||
# so we have to take care of it else they'll bubble and kill the build
|
||||
if ($error.Count -gt 0) { return }
|
||||
|
||||
try {
|
||||
Push-Location "$($this.SolutionRoot)\src\Umbraco.Web.UI.Client"
|
||||
Write-Output "" > $log
|
||||
|
||||
Write-Output "### node version is:" > $log
|
||||
node -v >> $log 2>&1
|
||||
if (-not $?) { throw "Failed to report node version." }
|
||||
|
||||
Write-Output "### npm version is:" >> $log 2>&1
|
||||
npm -v >> $log 2>&1
|
||||
if (-not $?) { throw "Failed to report npm version." }
|
||||
|
||||
Write-Output "### clean npm cache" >> $log 2>&1
|
||||
npm cache clean --force >> $log 2>&1
|
||||
$error.Clear() # that one can fail 'cos security bug - ignore
|
||||
|
||||
Write-Output "### npm ci" >> $log 2>&1
|
||||
npm ci >> $log 2>&1
|
||||
Write-Output ">> $? $($error.Count)" >> $log 2>&1
|
||||
# Don't really care about the messages from npm ci making us think there are errors
|
||||
$error.Clear()
|
||||
|
||||
Write-Output "### gulp build for version $($this.Version.Release)" >> $log 2>&1
|
||||
npm run build --buildversion=$this.Version.Release >> $log 2>&1
|
||||
|
||||
# We can ignore this warning, we need to update to node 12 at some point - https://github.com/jsdom/jsdom/issues/2939
|
||||
$indexes = [System.Collections.ArrayList]::new()
|
||||
$index = 0;
|
||||
$error | ForEach-Object {
|
||||
# Find which of the errors is the ExperimentalWarning
|
||||
if($_.ToString().Contains("ExperimentalWarning: The fs.promises API is experimental")) {
|
||||
[void]$indexes.Add($index)
|
||||
}
|
||||
$index++
|
||||
}
|
||||
$indexes | ForEach-Object {
|
||||
# Loop through the list of indexes and remove the errors that we expect and feel confident we can ignore
|
||||
$error.Remove($error[$_])
|
||||
}
|
||||
|
||||
if (-not $?) { throw "Failed to build" } # that one is expected to work
|
||||
} finally {
|
||||
Pop-Location
|
||||
|
||||
# FIXME: should we filter the log to find errors?
|
||||
#get-content .\build.tmp\belle.log | %{ if ($_ -match "build") { write $_}}
|
||||
|
||||
# restore
|
||||
$this.RestoreNode()
|
||||
}
|
||||
|
||||
# setting node_modules folder to hidden
|
||||
# used to prevent VS13 from crashing on it while loading the websites project
|
||||
# also makes sure aspnet compiler does not try to handle rogue files and chokes
|
||||
# in VSO with Microsoft.VisualC.CppCodeProvider -related errors
|
||||
# use get-item -force 'cos it might be hidden already
|
||||
Write-Host "Set hidden attribute on node_modules"
|
||||
$dir = Get-Item -force "$src\Umbraco.Web.UI.Client\node_modules"
|
||||
$dir.Attributes = $dir.Attributes -bor ([System.IO.FileAttributes]::Hidden)
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("CompileUmbraco",
|
||||
{
|
||||
$buildConfiguration = "Release"
|
||||
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$log = "$($this.BuildTemp)\build.umbraco.log"
|
||||
|
||||
if ($this.BuildEnv.VisualStudio -eq $null)
|
||||
{
|
||||
throw "Build environment does not provide VisualStudio."
|
||||
}
|
||||
|
||||
Write-Host "Compile Umbraco"
|
||||
Write-Host "Logging to $log"
|
||||
|
||||
& dotnet build "$src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" `
|
||||
--configuration $buildConfiguration `
|
||||
--output "$($this.BuildTemp)\bin\\" `
|
||||
> $log
|
||||
|
||||
# get files into WebApp\bin
|
||||
& dotnet publish "$src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" `
|
||||
--configuration Release --output "$($this.BuildTemp)\WebApp\bin\\" `
|
||||
> $log
|
||||
|
||||
& dotnet publish "$src\Umbraco.Persistence.SqlCe\Umbraco.Persistence.SqlCe.csproj" `
|
||||
--configuration Release --output "$($this.BuildTemp)\SqlCe\" `
|
||||
> $log
|
||||
|
||||
# remove extra files
|
||||
$webAppBin = "$($this.BuildTemp)\WebApp\bin"
|
||||
$excludeDirs = @("$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\Umbraco","$($webAppBin)\wwwroot")
|
||||
$excludeFiles = @("$($webAppBin)\appsettings.*","$($webAppBin)\*.deps.json","$($webAppBin)\*.exe","$($webAppBin)\*.config","$($webAppBin)\*.runtimeconfig.json")
|
||||
$this.RemoveDirectory($excludeDirs)
|
||||
$this.RemoveFile($excludeFiles)
|
||||
|
||||
# copy rest of the files into WebApp
|
||||
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco")
|
||||
$excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib")
|
||||
$this.RemoveDirectory($excludeUmbracoDirs)
|
||||
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Views", "*", "$($this.BuildTemp)\WebApp\Views")
|
||||
Copy-Item "$($this.SolutionRoot)\src\Umbraco.Web.UI\appsettings.json" "$($this.BuildTemp)\WebApp"
|
||||
|
||||
if (-not $?) { throw "Failed to compile Umbraco.Web.UI." }
|
||||
|
||||
# /p:UmbracoBuild tells the csproj that we are building from PS, not VS
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("CompileJsonSchema",
|
||||
{
|
||||
Write-Host "Generating JSON Schema for AppSettings"
|
||||
Write-Host "Logging to $($this.BuildTemp)\json.schema.log"
|
||||
|
||||
## NOTE: Need to specify the outputfile to point to the build temp folder
|
||||
&dotnet run --project "$($this.SolutionRoot)\src\JsonSchema\JsonSchema.csproj" `
|
||||
-c Release > "$($this.BuildTemp)\json.schema.log" `
|
||||
-- `
|
||||
--outputFile "$($this.BuildTemp)\WebApp\umbraco\config\appsettings-schema.json"
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PrepareTests",
|
||||
{
|
||||
Write-Host "Prepare Tests"
|
||||
|
||||
# FIXME: - idea is to avoid rebuilding everything for tests
|
||||
# but because of our weird assembly versioning (with .* stuff)
|
||||
# everything gets rebuilt all the time...
|
||||
#Copy-Files "$tmp\bin" "." "$tmp\tests"
|
||||
|
||||
# data
|
||||
Write-Host "Copy data files"
|
||||
if (-not (Test-Path -Path "$($this.BuildTemp)\tests\Packaging" ))
|
||||
{
|
||||
Write-Host "Create packaging directory"
|
||||
mkdir "$($this.BuildTemp)\tests\Packaging" > $null
|
||||
}
|
||||
#$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Tests\Packaging\Packages", "*", "$($this.BuildTemp)\tests\Packaging\Packages")
|
||||
|
||||
# required for package install tests
|
||||
if (-not (Test-Path -Path "$($this.BuildTemp)\tests\bin" ))
|
||||
{
|
||||
Write-Host "Create bin directory"
|
||||
mkdir "$($this.BuildTemp)\tests\bin" > $null
|
||||
}
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("CompileTests",
|
||||
{
|
||||
$buildConfiguration = "Release"
|
||||
$log = "$($this.BuildTemp)\msbuild.tests.log"
|
||||
|
||||
if ($this.BuildEnv.VisualStudio -eq $null)
|
||||
{
|
||||
throw "Build environment does not provide VisualStudio."
|
||||
}
|
||||
|
||||
Write-Host "Compile Tests"
|
||||
Write-Host "Logging to $log"
|
||||
|
||||
# beware of the weird double \\ at the end of paths
|
||||
# see http://edgylogic.com/blog/powershell-and-external-commands-done-right/
|
||||
&$this.BuildEnv.VisualStudio.MsBuild "$($this.SolutionRoot)\tests\Umbraco.Tests\Umbraco.Tests.csproj" `
|
||||
/p:WarningLevel=0 `
|
||||
/p:Configuration=$buildConfiguration `
|
||||
/p:Platform=AnyCPU `
|
||||
/p:UseWPP_CopyWebApplication=True `
|
||||
/p:PipelineDependsOnBuild=False `
|
||||
/p:OutDir="$($this.BuildTemp)\tests\\" `
|
||||
/p:Verbosity=minimal `
|
||||
/t:Build `
|
||||
/tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" `
|
||||
/p:UmbracoBuild=True `
|
||||
> $log
|
||||
|
||||
# copy Umbraco.Persistence.SqlCe files into WebApp
|
||||
Copy-Item "$($this.BuildTemp)\tests\Umbraco.Persistence.SqlCe.*" "$($this.BuildTemp)\WebApp\bin"
|
||||
|
||||
if (-not $?) { throw "Failed to compile tests." }
|
||||
|
||||
# /p:UmbracoBuild tells the csproj that we are building from PS
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PreparePackages",
|
||||
{
|
||||
Write-Host "Prepare Packages"
|
||||
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$tmp = "$($this.BuildTemp)"
|
||||
$out = "$($this.BuildOutput)"
|
||||
$templates = "$($this.SolutionRoot)\build\templates"
|
||||
|
||||
$buildConfiguration = "Release"
|
||||
|
||||
# cleanup build
|
||||
Write-Host "Clean build"
|
||||
$this.RemoveFile("$tmp\bin\*.dll.config")
|
||||
$this.RemoveFile("$tmp\WebApp\bin\*.dll.config")
|
||||
|
||||
# cleanup presentation
|
||||
Write-Host "Cleanup presentation"
|
||||
$this.RemoveDirectory("$tmp\WebApp\umbraco.presentation")
|
||||
|
||||
# create directories
|
||||
Write-Host "Create directories"
|
||||
mkdir "$tmp\WebApp\App_Data" > $null
|
||||
mkdir "$tmp\Templates" > $null
|
||||
#mkdir "$tmp\WebApp\Media" > $null
|
||||
#mkdir "$tmp\WebApp\Views" > $null
|
||||
|
||||
# copy various files
|
||||
Write-Host "Copy xml documentation"
|
||||
Copy-Item -force "$tmp\bin\*.xml" "$tmp\WebApp\bin"
|
||||
|
||||
# offset the modified timestamps on all umbraco dlls, as WebResources
|
||||
# break if date is in the future, which, due to timezone offsets can happen.
|
||||
Write-Host "Offset dlls timestamps"
|
||||
Get-ChildItem -r "$tmp\*.dll" | ForEach-Object {
|
||||
$_.CreationTime = $_.CreationTime.AddHours(-11)
|
||||
$_.LastWriteTime = $_.LastWriteTime.AddHours(-11)
|
||||
}
|
||||
|
||||
# copy libs
|
||||
Write-Host "Copy SqlCE libraries"
|
||||
$nugetPackages = $env:NUGET_PACKAGES
|
||||
if (-not $nugetPackages)
|
||||
{
|
||||
$nugetPackages = [System.Environment]::ExpandEnvironmentVariables("%userprofile%\.nuget\packages")
|
||||
}
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86")
|
||||
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64")
|
||||
|
||||
# copy Belle
|
||||
Write-Host "Copy Belle"
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\assets", "*", "$tmp\WebApp\wwwroot\umbraco\assets")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\js", "*", "$tmp\WebApp\wwwroot\umbraco\js")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\views", "*", "$tmp\WebApp\wwwroot\umbraco\views")
|
||||
|
||||
|
||||
|
||||
# Prepare templates
|
||||
Write-Host "Copy template files"
|
||||
$this.CopyFiles("$templates", "*", "$tmp\Templates")
|
||||
|
||||
Write-Host "Copy files for dotnet templates"
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI", "Program.cs", "$tmp\Templates\UmbracoProject")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI", "Startup.cs", "$tmp\Templates\UmbracoProject")
|
||||
$this.CopyFiles("$src\Umbraco.Web.UI\Views", "*", "$tmp\Templates\UmbracoProject\Views")
|
||||
|
||||
$this.RemoveDirectory("$tmp\Templates\UmbracoProject\bin")
|
||||
})
|
||||
|
||||
|
||||
$ubuild.DefineMethod("PrepareBuild",
|
||||
{
|
||||
Write-host "Set environment"
|
||||
$env:UMBRACO_VERSION=$this.Version.Semver.ToString()
|
||||
$env:UMBRACO_RELEASE=$this.Version.Release
|
||||
$env:UMBRACO_COMMENT=$this.Version.Comment
|
||||
$env:UMBRACO_BUILD=$this.Version.Build
|
||||
$env:UMBRACO_TMP="$($this.SolutionRoot)\build.tmp"
|
||||
|
||||
if ($args -and $args[0] -eq "vso")
|
||||
{
|
||||
Write-host "Set VSO environment"
|
||||
# set environment variable for VSO
|
||||
# https://github.com/Microsoft/vsts-tasks/issues/375
|
||||
# https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md
|
||||
Write-Host ("##vso[task.setvariable variable=UMBRACO_VERSION;]$($this.Version.Semver.ToString())")
|
||||
Write-Host ("##vso[task.setvariable variable=UMBRACO_RELEASE;]$($this.Version.Release)")
|
||||
Write-Host ("##vso[task.setvariable variable=UMBRACO_COMMENT;]$($this.Version.Comment)")
|
||||
Write-Host ("##vso[task.setvariable variable=UMBRACO_BUILD;]$($this.Version.Build)")
|
||||
|
||||
Write-Host ("##vso[task.setvariable variable=UMBRACO_TMP;]$($this.SolutionRoot)\build.tmp")
|
||||
}
|
||||
})
|
||||
|
||||
$nugetsourceUmbraco = "https://api.nuget.org/v3/index.json"
|
||||
|
||||
$ubuild.DefineMethod("RestoreNuGet",
|
||||
{
|
||||
Write-Host "Restore NuGet"
|
||||
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
|
||||
$params = "-Source", $nugetsourceUmbraco
|
||||
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\umbraco-netcore-only.sln" > "$($this.BuildTemp)\nuget.restore.log" @params
|
||||
if (-not $?) { throw "Failed to restore NuGet packages." }
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PackageNuGet",
|
||||
{
|
||||
$nuspecs = "$($this.SolutionRoot)\build\NuSpecs"
|
||||
$templates = "$($this.BuildTemp)\Templates"
|
||||
|
||||
Write-Host "Create NuGet packages"
|
||||
|
||||
&dotnet pack "$($this.SolutionRoot)\umbraco-netcore-only.sln" `
|
||||
--output "$($this.BuildOutput)" `
|
||||
--verbosity detailed `
|
||||
-c Release `
|
||||
-p:PackageVersion="$($this.Version.Semver.ToString())" > "$($this.BuildTemp)\pack.umbraco.log"
|
||||
|
||||
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.nuspec" `
|
||||
-Properties BuildTmp="$($this.BuildTemp)" `
|
||||
-Version "$($this.Version.Semver.ToString())" `
|
||||
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cms.log"
|
||||
if (-not $?) { throw "Failed to pack NuGet UmbracoCms." }
|
||||
|
||||
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.SqlCe.nuspec" `
|
||||
-Properties BuildTmp="$($this.BuildTemp)" `
|
||||
-Version "$($this.Version.Semver.ToString())" `
|
||||
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmssqlce.log"
|
||||
if (-not $?) { throw "Failed to pack NuGet UmbracoCms.SqlCe." }
|
||||
|
||||
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.StaticAssets.nuspec" `
|
||||
-Properties BuildTmp="$($this.BuildTemp)" `
|
||||
-Version "$($this.Version.Semver.ToString())" `
|
||||
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmsstaticassets.log"
|
||||
if (-not $?) { throw "Failed to pack NuGet UmbracoCms.StaticAssets." }
|
||||
|
||||
&$this.BuildEnv.NuGet Pack "$templates\Umbraco.Templates.nuspec" `
|
||||
-Properties BuildTmp="$($this.BuildTemp)" `
|
||||
-Version "$($this.Version.Semver.ToString())" `
|
||||
-NoDefaultExcludes `
|
||||
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.templates.log"
|
||||
if (-not $?) { throw "Failed to pack NuGet Umbraco.Templates." }
|
||||
|
||||
# run hook
|
||||
if ($this.HasMethod("PostPackageNuGet"))
|
||||
{
|
||||
Write-Host "Run PostPackageNuGet hook"
|
||||
$this.PostPackageNuGet();
|
||||
if (-not $?) { throw "Failed to run hook." }
|
||||
}
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("VerifyNuGet",
|
||||
{
|
||||
$this.VerifyNuGetConsistency(
|
||||
("UmbracoCms"),
|
||||
("Umbraco.Core", "Umbraco.Infrastructure", "Umbraco.Web.UI", "Umbraco.Examine.Lucene", "Umbraco.PublishedCache.NuCache", "Umbraco.Web.Common", "Umbraco.Web.Website", "Umbraco.Web.BackOffice", "Umbraco.Persistence.SqlCe"))
|
||||
if ($this.OnError()) { return }
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PrepareCSharpDocs",
|
||||
{
|
||||
Write-Host "Prepare C# Documentation"
|
||||
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$tmp = $this.BuildTemp
|
||||
$out = $this.BuildOutput
|
||||
$DocFxJson = Join-Path -Path $src "\ApiDocs\docfx.json"
|
||||
$DocFxSiteOutput = Join-Path -Path $tmp "\_site\*.*"
|
||||
|
||||
# run DocFx
|
||||
$DocFx = $this.BuildEnv.DocFx
|
||||
|
||||
& $DocFx metadata $DocFxJson
|
||||
& $DocFx build $DocFxJson
|
||||
|
||||
# zip it
|
||||
& $this.BuildEnv.Zip a -tzip -r "$out\csharp-docs.zip" $DocFxSiteOutput
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PrepareAngularDocs",
|
||||
{
|
||||
Write-Host "Prepare Angular Documentation"
|
||||
|
||||
$src = "$($this.SolutionRoot)\src"
|
||||
$out = $this.BuildOutput
|
||||
|
||||
# Check if the solution has been built
|
||||
if (!(Test-Path "$src\Umbraco.Web.UI.Client\node_modules")) {throw "Umbraco needs to be built before generating the Angular Docs"}
|
||||
|
||||
"Moving to Umbraco.Web.UI.Docs folder"
|
||||
cd $src\Umbraco.Web.UI.Docs
|
||||
|
||||
"Generating the docs and waiting before executing the next commands"
|
||||
& npm ci
|
||||
& npx gulp docs
|
||||
|
||||
Pop-Location
|
||||
|
||||
# change baseUrl
|
||||
$BaseUrl = "https://apidocs.umbraco.com/v9/ui/"
|
||||
$IndexPath = "./api/index.html"
|
||||
(Get-Content $IndexPath).replace('origin + location.href.substr(origin.length).replace(rUrl, indexFile)', "`'" + $BaseUrl + "`'") | Set-Content $IndexPath
|
||||
|
||||
# zip it
|
||||
& $this.BuildEnv.Zip a -tzip -r "$out\ui-docs.zip" "$src\Umbraco.Web.UI.Docs\api\*.*"
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("Build",
|
||||
{
|
||||
$error.Clear()
|
||||
|
||||
$this.PrepareBuild()
|
||||
if ($this.OnError()) { return }
|
||||
$this.RestoreNuGet()
|
||||
if ($this.OnError()) { return }
|
||||
$this.CompileBelle()
|
||||
if ($this.OnError()) { return }
|
||||
$this.CompileUmbraco()
|
||||
if ($this.OnError()) { return }
|
||||
$this.CompileJsonSchema()
|
||||
if ($this.OnError()) { return }
|
||||
$this.PrepareTests()
|
||||
if ($this.OnError()) { return }
|
||||
$this.CompileTests()
|
||||
if ($this.OnError()) { return }
|
||||
# not running tests
|
||||
$this.PreparePackages()
|
||||
if ($this.OnError()) { return }
|
||||
$this.VerifyNuGet()
|
||||
if ($this.OnError()) { return }
|
||||
$this.PackageNuGet()
|
||||
if ($this.OnError()) { return }
|
||||
$this.PostPackageHook()
|
||||
if ($this.OnError()) { return }
|
||||
|
||||
Write-Host "Done"
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("PostPackageHook",
|
||||
{
|
||||
# run hook
|
||||
if ($this.HasMethod("PostPackage"))
|
||||
{
|
||||
Write-Host "Run PostPackage hook"
|
||||
$this.PostPackage();
|
||||
if (-not $?) { throw "Failed to run hook." }
|
||||
}
|
||||
})
|
||||
|
||||
# ################################################################
|
||||
# RUN
|
||||
# ################################################################
|
||||
|
||||
# configure
|
||||
$ubuild.ReleaseBranches = @( "master" )
|
||||
|
||||
# run
|
||||
if (-not $get)
|
||||
{
|
||||
if ($command.Length -eq 0)
|
||||
{
|
||||
$command = @( "Build" )
|
||||
}
|
||||
$ubuild.RunMethod($command);
|
||||
if ($ubuild.OnError()) { return }
|
||||
}
|
||||
if ($get) { return $ubuild }
|
||||
@@ -1,35 +0,0 @@
|
||||
name: Nightly_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
||||
|
||||
pr: none
|
||||
trigger: none
|
||||
|
||||
schedules:
|
||||
- cron: '0 0 * * *'
|
||||
displayName: Daily midnight build
|
||||
branches:
|
||||
include:
|
||||
- v10/dev
|
||||
- v12/dev
|
||||
- v13/dev
|
||||
- v14/dev
|
||||
|
||||
steps:
|
||||
- checkout: none
|
||||
- task: TriggerBuild@4
|
||||
inputs:
|
||||
definitionIsInCurrentTeamProject: true
|
||||
buildDefinition: '301'
|
||||
queueBuildForUserThatTriggeredBuild: true
|
||||
ignoreSslCertificateErrors: false
|
||||
useSameSourceVersion: false
|
||||
useCustomSourceVersion: false
|
||||
useSameBranch: true
|
||||
waitForQueuedBuildsToFinish: false
|
||||
storeInEnvironmentVariable: false
|
||||
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
|
||||
authenticationMethod: 'OAuth Token'
|
||||
enableBuildInQueueCondition: false
|
||||
dependentOnSuccessfulBuildCondition: false
|
||||
dependentOnFailedBuildCondition: false
|
||||
checkbuildsoncurrentbranch: false
|
||||
failTaskIfConditionsAreNotFulfilled: false
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="4.1.0">
|
||||
<id>Umbraco.Templates</id>
|
||||
<version>1.0.0</version>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://umbraco.com/</projectUrl>
|
||||
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Umbraco Cms templates for .NET Core Template Engine available through the dotnet CLI's new command</description>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
|
||||
<packageTypes>
|
||||
<packageType name="Template" />
|
||||
</packageTypes>
|
||||
</metadata>
|
||||
</package>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/dotnetcli.host",
|
||||
"symbolInfo": {
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/vs-2017.3.host",
|
||||
"order" : 0,
|
||||
"icon": "icon.png",
|
||||
"description": {
|
||||
"id": "UmbracoPackage",
|
||||
"text": "Umbraco Package - An empty Umbraco CMS package (Plugin)"
|
||||
},
|
||||
"symbolInfo": [
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/template",
|
||||
"author": "Umbraco HQ",
|
||||
"description": "An empty Umbraco Package/Plugin ready to get started",
|
||||
"classifications": [ "Web", "CMS", "Umbraco", "Package", "Plugin"],
|
||||
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
|
||||
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
|
||||
"name": "Umbraco Package",
|
||||
"shortName": "umbracopackage",
|
||||
"defaultName": "UmbracoPackage1",
|
||||
"preferNameDirectory": true,
|
||||
"tags": {
|
||||
"language": "C#",
|
||||
"type": "project"
|
||||
},
|
||||
"primaryOutputs": [
|
||||
{
|
||||
"path": "UmbracoPackage.csproj"
|
||||
}
|
||||
],
|
||||
"sourceName": "UmbracoPackage",
|
||||
"preferNameDirectory": true,
|
||||
"symbols": {
|
||||
"version": {
|
||||
"type": "parameter",
|
||||
"datatype": "string",
|
||||
"defaultValue": "9.4.3",
|
||||
"description": "The version of Umbraco to load using NuGet",
|
||||
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
|
||||
},
|
||||
"namespaceReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "UmbracoPackage",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"msbuildReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "UmbracoPackageMsBuild",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "\\.",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": ""
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Framework": {
|
||||
"type": "parameter",
|
||||
"description": "The target framework for the project.",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "net5.0",
|
||||
"description": "Target net5.0"
|
||||
},
|
||||
{
|
||||
"choice": "net6.0",
|
||||
"description": "Target net6.0"
|
||||
}
|
||||
],
|
||||
"replaces": "net5.0",
|
||||
"defaultValue": "net5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<ContentTargetFolders>.</ContentTargetFolders>
|
||||
<Product>UmbracoPackage</Product>
|
||||
<PackageId>UmbracoPackage</PackageId>
|
||||
<Title>UmbracoPackage</Title>
|
||||
<Description>...</Description>
|
||||
<Product>...</Product>
|
||||
<PackageTags>umbraco plugin package</PackageTags>
|
||||
<RootNamespace>UmbracoPackage</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE"/>
|
||||
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="UMBRACO_VERSION_FROM_TEMPLATE"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="App_Plugins\UmbracoPackage\**\*.*">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<None Include="build\**\*.*">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>buildTransitive</PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<UmbracoPackageMsBuildContentFilesPath>$(MSBuildThisFileDirectory)..\App_Plugins\UmbracoPackage\**\*.*</UmbracoPackageMsBuildContentFilesPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CopyUmbracoPackageMsBuildAssets" BeforeTargets="Build">
|
||||
<ItemGroup>
|
||||
<UmbracoPackageMsBuildContentFiles Include="$(UmbracoPackageMsBuildContentFilesPath)" />
|
||||
</ItemGroup>
|
||||
<Message Text="Copying UmbracoPackage files: $(UmbracoPackageMsBuildContentFilesPath) - #@(UmbracoPackageMsBuildContentFiles->Count()) files" Importance="high" />
|
||||
<Copy
|
||||
SourceFiles="@(UmbracoPackageMsBuildContentFiles)"
|
||||
DestinationFiles="@(UmbracoPackageMsBuildContentFiles->'$(MSBuildProjectDirectory)\App_Plugins\UmbracoPackage\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="ClearUmbracoPackageMsBuildAssets" BeforeTargets="Clean">
|
||||
<ItemGroup>
|
||||
<UmbracoPackageMsBuildDir Include="$(MSBuildProjectDirectory)\App_Plugins\UmbracoPackage\" />
|
||||
</ItemGroup>
|
||||
<Message Text="Clear old UmbracoPackage data" Importance="high" />
|
||||
<RemoveDir Directories="@(UmbracoPackageMsBuildDir)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -1,4 +1,3 @@
|
||||
#if (!MinimalGitignore)
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
@@ -454,27 +453,38 @@ $RECYCLE.BIN/
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
#endif
|
||||
|
||||
##
|
||||
## Umbraco CMS
|
||||
## Umbraco CMS .NETCore
|
||||
##
|
||||
|
||||
# JSON schema file for appsettings.json
|
||||
appsettings-schema.json
|
||||
# Dont commit Umbraco TEMP folder containing Examine Indexes, NuCache etc
|
||||
**/umbraco/Data/TEMP/
|
||||
|
||||
# Packages created from the backoffice (package.xml/package.zip)
|
||||
/umbraco/Data/CreatedPackages/
|
||||
# Umbraco log files
|
||||
**/umbraco/Logs/
|
||||
|
||||
# Temp folder containing Examine indexes, NuCache, MediaCache, etc.
|
||||
/umbraco/Data/TEMP/
|
||||
# Dont commit files that are generated and cached from the default ImageSharp location
|
||||
**/umbraco/mediacache/
|
||||
|
||||
# SQLite database files
|
||||
/umbraco/Data/*.sqlite.db
|
||||
/umbraco/Data/*.sqlite.db-shm
|
||||
/umbraco/Data/*.sqlite.db-wal
|
||||
# Umbraco backoffice language files
|
||||
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
|
||||
# Customize langguage files in /config/lang/{language}.user.xml
|
||||
**/umbraco/config/lang/
|
||||
|
||||
# Log files
|
||||
/umbraco/Logs/
|
||||
# JSON Schema file for appsettings
|
||||
# This is auto generated from the build
|
||||
**/umbraco/config/appsettings-schema.json
|
||||
|
||||
# Media files
|
||||
/wwwroot/media/
|
||||
# This is the no-nodes, installer & upgrader pages from Umbraco
|
||||
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
|
||||
**/umbraco/UmbracoWebsite/
|
||||
**/umbraco/UmbracoInstall/
|
||||
**/umbraco/UmbracoBackOffice/
|
||||
|
||||
# Comment out the line below if you wish to change or add any new templates to PartialView Macros
|
||||
**/umbraco/PartialViewMacros/
|
||||
|
||||
# Umbraco Static Assets of Backoffice
|
||||
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
|
||||
**/wwwroot/umbraco/
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/dotnetcli.host",
|
||||
"symbolInfo": {
|
||||
"PackageTestSiteName": {
|
||||
"longName": "PackageTestSiteName",
|
||||
"shortName": "p"
|
||||
},
|
||||
"UseSqlCe": {
|
||||
"longName": "SqlCe",
|
||||
"shortName": "ce"
|
||||
},
|
||||
"SkipRestore": {
|
||||
"longName": "no-restore",
|
||||
"shortName": ""
|
||||
},
|
||||
"FriendlyName": {
|
||||
"longName": "friendly-name",
|
||||
"shortName": ""
|
||||
},
|
||||
"Email": {
|
||||
"longName": "email",
|
||||
"shortName": ""
|
||||
},
|
||||
"Password": {
|
||||
"longName": "password",
|
||||
"shortName": ""
|
||||
},
|
||||
"ConnectionString":{
|
||||
"longName": "connection-string",
|
||||
"shortName": ""
|
||||
},
|
||||
"NoNodesViewPath":{
|
||||
"longName": "no-nodes-view-path",
|
||||
"shortName": ""
|
||||
},
|
||||
"UseHttpsRedirect": {
|
||||
"longName": "use-https-redirect",
|
||||
"shortName": ""
|
||||
}
|
||||
},
|
||||
"usageExamples": [
|
||||
"dotnet new umbraco -n MyNewProject",
|
||||
"dotnet new umbraco -n MyNewProjectWithCE -ce",
|
||||
"dotnet new umbraco -n MyNewProject --no-restore",
|
||||
"dotnet new umbraco -n MyNewProject --friendly-name \"Friendly User\" --email user@email.com --password password1234 --connection-string \"Server=ConnectionStringHere\""
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/vs-2017.3.host",
|
||||
"order" : 0,
|
||||
"icon": "icon.png",
|
||||
"description": {
|
||||
"id": "UmbracoProject",
|
||||
"text": "Umbraco Web Application - An empty Umbraco CMS web application"
|
||||
},
|
||||
"symbolInfo": [
|
||||
{
|
||||
"id": "UseSqlCe",
|
||||
"name": {
|
||||
"text": "Use Sql Compact Edition (SqlCE)"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "SkipRestore",
|
||||
"name": {
|
||||
"text": "Skips the automatic NuGet restore of the project on create"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "PackageTestSiteName",
|
||||
"name": {
|
||||
"text": "Optional: Specify the name of a package that this should be a test site for"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "FriendlyName",
|
||||
"name": {
|
||||
"text": "Optional: The friendly name of the user for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "Email",
|
||||
"name": {
|
||||
"text": "Optional: Email to use for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "Password",
|
||||
"name": {
|
||||
"text": "Optional: Password to use for Umbraco login when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "ConnectionString",
|
||||
"name": {
|
||||
"text": "Optional: Database connection string when using Unattended install"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "NoNodesViewPath",
|
||||
"name": {
|
||||
"text": "Optional: Path to a custom view presented with the Umbraco installation contains no published content"
|
||||
},
|
||||
"isVisible": "true"
|
||||
},
|
||||
{
|
||||
"id": "UseHttpsRedirect",
|
||||
"name": {
|
||||
"text": "Optional: Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting."
|
||||
},
|
||||
"isVisible": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/template",
|
||||
"author": "Umbraco HQ",
|
||||
"description": "An empty Umbraco Project ready to get started",
|
||||
"classifications": [ "Web", "CMS", "Umbraco"],
|
||||
"groupIdentity": "Umbraco.Templates.UmbracoProject",
|
||||
"identity": "Umbraco.Templates.UmbracoProject.CSharp",
|
||||
"name": "Umbraco Project",
|
||||
"shortName": "umbraco",
|
||||
"defaultName": "UmbracoProject1",
|
||||
"preferNameDirectory": true,
|
||||
"tags": {
|
||||
"language": "C#",
|
||||
"type": "project"
|
||||
},
|
||||
"primaryOutputs": [
|
||||
{
|
||||
"path": "UmbracoProject.csproj"
|
||||
}
|
||||
],
|
||||
"postActions": [
|
||||
{
|
||||
"condition": "(!SkipRestore)",
|
||||
"description": "Restore NuGet packages required by this project",
|
||||
"manualInstructions": [{
|
||||
"text": "Run 'dotnet restore'"
|
||||
}],
|
||||
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
|
||||
"continueOnError": true
|
||||
}
|
||||
],
|
||||
"sourceName": "UmbracoProject",
|
||||
"symbols": {
|
||||
"namespaceReplacer": {
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "Umbraco.Cms.Web.UI",
|
||||
"parameters": {
|
||||
"source": "name",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\s",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "-",
|
||||
"replacement": "_"
|
||||
},
|
||||
{
|
||||
"regex": "^[^a-zA-Z_]+",
|
||||
"replacement": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": {
|
||||
"type": "parameter",
|
||||
"datatype": "string",
|
||||
"defaultValue": "9.4.3",
|
||||
"description": "The version of Umbraco to load using NuGet",
|
||||
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
|
||||
},
|
||||
"PackageTestSiteName": {
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"defaultValue": "",
|
||||
"replaces":"PackageTestSiteName",
|
||||
"description": "The name of the package this should be a test site for (Default: '')"
|
||||
},
|
||||
"UseSqlCe":{
|
||||
"type": "parameter",
|
||||
"datatype":"bool",
|
||||
"defaultValue": "false",
|
||||
"description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)"
|
||||
},
|
||||
"Framework": {
|
||||
"type": "parameter",
|
||||
"description": "The target framework for the project",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "net5.0",
|
||||
"description": "Target net5.0"
|
||||
},
|
||||
{
|
||||
"choice": "net6.0",
|
||||
"description": "Target net6.0"
|
||||
}
|
||||
],
|
||||
"replaces": "net5.0",
|
||||
"defaultValue": "net5.0"
|
||||
},
|
||||
"SkipRestore": {
|
||||
"type": "parameter",
|
||||
"datatype": "bool",
|
||||
"description": "If specified, skips the automatic restore of the project on create",
|
||||
"defaultValue": "false"
|
||||
},
|
||||
"HttpPort": {
|
||||
"type": "generated",
|
||||
"generator": "port",
|
||||
"replaces": "HTTP_PORT_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"high": 65535,
|
||||
"low": 1024,
|
||||
"fallback": 5000
|
||||
}
|
||||
},
|
||||
"HttpsPort": {
|
||||
"type": "generated",
|
||||
"generator": "port",
|
||||
"replaces": "HTTPS_PORT_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"low": 44300,
|
||||
"high": 44399,
|
||||
"fallback": 5001
|
||||
}
|
||||
},
|
||||
"FriendlyName":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "The friendly name of the user for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"FriendlyNameReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "FRIENDLY_NAME_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "FriendlyName",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Email":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Email to use for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"EmailReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "EMAIL_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "Email",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Password":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Password to use for Umbraco login when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"PasswordReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "PASSWORD_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "Password",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"ConnectionString":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Database connection string when using Unattended install (Without installer wizard UI)",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"ConnectionStringReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "CONNECTION_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "ConnectionString",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"NoNodesViewPath":{
|
||||
"type": "parameter",
|
||||
"datatype":"text",
|
||||
"description": "Path to a custom view presented with the Umbraco installation contains no published content",
|
||||
"defaultValue": ""
|
||||
},
|
||||
"NoNodesViewPathReplaced":{
|
||||
"type": "generated",
|
||||
"generator": "regex",
|
||||
"dataType": "string",
|
||||
"replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
|
||||
"parameters": {
|
||||
"source": "NoNodesViewPath",
|
||||
"steps": [
|
||||
{
|
||||
"regex": "\\\\",
|
||||
"replacement": "\\\\"
|
||||
},
|
||||
{
|
||||
"regex": "\\\"",
|
||||
"replacement": "\\\""
|
||||
},
|
||||
{
|
||||
"regex": "\\\n",
|
||||
"replacement": "\\\n"
|
||||
},
|
||||
{
|
||||
"regex": "\\\t",
|
||||
"replacement": "\\\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"HasConnectionString":{
|
||||
"type": "computed",
|
||||
"value": "(ConnectionString != \"\")"
|
||||
},
|
||||
"HasNoNodesViewPath":{
|
||||
"type": "computed",
|
||||
"value": "(NoNodesViewPath != \"\")"
|
||||
},
|
||||
"UsingUnattenedInstall":{
|
||||
"type": "computed",
|
||||
"value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")"
|
||||
},
|
||||
"UseHttpsRedirect":{
|
||||
"type": "parameter",
|
||||
"datatype":"bool",
|
||||
"defaultValue": "false",
|
||||
"description": "Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting (Default: false)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Umbraco.Cms" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
|
||||
<PackageReference Include="Umbraco.Cms.SqlCe" Version="UMBRACO_VERSION_FROM_TEMPLATE" Condition="'$(UseSqlCe)' == 'true'" />
|
||||
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" Condition="'$(UseSqlCe)' == 'true'" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
|
||||
|
||||
<RuntimeHostConfigurationOption
|
||||
Condition="$(RuntimeIdentifier.StartsWith('linux')) Or $(RuntimeIdentifier.StartsWith('win')) Or ('$(RuntimeIdentifier)' == '' And !$([MSBuild]::IsOSPlatform('osx')))"
|
||||
Include="System.Globalization.AppLocalIcu"
|
||||
Value="68.2.0.9" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\PackageTestSiteName\build\PackageTestSiteName.targets" Condition="'$(PackageTestSiteName)' != ''" />
|
||||
|
||||
<ItemGroup Condition="'$(PackageTestSiteName)' != ''">
|
||||
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Set this to true if ModelsBuilder mode is not InMemoryAuto-->
|
||||
<PropertyGroup>
|
||||
<RazorCompileOnBuild>false</RazorCompileOnBuild>
|
||||
<RazorCompileOnPublish>false</RazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
@using Umbraco.Web.UI
|
||||
@using Umbraco.Extensions
|
||||
@using Umbraco.Web.PublishedModels
|
||||
@using Umbraco.Cms.Core.Models.PublishedContent
|
||||
@using Microsoft.AspNetCore.Html
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, Smidge
|
||||
@inject Smidge.SmidgeHelper SmidgeHelper
|
||||
+18
-12
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "./appsettings-schema.json",
|
||||
"$schema" : "./umbraco/config/appsettings-schema.json",
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information"
|
||||
@@ -17,32 +17,38 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
//#if (HasDevelopmentConnectionString)
|
||||
//#if (HasConnectionString)
|
||||
"ConnectionStrings": {
|
||||
"umbracoDbDSN": "CONNECTION_STRING_DEVELOPMENT_FROM_TEMPLATE",
|
||||
"umbracoDbDSN_ProviderName": "CONNECTION_STRING_PROVIDER_NAME_DEVELOPMENT_FROM_TEMPLATE"
|
||||
"umbracoDbDSN": "CONNECTION_FROM_TEMPLATE"
|
||||
},
|
||||
//#endif
|
||||
"Umbraco": {
|
||||
"CMS": {
|
||||
"Content": {
|
||||
"MacroErrors": "Throw"
|
||||
},
|
||||
//#if (UsingUnattenedInstall)
|
||||
"Unattended": {
|
||||
"InstallUnattended": true,
|
||||
"UnattendedUserName": "UNATTENDED_USER_NAME_FROM_TEMPLATE",
|
||||
"UnattendedUserEmail": "UNATTENDED_USER_EMAIL_FROM_TEMPLATE",
|
||||
"UnattendedUserPassword": "UNATTENDED_USER_PASSWORD_FROM_TEMPLATE"
|
||||
"UnattendedUserName": "FRIENDLY_NAME_FROM_TEMPLATE",
|
||||
"UnattendedUserEmail": "EMAIL_FROM_TEMPLATE",
|
||||
"UnattendedUserPassword": "PASSWORD_FROM_TEMPLATE"
|
||||
},
|
||||
//#endif
|
||||
"Content": {
|
||||
"MacroErrors": "Throw"
|
||||
"Global": {
|
||||
"Smtp": {
|
||||
"From": "your@email.here",
|
||||
"Host": "localhost",
|
||||
"Port": 25
|
||||
}
|
||||
},
|
||||
"Hosting": {
|
||||
"Debug": true
|
||||
},
|
||||
"RuntimeMinification": {
|
||||
"UseInMemoryCache": true,
|
||||
"CacheBuster": "Timestamp"
|
||||
"useInMemoryCache": true,
|
||||
"cacheBuster": "Timestamp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
-10
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "./appsettings-schema.json",
|
||||
"$schema" : "./umbraco/config/appsettings-schema.json",
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
@@ -10,26 +10,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
//#if (HasConnectionString)
|
||||
"ConnectionStrings": {
|
||||
"umbracoDbDSN": "CONNECTION_STRING_FROM_TEMPLATE",
|
||||
"umbracoDbDSN_ProviderName": "CONNECTION_STRING_PROVIDER_NAME_FROM_TEMPLATE"
|
||||
"umbracoDbDSN": ""
|
||||
},
|
||||
//#endif
|
||||
"Umbraco": {
|
||||
"CMS": {
|
||||
//#if (HasNoNodesViewPath || UseHttpsRedirect)
|
||||
"Global": {
|
||||
"Id": "TELEMETRYID_FROM_TEMPLATE",
|
||||
//#if (UseHttpsRedirect)
|
||||
"SanitizeTinyMce": true,
|
||||
//#if (!HasNoNodesViewPath && UseHttpsRedirect)
|
||||
"UseHttps": true
|
||||
//#elseif (UseHttpsRedirect)
|
||||
"UseHttps": true,
|
||||
//#endif
|
||||
//#if (HasNoNodesViewPath)
|
||||
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
|
||||
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE"
|
||||
//#endif
|
||||
"SanitizeTinyMce": true
|
||||
|
||||
},
|
||||
//#endif
|
||||
"Hosting": {
|
||||
"Debug": false
|
||||
},
|
||||
"Content": {
|
||||
"AllowEditInvariantFromNonDefault": true,
|
||||
"ContentVersionCleanupPolicy": {
|
||||
"EnableCleanup": true
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "6.0.300",
|
||||
"rollForward": "latestFeature"
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
name: issue-first-response
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
send-response:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install node-fetch@2
|
||||
- name: Fetch random comment 🗣️ and add it to the issue
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fetch = require('node-fetch')
|
||||
|
||||
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
|
||||
method: 'post',
|
||||
body: JSON.stringify({
|
||||
repo: '${{ github.repository }}',
|
||||
number: '${{ github.event.number }}',
|
||||
actor: '${{ github.actor }}',
|
||||
commentType: 'opened-issue-first-comment'
|
||||
}),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const data = await response.text();
|
||||
|
||||
if(response.status === 200 && data !== '') {
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: data
|
||||
});
|
||||
} else {
|
||||
console.log("Status code did not indicate success:", response.status);
|
||||
console.log("Returned data:", data);
|
||||
}
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -3,17 +3,18 @@
|
||||
{
|
||||
"src": [
|
||||
{
|
||||
"src": "../../src",
|
||||
"src": "../",
|
||||
"files": [
|
||||
"**/*.csproj"
|
||||
"**/*.csproj",
|
||||
"**/Umbraco.Infrastructure/**/*.cs"
|
||||
],
|
||||
"exclude": [
|
||||
"**/obj/**",
|
||||
"**/bin/**",
|
||||
"**/Umbraco.Web.csproj",
|
||||
"**/Umbraco.Infrastructure.csproj",
|
||||
"**/Umbraco.Web.UI.csproj",
|
||||
"**/Umbraco.Cms.StaticAssets.csproj",
|
||||
"**/JsonSchema.csproj"
|
||||
"**/**.Test**/*.csproj"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -0,0 +1,42 @@
|
||||
<Project>
|
||||
<!-- Enable multi-level merging -->
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>9.4.3</Version>
|
||||
<AssemblyVersion>9.4.3</AssemblyVersion>
|
||||
<InformationalVersion>9.4.3</InformationalVersion>
|
||||
<FileVersion>9.4.3</FileVersion>
|
||||
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Company>Umbraco CMS</Company>
|
||||
<Copyright>Copyright © Umbraco 2021</Copyright>
|
||||
<Authors>Umbraco HQ</Authors>
|
||||
<PackageProjectUrl>https://umbraco.com/</PackageProjectUrl>
|
||||
<PackageIconUrl>https://umbraco.com/dist/nuget/logo-small.png</PackageIconUrl>
|
||||
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<PackageTags>umbraco</PackageTags>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/umbraco/umbraco-cms</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- SourceLink: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element)-->
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
|
||||
<!-- SourceLink: Embed source files that are not tracked by the source control manager in the PDB -->
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
|
||||
<!-- SourceLink: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- SourceLink: Deterministic -->
|
||||
<!-- https://github.com/clairernovotny/DeterministicBuilds -->
|
||||
<!-- Only for Azure Pipelines CI Build -->
|
||||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<NoWarn>NU1507</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
|
||||
<PackageVersion Include="Examine" Version="3.0.1" />
|
||||
<PackageVersion Include="Examine.Core" Version="3.0.1" />
|
||||
<PackageVersion Include="HtmlAgilityPack" Version="1.11.54" />
|
||||
<PackageVersion Include="IPNetwork2" Version="2.6.618" />
|
||||
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.6" />
|
||||
<PackageVersion Include="MailKit" Version="3.2.0" />
|
||||
<PackageVersion Include="Markdown" Version="2.2.1" />
|
||||
<PackageVersion Include="MessagePack" Version="2.5.187" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.24" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.24" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="6.0.24" />
|
||||
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.24" />
|
||||
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="6.0.24" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="6.0.24" />
|
||||
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
|
||||
<PackageVersion Include="MiniProfiler.Shared" Version="4.2.22" />
|
||||
<PackageVersion Include="ncrontab" Version="3.3.3" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageVersion Include="NPoco.SqlServer" Version="5.3.2" />
|
||||
<PackageVersion Include="Serilog" Version="2.12.0" />
|
||||
<PackageVersion Include="Serilog.AspNetCore" Version="5.0.0" />
|
||||
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
|
||||
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageVersion Include="Serilog.Expressions" Version="3.4.1" />
|
||||
<PackageVersion Include="Serilog.Extensions.Hosting" Version="4.2.0" />
|
||||
<PackageVersion Include="Serilog.Formatting.Compact" Version="1.1.0" />
|
||||
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="1.0.5" />
|
||||
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.10" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="2.0.2" />
|
||||
<PackageVersion Include="Smidge.InMemory" Version="4.3.0" />
|
||||
<PackageVersion Include="Smidge.Nuglify" Version="4.2.1" />
|
||||
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="6.0.4" />
|
||||
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
|
||||
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
|
||||
<PackageVersion Include="System.Runtime.Caching" Version="6.0.0" />
|
||||
<PackageVersion Include="Umbraco.CSharpTest.Net.Collections" Version="14.906.1403.1085" />
|
||||
<!-- Add dependencies that we force an update to, even that we do not use them explicitly and they seems to be taken from the framework instead of from Nuget -->
|
||||
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Xml" Version="6.0.1" />
|
||||
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -16,7 +16,7 @@ namespace JsonSchema
|
||||
/// <summary>
|
||||
/// Gets or sets the Umbraco
|
||||
/// </summary>
|
||||
public UmbracoDefinition? Umbraco { get; set; }
|
||||
public UmbracoDefinition Umbraco { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Configuration of Umbraco CMS and packages
|
||||
@@ -24,90 +24,74 @@ namespace JsonSchema
|
||||
internal class UmbracoDefinition
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public CmsDefinition? CMS { get; set; }
|
||||
public CmsDefinition CMS { get; set; }
|
||||
|
||||
public FormsDefinition? Forms { get; set; }
|
||||
public FormsDefinition Forms { get; set; }
|
||||
|
||||
public DeployDefinition? Deploy { get; set; }
|
||||
public DeployDefinition Deploy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Configurations for the Umbraco CMS
|
||||
/// </summary>
|
||||
public class CmsDefinition
|
||||
{
|
||||
public ContentSettings? Content { get; set; }
|
||||
public CoreDebugSettings? Debug { get; set; }
|
||||
public ActiveDirectorySettings ActiveDirectory { get; set; }
|
||||
|
||||
public ExceptionFilterSettings? ExceptionFilter { get; set; }
|
||||
public ContentSettings Content { get; set; }
|
||||
|
||||
public ModelsBuilderSettings? ModelsBuilder { get; set; }
|
||||
public ExceptionFilterSettings ExceptionFilter { get; set; }
|
||||
|
||||
public GlobalSettings? Global { get; set; }
|
||||
public ModelsBuilderSettings ModelsBuilder { get; set; }
|
||||
|
||||
public HealthChecksSettings? HealthChecks { get; set; }
|
||||
public GlobalSettings Global { get; set; }
|
||||
|
||||
public HostingSettings? Hosting { get; set; }
|
||||
public HealthChecksSettings HealthChecks { get; set; }
|
||||
|
||||
public ImagingSettings? Imaging { get; set; }
|
||||
public HostingSettings Hosting { get; set; }
|
||||
|
||||
public IndexCreatorSettings? Examine { get; set; }
|
||||
public IndexingSettings? Indexing { get; set; }
|
||||
public ImagingSettings Imaging { get; set; }
|
||||
|
||||
public KeepAliveSettings? KeepAlive { get; set; }
|
||||
public IndexCreatorSettings Examine { get; set; }
|
||||
|
||||
public LoggingSettings? Logging { get; set; }
|
||||
public KeepAliveSettings KeepAlive { get; set; }
|
||||
|
||||
public NuCacheSettings? NuCache { get; set; }
|
||||
public LoggingSettings Logging { get; set; }
|
||||
|
||||
public RequestHandlerSettings? RequestHandler { get; set; }
|
||||
public MemberPasswordConfigurationSettings MemberPassword { get; set; }
|
||||
|
||||
public RuntimeSettings? Runtime { get; set; }
|
||||
public NuCacheSettings NuCache { get; set; }
|
||||
|
||||
public SecuritySettings? Security { get; set; }
|
||||
public RequestHandlerSettings RequestHandler { get; set; }
|
||||
|
||||
public TourSettings? Tours { get; set; }
|
||||
public RuntimeSettings Runtime { get; set; }
|
||||
|
||||
public TypeFinderSettings? TypeFinder { get; set; }
|
||||
public SecuritySettings Security { get; set; }
|
||||
|
||||
public WebRoutingSettings? WebRouting { get; set; }
|
||||
public TourSettings Tours { get; set; }
|
||||
|
||||
public UmbracoPluginSettings? Plugins { get; set; }
|
||||
public TypeFinderSettings TypeFinder { get; set; }
|
||||
|
||||
public UnattendedSettings? Unattended { get; set; }
|
||||
public UserPasswordConfigurationSettings UserPassword { get; set; }
|
||||
|
||||
public RichTextEditorSettings? RichTextEditor { get; set; }
|
||||
public WebRoutingSettings WebRouting { get; set; }
|
||||
|
||||
public RuntimeMinificationSettings? RuntimeMinification { get; set; }
|
||||
public UmbracoPluginSettings Plugins { get; set; }
|
||||
|
||||
public BasicAuthSettings? BasicAuth { get; set; }
|
||||
public UnattendedSettings Unattended { get; set; }
|
||||
|
||||
public PackageMigrationSettings? PackageMigration { get; set; }
|
||||
public RichTextEditorSettings RichTextEditor { get; set; }
|
||||
|
||||
public LegacyPasswordMigrationSettings? LegacyPasswordMigration { get; set; }
|
||||
public RuntimeMinificationSettings RuntimeMinification { get; set; }
|
||||
|
||||
public ContentDashboardSettings? ContentDashboard { get; set; }
|
||||
public BasicAuthSettings BasicAuth { get; set; }
|
||||
|
||||
public HelpPageSettings? HelpPage { get; set; }
|
||||
public PackageMigrationSettings PackageMigration { get; set; }
|
||||
|
||||
public InstallDefaultData? InstallDefaultData { get; set; }
|
||||
public LegacyPasswordMigrationSettings LegacyPasswordMigration { get; set; }
|
||||
|
||||
public DataTypesSettings? DataTypes { get; set; }
|
||||
public ContentDashboardSettings ContentDashboard { get; set; }
|
||||
|
||||
public MarketplaceSettings? Marketplace { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configurations for the Umbraco CMS InstallDefaultData configuration.
|
||||
/// </summary>
|
||||
public class InstallDefaultData
|
||||
{
|
||||
public InstallDefaultDataSettings? Languages { get; set; }
|
||||
|
||||
public InstallDefaultDataSettings? DataTypes { get; set; }
|
||||
|
||||
public InstallDefaultDataSettings? MediaTypes { get; set; }
|
||||
|
||||
public InstallDefaultDataSettings? MemberTypes { get; set; }
|
||||
public HelpPageSettings HelpPage { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -115,24 +99,24 @@ namespace JsonSchema
|
||||
/// </summary>
|
||||
public class FormsDefinition
|
||||
{
|
||||
public FormDesignSettings? FormDesign { get; set; }
|
||||
public FormDesignSettings FormDesign { get; set; }
|
||||
|
||||
public PackageOptionSettings? Options { get; set; }
|
||||
public PackageOptionSettings Options { get; set; }
|
||||
|
||||
public Umbraco.Forms.Core.Configuration.SecuritySettings? Security { get; set; }
|
||||
public Umbraco.Forms.Core.Configuration.SecuritySettings Security { get; set; }
|
||||
|
||||
public FieldTypesDefinition? FieldTypes { get; set; }
|
||||
public FieldTypesDefinition FieldTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Configurations for the Umbraco Forms Field Types
|
||||
/// </summary>
|
||||
public class FieldTypesDefinition
|
||||
{
|
||||
public DatePickerSettings? DatePicker { get; set; }
|
||||
public DatePickerSettings DatePicker { get; set; }
|
||||
|
||||
public Recaptcha2Settings? Recaptcha2 { get; set; }
|
||||
public Recaptcha2Settings Recaptcha2 { get; set; }
|
||||
|
||||
public Recaptcha3Settings? Recaptcha3 { get; set; }
|
||||
public Recaptcha3Settings Recaptcha3 { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,11 +125,11 @@ namespace JsonSchema
|
||||
/// </summary>
|
||||
public class DeployDefinition
|
||||
{
|
||||
public DeploySettings? Settings { get; set; }
|
||||
public DeploySettings Settings { get; set; }
|
||||
|
||||
public DeployProjectConfig? Project { get; set; }
|
||||
public DeployProjectConfig Project { get; set; }
|
||||
|
||||
public DebugSettings? Debug { get; set; }
|
||||
public DebugSettings Debug { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="NJsonSchema" Version="10.5.2" />
|
||||
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
|
||||
<PackageReference Include="Umbraco.Deploy.Core" Version="9.3.0" />
|
||||
<PackageReference Include="Umbraco.Forms.Core" Version="9.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy forms xml docs-->
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<IsPackable>false</IsPackable>
|
||||
<EnablePackageValidation>false</EnablePackageValidation>
|
||||
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="NJsonSchema" Version="10.9.0" />
|
||||
</ItemGroup>
|
||||
<Target Name="CopyPackagesXml" BeforeTargets="Build">
|
||||
<ItemGroup>
|
||||
<PackageReferenceFiles Include="$(NugetPackageRoot)%(PackageReference.Identity)\%(PackageReference.Version)%(PackageReference.CopyToOutputDirectory)\lib\**\*.xml" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
|
||||
<PackageReference Include="Umbraco.Deploy.Core" Version="10.4.0" />
|
||||
<PackageReference Include="Umbraco.Forms.Core" Version="10.5.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace JsonSchema
|
||||
{
|
||||
internal class NamespacePrefixedSchemaNameGenerator : DefaultSchemaNameGenerator
|
||||
{
|
||||
public override string Generate(Type type) => type.Namespace?.Replace(".", string.Empty) + base.Generate(type);
|
||||
public override string Generate(Type type) => type.Namespace.Replace(".", string.Empty) + base.Generate(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace JsonSchema
|
||||
{
|
||||
internal class Options
|
||||
{
|
||||
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "appsettings-schema.json")]
|
||||
public string OutputFile { get; set; } = null!;
|
||||
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "../../../../Umbraco.Web.UI/umbraco/config/appsettings-schema.json")]
|
||||
public string OutputFile { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace JsonSchema
|
||||
|
||||
var path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, options.OutputFile));
|
||||
Console.WriteLine("Path to use {0}", path);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
Console.WriteLine("Ensured directory exists");
|
||||
await File.WriteAllTextAsync(path, schema);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NJsonSchema.Generation;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
|
||||
namespace JsonSchema
|
||||
{
|
||||
@@ -42,17 +43,14 @@ namespace JsonSchema
|
||||
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return JsonConvert.DeserializeObject<JObject>(result)!;
|
||||
return JsonConvert.DeserializeObject<JObject>(result);
|
||||
}
|
||||
|
||||
private JObject GenerateUmbracoSchema()
|
||||
{
|
||||
NJsonSchema.JsonSchema schema = _innerGenerator.Generate(typeof(AppSettings));
|
||||
|
||||
// TODO: when the "UmbracoPath" setter is removed from "GlobalSettings" (scheduled for V12), remove this line as well
|
||||
schema.Definitions["UmbracoCmsCoreConfigurationModelsGlobalSettings"]?.Properties?.Remove(nameof(GlobalSettings.UmbracoPath));
|
||||
|
||||
return JsonConvert.DeserializeObject<JObject>(schema.ToJson())!;
|
||||
return JsonConvert.DeserializeObject<JObject>(schema.ToJson());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Builders;
|
||||
|
||||
public class ProblemDetailsBuilder
|
||||
{
|
||||
private string? _title;
|
||||
private string? _detail;
|
||||
private int _status = StatusCodes.Status400BadRequest;
|
||||
private string? _type;
|
||||
|
||||
public ProblemDetailsBuilder WithTitle(string title)
|
||||
{
|
||||
_title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemDetailsBuilder WithDetail(string detail)
|
||||
{
|
||||
_detail = detail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemDetailsBuilder WithStatus(int status)
|
||||
{
|
||||
_status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemDetailsBuilder WithType(string type)
|
||||
{
|
||||
_type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemDetails Build() =>
|
||||
new()
|
||||
{
|
||||
Title = _title,
|
||||
Detail = _detail,
|
||||
Status = _status,
|
||||
Type = _type ?? "Error",
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.New.Cms.Web.Common.Routing;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Configuration;
|
||||
|
||||
public class ConfigureMvcOptions : IConfigureOptions<MvcOptions>
|
||||
{
|
||||
private readonly IOptions<GlobalSettings> _globalSettings;
|
||||
|
||||
public ConfigureMvcOptions(IOptions<GlobalSettings> globalSettings)
|
||||
{
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
public void Configure(MvcOptions options)
|
||||
{
|
||||
// Replace the BackOfficeToken in routes.
|
||||
|
||||
var backofficePath = _globalSettings.Value.UmbracoPath.TrimStart(Constants.CharArrays.TildeForwardSlash);
|
||||
options.Conventions.Add(new UmbracoBackofficeToken(Constants.Web.AttributeRouting.BackOfficeToken, backofficePath));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
|
||||
|
||||
public class AllAnalyticsController : AnalyticsControllerBase
|
||||
{
|
||||
[HttpGet("all")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<TelemetryLevel>), StatusCodes.Status200OK)]
|
||||
public async Task<PagedViewModel<TelemetryLevel>> GetAll(int skip, int take)
|
||||
{
|
||||
TelemetryLevel[] levels = Enum.GetValues<TelemetryLevel>();
|
||||
return await Task.FromResult(new PagedViewModel<TelemetryLevel>
|
||||
{
|
||||
Total = levels.Length,
|
||||
Items = levels.Skip(skip).Take(take),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NSwag.Annotations;
|
||||
using Umbraco.New.Cms.Web.Common.Routing;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
|
||||
|
||||
[ApiController]
|
||||
[BackOfficeRoute("api/v{version:apiVersion}/analytics")]
|
||||
[OpenApiTag("Analytics")]
|
||||
[ApiVersion("1.0")]
|
||||
public abstract class AnalyticsControllerBase : ManagementApiControllerBase
|
||||
{
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Analytics;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
|
||||
|
||||
public class GetAnalyticsController : AnalyticsControllerBase
|
||||
{
|
||||
private readonly IMetricsConsentService _metricsConsentService;
|
||||
|
||||
public GetAnalyticsController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
|
||||
|
||||
[HttpGet]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(AnalyticsLevelViewModel), StatusCodes.Status200OK)]
|
||||
public async Task<AnalyticsLevelViewModel> Get() => await Task.FromResult(new AnalyticsLevelViewModel { AnalyticsLevel = _metricsConsentService.GetConsentLevel() });
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Analytics;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Server;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
|
||||
|
||||
public class SetAnalyticsController : AnalyticsControllerBase
|
||||
{
|
||||
private readonly IMetricsConsentService _metricsConsentService;
|
||||
|
||||
public SetAnalyticsController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
|
||||
|
||||
[HttpPost]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> SetConsentLevel(AnalyticsLevelViewModel analyticsLevelViewModel)
|
||||
{
|
||||
if (!Enum.IsDefined(analyticsLevelViewModel.AnalyticsLevel))
|
||||
{
|
||||
var invalidModelProblem = new ProblemDetails
|
||||
{
|
||||
Title = "Invalid AnalyticsLevel value",
|
||||
Detail = "The provided value for AnalyticsLevel is not valid",
|
||||
Status = StatusCodes.Status400BadRequest,
|
||||
Type = "Error",
|
||||
};
|
||||
return BadRequest(invalidModelProblem);
|
||||
}
|
||||
|
||||
_metricsConsentService.SetConsentLevel(analyticsLevelViewModel.AnalyticsLevel);
|
||||
return await Task.FromResult(Ok());
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Culture;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Culture;
|
||||
|
||||
public class AllCultureController : CultureControllerBase
|
||||
{
|
||||
private readonly IUmbracoMapper _umbracoMapper;
|
||||
|
||||
public AllCultureController(IUmbracoMapper umbracoMapper) => _umbracoMapper = umbracoMapper;
|
||||
|
||||
/// <summary>
|
||||
/// Returns all cultures available for creating languages.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<CultureViewModel>), StatusCodes.Status200OK)]
|
||||
public async Task<PagedViewModel<CultureViewModel>> GetAll(int skip, int take)
|
||||
{
|
||||
IEnumerable<CultureInfo> list = CultureInfo.GetCultures(CultureTypes.AllCultures)
|
||||
.DistinctBy(x => x.Name)
|
||||
.OrderBy(x => x.EnglishName)
|
||||
.Skip(skip)
|
||||
.Take(take);
|
||||
|
||||
return await Task.FromResult(_umbracoMapper.Map<PagedViewModel<CultureViewModel>>(list)!);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NSwag.Annotations;
|
||||
using Umbraco.New.Cms.Web.Common.Routing;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Culture;
|
||||
|
||||
[ApiController]
|
||||
[BackOfficeRoute("api/v{version:apiVersion}/culture")]
|
||||
[OpenApiTag("Culture")]
|
||||
[ApiVersion("1.0")]
|
||||
public abstract class CultureControllerBase : ManagementApiControllerBase
|
||||
{
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree;
|
||||
|
||||
public class ChildrenDataTypeTreeController : DataTypeTreeControllerBase
|
||||
{
|
||||
public ChildrenDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
|
||||
: base(entityService, dataTypeService)
|
||||
{
|
||||
}
|
||||
|
||||
[HttpGet("children")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult<PagedViewModel<FolderTreeItemViewModel>>> Children(Guid parentKey, int skip = 0, int take = 100, bool foldersOnly = false)
|
||||
{
|
||||
RenderFoldersOnly(foldersOnly);
|
||||
return await GetChildren(parentKey, skip, take);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NSwag.Annotations;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.Entities;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.Controllers.Tree;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
|
||||
using Umbraco.New.Cms.Web.Common.Routing;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree;
|
||||
|
||||
[ApiVersion("1.0")]
|
||||
[ApiController]
|
||||
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DataType}/tree")]
|
||||
[OpenApiTag(nameof(Constants.UdiEntityType.DataType))]
|
||||
public class DataTypeTreeControllerBase : FolderTreeControllerBase<FolderTreeItemViewModel>
|
||||
{
|
||||
private readonly IDataTypeService _dataTypeService;
|
||||
|
||||
public DataTypeTreeControllerBase(IEntityService entityService, IDataTypeService dataTypeService)
|
||||
: base(entityService) =>
|
||||
_dataTypeService = dataTypeService;
|
||||
|
||||
protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.DataType;
|
||||
|
||||
protected override UmbracoObjectTypes FolderObjectType => UmbracoObjectTypes.DataTypeContainer;
|
||||
|
||||
protected override FolderTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities)
|
||||
{
|
||||
var dataTypes = _dataTypeService
|
||||
.GetAll(entities.Select(entity => entity.Id).ToArray())
|
||||
.ToDictionary(contentType => contentType.Id);
|
||||
|
||||
return entities.Select(entity =>
|
||||
{
|
||||
FolderTreeItemViewModel viewModel = MapTreeItemViewModel(parentKey, entity);
|
||||
if (dataTypes.TryGetValue(entity.Id, out IDataType? dataType))
|
||||
{
|
||||
viewModel.Icon = dataType.Editor?.Icon ?? viewModel.Icon;
|
||||
}
|
||||
|
||||
return viewModel;
|
||||
}).ToArray();
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree;
|
||||
|
||||
public class ItemsDataTypeTreeController : DataTypeTreeControllerBase
|
||||
{
|
||||
public ItemsDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
|
||||
: base(entityService, dataTypeService)
|
||||
{
|
||||
}
|
||||
|
||||
[HttpGet("items")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(IEnumerable<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult<IEnumerable<FolderTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
|
||||
=> await GetItems(keys);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree;
|
||||
|
||||
public class RootDataTypeTreeController : DataTypeTreeControllerBase
|
||||
{
|
||||
public RootDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
|
||||
: base(entityService, dataTypeService)
|
||||
{
|
||||
}
|
||||
|
||||
[HttpGet("root")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult<PagedViewModel<FolderTreeItemViewModel>>> Root(int skip = 0, int take = 100, bool foldersOnly = false)
|
||||
{
|
||||
RenderFoldersOnly(foldersOnly);
|
||||
return await GetRoot(skip, take);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Dictionary;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class AllDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IUmbracoMapper _umbracoMapper;
|
||||
|
||||
public AllDictionaryController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_umbracoMapper = umbracoMapper;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a list with all dictionary items
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The <see cref="IEnumerable{T}" />.
|
||||
/// </returns>
|
||||
[HttpGet]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<DictionaryOverviewViewModel>), StatusCodes.Status200OK)]
|
||||
public async Task<PagedViewModel<DictionaryOverviewViewModel>> All(int skip, int take)
|
||||
{
|
||||
IDictionaryItem[] items = _localizationService.GetDictionaryItemDescendants(null).ToArray();
|
||||
var list = new List<DictionaryOverviewViewModel>(items.Length);
|
||||
|
||||
// Build the proper tree structure, as we can have nested dictionary items
|
||||
BuildTree(list, items);
|
||||
|
||||
var model = new PagedViewModel<DictionaryOverviewViewModel>
|
||||
{
|
||||
Total = list.Count,
|
||||
Items = list.Skip(skip).Take(take),
|
||||
};
|
||||
return await Task.FromResult(model);
|
||||
}
|
||||
|
||||
// recursive method to build a tree structure from the flat structure returned above
|
||||
private void BuildTree(List<DictionaryOverviewViewModel> list, IDictionaryItem[] items, int level = 0, Guid? parentId = null)
|
||||
{
|
||||
IDictionaryItem[] children = items.Where(t => t.ParentId == parentId).ToArray();
|
||||
if (children.Any() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (IDictionaryItem child in children.OrderBy(item => item.ItemKey))
|
||||
{
|
||||
DictionaryOverviewViewModel? display = _umbracoMapper.Map<IDictionaryItem, DictionaryOverviewViewModel>(child);
|
||||
if (display is not null)
|
||||
{
|
||||
display.Level = level;
|
||||
list.Add(display);
|
||||
}
|
||||
|
||||
BuildTree(list, items, level + 1, child.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Dictionary;
|
||||
using Umbraco.New.Cms.Core.Factories;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class ByIdDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IDictionaryFactory _dictionaryFactory;
|
||||
|
||||
public ByIdDictionaryController(
|
||||
ILocalizationService localizationService,
|
||||
IDictionaryFactory dictionaryFactory)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_dictionaryFactory = dictionaryFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a dictionary item by guid
|
||||
/// </summary>
|
||||
/// <param name="key">
|
||||
/// The id.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="DictionaryDisplay" />. Returns a not found response when dictionary item does not exist
|
||||
/// </returns>
|
||||
[HttpGet("{key:guid}")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(DictionaryViewModel), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult<DictionaryViewModel>> ByKey(Guid key)
|
||||
{
|
||||
IDictionaryItem? dictionary = _localizationService.GetDictionaryItemById(key);
|
||||
if (dictionary == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return await Task.FromResult(_dictionaryFactory.CreateDictionaryViewModel(dictionary));
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Dictionary;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class CreateDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly ILocalizedTextService _localizedTextService;
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly IBackOfficeSecurityAccessor _backofficeSecurityAccessor;
|
||||
private readonly ILogger<CreateDictionaryController> _logger;
|
||||
|
||||
public CreateDictionaryController(
|
||||
ILocalizationService localizationService,
|
||||
ILocalizedTextService localizedTextService,
|
||||
IOptionsSnapshot<GlobalSettings> globalSettings,
|
||||
IBackOfficeSecurityAccessor backofficeSecurityAccessor,
|
||||
ILogger<CreateDictionaryController> logger)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_localizedTextService = localizedTextService;
|
||||
_globalSettings = globalSettings.Value;
|
||||
_backofficeSecurityAccessor = backofficeSecurityAccessor;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new dictionary item
|
||||
/// </summary>
|
||||
/// <param name="dictionaryViewModel">The viewmodel to pass to the action</param>
|
||||
/// <returns>
|
||||
/// The <see cref="HttpResponseMessage" />.
|
||||
/// </returns>
|
||||
[HttpPost("create")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(CreatedResult), StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
public async Task<ActionResult<int>> Create(DictionaryItemViewModel dictionaryViewModel)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dictionaryViewModel.Key.ToString()))
|
||||
{
|
||||
return ValidationProblem("Key can not be empty."); // TODO: translate
|
||||
}
|
||||
|
||||
if (_localizationService.DictionaryItemExists(dictionaryViewModel.Key.ToString()))
|
||||
{
|
||||
var message = _localizedTextService.Localize(
|
||||
"dictionaryItem",
|
||||
"changeKeyError",
|
||||
_backofficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.GetUserCulture(_localizedTextService, _globalSettings),
|
||||
new Dictionary<string, string?>
|
||||
{
|
||||
{ "0", dictionaryViewModel.Key.ToString() },
|
||||
});
|
||||
return await Task.FromResult(ValidationProblem(message));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Guid? parentGuid = null;
|
||||
|
||||
if (dictionaryViewModel.ParentId.HasValue)
|
||||
{
|
||||
parentGuid = dictionaryViewModel.ParentId;
|
||||
}
|
||||
|
||||
IDictionaryItem item = _localizationService.CreateDictionaryItemWithIdentity(
|
||||
dictionaryViewModel.Key.ToString(),
|
||||
parentGuid,
|
||||
string.Empty);
|
||||
|
||||
|
||||
return await Task.FromResult(Created($"api/v1.0/dictionary/{item.Key}", item.Key));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error creating dictionary with {Name} under {ParentId}", dictionaryViewModel.Key, dictionaryViewModel.ParentId);
|
||||
return await Task.FromResult(ValidationProblem("Error creating dictionary item"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class DeleteDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
|
||||
|
||||
public DeleteDictionaryController(ILocalizationService localizationService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
|
||||
}
|
||||
/// <summary>
|
||||
/// Deletes a data type with a given ID
|
||||
/// </summary>
|
||||
/// <param name="key">The key of the dictionary item to delete</param>
|
||||
/// <returns>
|
||||
/// <see cref="HttpResponseMessage" />
|
||||
/// </returns>
|
||||
[HttpDelete("{key}")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Delete(Guid key)
|
||||
{
|
||||
IDictionaryItem? foundDictionary = _localizationService.GetDictionaryItemByKey(key.ToString());
|
||||
|
||||
if (foundDictionary == null)
|
||||
{
|
||||
return await Task.FromResult(NotFound());
|
||||
}
|
||||
|
||||
IEnumerable<IDictionaryItem> foundDictionaryDescendants =
|
||||
_localizationService.GetDictionaryItemDescendants(foundDictionary.Key);
|
||||
|
||||
foreach (IDictionaryItem dictionaryItem in foundDictionaryDescendants)
|
||||
{
|
||||
_localizationService.Delete(dictionaryItem, _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.Id ?? -1);
|
||||
}
|
||||
|
||||
_localizationService.Delete(foundDictionary, _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.Id ?? -1);
|
||||
|
||||
return await Task.FromResult(Ok());
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NSwag.Annotations;
|
||||
using Umbraco.New.Cms.Web.Common.Routing;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
[ApiController]
|
||||
[BackOfficeRoute("api/v{version:apiVersion}/dictionary")]
|
||||
[OpenApiTag("Dictionary")]
|
||||
[ApiVersion("1.0")]
|
||||
// TODO: Add authentication
|
||||
public abstract class DictionaryControllerBase : ManagementApiControllerBase
|
||||
{
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class ExportDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IEntityXmlSerializer _entityXmlSerializer;
|
||||
|
||||
public ExportDictionaryController(ILocalizationService localizationService, IEntityXmlSerializer entityXmlSerializer)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_entityXmlSerializer = entityXmlSerializer;
|
||||
}
|
||||
|
||||
[HttpGet("export/{key:guid}")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(NotFoundObjectResult), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> ExportDictionary(Guid key, bool includeChildren = false)
|
||||
{
|
||||
IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(key);
|
||||
if (dictionaryItem is null)
|
||||
{
|
||||
return await Task.FromResult(NotFound("No dictionary item found with id "));
|
||||
}
|
||||
|
||||
XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren);
|
||||
|
||||
var fileName = $"{dictionaryItem.ItemKey}.udt";
|
||||
|
||||
// Set custom header so umbRequestHelper.downloadFile can save the correct filename
|
||||
HttpContext.Response.Headers.Add("x-filename", fileName);
|
||||
|
||||
return await Task.FromResult(File(Encoding.UTF8.GetBytes(xml.ToDataString()), MediaTypeNames.Application.Octet, fileName));
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.Services;
|
||||
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class ImportDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private readonly IDictionaryService _dictionaryService;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly ILoadDictionaryItemService _loadDictionaryItemService;
|
||||
|
||||
public ImportDictionaryController(
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IDictionaryService dictionaryService,
|
||||
IWebHostEnvironment webHostEnvironment,
|
||||
ILoadDictionaryItemService loadDictionaryItemService)
|
||||
{
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_dictionaryService = dictionaryService;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_loadDictionaryItemService = loadDictionaryItemService;
|
||||
}
|
||||
|
||||
[HttpPost("import")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(ContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> ImportDictionary(string file, int? parentId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(file))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var filePath = Path.Combine(_hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Data), file);
|
||||
if (_webHostEnvironment.ContentRootFileProvider.GetFileInfo(filePath) is null)
|
||||
{
|
||||
return await Task.FromResult(NotFound());
|
||||
}
|
||||
|
||||
IDictionaryItem dictionaryItem = _loadDictionaryItemService.Load(filePath, parentId);
|
||||
|
||||
return await Task.FromResult(Content(_dictionaryService.CalculatePath(dictionaryItem.ParentId, dictionaryItem.Id), MediaTypeNames.Text.Plain, Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Json.Patch;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.Serialization;
|
||||
using Umbraco.Cms.ManagementApi.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Dictionary;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.JsonPatch;
|
||||
using Umbraco.New.Cms.Core.Factories;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class UpdateDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IUmbracoMapper _umbracoMapper;
|
||||
private readonly IDictionaryService _dictionaryService;
|
||||
private readonly IDictionaryFactory _dictionaryFactory;
|
||||
private readonly IJsonPatchService _jsonPatchService;
|
||||
private readonly ISystemTextJsonSerializer _systemTextJsonSerializer;
|
||||
|
||||
public UpdateDictionaryController(
|
||||
ILocalizationService localizationService,
|
||||
IUmbracoMapper umbracoMapper,
|
||||
IDictionaryService dictionaryService,
|
||||
IDictionaryFactory dictionaryFactory,
|
||||
IJsonPatchService jsonPatchService,
|
||||
ISystemTextJsonSerializer systemTextJsonSerializer)
|
||||
{
|
||||
_localizationService = localizationService;
|
||||
_umbracoMapper = umbracoMapper;
|
||||
_dictionaryService = dictionaryService;
|
||||
_dictionaryFactory = dictionaryFactory;
|
||||
_jsonPatchService = jsonPatchService;
|
||||
_systemTextJsonSerializer = systemTextJsonSerializer;
|
||||
}
|
||||
|
||||
[HttpPatch("{id:Guid}")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(ContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Update(Guid id, JsonPatchViewModel[] updateViewModel)
|
||||
{
|
||||
IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(id);
|
||||
|
||||
if (dictionaryItem is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
DictionaryViewModel dictionaryToPatch = _umbracoMapper.Map<DictionaryViewModel>(dictionaryItem)!;
|
||||
|
||||
PatchResult? result = _jsonPatchService.Patch(updateViewModel, dictionaryToPatch);
|
||||
|
||||
if (result?.Result is null)
|
||||
{
|
||||
throw new JsonException("Could not patch the JsonPatchViewModel");
|
||||
}
|
||||
|
||||
DictionaryViewModel? updatedDictionaryItem = _systemTextJsonSerializer.Deserialize<DictionaryViewModel>(result.Result.ToJsonString());
|
||||
if (updatedDictionaryItem is null)
|
||||
{
|
||||
throw new JsonException("Could not serialize from PatchResult to DictionaryViewModel");
|
||||
}
|
||||
|
||||
IDictionaryItem dictionaryToSave = _dictionaryFactory.CreateDictionaryItem(updatedDictionaryItem!);
|
||||
_localizationService.Save(dictionaryToSave);
|
||||
return await Task.FromResult(Content(_dictionaryService.CalculatePath(dictionaryToSave.ParentId, dictionaryToSave.Id), MediaTypeNames.Text.Plain, Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using System.Xml;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.ManagementApi.Models;
|
||||
using Umbraco.Cms.ManagementApi.Services;
|
||||
using Umbraco.Cms.ManagementApi.ViewModels.Dictionary;
|
||||
using Umbraco.Extensions;
|
||||
using Umbraco.New.Cms.Core.Factories;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
|
||||
|
||||
public class UploadDictionaryController : DictionaryControllerBase
|
||||
{
|
||||
private readonly ILocalizedTextService _localizedTextService;
|
||||
private readonly IUploadFileService _uploadFileService;
|
||||
private readonly IDictionaryFactory _dictionaryFactory;
|
||||
|
||||
public UploadDictionaryController(ILocalizedTextService localizedTextService, IUploadFileService uploadFileService, IDictionaryFactory dictionaryFactory)
|
||||
{
|
||||
_localizedTextService = localizedTextService;
|
||||
_uploadFileService = uploadFileService;
|
||||
_dictionaryFactory = dictionaryFactory;
|
||||
}
|
||||
|
||||
[HttpPost("upload")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(DictionaryImportViewModel), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
public async Task<ActionResult<DictionaryImportViewModel>> Upload(IFormFile file)
|
||||
{
|
||||
FormFileUploadResult formFileUploadResult = _uploadFileService.TryLoad(file);
|
||||
if (formFileUploadResult.CouldLoad is false || formFileUploadResult.XmlDocument is null)
|
||||
{
|
||||
return await Task.FromResult(ValidationProblem(
|
||||
_localizedTextService.Localize("media", "failedFileUpload"),
|
||||
formFileUploadResult.ErrorMessage));
|
||||
}
|
||||
|
||||
DictionaryImportViewModel model = _dictionaryFactory.CreateDictionaryImportViewModel(formFileUploadResult);
|
||||
|
||||
if (!model.DictionaryItems.Any())
|
||||
{
|
||||
return ValidationProblem(
|
||||
_localizedTextService.Localize("media", "failedFileUpload"),
|
||||
_localizedTextService.Localize("dictionary", "noItemsInFile"));
|
||||
}
|
||||
|
||||
return await Task.FromResult(model);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user