Skip to main content

cli

Installation

with npm:

npm install -g @morfeo/cli
# or npm install --save-dev @morfeo/cli

or yarn:

yarn global add @morfeo/cli
# or yarn add --dev @morfeo/cli

Usage

morfeo <command>

Commands:
morfeo build [name] [options] build css styles based on your themes
morfeo compose [name] [options] compose morfeo style files into themes

Options:
--version Show version number [boolean]
--help Show help [boolean]

Commands

morfeo build

build css styles based on your themes

morfeo build [options]

build css styles based on your themes

Options:
--version Show version number [boolean]
--help Show help [boolean]
-t, --theme [string]
-n, --name an identifier for the passed theme, for example "light", "dark" [string] [default: "default"]
-b, --build the path where the generated css files will be placed [string]
-c, --config the path to the configuration file [string] [default: ".morfeorc"]

Examples:
simple morfeo build
with custom config morfeo build --config="configurations/.morfeorc"
custom options morfeo build --theme="path/to/theme.ts" --name="light"

morfeo compose

compose morfeo style files into themes

morfeo compose [options]

compose morfeo style files into themes

Options:
--version Show version number [boolean]
--help Show help [boolean]
-w, --watch watch file changes [boolean] [default: false]
-c, --config the path to the configuration file [string] [default: ".morfeorc"]

Examples:
simple morfeo compose
watch morfeo compose --watch

Configuration

Global configuration could be specified in a file called by default .morfeorc.(js|json|ts), this file should export an object that follow this structure:

type MorfeoConfig = {
/**
* the path where the generated css files will be placed
*/
buildPath?: string;
/**
* An object where the key is the theme name and the value is the path to the theme.
* @example
* ```json
* {
* "dark": "path/to/darkTheme",
* "light": "path/to/lightTheme",
* }
* ```
*/
themes: Record<string, string>;
};

for example these formats are all valid configurations:

.morfeorc.ts
export default {
buildPath: './src/styles',
themes: {
light: './src/themes/lightTheme.ts',
dark: './src/themes/darkTheme.ts',
},
};
.morfeorc.js
module.exports = {
buildPath: './src/styles',
themes: {
light: './src/themes/lightTheme.ts',
dark: './src/themes/darkTheme.ts',
},
};
.morfeorc.json
{
"buildPath": "./src/styles",
"themes": {
"light": "./src/themes/lightTheme.ts",
"dark": "./src/themes/darkTheme.ts",
},
};
info

with the flag -c or ---config you can specify a different path for the configuration, for example:

morfeo build --config=src/configs/morfeo.config.ts