An opinionated yeoman generator for TypeScript packages with best practices
- 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
npm install -g generator-typescript-packageCreate 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.
default: false
Generate a package in a lerna mono-repo. This package is expected to be built with TypeScript 3.0's build mode.
default: false
Define an executable file under the bin section in the package.json.
Test the generated package
npm testGitHub 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.
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.