Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package.json fields configuration to usage in cli #435

Closed
kareniel opened this issue Feb 23, 2018 · 2 comments
Closed

Add package.json fields configuration to usage in cli #435

kareniel opened this issue Feb 23, 2018 · 2 comments

Comments

@kareniel
Copy link
Member

kareniel commented Feb 23, 2018

Configuring Bankai is done by modifying package.json. It'd be cool if you could get the usage info for the browserify, sheetify, and documentify fields in the usage text (--help) in the CLI.

Possible approach

Not sure about the wording, but:

  1. Add this line to usage:
For configuration usage, type `bankai --help config`.
  1. Output something like this:
Configuration


Bankai is built on top of compilers for scripts, styles and documents. 
Each of them can be configured by adding a field to your project's package.json.

These three fields are, respectively: "browserify", "sheetify" and "documentify".
Each one should have a configuration object as it's value.

There is currently one possible configuration field: "transform".

It can be one of either:

1. An array of transform names. 
       ie:  [ "babelify" ]
2. An array of tuples transform name + configuration object. 
       ie: [[ "babelify", { "presets": [ "env" ] } ]]

Full example:

{
  "browserify": {
    "transform": [
      [ "babelify", { "presets": [ "env" ] } ]
    ]
  },
  "sheetify": {
    "transform": [
      "sheetify-cssnext"
    ]
  },
  "documentify": {
    "transform": [
      [ "posthtmlify", { "use": [ "posthtml-custom-elements" ] } ]
    ]
  }
}

  1. Profit
@yoshuawuyts
Copy link
Member

@kareniel that's a great idea!

@kareniel
Copy link
Member Author

kareniel commented Mar 7, 2018

Closed by #437 :)

@kareniel kareniel closed this as completed Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants