Upgrading from CLI 1.x.x to 2.0.0

CLI 1.x.x compatability

CLI 1.x.x is compatible with latest Interplay release.

So the previous CLI version 1.0.19 is compatible with the latest Interplay API (Sep 2021).

Changes in CLI 2.x.x

Changes to settings file structure

CLI 2.x.x uses a slightly different settings file structure from CLI 1.x.x.

Previously there were the following two settings files for the CLI, stored in the interplay folder

  • interplay.json for the configuration settings
  • interplay.js (optional) for the modifiers functions and event handlers

These have been re-organised into a new .interplay folder

  • interplay.config.js that combines the old settings
  • targets.json which can contain multiple team/project targets for your deploys. It defaults to one single default target.

CLI 2.x.x is not compatible with the old interplay.json configuration files.

Preset Handling

CLI 1.x.x had 2 different preset parsing modes, and only limited control of which component instances in parsed story/docs files were selected for import as presets (examples) - a Button preset may be generated from Button.story.js, but could also be generated from a Button instance in Card.story.js

CLI 2.x.x consolidates these parsing modes into a single parsing mode, and now supports preset matching rules, which allow you to set rules by which presets will be created. This means that you can specify e.g. only create Button presets from instances found in Button.story.js

Because of this different processing, a slightly different set of presets will likely be returned by CLI 2.x.x compared to CLI 1.x.x.. The additional control should mean we can curate a better set of presets. We recommend experimenting with these settings - please contact us when you are ready to upgrade.

For more details about presetRules, please see

Upgrade steps

👉

We would love to help you upgrade - please let us know and we can run through the steps on a call together.

  1. Install CLI 2.0.0 and run interplay --version to verify the correct latest version is showing
  2. Run interplay init to create new template settings files. These will be created as:
  3. .interplay/interplay.config.js

    .interplay/targets.json

  4. Cut and paste the teamId and projectId from your old interplay/interplay.json into the targets.json folder, replacing the existing values under default
  5. Cut and paste the remaining settings from interplay.json and interplay.js into interplay.config.js
  6. Adjust the default presetRules as required for your repo (we can help you do this)
  7. Run the stages of the new CLI in sequence and check each stage completes as expected:
  8. interplay build

    interplay parse

    interplay deploy

  9. You can rename the old interplay folder to archive it, as it is not used by CLI 2+. Please update your gitignore settings to save your new CLI config
  10. //.gitignore
    //ignore subfolders of .interplay unless you have added files to save
    .interplay/*/