@0wv/nodejs-ultimate-template 中文文档教程
Node.js Ultimate Template
终极入门模板< /em> 用于带有 TypeScript + Jest + ESLint + Parcel + TypeDoc (+ Gitpod)! ??? 还有使用 GitHub Actions 的自动化测试、linting 和文档生成! ⚡
让我们以最快的速度开始开发吧! ????️
✨ Features
- [x] TypeScript
♻️ Lint and Test
- [x] Jest
- [x] ESLint
- [x] eslint-config-standard-with-typescript
Development
- [x] Parcel
Documentation
- [x] TypeDoc
- [x] Code coverage report by Jest
Others
- [x] Automated testing, linting and generating documentation using GitHub Actions
- [x] Gitpod support
App structure
field in ./package.json | value |
---|---|
source | src/index.ts |
main | dist/index.js |
types | dist/index.d.ts |
$ tree src
src
├── index.ts
├── main.test.ts
└── main.ts
0 directories, 3 files
Get started (automatic if using Gitpod)
要求
tmux
(used bynpm run dev
andnpm run docs:serve
)
npx degit sakkke/nodejs-ultimate-template [project-name]
cd [project-name]
npm i
npm run dev
Stop npm run dev
- Press
<C-b>:killw<CR>
- Done!
Manually lint and test instead of npm run dev
Compile on change
npm run watch
Run Jest in watch mode
npm run test:watch
Run ESLint in watch mode
npm run lint:watch
Run TypeDoc in watch mode
npm run docs:watch
Serve _docs
npx serve _docs
Checklist
- [ ] Check or update
./LICENSE
- [ ] Update
name
,version
,description
,author
in./package.json
- [ ] Change
env.PUBLISH_*_SCOPE
fields in./.github/workflows/main.yml
(see #Scope) - [ ] Set GitHub Pages source to
gh-pages
branch - [ ] Update
./README.md
Deploy with GitHub Actions
Overview
此模板支持使用 GitHub Actions 发布到 GitHub Package Registry 和 npm Registry。 要发布,您推送以 :bookmark:
开头的提交。 此外,您可以使用以 :bug:
、:sparkles:
或 :boom:
开头的提交。 他们正在递增 ./package.json
中的 version
字段并同时发布。
Start with | What kind of increment |
---|---|
:bug: | It increments patch version (like npm version patch ) |
:sparkles: | It increments minor version (like npm version minor ) |
:boom: | It increments major version (like npm version major ) |
Important
您必须需要 secrets.PAT
。 这是 GitHub 个人访问令牌。
Scope
Registry | Default scope |
---|---|
GitHub Package Registry | @sakkke |
npm Registry | @0wv |
要更改,您必须编辑 ./.github/workflows/main.yml
中的 env.PUBLISH_*_SCOPE
字段。
Example
First publish
$ git commit --allow-empty -m ':bookmark: v0.1.0'
$ git tag v0.1.0
$ git push --follow-tags
Publish package as v0.42.0
$ git commit --allow-empty -m ':bookmark: v0.42.0'
$ git tag v0.42.0
$ git push --follow-tags
Publish package with incrementing minor version
$ git commit --allow-empty -m ':sparkles: release'
$ git push
Related
- Svelte Ultimate Template - A starter template for Progressive Web App with Svelte + TypeScript + SugarSS
License
未授权
Node.js Ultimate Template
A ultimate starter template for Node.js with TypeScript + Jest + ESLint + Parcel + TypeDoc (+ Gitpod)! ???? There's also automated testing, linting, and documentation generation using GitHub Actions! ⚡
Let's get started development at the fastest speed! ????️
✨ Features
- [x] TypeScript
♻️ Lint and Test
- [x] Jest
- [x] ESLint
- [x] eslint-config-standard-with-typescript
???? Development
- [x] Parcel
???? Documentation
- [x] TypeDoc
- [x] Code coverage report by Jest
???? Others
- [x] Automated testing, linting and generating documentation using GitHub Actions
- [x] Gitpod support
???? App structure
field in ./package.json | value |
---|---|
source | src/index.ts |
main | dist/index.js |
types | dist/index.d.ts |
$ tree src
src
├── index.ts
├── main.test.ts
└── main.ts
0 directories, 3 files
???? Get started (automatic if using Gitpod)
Requires:
tmux
(used bynpm run dev
andnpm run docs:serve
)
npx degit sakkke/nodejs-ultimate-template [project-name]
cd [project-name]
npm i
npm run dev
Stop npm run dev
- Press
<C-b>:killw<CR>
- Done!
Manually lint and test instead of npm run dev
Compile on change
npm run watch
Run Jest in watch mode
npm run test:watch
Run ESLint in watch mode
npm run lint:watch
Run TypeDoc in watch mode
npm run docs:watch
Serve _docs
npx serve _docs
???? Checklist
- [ ] Check or update
./LICENSE
- [ ] Update
name
,version
,description
,author
in./package.json
- [ ] Change
env.PUBLISH_*_SCOPE
fields in./.github/workflows/main.yml
(see #Scope) - [ ] Set GitHub Pages source to
gh-pages
branch - [ ] Update
./README.md
???? Deploy with GitHub Actions
Overview
This template supports publishing to GitHub Package Registry and npm Registry with GitHub Actions. To publish, you push the commit that starts with :bookmark:
. Also, you can use the commit that starts with :bug:
, :sparkles:
or :boom:
. They are incrementing version
field in ./package.json
and publishing at the same time.
Start with | What kind of increment |
---|---|
:bug: | It increments patch version (like npm version patch ) |
:sparkles: | It increments minor version (like npm version minor ) |
:boom: | It increments major version (like npm version major ) |
Important
You must need secrets.PAT
. This is GitHub Personal Access Token.
Scope
Registry | Default scope |
---|---|
GitHub Package Registry | @sakkke |
npm Registry | @0wv |
To change, you must edit env.PUBLISH_*_SCOPE
fields in ./.github/workflows/main.yml
.
Example
First publish
$ git commit --allow-empty -m ':bookmark: v0.1.0'
$ git tag v0.1.0
$ git push --follow-tags
Publish package as v0.42.0
$ git commit --allow-empty -m ':bookmark: v0.42.0'
$ git tag v0.42.0
$ git push --follow-tags
Publish package with incrementing minor version
$ git commit --allow-empty -m ':sparkles: release'
$ git push
???? Related
- Svelte Ultimate Template - A starter template for Progressive Web App with Svelte + TypeScript + SugarSS
???? License
Unlicense