組織
仍是項目
facebook.github.io/react
rollup.github.io
下載git安裝包直接安裝
打開Git Bash命令框html
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
cat ~/.ssh/id_rsa.pub
ssh-keygen -t rsa -C "171250669@qq.com"
cat ~/.ssh/id_rsa.pub
clip < ~/.ssh/id_rsa.pub
git clone git@github.com:Firsmant/info-manage.git
git add .
git commit -m "first update"
git push origin master
版本號分三級
0.x.x能夠認爲是非正式版本、測試版本
從1.x.x開始正式發佈版本
"version":"0.0.1"
node
src
- 源碼release
- 發佈結果test
- 單元測試用例doc
- 文檔example
- 示例進入項目目錄運行 npm init
按提示完成,參考package.json文件填寫相應內容。注意版本號
和license
不能默認,入口js修改成src/index.js
react
生成package.json
文件
webpack
使用 webpack
git
安裝npm i babel-core babel-loader babel-polyfill babel-preset-es2015 babel-preset-latest webpack webpack-cli --save-dev
後面再加上淘寶鏡像
--registry=https://registry.npm.taobao.org
github
.babelrc
文件,添加內容{ "presets": ["es2015", "latest"], "plugins": [] }
webpack.config.js
文件,添加內容以下entry
文件發佈到output
module.exports = { entry: './src/index.js', output: { path: __dirname, filename: './release/bundle.js' }, module: { rules: [{ test: /\.js?$/, exclude: /(node_modules)/, loader: 'babel-loader' }] } }
scripts
,添加"release":"webpack"
,說明使用的打包工具"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "release": "webpack" },
npm run release
生成release內容test.html
文件,添加內容<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>example</title> </head> <body> <p>example</p> <script src="../release/bundle.js"></script> </body> </html>
package.json
中的scripts
增長"example":"http-server -p 8880"
"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "release": "webpack", "example": "http-server -p 8880" },
npm install http-sever -g
npm run example
localhost:8880/example/test.html
測試用例須要用到其它工具web
md
格式生成文檔,安裝工具,npm install gitbook-cli -g
SUMMARY.md
,內容以下:# Summary * [項目介紹](README.md) * [使用文檔](doc/use/README.md) * [使用1](doc/use/use1.md) * [使用2](doc/use/use2.md) * [二次開發](doc/dev/README.md) * [開發1](doc/dev/dev1.md) * [開發2](doc/dev/dev2.md)
npm install gitbook -g
安裝工具gitbook init
按照以上目錄在doc
中建立文件gitbook build
將md
文件發佈爲html
文件http://localhost:8880/_book/
中查看使用 es-lint規範編碼npm
git tag -a 'v0.0.1' -m 'first commit' git push origin v0.0.1
可讓用戶經過npm進行安裝json
npm adduser
註冊帳戶npm login
登陸用戶npm publish .
發佈到npmgit checkout -b dev
,在分支中進行修改package.js
中修改版本號,而後提交修改git add .
git commit -m "0.0.2"
git push origin dev
git checkout master
git merge div
git push origin master
github用戶名.github.io
名稱規則是這樣的index.html
github用戶名.github.io
便可_book
內容複製到組織帳戶的根目錄下轉載連接:https://www.imooc.com/article/28240瀏覽器