-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sources plugin, remove obsolete handler map.
- Loading branch information
Showing
14 changed files
with
213 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Sources | ||
|
||
> Reads the component tree | ||
Combines the load and parse plugins to read the full component tree. | ||
|
||
## Install | ||
|
||
``` | ||
npm i trucks-plugin-load --save-dev | ||
``` | ||
|
||
For the command line interface see [trucks-cli][]. | ||
|
||
--- | ||
|
||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [License](#license) | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
This plugin is bundled with the core library. | ||
|
||
For command line usage see [trucks-cli][]. | ||
|
||
## License | ||
|
||
MIT | ||
|
||
--- | ||
|
||
Created by [mkdoc](https://github.com/mkdoc/mkdoc) on July 17, 2016 | ||
|
||
[trucks]: https://github.com/tmpfs/trucks | ||
[trucks-cli]: https://github.com/tmpfs/trucks/blob/master/packages/trucks-cli | ||
[skatejs]: https://github.com/skatejs/skatejs | ||
[webcomponents]: https://github.com/w3c/webcomponents | ||
[shadow-dom]: https://w3c.github.io/webcomponents/spec/shadow/ | ||
[custom-elements]: https://www.w3.org/TR/custom-elements/ | ||
[html-imports]: https://w3c.github.io/webcomponents/spec/imports/ | ||
[html-templates]: https://html.spec.whatwg.org/multipage/scripting.html#the-template-element | ||
[polymer]: https://www.polymer-project.org/1.0/ | ||
[react]: https://facebook.github.io/react/ | ||
[react-webcomponents]: https://github.com/facebook/react/issues/5052 | ||
[react-integration]: https://github.com/skatejs/react-integration | ||
[mozilla-webcomponents]: https://hacks.mozilla.org/2014/12/mozilla-and-web-components/ | ||
[csp]: http://content-security-policy.com/ | ||
[npm]: https://www.npmjs.com/ | ||
[postcss]: https://github.com/postcss/postcss | ||
[mkdoc]: https://github.com/mkdoc/mkdoc | ||
[mkapi]: https://github.com/mkdoc/mkapi | ||
[mkparse]: https://github.com/mkdoc/mkparse | ||
[jshint]: http://jshint.com | ||
[jscs]: http://jscs.info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Sources | ||
|
||
> Reads the component tree | ||
Combines the load and parse plugins to read the full component tree. | ||
|
||
<? @include {=readme} | ||
install.md ?> | ||
|
||
*** | ||
<!-- @toc --> | ||
*** | ||
|
||
<? @include {=readme} usage.md ?> | ||
|
||
<? @include ../../../doc/readme/license.md ?> | ||
<? @include ../../../doc/readme/links.md ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Install | ||
|
||
``` | ||
npm i trucks-plugin-load --save-dev | ||
``` | ||
|
||
For the command line interface see [trucks-cli][]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const trucks = require('../../../../lib/index'); | ||
|
||
trucks( | ||
{ | ||
files: ['example/components.html'] | ||
}, (err, res) => { | ||
if(err) { | ||
throw err; | ||
} | ||
console.log(res); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Usage | ||
|
||
This plugin is bundled with the core library. | ||
|
||
For command line usage see [trucks-cli][]. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
function sources() { | ||
return [require('trucks-plugin-load'), require('trucks-plugin-parse')]; | ||
} | ||
|
||
module.exports = sources; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var mk = require('mktask'); | ||
|
||
function doc(src, dest, opts, cb) { | ||
mk.doc(src) | ||
.pipe(mk.pi()) | ||
.pipe(mk.ref()) | ||
.pipe(mk.abs()) | ||
.pipe(mk.msg()) | ||
.pipe(mk.toc(opts.toc)) | ||
//.pipe(mk.ast.stringify()) | ||
//.pipe(process.stdout) | ||
.pipe(mk.out()) | ||
.pipe(mk.dest(dest)) | ||
.on('finish', cb); | ||
} | ||
|
||
// @task readme build the readme file | ||
function readme(cb) { | ||
doc( | ||
'doc/readme.md', 'README.md', | ||
{toc: {depth: 2, max: 3}}, cb); | ||
} | ||
|
||
// @task docs build all docs | ||
function docs(cb){ | ||
cb(); | ||
} | ||
|
||
mk.task(readme); | ||
mk.task([readme], docs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "trucks-plugin-sources", | ||
"version": "1.0.0", | ||
"description": "Reads the full component tree", | ||
"author": "muji <noop@xpm.io>", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tmpfs/trucks" | ||
}, | ||
"engines": { | ||
"node": ">=4.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "~6.10.1", | ||
"babel-preset-es2015": "~6.9.0", | ||
"chai": "~3.5.0", | ||
"coveralls": "~2.11.9", | ||
"express": "~4.14.0", | ||
"istanbul": "~0.4.4", | ||
"mocha": "~2.5.3" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf coverage target lib", | ||
"build": "babel --presets es2015 src --out-dir lib", | ||
"prepublish": "npm run build", | ||
"lint": "jshint src test doc && jscs src test/spec", | ||
"target": "rm -rf target && mkdir target", | ||
"pretest": "npm run target", | ||
"test": "NODE_ENV=test mocha ${SPEC:-test/spec}", | ||
"precover": "npm run pretest", | ||
"cover": "NODE_ENV=test istanbul cover _mocha -- ${SPEC:-test/spec}", | ||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function sources() { | ||
return [ | ||
require('trucks-plugin-load'), | ||
require('trucks-plugin-parse') | ||
]; | ||
} | ||
|
||
module.exports = sources; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-u bdd | ||
--recursive | ||
--bail | ||
--reporter list | ||
-A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var expect = require('chai').expect | ||
, trucks = require('../../../../src'); | ||
|
||
describe('sources:', function() { | ||
|
||
it('should use default options', function(done) { | ||
const src = '../../test/fixtures/simple-inline/components.html'; | ||
trucks( | ||
{ | ||
files: [src], | ||
out: 'target', | ||
name: 'sources', | ||
plugins: [require('../../src')] | ||
}, (err, result) => { | ||
expect(err).to.eql(null); | ||
expect(result).to.be.an('object'); | ||
done(); | ||
} | ||
); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters