Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add pnpm-lock.yaml #4984

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 13 additions & 70 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ name: MAIN_PULL_REQUEST

on:
pull_request:
branches: [develop, main, compositionAPI]
branches: [develop, main]
# opened:当 PR 创建时触发
# synchronize:当 PR 的源分支有新的提交时触发
# reopened:当关闭的 PR 重新打开时触发
types: [opened, synchronize, reopened]
# workflow_dispatch:允许手动触发工作流
workflow_dispatch:

# todo: paopao
# jobs:
Expand Down Expand Up @@ -78,34 +76,16 @@ jobs:
submodules: recursive

# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4

# 设置 Node.js 环境,版本为 18
- uses: actions/setup-node@v4
with:
node-version: 18

# 获取 pnpm 的存储目录路径
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# 设置 pnpm 缓存
- uses: actions/cache@v4
name: Setup pnpm cache
with:
# 缓存路径
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# 缓存键
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# 恢复缓存的备用键
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: 'pnpm'

# 安装依赖
- run: pnpm i
- run: pnpm install --frozen-lockfile

# 运行代码 lint 检查
- run: pnpm run lint
Expand All @@ -132,42 +112,23 @@ jobs:
submodules: recursive

# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4

# 设置 Node.js 环境,版本为 18
- uses: actions/setup-node@v4
with:
node-version: 18

# 获取 pnpm 的存储目录路径
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# 设置 pnpm 缓存
- uses: actions/cache@v4
name: Setup pnpm cache
with:
# 缓存路径
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# 缓存键
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# 恢复缓存的备用键
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: 'pnpm'

# 安装依赖
- run: pnpm i
- run: pnpm install --frozen-lockfile

# 构建站点
- name: Build site
- name: Run build site
run: pnpm run site:preview

# 将构建的站点文件压缩为 zip
- run: |
zip -r _site.zip _site
- run: zip -r _site.zip _site

# 上传站点文件作为构建产物
- name: upload _site artifact
Expand Down Expand Up @@ -209,35 +170,17 @@ jobs:
submodules: recursive

# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4

# 设置 Node.js 环境,版本为 18
- uses: actions/setup-node@v4
with:
node-version: 18

# 获取 pnpm 的存储目录路径
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# 设置 pnpm 缓存
- uses: actions/cache@v4
name: Setup pnpm cache
with:
# 缓存路径
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# 缓存键
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# 恢复缓存的备用键
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: 'pnpm'

# 安装依赖
- run: pnpm i
- run: pnpm install --frozen-lockfile

# 运行构建任务
- name: Build
- name: Run build
run: pnpm run build
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@
"author": "tdesign",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.22.6",
"@popperjs/core": "^2.11.8",
"@babel/runtime": "7.26.7",
"@tdesign/common-js": "workspace:^",
"@tdesign/common-style": "workspace:^",
"@types/sortablejs": "^1.15.1",
"@types/tinycolor2": "^1.4.3",
"@types/validator": "^13.7.17",
"@popperjs/core": "2.11.8",
"@types/sortablejs": "1.15.8",
"@types/tinycolor2": "1.4.6",
"@types/validator": "^13.12.2",
"dayjs": "1.11.10",
"lodash-es": "^4.17.21",
"mitt": "^3.0.1",
"sortablejs": "^1.15.0",
"tdesign-icons-vue-next": "^0.3.4",
"tinycolor2": "^1.6.0",
"validator": "^13.9.0"
"lodash-es": "4.17.21",
"mitt": "3.0.1",
"sortablejs": "1.15.6",
"tdesign-icons-vue-next": "0.3.4",
"tinycolor2": "1.6.0",
"validator": "13.12.0"
},
"peerDependencies": {
"vue": ">=3.1.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/components/calendar/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { FIRST_MONTH_OF_YEAR, LAST_MONTH_OF_YEAR, DAY_CN_MAP } from './const';
* 获取一个日期是周几(1~7)
*/
export const getDay = (dt: Date): number => {
let day = dayjs(dt).day();
const day = dayjs(dt).day();
if (day === 0) {
day = 7;
return 7;
}
return day;
};
Expand Down
Loading