0.0.33 • Published 4 years ago

@tasit/hooks v0.0.33

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@tasit/hooks

This package assumes you have React as a peer dependency so that you can use these hooks. For example, @tasit/hooks includes the functionality of @tasit/account for generating accounts but in the form of a hook you can use directly in a React component.

Commands

TSDX scaffolds your new library inside /src.

The recommended workflow is to run TSDX in one terminal:

npm 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.

To run tests, use npm test.

Configuration

Code quality is set up with prettier, husky, and lint-staged.

Jest

Jest tests are set up to run with npm test. This runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

Folder Structure

/src
  index.tsx
  index.test.tsx
.gitignore
package.json
README.md
tsconfig.json

Bundler

The packages uses TSDX which uses Rollup v1.x as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

Optimizations

Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:

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

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

You can also choose to install and use invariant and warning functions.

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.

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.

Publishing to NPM

We recommend using np.

0.0.31

4 years ago

0.0.32

4 years ago

0.0.33

4 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.27

4 years ago

0.0.24

4 years ago

0.0.26

4 years ago

0.0.23

4 years ago

0.0.21

4 years ago