generator-typescript-react-lib

1.0.178 • Public • Published

generator-typescript-react-lib

npm version build status coverage status npm downloads

A Yeoman generator for React libs written with Typescript.

Table of Contents

Background

To provide a basic starting point when authoring React libraries with Typescript. By design not all use-cases will be handled, so some post-generation modifications may be required.

Features

  • Generates CommonJS, ES module, and Universal Module Definition bundles via Rollup.
  • Tests bundles via Jest.
  • Generates Typescript type declarations for publishing.
  • Outputs, strips, or wraps PropTypes declarations according to bundle type.
  • Configures continuous integration via GitHub Actions.
  • Configures code coverage analysis via Codecov.
  • Configures Renovate for dependency management.
  • Adds scripts for releasing to npm.
  • Makes Universal Module Definition bundles available via unpkg.
  • Initialises Git.

Installation

First, install Yeoman and generator-typescript-react-lib:

$ npm install -g yo generator-typescript-react-lib

Then generate your new library:

$ mkdir your-new-react-library && cd $_
$ yo typescript-react-lib

Common Workflows

Setup

  1. Create a new GitHub repository.
  2. Install/enable the Renovate GitHub app.
  3. Use this generator to create your lib.

Development

Everything revolves around GitHub PRs:

  1. Create a new local branch.
  2. Add a remote tracking branch.
  3. Make some changes.
  4. Push the changes.
  5. Open a PR.

It's also recommended to set branch protection rules against the master branch by selecting the following:

  • Require status checks to pass before merging.
  • Require branches to be up to date before merging.
  • ci.

Testing

Running npm test will:

  • Check code style with Prettier.
  • Type check with TypeScript.
  • Build the package assets.
  • Test the package assets.

Publishing

Once the PR checks have passed:

  1. Merge the PR.
  2. Checkout the master branch.
  3. Ensure master is up-to-date.
  4. Run npm release <newversion>. Refer to the npm-version docs for information on the newversion argument.

The release script will:

  1. Bump the package.json version.
  2. Run the test flow.
  3. Generate a CHANGELOG.md that includes these latest changes.
  4. Generate or update the AUTHORS file.
  5. Make a version commit and tag.
  6. Push the commit and tag to GitHub.
  7. Publish the package to npm.

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.1780latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.1780
1.0.1770
1.0.1760
1.0.1750
1.0.1740
1.0.1730
1.0.1721
1.0.1710
1.0.1700
1.0.1690
1.0.1681
1.0.1670
1.0.1660
1.0.1650
1.0.1640
1.0.1630
1.0.1620
1.0.1610
1.0.1601
1.0.1590
1.0.1581
1.0.1572
1.0.1560
1.0.1550
1.0.1541
1.0.1530
1.0.1520
1.0.1510
1.0.1500
1.0.1490
1.0.1480
1.0.1470
1.0.1460
1.0.1450
1.0.1440
1.0.1430
1.0.1420
1.0.1410
1.0.1400
1.0.1390
1.0.1380
1.0.1370
1.0.1360
1.0.1350
1.0.1340
1.0.1331
1.0.1320
1.0.1310
1.0.1300
1.0.1290
1.0.1280
1.0.1270
1.0.1260
1.0.1250
1.0.1240
1.0.1230
1.0.1220
1.0.1210
1.0.1200
1.0.1190
1.0.1180
1.0.1170
1.0.1160
1.0.1150
1.0.1140
1.0.1130
1.0.1120
1.0.1110
1.0.1100
1.0.1090
1.0.1080
1.0.1070
1.0.1060
1.0.1050
1.0.1040
1.0.1030
1.0.1020
1.0.1010
1.0.1000
1.0.990
1.0.980
1.0.970
1.0.960
1.0.950
1.0.940
1.0.930
1.0.920
1.0.910
1.0.901
1.0.890
1.0.880
1.0.870
1.0.860
1.0.850
1.0.840
1.0.830
1.0.820
1.0.810
1.0.800
1.0.790
1.0.780
1.0.770
1.0.762
1.0.750
1.0.740
1.0.730
1.0.720
1.0.710
1.0.700
1.0.690
1.0.680
1.0.670
1.0.660
1.0.650
1.0.640
1.0.630
1.0.620
1.0.610
1.0.600
1.0.590
1.0.580
1.0.571
1.0.560
1.0.550
1.0.540
1.0.530
1.0.520
1.0.510
1.0.500
1.0.490
1.0.480
1.0.470
1.0.461
1.0.450
1.0.440
1.0.430
1.0.420
1.0.410
1.0.400
1.0.390
1.0.380
1.0.370
1.0.360
1.0.350
1.0.340
1.0.330
1.0.321
1.0.310
1.0.300
1.0.290
1.0.280
1.0.270
1.0.260
1.0.250
1.0.240
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.161
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.61
1.0.50
1.0.40
1.0.31
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i generator-typescript-react-lib

Weekly Downloads

17

Version

1.0.178

License

MIT

Unpacked Size

26.6 kB

Total Files

36

Last publish

Collaborators

  • tanem