GitXplorerGitXplorer
c

reshape-components

public
3 stars
0 forks
20 issues

Commits

List of commits on branch master.
Verified
05e6d366633d369713f99a4495688ecb693bf11e

chore(package): update eslint-plugin-jest to version 21.4.3 (#16)

ccalebeby committed 7 years ago
Verified
eb1c8d8a2d906e74d57a3f4062c8d056258a48a0

chore(package): update @commitlint/config-angular to version 5.1.1 (#14)

ccalebeby committed 7 years ago
Verified
b29bea5aa27d600dda399d15ad8c2889cdd4b255

chore(package): update prettier to version 1.9.2 (#13)

ccalebeby committed 7 years ago
Unverified
28df4eb64af7139ffceaa98b50436028dadc851e

Update @commitlint/config-angular to the latest version (#6)

ggreenkeeper[bot] committed 7 years ago
Unverified
be6fc5962393090a748c0c73932f88b7b17486dc

chore(package): update @commitlint/cli to version 4.1.1 (#5)

ccalebeby committed 7 years ago
Unverified
0403949248d5259a01755aa34bcf1bed071721bc

fix(index): pass filename into parser

ccalebeby committed 7 years ago

README

The README file for this repository.

Reshape Components

Build Status codecov Greenkeeper badge

Usage

Input:

foobar.html

<div class="g-foobar">
  <h1>This is a foobar called {{ props.title }}</h1>
  {{{ props.children }}}
  <h2>otherProp is {{ props.otherprop }}</h2>
</div>

main.html

<Import src="./foobar.html" as="FooBar"/>
<FooBar title="this is the title" otherProp="5">
  <p>Child Here</p>
</FooBar>

Processed as such:

const { readFileSync } = require('fs')
const reshape = require('reshape')
const components = require('reshape-components')
const expressions = require('reshape-expressions')

const main = readFileSync('main.html')

reshape({ plugins: [components(), expressions()] })
  .process(main)
  .then((result) => console.log(result.output()))

Results in:

<div class="g-foobar">
  <h1>This is a foobar called "this is the title"</h1>
  <p>Child Here</p>
  <h2>otherProp is 5</h2>
</div>

Installation

NPM

npm i -s reshape-components

Yarn

yarn add reshape-components

License: License: MIT

Copyright 2017 Caleb Eby

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.