Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 1.37 KB

CONTRIBUTING.md

File metadata and controls

57 lines (33 loc) · 1.37 KB

Contribution guidelines

Commands

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

Configuration

Code quality will be set up using prettier, husky, and lint-staged.

Jest

Jest tests are set up to run with npm test or yarn test.

Rollup

This project uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as jsx.

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix

Optimizations

You can do development-only optimizations by using the __DEV__ global variable.

// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.