Web component compiler command line interface
Command line interface for the trucks-compiler libary.
npm i -g trucks
Or just for your project:
npm i trucks --save-dev
Use the --help
or -h
option for program help:
trucks -h
If the program is installed globally the man page will be installed:
man trucks
To compile components pass HTML source files, for example:
trucks src/*.html
Which will generate components.css
, components.js
and components.html
in the current working directory. Template elements in the source component files are compiled to javascript functions and prepended to components.js
.
In this case the HTML templates are not compiled to javascript. Use this option when compiling polymer components.
Change the output directory with the --out
option:
trucks src/*.html -o build
The output file name is components
by default; use the --name
option to change the name of the generated files.
Configuration files can be loaded and merged with the default options using the --conf
option:
trucks src/*.html -o build --conf options.js
See OPTIONS for the options that may be specified in configuration files.
For full cli documentation see the man page and consult the trucks readme for information on creating components.
Completion is available for zsh. To install copy _trucks to a directory in $fpath
, see the completion docs for more information.
Usage: trucks [-fh] [--force] [--secure] [--print-imports] [--print-tree]
[--print-manifest] [--print-stack] [--help] [--version] [--out
<dir>] [--name <val>] [--html <file>] [--css <file>] [--js
<file>] [--transforms <id...>] [--protocols <id...>] [--rc
<file...>] [--extract <dir>] [--inject <dir>] [--manifest <file>]
[files...]
Compiles web components.
Options
-o, --out=[dir] Output directory (default: cwd)
-n, --name=[val] Name for output files (default: components)
-m, --html=[file] Template output file
-s, --css=[file] Stylesheet output file
-j, --js=[file] Javascript output file
-t, --transforms=[id...]
Run transform plugins
-p, --protocols=[id...] Enable protocol resolver plugins
-c, --rc=[file...] Configuration files to require
-e, --extract=[dir] Extract shadow styles to directory
-i, --inject=[dir] Inject shadow styles from directory
-a, --manifest=[file] Write manifest to file
-f, --force Force overwrite existing files
--secure Disable the http: protocol
--print-imports Print the file hierarchy
--print-tree Print the component tree hierarchy
--print-manifest Print the generated files manifest
--print-stack Print stack trace on error
-h, --help Display help and exit
--version Print the version and exit
trucks@1.0.15
Install dependencies with npm i
and install mkdoc globally (npm i -g mkdoc
).
To build all the command line interface files run:
mk cli
To see all available tasks run mk --tasks
.
To build the readme file:
mk readme
To run the test suite:
npm test
Tests are not included in the npm package you should clone the repository to run the test suite.
To generate code coverage run:
npm run cover
Run the source tree through jshint and jscs:
npm run lint
Remove generated files:
npm run clean
MIT
Created by mkdoc on August 6, 2016