Fluid CLI

## Fluid Design System CLI by ENGIE

This package regroups helper scripts and acts as a CLI for Fluid. As of v0.1.0, it mainly helps for the Fluid tokens migration.

Getting started

You can either directly run the CLI with npx or install the package globally:

# Though npx
npx @engie-group/fluid-cli


# Installing the package globally
npm i -g @engie-group/fluid-cli

# Then running the CLI

Use the help option to list all the available commands and their use.

nj-fluid-cli --help

Tokens migration

Util to migrate tokens to a new version.

As some tokens have been removed, the script will replace those tokens by the same name but will add prefix REMOVED. Be careful when the migration is done you should check for --nj-REMOVED in all your files and replace them with the correct token.

# Use npx
npx @engie-group/fluid-cli tokens migrate


# Then
nj-fluid-cli tokens migrate

The script will by default:

  • run at the root of the folder you currently are in,
  • replace tokens in css, scss, sass, less.

You can change the default behaviour by passing option arguments.

Access all other options with

npx nj-fluid-cli tokens migrate --help


-d, --dir to pass the dir path in which you want to proceed with the migration (default to .):

# Example with a custom path
npx @engie-group/fluid-cli --dir "path/to/your/files/"

-f, --files files extensions in which we want to proceed to migration, extensions should be seperated by comma. e.g: --files "ts, js", (default to: css, scss, sass, less):

# Example for a static website with only html, markdown and css
npx @engie-group/fluid-cli --files "html, md, css"

-e, --exclude files regex you want to ignore, regex should be seperated by comma. (default to: **/node_modules/**, **/*-lock.*, **/*.lock, **/package.json, **/*.map):

# Example with custom exclude
npx @engie-group/fluid-cli --exclude "**/node_modules/**, **/*-lock.*"

--versions from which to which version you are migrating, available options are listed when using help. Always defaults to latest migration,

# Example with versions
npx @engie-group/fluid-cli --versions "5.3To5.4"

-v, --verbose: verbose mode to display more info (default: false)

# Example with verbose
npx @engie-group/fluid-cli --verbose true