npm-lib-template
TypeScript icon, indicating that this package has built-in type declarations

0.5.3 • Public • Published

npm-lib-template

codecov

icebreaker 编写的一个 npm 包的一个模板

  • 使用 tsup 打包 , rollup 打包版本在 rollup 分支 (兼容 tsc)
  • 使用 vitest 作为单元测试框架
  • 使用 eslint 来规范代码风格
  • 输出 dist -> cjs,esm and .d.ts
  • 使用 semantic-release 来发布 npm/github

为什么使用 vitest 而不是原先的 jest

vitest 开箱即用, jest 在同时遇到 cjsesm 依赖的时候,支持差,而且配置复杂,依赖的 preset 多,比如 ts-jest..

scripts

rename

执行 npm run init:rename

作用为替换 package.json 中默认包含的所有名称为 npm-lib-template 的字段

默认替换为新建代码仓库的文件夹名称!

bin

执行 npm run init:bin

作用为 package.json 添加 filesbin,同时生成 bin/{{pkg.name}}.jssrc/cli.ts 文件

Readme

Keywords

Package Sidebar

Install

npm i npm-lib-template

Weekly Downloads

2

Version

0.5.3

License

MIT

Unpacked Size

6.95 kB

Total Files

7

Last publish

Collaborators

  • icebreaker