Skip to content

Commit 39ac362

Browse files
betavsnovlan1
andauthored
refactor: use monorepo (#3660)
* chore: directory structure optimization * chore: update coverage badges * chore: update dependency installation to use pnpm action * chore: the respective package.json * chore: move test to root dir * chore: update jest config * chore: update typos-config * chore: update typos-config * chore: update import path * chore: lint * chore: update script * chore: update plugin script * chore: update script * chore: update deps * chore: update dep * chore: support ty live host * chore: update live host * chore: update badge script data path * chore: update vscode setting and nest files --------- Co-authored-by: novlan1 <1576271227@qq.com>
1 parent cdc4163 commit 39ac362

2,770 files changed

Lines changed: 302 additions & 198 deletions

File tree

Some content is hidden

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

.github/actions/install-dep/action.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@ on:
99
default: '14'
1010

1111
runs:
12-
using: "composite"
13-
steps:
14-
- uses: actions/setup-node@v2
12+
using: 'composite'
13+
steps:
14+
- uses: actions/setup-node@v4
1515
with:
1616
node-version: ${{ inputs.nodeVersion }}
17-
- name: Get npm cache directory
18-
id: npm-cache-dir
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
1923
shell: bash
20-
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
21-
- uses: actions/cache@v3
22-
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
24+
run: echo "dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
25+
26+
- uses: actions/cache@v4
27+
name: Setup pnpm cache
2328
with:
24-
path: ${{ steps.npm-cache-dir.outputs.dir }}
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
29+
path: ${{ steps.pnpm-cache.outputs.dir }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
2631
restore-keys: |
27-
${{ runner.os }}-node-
28-
- run: npm install
29-
shell: bash
32+
${{ runner.os }}-pnpm-store-
33+
34+
- run: pnpm install
35+
shell: bash

.github/workflows/pkg-pr-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
node-version: 18
1919

20-
- run: npm install
20+
- uses: ./.github/actions/install-dep
2121

2222
- run: npm run build
2323

.github/workflows/pr-comment-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions/setup-node@v4
8585
with:
8686
node-version: 18
87-
- run: npm install
87+
- uses: ./.github/actions/install-dep
8888
- run: npm run test:snap-update
8989
- name: Commit Snapshot
9090
run: |

.github/workflows/pr-compressed-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
- uses: preactjs/compressed-size-action@v2
1515
with:
1616
repo-token: '${{ secrets.GITHUB_TOKEN }}'
17-
install-script: 'npm install'
17+
install-script: 'npm install --force'
1818
pattern: './miniprogram_dist/**/*.{js,wxs,wxml,json}'

.github/workflows/typos-config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ nd = "nd"
99
loosing = "loosing"
1010

1111
[files]
12-
extend-exclude = ["CHANGELOG*.md"]
12+
extend-exclude = ["CHANGELOG*.md", "changelog.json"]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ yarn-error.log*
2727
*.njsproj
2828
*.sln
2929
*.sw*
30-
tdesign-miniprogram
30+
/tdesign-miniprogram
3131
m2w_dist

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "src/_common"]
2-
path = src/_common
1+
[submodule "packages/common"]
2+
path = packages/common
33
url = https://github.com/Tencent/tdesign-common.git

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
**/*.md
2-
src/_common
2+
packages/common

example/app.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import '../src/common/style/_variables.less';
2-
@import '../src/common/style/theme/_index.less';
1+
@import '../packages/components/common/style/_variables.less';
2+
@import '../packages/components/common/style/theme/_index.less';
33

44
@font-face {
55
font-family: 'TCloudNumber';

example/components/demo-block/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../src/common/style/index.less';
1+
@import '../../../packages/components/common/style/index.less';
22

33
.demo-block {
44
margin: @spacer-4 0 0;

0 commit comments

Comments
 (0)