-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guide
The purpose of this short guide is to explain concepts and commands employed within Polar's development process.
Quick explanation of how the GitHub actions and build.js
file takes care of the docs, webpack and npm building. After the TypeScript code is written in src/
, the code must be distributed in three different ways.
-
UMD: In the
umd/
directory, thepolar.min.js
file is generated for use with the UNPKG cdn -
npm: The npm registry only accepts .js files, so the library is completely converted into JavaScript in the
dist/
directory. This means that people can bundle their own game with the polar.js dependency independently using tools such as webpack. -
Docs: The builder also reads all the type docs in
src
and generates a documentation website indocs/
-
npm run lint
: Uses eslint to lint the whole project -
npm run watch
: Continually watches for file changes insrc/
and outputs thepolar.min.js
file in thetests/
dir on any changes (for development builds) -
npm run build
: Builds the three directories above (umd/
,docs/
,dist/
) (for release builds)
-
master
is for the current in development build -
stable
is for the latest stable version that would also be the latest version on npm -
gh-pages
is the docs for thestable
branch (aka the one on npm too)
Whenever a push is sent to master
, complete linting will be done, no building.
Whenever a push is sent to stable
, the full build process will be sequenced, no linting as its assumed the linting was done before master was merged into stable.
Typescript declarations are included in the project and defined in the package.json
, this means a user is able to build a TypeScript project with polar.js
as a dependency seamlessly without the need to install types separately. These are included in the dist/
folder