从零系列--开发npm包(二)
2024-09-15 18:19:11
一、利用shell简化组合命令
set -e CVERSION=$(git tag | tail -)
echo "current version:$CVERSION" echo "Enter release version: "
read VERSION read -p "Releasing $VERSION - are you sure? (y/n)" -n -r
echo # (optional) move to a new line if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Releasing $VERSION ..." # commit
git add -A
git commit -m "[build] $VERSION"
npm version $VERSION --message "[release] $VERSION" # publish
git push -u origin master
git push
npm publish
fi
二、利用gitbook编写文档
1、安装gitbook
npm i -g gitbook-cli -d
2、docs目录结构
.
├── book.json
├── README.md
├── SUMMARY.md
├── part1/
| ├── README.md
| └── something.md
└── part/
├── README.md
└── something.md
3、特殊文件描述
文件 描述
book.json 配置数据 (optional)
README.md 电子书的前言或简介 (required)
SUMMARY.md 电子书目录 (optional)
GLOSSARY.md 词汇/注释术语列表 (optional)
4、SUMMARY.md文件内容
# xx* [Introduction](README.md)
* [Part I](part1/README.md)
* [Writing is nice](part1/writing.md)
* [GitBook is nice](part1/gitbook.md)
* [Part II](part2/README.md)
* [We love feedback](part2/feedback_please.md)
* [Better tools for authors](part2/better_tools.md)
5、利用shell组合命令
cd docs
rm -rf _book
gitbook install
gitbook build cd _book
git init
git add -A
git commit -m 'update book'
git push -f git@gitlab.com:xxx/xxxx.git master:gh-pages
最新文章
- 分布式唯一ID生成服务
- The JSP specification requires that an attribute name is preceded by whitespace
- php日期时间函数和数学函数
- 个人站长如何使用svn发布到服务器不遗漏文件
- 不允许从数据类型 nvarchar 到 varbinary 的隐式转换
- C#控制条码打印机 纸张大小,间距,绘制内容(所有条码打印机通用)
- iOS 堆和栈 的理解
- selenium C#下的zencart自动化测试(WFloginUrlPayment)环境4.0
- 收集一些工作中常用的经典SQL语句
- 学会WCF之试错法——数据传输
- Java单例模式之懒汉模式线程安全
- 把tomcat服务器配置为windows服务的方法
- django by example 第五章 No module named 'sorl-thumbnail'
- C#连接数据库open函数失败
- 『算法设计_伪代码』贪心算法_最短路径Dijkstra算法
- [UE4]虚幻4 spline组件、spline mesh组件的用法
- LNMP架构介绍 MySQL安装 PHP安装 Nginx介绍
- OOD与OOP的思想的感悟
- (1)构造方法和方法重载 (2)this关键字 (3)方法的传参和递归调用
- CSUOJ 1973 给自己出题的小X DFS
热门文章
- 1055. [HAOI2008]玩具取名【区间DP】
- Selenium启动最新的火狐浏览器异常排查
- Windows7下配置JMeter安装环境
- http 的request和response 在servlet的应用文件下载
- 拼多多java后台笔试题目总结(20180830)
- 学习JavaSE TCP/IP协议与搭建简易聊天室
- CMap使用方法总结
- 2017-2018-2 20155327『网络对抗技术』Exp5:MSF基础应用
- 查看git提交细节
- VirtualBOX启动错误the vm session was closed before any attempt to power it on解决办法