@mhy/config

> This documentation is not complete. It's in progress and it's a BETA version. Use the tool at your own risk.

Please use 'npm i mhy -g'
Last updated a year ago by wintercounter .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mhy/config 
SYNC missed versions from official npm registry.

WARNING!

This documentation is not complete. It's in progress and it's a BETA version. Use the tool at your own risk.

@mhy/config

This lib is a collection of all configuration and UI panels (ecosystem) @mhy uses.

Config

Load configuration based on the current environment from folders (see repo) and/or from a project's package.json file. The final object structure is being represented in the directory/package.json structure. (see repo)

Config options are being separated into environments. By default @mhy uses root (always used), development and production.

Examples

// Dir structure
foo
  index.js
  development
      bar.js => exports 1
  production
      baz.js => exports 2
  root
      fip.js => exports 3

API

import { load } from '@mhy/config'

load('foo')

CLI

mhy config foo

Output

{
    bar: 1,
    fip: 3
}
*/

baz is missing because development env is default thus it's not being loaded.

Defining env

// *nix
NODE_ENV=production mhy config foo

// Windows
set NODE_ENV=production&& mhy config foo // not a typo, no space needed there!

CLI

It'll return the configuration object being used from @mhy/config.

// Print out config
mhy config webpack

// Print out config in different format
mhy config babel -f json
mhy config babel --format=json

// Print out config in different format and save into a file
mhy config babel -f json >> .babelrc

Custom overrides

using files/folders

Structure

webpack
  development
     devServer.js

devServer.js file

module.exports = (defaults) => ({
    ...defaults,
    host: 'my-host.com'
})

Using package.json

package.json file

{
    ...
    "mhy" {
       "webpack": {
           "development": {
               "devServer": {
                   "host": "my-host.com"
               }
           }
       }
    }
    ...
}

Flow

  1. Load root config from package dir/files.
  2. Load env config from package dir/files.
  3. Load root config from project package.json.
  4. Load env config from project package.json.

UI

UIs are basically built-in ecosystem tasks. You can run all of them at once or separately.

// Run ecosystem (ui) (default)
mhy
mhy ui

// Run specific ui process only
mhy webpack-dev-server
mhy run webpack-dev-server

// Run specific process only with specific task
mhy jest watch
mhy run jest watch

Navigation with-in UI

  • Tab change active panel
  • Left/Right arrow select action
  • Enter run selected action
  • Up/Down arrow scroll up/down in the selected panel

UI Panels

By default the following panels are enabled when you simply run mhy:

  • jest
  • storybook-start
  • webpack-dev-server
  • tsc

Disabled by default:

  • prettier webpack-dev-server already handles it, but it can be useful to run it before pushing commits and such.

However, you can can explicitly enable/disable panels in package.json per environment, or explicitly tell which panels to run in CLI.

mhy ui prettier storybook-start

Enabling panels

"mhy": {
    "ui": {
        "root": {
            "enabled": [
                "prettier"
            ]
        }
    }
}

Disabling panels

"mhy": {
    "ui": {
        "root": {
            "disabled": [
                "tsc"
            ]
        }
    }
}

Current Tags

  • 0.19.9                                ...           latest (a year ago)

