1

快来构建你的第一个 js 库吧

 3 years ago
source link: https://www.v2ex.com/t/802276
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  JavaScript

快来构建你的第一个 js 库吧

  jomsou · 11 小时 22 分钟前 · 408 次点击

这是一个 js 库构建模板,欢迎使用,觉得不错可以 star 支持下,谢谢~~,有问题欢迎提交 issues, 喜欢沟通交流技术的朋友也可以跟我( https://github.com/Zenquan) 相互 follow 哦

js-lib-starter

js-lib-starter

  • 通过 github actions 自动部署到 npm
  • 规范化注释后,由 jsdoc 生成 markdown,自动化生成文档,从某种意义上来说养成写文档和注释的习惯。
  • 可使用 vercel,自动化部署文档
  • 规范化 git commit
  • 可生成 umd/esm 等 js 文件
  • 详细的使用案例
  • 可使用 mocha 编写详细的测试代码

截屏 2021-09-16 下午 1.27.28.png

script

{
  // 构建
  "build": "npm run clean && npm run build:self && npm run build:esm && npm run build:aio && npm run build:aio.min"
  // 由代码中注释生成 markdown 文档
  "docs:jsdoc2md": "rimraf docs/pages/folder1/api.md && npx jsdoc2md src/* >> docs/pages/folder1/api.md", 
  // 由代码中注释生成 markdown 文档,并且生成 vuepress 静态资源文件
  "docs:build": "npm run docs:jsdoc2md && npx vuepress build docs",
  // 由代码中注释生成 markdown 文档, 并在本地运行 vuepress 
  "docs:dev": "npm run docs:jsdoc2md && npx vuepress dev docs", 
  // 打包生成代码和文档
  "deploy": "npm run build && npm run docs:build", 
}

jrfe-utils


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK