LrndefLib 2.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package LrndefLib --version 2.0.0
NuGet\Install-Package LrndefLib -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LrndefLib" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LrndefLib --version 2.0.0
#r "nuget: LrndefLib, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LrndefLib as a Cake Addin
#addin nuget:?package=LrndefLib&version=2.0.0

// Install LrndefLib as a Cake Tool
#tool nuget:?package=LrndefLib&version=2.0.0

LrndefLib

LrndefLib provides a version-based config file

GitHub license GitHub release (latest SemVer) GitHub release (latest SemVer including pre-releases) Nuget Nuget (with prereleases)

Goals

Version Ambiguity

The config file implementation provided by TShock can't differentiate between config versions without iterating the whole file. LrndefLib provides an alternative implementation that instead compares a single property "metadata:version". However, the schema isn't strictly enforced

Migrations

LrndefLib allows for config migrations during parsing. However, you need to provide your own migration implementation. LrndefLib can't migrate by default, it binds the config 1:1 as if it were any other version

Migrations can be implemented by modifying VersionedConfigFile.BindDelegate. The delegate is called in the middle of parsing to bind a JObject to a config object

Installation

With Visual Studio/NuGet

  1. Open NuGet
  2. Search for "LrndefLib"
  3. Install

With Paket(HTTP) (Old Way)

  1. Add http https://github.com/Arthri/LrndefLib/releases/download/[VERSION]/LrndefLib.[VERSION].nupkg packages/LrndefLib/[VERSION]/LrndefLib.[VERSION].nupkg to your paket.dependencies
    • Replace [VERSION] with your desired version. DO NOT use latest.
  2. Add source paket-files/github.com/packages, also to paket.dependencies
  3. Reference in projects via paket.references
  4. Run dotnet paket install

Usage

  1. Create a new instance of VersionedConfigFile like so: var configFile = new VersionedConfigFile<TSettings>(CurrentVersion);
    • replace TSettings with the settings class
    • replace CurrentVersion with the current version of the config
  2. Read the config file: configFile.Read(configPath, out bool _);

Unofficial Conventions

CurrentVersion

A config's "CurrentVersion" is its latest iteration. Ideally, it should follow SemVer. Since configs change rarely, ideally, CurrentVersion should NOT be derived from the assembly version

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated

Removed VersionedSettings and constraint. More info at https://github.com/Arthri/LrndefLib/releases/tag/2.0.0