Skip to content

Commit 758385a

Browse files
author
Jay Hsueh
committed
chore: Replace JavaScript with TypeScript for CNAME rendering script and update documentation code blocks to use correct syntax highlighting
1 parent 439fb9b commit 758385a

21 files changed

Lines changed: 84 additions & 86 deletions

docs/buildTool/package-json.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ npm 脚本有 pre 和 post 两个钩子,如 运行 npm run install 的时候
270270

271271
npm 默认提供下面这些钩子。
272272

273-
```code
273+
```bash
274274
prepublish,postpublish
275275
preinstall,postinstall
276276
preuninstall,postuninstall
@@ -297,7 +297,7 @@ prerestart,postrestart
297297

298298
`.gitignore`
299299

300-
```code
300+
```bash
301301
yarn.lock
302302
package-lock.json
303303
```
@@ -383,7 +383,7 @@ npm config set foo:port 80
383383

384384
但如果真的遇上对 node 版本要求比较严格的项目,就可以在 `.npmrc`文件设置
385385

386-
```code
386+
```bash
387387
engine-strict=true
388388
```
389389

docs/buildTool/rollup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ npm init
88

99
## 安装 rollup
1010

11-
```bish
11+
```bash
1212
yarn add rollup -D
1313
```
1414

1515
## Babel
1616

1717
### 许多开发人员在他们的项目中使用[Babel](https://babeljs.io/),以便他们可以使用未被浏览器和 Node.js 支持的将来版本的 JavaScript 特性。
1818

19-
```bish
19+
```bash
2020
yarn add @babel/core @babel/preset-env babel-preset-es2015-rollup -D
2121
```
2222

23-
```bish
23+
```bash
2424
yarn add rollup-plugin-babel -D
2525
```
2626

@@ -48,13 +48,13 @@ export default {
4848

4949
### 现在,在我们运行 rollup 之前,我们需要安装 external-helpers 插件
5050

51-
```bish
51+
```bash
5252
yarn add babel-plugin-external-helpers -D
5353
```
5454

5555
### 若使用 class 需要安装 plugin-proposal-class-properties 插件
5656

57-
```bish
57+
```bash
5858
yarn add @babel/plugin-proposal-class-properties -D
5959
```
6060

@@ -70,7 +70,7 @@ module.exports = {
7070

7171
### 使用 rollup-plugin-uglify 插件进行代码压缩
7272

73-
```bish
73+
```bash
7474
yarn add rollup-plugin-uglify -D
7575
```
7676

docs/buildTool/webpack-optimizate.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module.exports = {
137137

138138
首先,安装 babel-plugin-component:
139139

140-
```bish
140+
```bash
141141
npm install babel-plugin-component -D
142142
```
143143

@@ -291,7 +291,7 @@ module.exports = {
291291

292292
安装依赖
293293

294-
```bish
294+
```bash
295295
yarn add cache-loader -D
296296
```
297297

@@ -387,8 +387,8 @@ module.exports = {
387387
},
388388
plugins: [
389389
new Happypack({
390-
id: 'js',
391-
use: ['babel-loader']
390+
id: 'js',
391+
use: ['babel-loader']
392392
})
393393
]
394394
}

docs/other/git-commit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88

99
### 一、全局安装
1010

11-
```bish
11+
```bash
1212
npm install -g commitizen cz-git
1313
```
1414

1515
run
1616

17-
```bish
17+
```bash
1818
git cz
1919
```
2020

