If you have an existing repository that you'd like to give the files from this repository, you can run npx template-typescript-node-package
in it to "hydrate" its tooling with this template's.
npx template-typescript-node-package
Warning Migration will override many files in your repository. You'll want to review each of the changes. There will almost certainly be some incorrect changes you'll need to fix.
Repository settings will be auto-filled from the repository's files if possible, but can be provided manually as well:
--author
(string
): e.g."Josh Goldberg"
--description
(string
): e.g."A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨"
--email
(string
): e.g."[email protected]"
--funding
(string
, optional): e.g."JoshuaKGoldberg"
--owner
(string
): e.g."JoshuaKGoldberg"
--repository
(string
): e.g."template-typescript-node-package"
--title
(string
): e.g."Template TypeScript Node Package"
For example, providing a funding
value different from the author
:
npx template-typescript-node-package --funding MyOrganization
The migration script by default will include all the features in this template. You can disable some of them on the command-line:
releases
(boolean
): Whether to include automated package publishingunitTests
(boolean
): Whether to include unit tests with code coverage tracking
npx template-typescript-node-package --releases false --unitTests false
After the migration script finishes aligning your repository's contents to the templates, it will call the Initialization script as well. It will forward any values you provided or it inferred from the repository.
You can prevent the migration script from making some network-based changes using any or all of the following CLI flags:
--skip-contributors
(boolean
): Skips detecting existing contributors withall-contributors-for-repository
--skip-github-api
(boolean
): Skips calling to GitHub APIs--skip-install
(boolean
): Skips installing all the new template packages withpnpm
npx template-typescript-node-package --skip-github-api --skip-install
Tip: the
--skip-github-api
flag will cause all changes to be limited to your local repository. That means you can test out the script withnpx template-typescript-node-package --skip-github-api
, thengit add -A; git reset --hard HEAD
to completely reset all changes.