What’s New and Improved with the SlowCheetah Extension

We are delighted to announce the latest release of the SlowCheetah extension for Visual Studio. For those who are new to SlowCheetah, it’s an extension that lets you easily add transforms that enable different app settings, connection strings and more for different build configurations. You can read more here. In this release, we’ve made several improvements we’re excited to share with you.

Released from the Microsoft Repository

For the first time, SlowCheetah is being released from the Microsoft repository and all future updates will be coming from this repository. If you have any issues or suggestions, please file them in the Issues tab of this repository.

Added JSON Transforms and Support

In this latest update, we’ve added the ability to add JSON transforms, as this is a popular format for config files that weren’t yet supported in SlowCheetah. In Visual Studio 2015 and Visual Studio 2017, you’ll now be able to add both XML and JSON transforms to your projects. Additionally, SlowCheetah supports all project types that support NuGet.

Automatic NuGet Installation

Tired of having to install your NuGet packages manually to get SlowCheetah to work? We’ve added automatic NuGet installation to help streamline your process. All you need to install is the latest extension and SlowCheetah will take care of the rest. When you use SlowCheetah for the first time in a project, it will prompt you to install or update NuGet packages. Agree and you’re ready to go!

clip_image002

JSON Document Transforms

In adding JSON Transforms to SlowCheetah, we found that many existing processes to transform JSON files required learning a new syntax and new keywords, as well as creating a transformation file that looks quite different from your source file. To combat this, we decided to create our own process in the form of JSON Document Transforms or JDT. With JDT, you’ll use the same properties as your source file. Your transformation file will look like your source file, making it easy for you to add JSON transforms even if it’s the first time you’re trying it! Currently, JDT supports Rename, Remove, Merge, and Replace. However, it is possible to use JDT without any knowledge of its syntax, as it will use a default transformation of merging the two files if no advanced keywords are used.

Below, you’ll find an example using the default transformation, as well as Rename.

Default Merge

Source:


{
      "Version": 1,
      "Settings": {
            "Setting01" : "Default01",
            "Setting02" : "Default02"
      },
      "SupportedVersions" : [1, 2, 3]
}

Transform:


{
      "Version": 2,
      "Settings": {
            "Setting01" : "NewValue01",
            "Setting03" : "NewValue03"
      },
      "SupportedVersions" : [4, 5],
      "UseThis" : true
}

Result:


{
      // Overriden by the transformation file
      "Version": 2,
      "Settings": {
            // Overriden by the transformation file
            "Setting01" : "NewValue01",
            // Not present in the transformation file, unchanged
            "Setting02" : "Default02",
            // Added by the transformation file
            "Setting03" : "NewValue03"
      },
      // The array in the transformation file was appended
      "SupportedVersions" : [1, 2, 3, 4, 5],
      // Added by the transformation file
      "UseThis" : true
}

Rename

Source:


{
      "A" : {
            "A1" : 11,
            "A2" : {
            "A21" : 121,
            "A22" : 122
            }
      },
      "B" : [
            21,
            22
      ],
      "C" : 3
}

Transform:


{
      "@JDT.Rename" : {
            "A" : "Astar",
            "B" : "Bstar"
      }
}

Result:


{
      // Does not alter result
      "Astar" : {
            "A1" : 11,
            "A2" : {
            "A21" : 121,
            "A22" : 122
            }
      },
      // Independs on object type
      "Bstar" : [
            21,
            22
      ],
      // Does not alter siblings
      "C" : 3
}

For more information, check out our wiki on JDT.

Thanks for reading! We hope you have a transformative experience with the newest updated to SlowCheetah! If you’d like to report an issue or have a suggestion, please use the Issues tab on our GitHub to let us know. We always welcome your feedback!

Allison Buchholtz-Au, Program Manager, Visual Studio Platform

Allison is a Program Manager on the Visual Studio Platform team, focusing on streamlining source control workflows and supporting both our first and third party source control providers.