0.8.0 • Published 1 year ago

@morfeo/cli v0.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@morfeo/cli

Morfeo logo

A Command Line Interface to use morfeo, more details can be found here


Documentation | API | Contributing | Discord


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"

See docs: morfeo build

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

See docs: morfeo compose

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",
  },
};

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

0.8.0

1 year ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.3.0

3 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.0

3 years ago