@0wv/nodejs-ultimate-template 中文文档教程

发布于 3年前 浏览 27 项目主页 更新于 3年前

license.github/workflows/main.ymlgithub-pagesGitpod ready-to-codeGitHub 标签npm

Node.js Ultimate Template

nodejs-parcel-typescript

终极入门模板< /em> 用于带有 TypeScript + Jest + ESLint + Parcel + TypeDoc (+ Gitpod)! ??? 还有使用 GitHub Actions 的自动化测试、linting 和文档生成! ⚡
让我们以最快的速度开始开发吧! ????️


✨ Features

  • [x] TypeScript

♻️ Lint and Test

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.jsonvalue
sourcesrc/index.ts
maindist/index.js
typesdist/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 by npm run dev and npm run docs:serve)
npx degit sakkke/nodejs-ultimate-template [project-name]
cd [project-name]
npm i
npm run dev

Stop npm run dev

  1. Press <C-b>:killw<CR>
  2. 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 withWhat 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

RegistryDefault 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

License

未授权

license.github/workflows/main.ymlgithub-pagesGitpod ready-to-codeGitHub tagnpm

Node.js Ultimate Template

nodejs-parcel-typescript

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

???? 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.jsonvalue
sourcesrc/index.ts
maindist/index.js
typesdist/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 by npm run dev and npm run docs:serve)
npx degit sakkke/nodejs-ultimate-template [project-name]
cd [project-name]
npm i
npm run dev

Stop npm run dev

  1. Press <C-b>:killw<CR>
  2. 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 withWhat 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

RegistryDefault 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

???? License

Unlicense

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文