Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 1.13 KB

File metadata and controls

86 lines (55 loc) · 1.13 KB

Publish a new Node.js/Typescript project at NPM

Pick a name for the new project:

PROJECT=new-lib-name

Then:

gh repo create $PROJECT --public
gh repo clone $PROJECT
cd $PROJECT
npx degit IlyaSemenov/npm-package-starter --force

Search and replace mylib with the new project name.


Install development dependencies:

pnpm i

Write sources under src, build with:

pnpm build

Write tests under src and tests as *.test.ts, run with:

pnpm test

Prepare package documentation:

mv README.lib.md README.md

Fill description in package.json.


Commit:

git add .
git commit -m "Initial release"

Setup Github Actions:

gh repo view --web

Under Settings > Secrets and variables > Actions > New repository secret:

  • Add new secret NPM_TOKEN.

Under Settings > Actions > General > Workflow permissions:

  • Choose: Read and write permissions.
  • Enable: Allow GitHub Actions to create and approve pull requests.

Push repo:

git push -u origin

Under Pull Requests, open the new "Version Packages" PR and click Rebase and Merge.