Want to Hack?
August 17, 2018 ยท View on GitHub
Thanks for your interest to tinker this project. Let's make it great!! ๐
Basic Overview
This project use rollup to bundle the final result while maintain the code format and it's comments block. Overall, the technology stack that this project uses are (you don't need to install this tools beforehand because it's already in dependecy list):
- static-type checker: flow
- code-style checker (linter): eslint + prettier
- bundler: rollup + babel
- git hooks: husky + commitlint + lint-staged + standard-version
- test framework: jest
Start Hacking
Setup
First, install all dependencies by running
npm install
and if you got message about security vulnurability, you can use this command to fix it
npm audit fix
Test
This project has 2 kind of tests, unit-tests and smoke-tests. The unit-tests will use jest which basically will run in node.js environment. Run this command to start the unit-tests (choose which one):
npm run test
npm run test:watch
npm run test:coverage
The smoke-tests is basically just an example how to use plugin in real simple project. To run the smoke-tests, you need to build/bundle it first, change directory to the example you want to run, then try to build that example. Summary if you want to build stencil example, this is what you need to do:
npm run build
cd examples/stencil
npm run build
and if you want to manually test the example, you can execute:
npm start
Build
To compile/bundle this project, you can choose between this 2 command
npm run build
npm run dev
Project Structure
In general, the folder structure of this project follow:
.
โโโ examples
โ โโโโโโโโโโโโโโโโโโโโโ
โ โ Bunch of smoke-tests
โ โโโโโโโโโโโโโโโโโโโโโ
โ
โโโ flow-typed # flow types definition
โ โโโ npm
โ โโโ rollupPluginRustDef.js
โ
โโโ src # scripts that will be build/bundled
โ โโโ ...bunch_of_helper_scripts
โ โโโ main.js # main scripts
โ
โโโ test
โ โโโ fixtures
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ Bunch of sample to be tested
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โโโ empty.js # just an empty file to do negative test
โ โ
โ โโโ util
โ โ โโโ ...bunch_of_helper_scripts
โ โ โโโ index.js
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Bunch of test-cases with file-extension *.spec.js
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโ
โ Bunch of config files
โโโโโโโโโโโโโโโโโโโโโโ