2121
![20211102141718](https://i.loli.net/2021/11/02/mwXbWiQ8RfPO2Gl.png)
2222

2323
### 二、本地安装
2424

25-
```bish
25+
```bash
2626
npm install commitizen cz-git -D
2727
```
2828

@@ -40,7 +40,7 @@ package.json:
4040

4141
run
4242

43-
```bish
43+
```bash
4444
git cz
4545
```
4646

docs/other/git.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,75 +30,75 @@
3030

3131
- 配置用户名
3232

33-
```bish
33+
```bash
3434
git config --global user.name "your name"
3535
```
3636

3737
- 配置用户邮箱
3838

39-
```bish
39+
```bash
4040
git config --global user.email "youremail@github.com"
4141
```
4242

4343
- 列出当前配置
4444

45-
```bish
45+
```bash
4646
git config --list
4747
```
4848

4949
- 列出 Repository 配置
5050

51-
```bish
51+
```bash
5252
git config --local --list
5353
```
5454

5555
- 列出全局配置
5656

57-
```bish
57+
```bash
5858
git config --global --list
5959
```
6060

6161
- 列出系统配置
6262

63-
```bish
63+
```bash
6464
git config --system --list
6565
```
6666

6767
## 分支管理
6868

6969
- 查看本地分支
7070

71-
```bish
71+
```bash
7272
git branch
7373
```
7474

7575
- 查看远程分支
7676

77-
```bish
77+
```bash
7878
git branch -r
7979
```
8080

8181
- 查看本地和远程分支
8282

83-
```bish
83+
```bash
8484
git branch -a
8585
```
8686

8787
- 切换到其他分支
8888

89-
```bish
89+
```bash
9090
git checkout <branch-name>
9191
```
9292

9393
- 基于当前分支创建并切换到新建分支
9494

95-
```bish
95+
```bash
9696
git checkout -b <branch-name>
9797
```
9898

9999
- 拉取远程分支并创建本地分支
100100

101-
```bish
101+
```bash
102102
git checkout -b 本地分支名x origin/远程分支名x
103103

104104
// 另外一种方式,也可以完成这个操作。
@@ -107,31 +107,31 @@
107107

108108
- 重命名本地分支
109109

110-
```bish
110+
```bash
111111
git branch -m <oldbranch-name> <newbranch-name>
112112
```
113113

114114
- 当前分支与指定分支合并
115115

116-
```bish
116+
```bash
117117
git merge <branch-name>
118118
```
119119

120120
- 删除本地分支
121121

122-
```bish
122+
```bash
123123
git branch -d <branch-name>
124124
```
125125

126126
- 删除远程分支
127127

128-
```bish
128+
```bash
129129
git push origin -d <branch-name>
130130
```
131131

132132
- 重命名本地并推送至远程分支
133133

134-
```bish
134+
```bash
135135
git branch -m <oldbranch-name> <newbranch-name>
136136
git push origin :<oldbranch-name>
137137
git push --set-upstream origin <newbranch-name>
@@ -158,40 +158,40 @@
158158

159159
- 撤销工作区修改
160160

161-
```bish
161+
```bash
162162
git checkout --
163163
```
164164

165165
- 暂存区文件撤销 (不覆盖工作区)
166166

167-
```bish
167+
```bash
168168
git reset HEAD
169169
```
170170

171171
- 版本回退
172172

173173
- 显示从最近到最远的提交日志
174174

175-
```bish
175+
```bash
176176
git log
177177
```
178178

179179
- 回退到指定 commit-id 版本
180180

181-
```bish
181+
```bash
182182
git reset --(soft | mixed | hard ) <commit-id> // 底下会列出三者的区别
183183
// 举个例子👇
184184
git reset --hard 7222c8f6be2d663982faa98dffe2647966b438b1
185185
```
186186

187187
- 推送到本地到远程仓库:让远程仓库代码和你本地一样,到当前你本地的版本
188188

189-
```bish
189+
```bash
190190
git push origin HEAD --force
191191
```
192192

193193
- 这个时候突然又发现不需要回退了,刚才那些消失的代码又要重新找回来了
194-
`bish git reflog git reset --(soft | mixed | hard ) <commit-id>`
194+
`bash git reflog git reset --(soft | mixed | hard ) <commit-id>`
195195
> `revert` 的语法和命令和 `reset` 一致。但是产生的实际效果会有不同,从需要提交到远程分支的角度来讲,reset 能够“毁尸灭迹”,不让别人发现我们曾经错误的合并过分支(注:多人协作中,需要谨慎使用);revert 则会将合并分支和撤回记录一并显示在远程提交记录上
196196

197197
## soft | mixed | hard

docs/other/husky_lint-staged_cz-git.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 安装依赖
44

5-
```bish
5+
```bash
66
npm i -D husky lint-staged cz-git cross-env
77
```
88

@@ -43,7 +43,7 @@ npm i -D husky lint-staged cz-git cross-env
4343

4444
## 初始化 `husky`
4545

46-
```bish
46+
```bash
4747
npm run husky:init
4848
```
4949

docs/other/outlook-oauth2-imap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Device Code Flow 需要开启此选项,否则会报 `AADSTS70002` 错误。
6060

6161
更新 `.env` 文件,填写目标邮箱:
6262

63-
```env
63+
```yaml
6464
OUTLOOK_CLIENT_ID=你的ClientID
6565
OUTLOOK_USER=handsome@outlook.com
6666
OUTLOOK_REFRESH_TOKEN=

docs/other/ssh-key.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010

1111
## 3、进入.ssh 文件夹
1212

13-
```bish
13+
```bash
1414
cd ~/.ssh/
1515
```
1616

1717
如果提示 “ No such file or directory”,你可以手动的创建一个 .ssh 文件夹
1818

19-
```bish
19+
```bash
2020
mkdir ~/.ssh
2121
```
2222

2323
## 4、配置全局的 name 和 email
2424

25-
```bish
25+
```bash
2626
git config --global user.name "xxj95719"
2727
git config --global user.email "xxj95719@gmail.com"
2828
```
2929

3030
## 5、生成 key
3131

32-
```bish
32+
```bash
3333
ssh-keygen -t rsa -C "xxj95719@gmail.com"
3434
```
3535

0 commit comments

Comments
 (0)