OptiScaffold 1.0.0

dotnet tool install --global OptiScaffold --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local OptiScaffold --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OptiScaffold&version=1.0.0
                    
nuke :add-package OptiScaffold --version 1.0.0
                    

OptiScaffold

Create new Optimizely blocks & pages with ease, in a simple to used CLI.

⚡️ Quick start

Install via your favorite terminal: dotnet tool install --global OptiScaffold

⚙️ How to use

init

Run the optiscaffolder init command at the root of your project. This creates an opti.scaf file that contains all the variables needed to scaffold your blocks/pages.

The following parameters are required when running the optiscaffolder init command:

-n - The namespace root of all pages/blocks. It is recommended to use feature folders in your Optimizely solution so a good example would be: "SomeCompany.Web.Features". Note that "Blocks" and "Pages" will dynamically be added to this namespace when writing files so do not include them in this parameter.

-b - The fully qualified class name of the block abstract class base, for example: "SomeCompany.Web.Features.Shared.Blocks.SharedBlockData".

-p - The fully qualified class name of the page abstract class base, for example: "SomeCompany.Web.Features.Shared.Pages.SharedPageData".

--blockVm - The fully qualified class name of base block view model, for example: "SomeCompany.Web.Features.Shared.BlockViewModel".

--pagevm - The fully qualified class name of base page view model, for example: "SomeCompany.Web.Features.Shared.ContentViewModel".

In the above examples, the command would be:

optiscaffolder init -n SomeCompany.Web.Features -b SomeCompany.Web.Features.Shared.Blocks.SharedBlockData -p SomeCompany.Web.Features.Shared.Pages.SharedPageData --blockvm SomeCompany.Web.Features.Shared.BlockViewModel --pagevm SomeCompany.Web.Features.Shared.ContentViewModel

block

Run the optiscaffolder block command in the directory you wish to scaffold a new block in. This will scaffold out all the files needed for a new block, along with creating a new GUID on the block file.

The block verb accepts the following required parameters:

-n | --class - The name of the C# class to create, for example: TestBlock. Note that no whitespace is allowed in this parameter.

-c | --cmsname - The name that you want to appear as the "DisplayName" in CMS, for example: "Test Block". Spaces are allowed here.

In the above examples, the command would be:

optiscaffolder block -n TestBlock -c "Test Block"

page

Run the optiscaffolder page command in the directory you wish to scaffold a new page in. This will scaffold out all the files needed for a new page, along with creating a new GUID on the page file.

The page verb accepts the following required parameters:

-n | --class - The name of the C# class to create, for example: TestPage. Note that no whitespace is allowed in this parameter.

-c | --cmsname - The name that you want to appear as the "DisplayName" in CMS, for example: "Test Page". Spaces are allowed here.

In the above examples, the command would be:

optiscaffolder page -n TestPage -c "Test Page"
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.

Version Downloads Last Updated
1.0.0 317 11/16/2023