Skip to content

Commit 85da235

Browse files
author
chufan
committed
chore: 新增scripts脚本
1 parent 8e50abf commit 85da235

File tree

26 files changed

+4609
-2067
lines changed

26 files changed

+4609
-2067
lines changed

.github/workflows/CI.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
## 代码CI快速集成流水线,lint、fix、build
2+
3+
4+
name: CI
5+
## 触发条件
6+
on:
7+
pull_request:
8+
branches:
9+
- 'master'
10+
- 'next'
11+
- '!pages/**'
12+
push:
13+
branches:
14+
- master
15+
- next
16+
# 手动触发部署
17+
workflow_dispatch:
18+
19+
schedule:
20+
- cron: "0 0 1 * *"
21+
22+
jobs:
23+
install-init:
24+
name: "依赖安装初始化"
25+
runs-on: ubuntu-latest
26+
permissions:
27+
actions: read
28+
pull-requests: read
29+
30+
steps:
31+
- name: checkout code
32+
uses: actions/checkout@v3
33+
with:
34+
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
35+
fetch-depth: 0
36+
37+
- name: Install Node.js
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: 16.20.2
41+
42+
- name: PNPM Install
43+
uses: pnpm/action-setup@v2
44+
with:
45+
version: 7
46+
run_install: true
47+
48+
- name: Cache Dependencies
49+
uses: actions/cache@v3
50+
with:
51+
path: node_modules
52+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
Base-Build:
54+
name: "基础编译构建"
55+
runs-on: ubuntu-latest
56+
needs: install-init
57+
steps:
58+
- name: Checkout Code
59+
uses: actions/checkout@v3
60+
with:
61+
fetch-depth: 0
62+
63+
- name: Restore Dependencies From Cache
64+
uses: actions/cache@v3
65+
with:
66+
path: node_modules
67+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
68+
69+
- name: Code LintFix
70+
run: ./scripts/lint --fix
71+
72+
- name: Build Site
73+
run: ./scripts/bundle build
74+
75+
- name: Build Site With Proxy
76+
run: ./scripts/bundle build_proxy
77+
78+
Build-Docker-Image:
79+
name: "构建Docker镜像"
80+
runs-on: ubuntu-latest
81+
needs: install-init
82+
## 主库master、next且执行release更新时执行
83+
if: github.repository == '142vip/408CSFamily' && startsWith(github.event.head_commit.message, 'chore(release):')
84+
permissions:
85+
actions: read
86+
pull-requests: read
87+
88+
steps:
89+
- name: Checkout Code
90+
uses: actions/checkout@v3
91+
with:
92+
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
93+
fetch-depth: 0
94+
95+
- name: Login Docker
96+
run: |
97+
docker version
98+
echo "-----------Docker Login-----------"
99+
docker login \
100+
--username=${{ env.UserName }} \
101+
--password=${{ secrets.DOCKER_PASSWORD }} \
102+
${{env.REGISTRY}}
103+
104+
- name: Restore Dependencies From Cache
105+
uses: actions/cache@v3
106+
with:
107+
path: node_modules
108+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
109+
110+
111+
## 构建,支持domain
112+
- name: Build To Dist
113+
run: ./scripts/bundle build_proxy
114+
115+
- name: Push Docker Image
116+
run: ./scripts/bundle image_faster

.github/workflows/code-ci.yml

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

.github/workflows/docker-image.yml

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

.npmrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
## 锁定版本
2+
engine-strict = true
13
shamefully-hoist=true
24
registry=https://registry.npmmirror.com
3-
## 锁定node版本
4-
## engine-strict = true

.versionrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// commit-and-tag-version 配置,参考:https://github.com/conventional-changelog/standard-version
2+
module.exports={
3+
"header": "# Release history\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n<!-- #region recent-beta -->\n",
4+
"releaseCommitMessageFormat": "chore(release): publish v{{currentTag}}",
5+
"types": [
6+
{ "type": "feat", "section": "Features" },
7+
{ "type": "feature", "section": "Features" },
8+
{ "type": "fix", "section": "Bug Fixes" },
9+
{ "type": "perf", "section": "Performance Improvements" },
10+
{ "type": "revert", "section": "Reverts" },
11+
{ "type": "docs", "section": "Documentation", "hidden": true },
12+
{ "type": "style", "section": "Styles", "hidden": true },
13+
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
14+
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
15+
{ "type": "test", "section": "Tests", "hidden": true },
16+
{ "type": "build", "section": "Build System", "hidden": true },
17+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
18+
],
19+
"skip": {
20+
"bump": true,
21+
"commit": true,
22+
"tag": true
23+
}
24+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# CONTAINER_BUILD: 采用容器构建
77
#
88
# 注意:vite构建需要支持node14以上,安装node16较为稳妥
9-
FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:16.12.0-alpine AS build_base
9+
FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:16.20.2-alpine AS build_base
1010

1111
ARG CONTAINER_BUILD
1212
## 确定工作空间 /apps

Readme.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
## JavaScriptCollection
22

33

4-
### 写最前面
5-
6-
7-
这里是工作、学习、生活中总结的各类笔记文章,涉及开发技术,也会感慨万千、水一些`思考`;若发现博客外链不能访问欢迎指正;
8-
所有内容会选择性的发表于**微信公众号、博客、掘金、CSDN、Github ,实际内容以本仓库排版、校对为主。** 代码会不定期同步到 **码云**
9-
10-
11-
**没有效访问链接的代表尚未完成,大家善用快捷键`Ctrl+F`**
12-
13-
14-
154
### 在线浏览
165

176
- 尝鲜版:<https://142vip.github.io/JavaScriptCollection>
@@ -24,9 +13,18 @@
2413
- Vercel: <https://js-collection.vercel.app>
2514

2615

27-
### 学习路线
16+
### 写在最前面
17+
18+
19+
这里是工作、学习、生活中总结的各类笔记文章,涉及开发技术,也会感慨万千、水一些`思考`;若发现博客外链不能访问欢迎指正;
20+
所有内容会选择性的发表于**微信公众号、博客、掘金、CSDN、Github ,实际内容以本仓库排版、校对为主。** 代码会不定期同步到 **码云**
2821

2922

23+
**没有效访问链接的代表尚未完成,大家善用快捷键`Ctrl+F`**
24+
25+
26+
27+
### 学习路线
3028

3129

3230
### 日常推荐

code/node/typescript/demo-2.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ class Inter implements myInter {
103103

104104
// 直接将属性定义在构造函数中
105105
class StudentA {
106-
constructor(
107-
public readonly name:string,
108-
public readonly age:number
109-
) {
110-
106+
name:string
107+
age:number
108+
constructor(name: string, age: number) {
109+
this.name = name
110+
this.age = age
111111
}
112112

113113
async getName() {
@@ -119,6 +119,9 @@ class StudentA {
119119
}
120120
}
121121

122+
const stuA = new StudentA('chufan', 18)
123+
console.log(stuA)
124+
122125
// 等价于
123126
class StudentB {
124127
public readonly name:string
@@ -192,9 +195,10 @@ class DogB extends Dog {
192195
return this._gender
193196
}
194197

195-
set gender(gender:number):void {
196-
this._gender = gender
197-
}
198+
// 异常
199+
// set gender(gender:number):void {
200+
// this._gender = gender
201+
// }
198202

199203

200204
// 等价于
@@ -210,7 +214,7 @@ class DogB extends Dog {
210214
const dogB = new DogB()
211215

212216
// 通过gender方法来获取_gender私有属性值
213-
dogB.gender = 18
217+
// dogB.gender = 18
214218
console.log(dogB.gender)
215219

216220
class TestStatic {

docs/manuscript/read-books/read-books.sidebar.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,19 @@ export const readBooksSidebar = [
4141
link: '/'
4242
},
4343
{
44-
text: '测试',
44+
text: '细雨中呼喊',
45+
link: '/f111'
46+
},
47+
{
48+
text: '第七天',
49+
link: '/f111'
50+
},
51+
{
52+
text: '文城',
53+
link: '/f111'
54+
},
55+
{
56+
text: '兄弟',
4557
link: '/f111'
4658
}
4759
]

0 commit comments

Comments
 (0)