Skip to content

📦 TypeScript库开发框架,集成了Rollup / Jest / TypeDoc / TSLint / Commitlint 等工具

License

Notifications You must be signed in to change notification settings

JarryChung/TypeScript-Starter

Repository files navigation

TypeScript-Starter - TypeScript 库开发框架

特性

开发说明

强制遵循

  • 使用 TypeScript 进行开发

  • 需要为每一个类或方法进行注释,最小化注释为:方法说明、参数、返回值

  • 需要为每一个导出的类或方法编写测试

  • 使用 git addnpm run commit 来提交代码

约定

  • src/index.ts 作为入口文件,应该在这里导出所有方法

开始

  • Fork 该仓库后 Clone 到本地

  • 更改项目信息:仓库地址、名称、作者等

  • 安装依赖

  • 开始开发

NPM 脚本说明

  • npm run lint: 使用 tslint 规范代码

  • npm run rm: 移除 dist / docs 目录

  • npm run build: 生成 bundles、.d.ts文件、以及文档

  • npm start: 以 live-reload 模式运行 npm run build

  • npm run test: 运行测试

  • npm run test:watch: 以 观察模式 运行测试

  • npm run test:prod: lint 代码、运行测试并生成测试文档(包含测试覆盖率)

  • npm run commit: 规范化、可交互的代码提交流程,基于 conventional 规范

库的使用

全量引入:

import awesomeLib from 'awesomeLib'

dist/lib 按需引入:

import coolFn from 'mylib/dist/lib/coolFn'

About

📦 TypeScript库开发框架,集成了Rollup / Jest / TypeDoc / TSLint / Commitlint 等工具

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published