Front End Central Angular2

Componentized FEC

Initial Setup

npm install

Retrieve the required modules such as typescript and webpack. Type definition is managed by @types and included in tsconfig.json.

npm run build

Pack up this document site. If you are going to run ‘npm run server’ to host the app, this step is not required, and you don’t have to re-run after each change, otherwise, re-run will be required.
If you are going to publish or contribute to existing/new component, this step is also not required.

npm run server

Host the app locally on http://localhost:3000/

npm run server:hmr (deprecated)

Enable hot module replacement on server, for better experience, please visit http://localhost:3000/webpack-dev-server/ instead.
Warning: HMR will not work on doc/index.html, which is the default page of doc app.

Build Details

npm run clean

This will clean all unnecessary files in src/components.

Contributing

Testing

npm run build:test

Compile and output the test bundle to /test/js with SpecRunner.html in /test. The SpecRunner is only supported by webpack-dev-server.
Therefore, if you would like to run all the tests in the browser, npm run server is required.
All the tests can be executed at http://localhost:3000/test/SpecRunner.html

For Karma, you can simply run karma start from project root, and webpack will handle everything for you.

Regenerating document HTML

Pandoc is required. Install Pandoc in OS X with brew install pandoc. Instructions for other systems are at pandoc.org.

# From project root:
./pandoc-build.sh

This bash script iterates through component source directories and runs a simple conversion on each README.md document, outputting to /doc/views/<component-name>/README.html.