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

Update stringify method #94

Open
skad0 opened this issue Jan 26, 2017 · 1 comment
Open

Update stringify method #94

skad0 opened this issue Jan 26, 2017 · 1 comment
Assignees

Comments

@skad0
Copy link
Member

skad0 commented Jan 26, 2017

API:

/**
 * @param {BemCell[]} decl 
 * @param {Object} opts
 * @param {String} opts.exportType - can be one of 'cjs', 'json5', 'json', 'es6'
 * @param {String} opts.format - v1, v2, enb
 * @returns {String}
*/

Description:

opts.format defines how to format normalized declaration:

  • v1 - export formatted decl for v1 format with blocks field
  • v2 - export formatted decl for v2 format with decl field
  • enb - export formatted decl for enb format with deps field

opts.exportType defines how to wrap stringified declaration:

  • cjs - in commonJS module
  • json5
  • json
  • es6 - export default (not right now)

Returned string is representation of object with fields format and formatted decaration (name is defined by opts.format.

Usage:

Use at save with opts.exportType = 'cjs' by default.

@blond blond mentioned this issue Jan 26, 2017
@Yeti-or
Copy link
Member

Yeti-or commented Jan 26, 2017

no es6 right now

@skad0 skad0 self-assigned this Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants