generator-typescript-package
v6.0.0
Published
Yet another Yeoman generator for TypeScript packages
Downloads
25
Maintainers
Readme
generator-typescript-package
An opinionated yeoman generator for TypeScript packages with best practices
NOTE: this project is on life-support, and is subject to change wildly, or not at all. Please reach out by opening an issue if you're interested in helping or taking over maintenance of this project!
Features
- supports scoped npm packages
- supports GitHub
- supports gitlab
- supports lerna monorepos
- continuous integration (GitHub Actions/gitlab-ci)
- continuous delivery (with semantic-release)
- runs tests in parallel with ava
- property-testing with fast-check
- code coverage (codecov)
- linting with typescript-eslint
- publishes only compiled JavaScript to npm (no typescript sources)
Note: there has been no explicit compatibility testing for Windows development-environments
Install
npm install -g generator-typescript-package
Use
Create a directory for the new package, cd
inside and generate the package skeleton
with
yo typescript-package [--lerna] [--bin]
git commit -m 'Initial commit'
Finally, address each TODO:
statement in the generated project.
Options
lerna
default: false
Generate a package in a lerna mono-repo. This package is expected to be built with TypeScript 3.0's build mode.
bin
default: false
Define an executable file under the bin
section in the package.json
.
Test
Test the generated package
npm test
Integrations
Continuous Integration
GitHub actions runs the .github/workflows/ci.yml
action on every pull-request against
the master
, alpha
, or beta
branch.
To configure this behavior, customize the invoked npm run-scripts or the GitHub action itself.
Continuous Delivery
GitHub actions runs the .github/workflows/release.yml
action on every push to the
master
, alpha
, or beta
branch.
This action uses the semantic-release GitHub action to create a new release and
publish to npm, which requires the NPM_TOKEN
Secret Variable.
Note that pushes to the alpha
and beta
branch create prereleases.