197 Versions

  • 0.19.9 [deprecated]           ...           a year ago
  • 0.19.7 [deprecated]           ...           a year ago
  • 0.19.6 [deprecated]           ...           a year ago
  • 0.19.5 [deprecated]           ...           a year ago
  • 0.19.4 [deprecated]           ...           a year ago
  • 0.19.3 [deprecated]           ...           a year ago
  • 0.19.2 [deprecated]           ...           a year ago
  • 0.19.1 [deprecated]           ...           a year ago
  • 0.19.0 [deprecated]           ...           a year ago
  • 0.18.16 [deprecated]           ...           a year ago
  • 0.18.15 [deprecated]           ...           a year ago
  • 0.18.14 [deprecated]           ...           a year ago
  • 0.18.12 [deprecated]           ...           a year ago
  • 0.18.11 [deprecated]           ...           a year ago
  • 0.18.10 [deprecated]           ...           a year ago
  • 0.18.8 [deprecated]           ...           a year ago
  • 0.18.6 [deprecated]           ...           a year ago
  • 0.18.5 [deprecated]           ...           2 years ago
  • 0.18.4 [deprecated]           ...           2 years ago
  • 0.18.2 [deprecated]           ...           2 years ago
  • 0.18.1 [deprecated]           ...           2 years ago
  • 0.18.0 [deprecated]           ...           2 years ago
  • 0.17.2 [deprecated]           ...           2 years ago
  • 0.17.1 [deprecated]           ...           2 years ago
  • 0.17.0 [deprecated]           ...           2 years ago
  • 0.16.4 [deprecated]           ...           2 years ago
  • 0.16.3 [deprecated]           ...           2 years ago
  • 0.16.2 [deprecated]           ...           2 years ago
  • 0.16.1 [deprecated]           ...           2 years ago
  • 0.16.0 [deprecated]           ...           2 years ago
  • 0.15.22 [deprecated]           ...           2 years ago
  • 0.15.21 [deprecated]           ...           2 years ago
  • 0.15.20 [deprecated]           ...           2 years ago
  • 0.15.19 [deprecated]           ...           2 years ago
  • 0.15.18 [deprecated]           ...           2 years ago
  • 0.15.17 [deprecated]           ...           2 years ago
  • 0.15.16 [deprecated]           ...           2 years ago
  • 0.15.15 [deprecated]           ...           2 years ago
  • 0.15.14 [deprecated]           ...           2 years ago
  • 0.15.12 [deprecated]           ...           2 years ago
  • 0.15.11 [deprecated]           ...           2 years ago
  • 0.15.10 [deprecated]           ...           2 years ago
  • 0.15.9 [deprecated]           ...           2 years ago
  • 0.15.8 [deprecated]           ...           2 years ago
  • 0.15.7 [deprecated]           ...           2 years ago
  • 0.15.6 [deprecated]           ...           2 years ago
  • 0.15.5 [deprecated]           ...           2 years ago
  • 0.15.4 [deprecated]           ...           2 years ago
  • 0.15.3 [deprecated]           ...           2 years ago
  • 0.15.2 [deprecated]           ...           2 years ago
  • 0.15.1 [deprecated]           ...           2 years ago
  • 0.15.0 [deprecated]           ...           2 years ago
  • 0.14.1 [deprecated]           ...           2 years ago
  • 0.14.0 [deprecated]           ...           2 years ago
  • 0.13.3 [deprecated]           ...           2 years ago
  • 0.13.2 [deprecated]           ...           2 years ago
  • 0.13.1 [deprecated]           ...           2 years ago
  • 0.13.0 [deprecated]           ...           2 years ago
  • 0.12.1 [deprecated]           ...           2 years ago
  • 0.12.0 [deprecated]           ...           2 years ago
  • 0.11.1 [deprecated]           ...           2 years ago
  • 0.11.0 [deprecated]           ...           2 years ago
  • 0.10.5 [deprecated]           ...           2 years ago
  • 0.10.3 [deprecated]           ...           2 years ago
  • 0.10.2 [deprecated]           ...           2 years ago
  • 0.10.1 [deprecated]           ...           2 years ago
  • 0.10.0 [deprecated]           ...           2 years ago
  • 0.9.5 [deprecated]           ...           2 years ago
  • 0.9.4 [deprecated]           ...           2 years ago
  • 0.9.3 [deprecated]           ...           2 years ago
  • 0.9.2 [deprecated]           ...           2 years ago
  • 0.9.1 [deprecated]           ...           2 years ago
  • 0.9.0 [deprecated]           ...           2 years ago
  • 0.8.6 [deprecated]           ...           2 years ago
  • 0.8.5 [deprecated]           ...           2 years ago
  • 0.8.4 [deprecated]           ...           2 years ago
  • 0.8.3 [deprecated]           ...           2 years ago
  • 0.8.2 [deprecated]           ...           2 years ago
  • 0.8.1 [deprecated]           ...           2 years ago
  • 0.8.0 [deprecated]           ...           2 years ago
  • 0.7.8 [deprecated]           ...           2 years ago
  • 0.7.7 [deprecated]           ...           2 years ago
  • 0.7.6 [deprecated]           ...           2 years ago
  • 0.7.5 [deprecated]           ...           2 years ago
  • 0.7.4 [deprecated]           ...           2 years ago
  • 0.7.3 [deprecated]           ...           2 years ago
  • 0.7.2 [deprecated]           ...           2 years ago
  • 0.7.1 [deprecated]           ...           2 years ago
  • 0.7.0 [deprecated]           ...           2 years ago
  • 0.6.2 [deprecated]           ...           2 years ago
  • 0.6.1 [deprecated]           ...           2 years ago
  • 0.6.0 [deprecated]           ...           2 years ago
  • 0.5.18 [deprecated]           ...           2 years ago
  • 0.5.17 [deprecated]           ...           2 years ago
  • 0.5.16 [deprecated]           ...           2 years ago
  • 0.5.15 [deprecated]           ...           2 years ago
  • 0.5.14 [deprecated]           ...           2 years ago
  • 0.5.13 [deprecated]           ...           2 years ago
  • 0.5.12 [deprecated]           ...           2 years ago
  • 0.5.11 [deprecated]           ...           2 years ago
  • 0.5.10 [deprecated]           ...           2 years ago
  • 0.5.9 [deprecated]           ...           2 years ago
  • 0.5.8 [deprecated]           ...           2 years ago
  • 0.5.6 [deprecated]           ...           2 years ago
  • 0.5.5 [deprecated]           ...           2 years ago
  • 0.5.4 [deprecated]           ...           2 years ago
  • 0.5.3 [deprecated]           ...           2 years ago
  • 0.5.2 [deprecated]           ...           2 years ago
  • 0.5.1 [deprecated]           ...           2 years ago
  • 0.5.0 [deprecated]           ...           2 years ago
  • 0.4.19 [deprecated]           ...           2 years ago
  • 0.4.18 [deprecated]           ...           2 years ago
  • 0.4.17 [deprecated]           ...           2 years ago
  • 0.4.16 [deprecated]           ...           2 years ago
  • 0.4.15 [deprecated]           ...           2 years ago
  • 0.4.14 [deprecated]           ...           2 years ago
  • 0.4.13 [deprecated]           ...           2 years ago
  • 0.4.12 [deprecated]           ...           2 years ago
  • 0.4.11 [deprecated]           ...           2 years ago
  • 0.4.10 [deprecated]           ...           2 years ago
  • 0.4.9 [deprecated]           ...           2 years ago
  • 0.4.8 [deprecated]           ...           2 years ago
  • 0.4.7 [deprecated]           ...           2 years ago
  • 0.4.6 [deprecated]           ...           2 years ago
  • 0.4.5 [deprecated]           ...           2 years ago
  • 0.4.4 [deprecated]           ...           2 years ago
  • 0.4.3 [deprecated]           ...           2 years ago
  • 0.4.2 [deprecated]           ...           2 years ago
  • 0.4.1 [deprecated]           ...           2 years ago
  • 0.4.0 [deprecated]           ...           2 years ago
  • 0.3.5 [deprecated]           ...           2 years ago
  • 0.3.4 [deprecated]           ...           2 years ago
  • 0.3.3 [deprecated]           ...           2 years ago
  • 0.3.2 [deprecated]           ...           2 years ago
  • 0.3.1 [deprecated]           ...           2 years ago
  • 0.3.0 [deprecated]           ...           2 years ago
  • 0.2.19 [deprecated]           ...           2 years ago
  • 0.2.18 [deprecated]           ...           2 years ago
  • 0.2.17 [deprecated]           ...           2 years ago
  • 0.2.16 [deprecated]           ...           2 years ago
  • 0.2.15 [deprecated]           ...           2 years ago
  • 0.2.14 [deprecated]           ...           2 years ago
  • 0.2.13 [deprecated]           ...           2 years ago
  • 0.2.12 [deprecated]           ...           2 years ago
  • 0.2.11 [deprecated]           ...           2 years ago
  • 0.2.10 [deprecated]           ...           2 years ago
  • 0.2.9 [deprecated]           ...           2 years ago
  • 0.2.8 [deprecated]           ...           2 years ago
  • 0.2.7 [deprecated]           ...           2 years ago
  • 0.2.6 [deprecated]           ...           2 years ago
  • 0.2.5 [deprecated]           ...           2 years ago
  • 0.2.4 [deprecated]           ...           2 years ago
  • 0.2.3 [deprecated]           ...           2 years ago
  • 0.2.2 [deprecated]           ...           2 years ago
  • 0.2.1 [deprecated]           ...           2 years ago
  • 0.2.0 [deprecated]           ...           2 years ago
  • 0.1.15 [deprecated]           ...           2 years ago
  • 0.1.14 [deprecated]           ...           2 years ago
  • 0.1.13 [deprecated]           ...           2 years ago
  • 0.1.12 [deprecated]           ...           2 years ago
  • 0.1.11 [deprecated]           ...           2 years ago
  • 0.1.10 [deprecated]           ...           2 years ago
  • 0.1.9 [deprecated]           ...           2 years ago
  • 0.1.8 [deprecated]           ...           2 years ago
  • 0.1.7 [deprecated]           ...           2 years ago
  • 0.1.6 [deprecated]           ...           2 years ago
  • 0.1.5 [deprecated]           ...           2 years ago
  • 0.1.4 [deprecated]           ...           2 years ago
  • 0.1.3 [deprecated]           ...           2 years ago
  • 0.1.2 [deprecated]           ...           2 years ago
  • 0.1.1 [deprecated]           ...           2 years ago
  • 0.1.0 [deprecated]           ...           2 years ago
  • 0.0.25 [deprecated]           ...           2 years ago
  • 0.0.24 [deprecated]           ...           2 years ago
  • 0.0.23 [deprecated]           ...           2 years ago
  • 0.0.22 [deprecated]           ...           2 years ago
  • 0.0.21 [deprecated]           ...           2 years ago
  • 0.0.20 [deprecated]           ...           2 years ago
  • 0.0.19 [deprecated]           ...           2 years ago
  • 0.0.18 [deprecated]           ...           2 years ago
  • 0.0.17 [deprecated]           ...           2 years ago
  • 0.0.16 [deprecated]           ...           2 years ago
  • 0.0.15 [deprecated]           ...           2 years ago
  • 0.0.14 [deprecated]           ...           2 years ago
  • 0.0.13 [deprecated]           ...           2 years ago
  • 0.0.12 [deprecated]           ...           2 years ago
  • 0.0.11 [deprecated]           ...           2 years ago
  • 0.0.10 [deprecated]           ...           2 years ago
  • 0.0.9 [deprecated]           ...           2 years ago
  • 0.0.8 [deprecated]           ...           2 years ago
  • 0.0.7 [deprecated]           ...           2 years ago
  • 0.0.6 [deprecated]           ...           2 years ago
  • 0.0.5 [deprecated]           ...           2 years ago
  • 0.0.4 [deprecated]           ...           2 years ago
  • 0.0.3 [deprecated]           ...           2 years ago
  • 0.0.2 [deprecated]           ...           2 years ago
  • 0.0.1 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |