Skip to content

Commit

Permalink
V14/json convert (#586)
Browse files Browse the repository at this point in the history
* extension methods.

* Json the core.

* remove more newtonsoft.

* Tidy up extension names.

* build action for v14

* action script update

* npm run.

* npm install --force

* feed

* remove repo.

* Caching nuget.

* Add comment in build script
  • Loading branch information
KevinJump authored Feb 20, 2024
1 parent 22951f3 commit fb57d36
Show file tree
Hide file tree
Showing 147 changed files with 9,895 additions and 9,922 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.304"
dotnet-version: "8.x"

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
Expand All @@ -43,18 +43,33 @@ jobs:
- name: Restore npm
uses: actions/setup-node@v3
with:
node-version: 18
node-version: '20.x'
cache: 'npm'
- run: npm install

# install and run the packages for our assets folder.
- name: Build Management client
run: |
npm run install-client
npm run build-client
- name: Display GitVersion SemVer
run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
# ------------------------
# actual builds / packages
# ------------------------
- name: Restore

# use nuget cache.
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashfiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore Dependencies
run: dotnet restore ./uSync/uSync.csproj

- name: tests
Expand All @@ -75,11 +90,14 @@ jobs:
- name: Build uSync.BackOffice
run: dotnet pack ./uSync.BackOffice/uSync.BackOffice.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}

- name: Build uSync.BackOfficeAssets
run: dotnet pack ./uSync.BackOffice.Assets/uSync.BackOffice.Assets.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.Backoffice.Management.Api
run: dotnet pack ./uSync.BackOffice.Management.Api/uSync.BackOffice.Management.Api.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}

- name: Build uSync.Backoffice.Management.Client
run: dotnet pack ./uSync.BackOffice.Management.Client/uSync.BackOffice.Management.Client.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}

- name: Build uSync.BackOfficeTargets
run: dotnet pack ./uSync.BackOffice.Targets/uSync.BackOffice.Targets.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
run: dotnet pack ./uSync.BackOffice.Targets/uSync.BackOffice.Targets.csproj -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}

- name: Build uSync
run: dotnet pack ./uSync/uSync.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
Expand All @@ -97,7 +115,8 @@ jobs:
dotnet nuget push ./build.out/uSync.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Core.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Assets.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Management.Api.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Management.Client.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Targets.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Community.Contrib.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Community.DataTypeSerializers.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

<PackageIcon>usync-logo.png</PackageIcon>

<!--
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
-->

<NoWarn>CS0618</NoWarn>

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": "true",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install-client": "cd ./uSync.Backoffice.Management.Client/Assets && npm install --force",
"watch-client": "cd ./uSync.Backoffice.Management.Client/Assets && npm run watch",
"build-client": "cd ./uSync.Backoffice.Management.Client/Assets && npm run build",
"generate-api": "cd ./uSync.Backoffice.Management.Client/Assets && npm run generate"
Expand Down
6 changes: 1 addition & 5 deletions uSync.BackOffice/Configuration/uSyncHandlerSetSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;

using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;

Expand All @@ -10,7 +7,6 @@ namespace uSync.BackOffice.Configuration
/// <summary>
/// Settings for a handler set (group of handlers)
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncHandlerSetSettings
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Configuration/uSyncHandlerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
using System.Collections.Generic;
using System.ComponentModel;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Umbraco.Extensions;

