0.0.26 • Published 5 months ago
billd-utils v0.0.26
简介
积累常用的 js 方法
安装
npm install billd-utils
文档
https://project.hsslive.cn/billd-monorepo/modules/utils.html
使用
该库尚未发布 1.0 版本,api 可能会随时发生变化,请勿用于生产环境!
import { isBrowser } from 'billd-utils';
console.log(isBrowser());
在浏览器使用
该库尚未发布 1.0 版本,api 可能会随时发生变化,请勿用于生产环境!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
http-equiv="X-UA-Compatible"
content="IE=edge"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Document</title>
</head>
<body>
<script src="https://unpkg.com/billd-utils/index.min.js"></script>
<script>
console.log(BilldUtils.isBrowser());
</script>
</body>
</html>
VSCode 提示
新建一个.d.ts 文件,如:billd-utils.d.ts(或者使用项目原有的.d.ts 文件),添加以下代码:
declare global {
// eslint-disable-next-line
import utils from 'billd-utils';
}
然后 vscode 里输入 billd-uitls 的方法,如 isBrowser
,vscode 就会提示是否从 billd-utils 导入 isBrowser
了~
本地调试
本地调试不会构建 umd
pnpm run dev
本地构建
pnpm run build
生成文档
使用 typedoc 生成,文档会生成在项目根目录的 doc 目录
pnpm run doc
发版
0.确保 git 工作区干净
即确保本地的修改已全部提交(git status 的时候会显示:nothing to commit, working tree clean
),否则会导致执行 release:local
脚本失败
1.执行本地发版脚本
pnpm run release:local
该脚本内部会做以下事情:
- 根据用户选择的版本,更新 package.json 的 version
- 开始构建
- 对比当前版本与上个版本的差异,生成 changelog
- 提交暂存区到本地仓库:git commit -m 'chore(release): v 当前版本'
- 生成当前版本 tag:git tag v 当前版本
2.执行线上发版脚本
pnpm run release:online
该脚本内部会做以下事情:
- 提交当前版本:git push
- 提交当前版本 tag:git push origin v 当前版本
- 发布到 npm
源码
0.0.26
5 months ago
0.0.23
8 months ago
0.0.24
8 months ago
0.0.25
8 months ago
0.0.22
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.13
2 years ago
0.0.14
2 years ago
0.0.15
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.18
2 years ago
0.0.19
2 years ago
0.0.12
2 years ago
0.0.10
2 years ago
0.0.11
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.6
2 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago