Skip to content

Commit 1faa0db

Browse files
uyarnhonkinglin
andauthored
chore: open site source code (#376)
* chore: open site source code Co-authored-by: Uyarn <[email protected]> * chore: pnpm management chore: add typos config chore: add exclude check folder chore: remove cache file chore: fix spell check chore: refactor site components chore: update typos config chore: update typos config chore: fix spell check * chore: update publish component path --------- Co-authored-by: honkinglin <[email protected]>
1 parent 56b3860 commit 1faa0db

File tree

610 files changed

+207712
-2
lines changed

Some content is hidden

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

610 files changed

+207712
-2
lines changed

.github/workflows/pr-spelling.template.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- name: Check spelling
1212
uses: crate-ci/typos@master
13+
with:
14+
config: .github/workflows/typos-config.toml
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PUBLISH_COMPONENTS
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request_target:
7+
types: [closed]
8+
9+
jobs:
10+
modify-components:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
components-changed: ${{ steps.components-changed.outputs.changed }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 100
18+
- uses: marceloprado/has-changed-path@v1
19+
id: components-changed
20+
with:
21+
paths: packages/components/package.json
22+
- run: echo components changed=${{ steps.components-changed.outputs.changed }}
23+
24+
publish-components:
25+
runs-on: ubuntu-latest
26+
needs: modify-components
27+
if: needs.modify-components.outputs.components-changed == 'true'
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-node@v2
31+
with:
32+
node-version: 18
33+
registry-url: "https://registry.npmjs.org"
34+
- run: cd packages/components && npm install
35+
- run: cd packages/components && npm run build
36+
- run: cd packages/components && npm publish
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.TDESIGN_NPM_TOKEN }}
39+
- run: echo '${{ github.ref }} ... ${{ github.ref_name }}'
40+
- if: steps.publish.outputs.type != 'none'
41+
run: |
42+
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"

.github/workflows/pull-request.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: MAIN_PULL_REQUEST
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request_target:
7+
types: [closed]
8+
9+
jobs:
10+
modify-services:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
services-changed: ${{ steps.services-changed.outputs.changed }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 100
18+
- uses: marceloprado/has-changed-path@v1
19+
id: services-changed
20+
with:
21+
paths: services
22+
- run: echo services changed=${{ steps.services-changed.outputs.changed }}
23+
24+
upload-services:
25+
runs-on: ubuntu-latest
26+
needs: modify-services
27+
if: needs.modify-services.outputs.services-changed == 'true'
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-node@v2
31+
with:
32+
node-version: 18
33+
- run: node ./services/update-components-notice.js
34+
- run: sleep 3s
35+
- run: |
36+
export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
37+
npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
38+
echo the preview URL is $DEPLOY_DOMAIN
39+
echo "::set-output name=url::$DEPLOY_DOMAIN"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 国际标准时间+8
2+
# 每周更新组件发布信息
3+
name: service-update-schedule
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 0 * * 5"
9+
10+
jobs:
11+
create-report:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 18
18+
- run: node ./services/update-components-notice.js
19+
- run: sleep 3s
20+
- run: |
21+
export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
22+
npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
23+
ls services
24+
echo the preview URL is $DEPLOY_DOMAIN
25+
echo "::set-output name=url::$DEPLOY_DOMAIN"

.github/workflows/typos-config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[default.extend-words]
2+
vertx = "vertx"
3+
4+
[files]
5+
extend-exclude = ["**/lib/**","**/spline/**","contributor.html","README.md","README_zh-CN.md","docsearch.min.js","*.svg"]

.gitignore

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
node_modules/
1+
## MacOS
2+
.DS_Store
3+
4+
## node_modules
5+
node_modules
6+
7+
## lock
8+
yarn.lock
29
package-lock.json
3-
.DS_Store
10+
11+
## build
12+
_data
13+
_site
14+
dist
15+
results
16+
static_site
17+
lib
18+
19+
## test
20+
coverage

.vscode/settings.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"typescript.preferences.importModuleSpecifier": "relative",
3+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"],
4+
"[html]": {
5+
"editor.formatOnSave": true,
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[typescriptreact]": {
9+
"editor.formatOnSave": true,
10+
"editor.defaultFormatter": "esbenp.prettier-vscode"
11+
},
12+
"[javascriptreact]": {
13+
"editor.formatOnSave": true,
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
16+
"[typescript]": {
17+
"editor.formatOnSave": true,
18+
"editor.defaultFormatter": "esbenp.prettier-vscode"
19+
},
20+
"[javascript]": {
21+
"editor.formatOnSave": true,
22+
"editor.defaultFormatter": "esbenp.prettier-vscode"
23+
},
24+
"cSpell.words": ["tdesign"],
25+
"cSpell.ignorePaths": ["pnpm-lock.yaml", "node_modules", ".git", ".vscode"]
26+
}

0 commit comments

Comments
 (0)