A fast, and small sized TypeScript 2.0 boilerplate. All source files get transpiled down to ES2015
by default. Rollup
and Bublé
are used to make a clean ES2015
bundle.Bublé
is used for compability with older browsers. Easy to get rid of or replaced with Babel
.
Debugging and server testing can be done within VSCode
.
A complete bundle time is assumed to be around 2 ms, and 4 ms for the browser tests. Depends on your computer and the size of your source files.
- Statically typed build system for working with Typescript 2.0 Pre
- VSCode integration. Debug and run tests in the editor.
- Consistent code style with TSLint.
- Bublé as the ES2015 compiler
- Rollup for bundling
- Intelligent code editing with VSCode
- Experimental support for ES7 decorators.
- async/await and generators support for ES5/ES3
- Karma as the test runner
- Test Driven Development (TDD)
- Mocha & Chai de facto standard
- Sinon for test doubles
- Environment variabels
- Code Coverage with Istanbul
- Production and development build with Rollup.
- ECMAScript 2015 modules in Node.
- Allow dead code elimination for ES6 modules
- SourceMap
- TSX / JSX
- Easy debugging
The only development dependency of this project is Node.js. So just make sure you have it installed. Then type few commands known to every Node developer...
git clone --depth 1 https://github.com/kflash/sikky.git
cd sikky
# install the project's dependencies
npm install
# dev build
npm run build:dev
# prod build
npm run build:prod
... and boom! You have it all setup for you!
npm run build
- transpile down to ES5 and builds a bundle both for development and productionnpm run build:dev
- transpile down to ES5 and builds a bundle for developmentnpm run build:prod
- transpile down to ES5 and builds a bundle for productionnpm run build:vcode
- build task for the VSCode editornpm run build:watch
- watch your TypeScript files and trigger recompilation on changes.npm run lint:src
- validates all source filesnpm run lint:tests
- validates all test filesnpm run clean
- removed the dist, coverage and build foldersnpm run clean:build
- remove the build foldernpm run clean:dist
- removed the dist foldernpm run test
- run tests both for browser and nodenpm run test:browser
- run all unit tests in the browsernpm run test:node
- run all unit tests in thenode.js environment
npm run tdd:browser
- run all unit tests and watch files for changes in the browser.npm run tdd:node
- run all unit tests and watch files for changes in thenode.js
environment.npm run debug
- debug task used byVSCode
.npm run dependencies:check
- shows a list over dependencies with a higher version number then the current one - if anynpm run dependencies:upgrade
- automatically upgrade all devDependencies & dependencies, and update package.json
Start the VSCode editor
, and press Ctrl+Shift+B
to build the project. You will see compiler output in the output window (Ctrl+Shift+U
) indicating that TypeScript transpile your source code to ES2015
.
To stop the compilation, press Ctrl+P → > Tasks: Terminate Running Task
.
Press F5
to start debugging.
To run the Mocha tests on node.js
- press F1
and then type task
to see all tasks available. Click on test
to run the tests.
With the npm run build:watch
, the TypeScript 2.0
compiler will start in watch mode, and watch input files and trigger recompilation on changes. Dead code elimination for ES6 modules are activated by default, so later on you can use either
Webpack 2.0
(early beta stage) or Rollup
to perform tree shaking.
The watch task inform you if something is wrong with your code, and can come up with suggestions on how to solve current issue.
7:28:24 PM - File change detected. Starting incremental compilation...
src/universal/foo.ts(7,10): error TS2348: Value of type 'typeof TeaSpoon' is not callable.
Did you mean to include 'new'?
Travis
, Circle
and Appveyor
are the only supported CI
. Travis
is setup to work with Linux and OSX.
Appveyor
only runs in a Windows
environment, but are configured to run on both the x86
and x64
platform.
It's integrated a tdd
task both for the browser tests, and server tests.
Istanbul
are used to generate the coverage report.
Server testing is done with Mocha + Chai, and is also integrated with the VSCode
.
This boilerplate is tested against Travis CI configured to run Android
with SDK version android-19 - 23
.
It's not tested with iOS
. But the conlusion is that this works just fine.