namespace uSync.BackOffice.Configuration
{
/// <summary>
/// Settings to control who a handler works
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class HandlerSettings
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Configuration/uSyncSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
using System.Collections.Generic;
using System.ComponentModel;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Configuration
{
/// <summary>
/// uSync Settings
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncSettings
{
/// <summary>
Expand Down
6 changes: 1 addition & 5 deletions uSync.BackOffice/Hubs/uSyncUpdateMessage.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Hubs
namespace uSync.BackOffice.Hubs
{
/// <summary>
/// update message sent via uSync to client
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncUpdateMessage
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Models/AddOnInfo.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System.Collections.Generic;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
{
/// <summary>
/// Information about uSync AddOns (displayed in version string)
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class AddOnInfo
{
/// <summary>
Expand Down
6 changes: 1 addition & 5 deletions uSync.BackOffice/Models/ISyncAddOn.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
namespace uSync.BackOffice.Models
{
/// <summary>
/// An add on to uSync, which allows you to inject a view onto the uSync page
/// just like a content app.
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public interface ISyncAddOn
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Models/SyncActionOptions.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
{
/// <summary>
/// Options to tell uSync how to process an action
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncActionOptions
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Models/SyncActionResult.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System.Collections.Generic;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
{
/// <summary>
/// Result of a series of actions performed by a controller
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncActionResult
{
/// <summary>
Expand Down
7 changes: 1 addition & 6 deletions uSync.BackOffice/Models/SyncHandlerView.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
namespace uSync.BackOffice.Models
{
/// <summary>
/// view model of a handler, sent to the UI to draw the handler boxes.
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncHandlerView
{
/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions uSync.BackOffice/Models/SyncProgressModels.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using System.Collections.Generic;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using uSync.BackOffice.SyncHandlers;

namespace uSync.BackOffice.Models
{
/// <summary>
/// Progress summary - object that tells the UI to draw the handler icons while uSync works.
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncProgressSummary
{
/// <summary>
Expand Down Expand Up @@ -138,7 +134,6 @@ public void Increment()
/// <summary>
/// Summary object used to display a summary of progress via the UI
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncHandlerSummary
{
/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions uSync.BackOffice/Models/uSyncImportOptions.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
using System;
using System.Collections.Generic;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using uSync.Core.Serialization;

namespace uSync.BackOffice.Models
{
/// <summary>
/// options passed to an import, report or export of an item.
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncImportOptions
{
/// <summary>
Expand Down Expand Up @@ -70,7 +66,6 @@ public class uSyncImportOptions
/// <summary>
/// Import options when paging any import operations
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncPagedImportOptions : uSyncImportOptions
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/Models/uSyncOptions.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System.Runtime.Serialization;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.Models
{
/// <summary>
/// Options passed to Import/Export methods by JS calls
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class uSyncOptions
{
/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions uSync.BackOffice/SyncHandlers/Interfaces/ISyncHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using System.Collections.Generic;
using System.Xml.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Umbraco.Cms.Core;

using uSync.BackOffice.Configuration;
Expand All @@ -23,7 +20,6 @@ namespace uSync.BackOffice.SyncHandlers
/// <summary>
/// Handler interface for anything that wants to process elements via uSync
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public interface ISyncHandler
{
/// <summary>
Expand Down
7 changes: 1 addition & 6 deletions uSync.BackOffice/SyncHandlers/Models/SyncHandlerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace uSync.BackOffice.SyncHandlers
namespace uSync.BackOffice.SyncHandlers
{
/// <summary>
/// options that define how we define a handler
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class SyncHandlerOptions
{
/// <summary>
Expand Down
6 changes: 0 additions & 6 deletions uSync.BackOffice/uSyncAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
using System.Linq;
using System.Text.Json.Serialization;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;

using uSync.Core;
using uSync.Core.Models;

Expand All @@ -15,7 +11,6 @@ namespace uSync.BackOffice
/// <summary>
/// A uSyncAction details what just happed when an Handler did something to an item
/// </summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public struct uSyncAction
{
/// <summary>
Expand Down Expand Up @@ -46,7 +41,6 @@ public struct uSyncAction
/// <summary>
/// type of change performed
/// </summary>
[Newtonsoft.Json.JsonConverter(typeof(StringEnumConverter))]
[System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))]
public ChangeType Change { get; set; }

Expand Down
Loading

0 comments on commit fb57d36

Please sign in to comment.