Skip to content

Commit 692ec6e

Browse files
author
微信公众号:储凡
authored
Merge pull request #145 from 142vip/refactor/dev
refactor: 进行一系列改造,简化项目、支持更高级的验证
2 parents af9a8b5 + 7afb312 commit 692ec6e

File tree

169 files changed

+385
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+385
-627
lines changed

.github/workflows/CD.yaml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
push:
1010
branches:
1111
- next
12+
- refactor/deploy
1213
workflow_dispatch:
1314

1415
# 环境变量
@@ -17,12 +18,21 @@ env:
1718
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1819
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1920

21+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
22+
permissions:
23+
contents: read
24+
pages: write
25+
id-token: write
26+
2027
jobs:
2128
# 部署到Github-Pages
2229
deploy-github:
2330
name: 部署到Github-Pages
24-
if: github.repository == '142vip/JavaScriptCollection'
2531
runs-on: ubuntu-latest
32+
environment:
33+
name: github-pages
34+
url: ${{ steps.deployment.outputs.page_url }}
35+
if: github.repository == '142vip/JavaScriptCollection'
2636

2737
steps:
2838
- name: Checkout Code
@@ -52,43 +62,19 @@ jobs:
5262
run: |
5363
./scripts/ci
5464
55-
# 运行构建脚本
56-
- name: Build VuePress Site
57-
run: |
58-
./scripts/bundle build_proxy
59-
60-
# 将README.md同步,利于github pages分支展示
61-
- name: Add Readme.md To Dist
62-
run: |
63-
cp -f README.md docs/.vuepress/dist
65+
# 编译 打包成dist
66+
- name: Build with VitePress
67+
run: pnpm build:proxy
6468

65-
- name: Check GitHub Pages status
66-
uses: crazy-max/ghaction-github-status@v3
69+
- name: Upload artifact
70+
uses: actions/upload-pages-artifact@v3
6771
with:
68-
pages_threshold: major_outage
72+
path: docs/.vuepress/dist
6973

70-
# 获取Git提交信息
71-
- name: Get Commit Info
72-
id: gitInfo
73-
run: |
74-
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
75-
echo "author=$(git log -1 --pretty=%an)" >> $GITHUB_OUTPUT
76-
echo "email=$(git log -1 --pretty=%ae)" >> $GITHUB_OUTPUT
77-
78-
# 参考:https://github.com/marketplace/actions/github-pages
79-
- name: Deploy To GitHub Page
80-
uses: crazy-max/ghaction-github-pages@v3
81-
with:
82-
target_branch: pages/github
83-
build_dir: docs/.vuepress/dist
84-
commit_message: |
85-
chore(sync): v${{steps.gitInfo.outputs.version}}
86-
87-
部署地址: https://142vip.github.io/JavaScriptCollection
88-
committer: ${{steps.gitInfo.outputs.author}}<${{steps.gitInfo.outputs.email}}>
89-
author: Mr·Sync
90-
env:
91-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
# 部署
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4
9278

9379
# 部署到vercel平台
9480
# deploy-vercel:
@@ -134,13 +120,6 @@ jobs:
134120
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
135121
fetch-depth: 0
136122

137-
# ## 打成压缩包
138-
- name: Create Zip Package
139-
run: |
140-
zip -r JavaScriptCollection.zip . \
141-
-x "node_modules/*" \
142-
-x "*.git*"
143-
144123
# 安装PNPM
145124
- name: PNPM Install
146125
uses: pnpm/action-setup@v4

.github/workflows/CI.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
pull_request:
1111
branches:
1212
- next
13+
- refactor/dev
1314
push:
1415
branches:
1516
- next
17+
- refactor/dev
1618

1719
# 手动触发部署
1820
workflow_dispatch:
@@ -70,11 +72,11 @@ jobs:
7072

7173
- name: Build Site
7274
run: |
73-
./scripts/bundle build
75+
pnpm build
7476
7577
- name: Build Site With Proxy
7678
run: |
77-
./scripts/bundle build_proxy
79+
pnpm build:proxy
7880
7981
Build-Docker-Image:
8082
name: 构建Docker镜像
@@ -115,7 +117,7 @@ jobs:
115117
# 构建,支持domain
116118
- name: Build To Dist
117119
run: |
118-
./scripts/bundle build
120+
pnpm build
119121
120122
# 快速构建并推送
121123
- name: Push Docker Image

.markdownlint.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

.markdownlintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,9 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
473473
- [ ] 更了不起的Node.js - 狼书卷1
474474
- [ ] 了不起的Node.js
475475
- [ ] 分布式消息中间件实践
476-
...
477476

478477
### 非技术类
479478

480-
>
481479
> 主要是跟计算机无关的一些书,在看完之后,会选择性的进行思维导图、经典词句整理,也可能添加个人思考
482480
483481
- [ ] 你好孤独 - 陈果
@@ -489,12 +487,13 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
489487

490488
<!-- #endregion quick-start -->
491489

492-
[//]: # (宣传内容)
490+
[//]: # '宣传内容'
491+
493492
<!-- #region we-media -->
494493

495494
## 赞赏列表
496495

497-
以下排名不分先后! [传送门→]() **赞赏过的一定要微信跟我说呀!!!!!!**
496+
以下排名不分先后! [传送门→]() **赞赏过的一定要微信跟我说呀!!!!!!**
498497

499498
<div>
500499
<a href="https://github.com/ChiefPing" target="_blank" style="margin: 5px">

code/express/apps/apis-demo/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ express.Router()创建路由器对象时也支持一些额外的参数,查看
119119
- `mergeParams`:保留req.params父路由器的值,布尔类型。如果父级和子级的参数名称有冲突,则子级的值优先。默认false
120120
- `strict`:是否开始严格模式路由,布尔类型。默认false,即:`/test``/test/`效果一样
121121

122-
[//]: # (路由器的用途还有很多,不仅支持多种请求类型的接口定义,还能分层管理,后面将单独开一篇详细讲讲,传送门:[路由的使用]&#40;./路由的使用.md&#41;)
122+
[//]: # '路由器的用途还有很多,不仅支持多种请求类型的接口定义,还能分层管理,后面将单独开一篇详细讲讲,传送门:[路由的使用](./路由的使用.md)'
123123

124124
## application对象
125125

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# #
22
# 服务名: JavaScriptCollection
33
# IP范围: 172.30.0.200
4-
# #
4+
#
55
version: '2'
66
services:
77
JavaScriptCollection:
8-
image: registry.cn-hangzhou.aliyuncs.com/142vip/doc_book:JavaScriptCollection-0.0.1
8+
image: registry.cn-hangzhou.aliyuncs.com/142vip/docs:JavaScriptCollection-0.0.1
99
container_name: JavaScriptCollection
1010
hostname: JavaScriptCollection
1111
ports:

docs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ features:
4242
link: /wechat-list.html
4343
---
4444

45-
[//]: # (<BiliBili bvid="BV1rd4y1V7tB" />)
46-
[//]: # (<XiGua id="7195198927220834868" />)
45+
[//]: # '<BiliBili bvid="BV1rd4y1V7tB" />'
46+
[//]: # '<XiGua id="7195198927220834868" />'
4747

4848
## 本地浏览【推荐】
4949

@@ -125,5 +125,6 @@ yarn run dev
125125
- Netlify: <https://js-collection.netlify.app>
126126
- Vercel: <https://js-collection.vercel.app>
127127

128-
[//]: # (自动引入首页)
128+
[//]: # '自动引入首页'
129+
129130
<!-- @include: ../README.md#we-media -->

docs/battle-interview/MySQL面试.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ show table status from database where name="tablename"
5656
- 日期类型:`Date``DateTime``TimeStamp``Time``Year`
5757
- 其他数据类型:`BINARY``VARBINARY``ENUM``SET``Geometry``Point``MultiPoint``LineString``MultiLineString``Polygon``GeometryCollection`
5858

59-
> BLOB和TEXT有什么区别? **字符串类型是:`SET``BLOB``ENUM``CHAR``TEXT``VARCHAR`**
59+
> BLOB和TEXT有什么区别? **字符串类型是:`SET``BLOB``ENUM``CHAR``TEXT``VARCHAR`**
6060
6161
- BLOB是一个二进制对象,可以容纳可变数量的数据。有四种类型的BLOB:TINYBLOB、BLOB、MEDIUMBLO和 LONGBLOB
6262
- TEXT是一个不区分大小写的BLOB。四种TEXT类型:TINYTEXT、TEXT、MEDIUMTEXT 和 LONGTEXT。
@@ -376,7 +376,7 @@ hash 分发,好处在于说,可以平均分配每个库的数据量和请求
376376

377377
> 为什么要分库?
378378
379-
数据库集群环境后都是多台 slave,基本满足了读取操作; 但是写入或者说大数据、频繁的写入操作对master性能影响就比较大,这个时候,单库并不能解决大规模并发写入的问题,所以就会考虑分库。
379+
数据库集群环境后都是多台 slave,基本满足了读取操作; 但是写入或者说大数据、频繁的写入操作对master性能影响就比较大,这个时候,单库并不能解决大规模并发写入的问题,所以就会考虑分库。
380380

381381
> 分库是什么?
382382

docs/battle-interview/Node面试.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function throttle(func, wait) {
217217

218218
> 原理就是:会从middleware数组中取第一个函数开始执行,中间件函数中调用next方法就会去取下一个中间件函数继续执行。
219219
> 每个中间件函数执行完毕后都会返回一个promise对象。
220-
(ps:调用next方法并不是表示当前中间件函数执行完毕了,调用next之后仍可以继续执行其他代码)
220+
> (ps:调用next方法并不是表示当前中间件函数执行完毕了,调用next之后仍可以继续执行其他代码)
221221
222222
参考:<https://zhuanlan.zhihu.com/p/29455788>
223223

0 commit comments

Comments
 (0)