Skip to content

Commit 364f3d1

Browse files
committed
Merge branch 'dev' of github.com:opentiny/tiny-vue into dev
2 parents 77a9acb + 216bb90 commit 364f3d1

File tree

5,078 files changed

+38075
-152066
lines changed

Some content is hidden

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

5,078 files changed

+38075
-152066
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,15 @@
627627
"contributions": [
628628
"code"
629629
]
630+
},
631+
{
632+
"login": "dufu1991",
633+
"name": "dufu1991",
634+
"avatar_url": "https://avatars.githubusercontent.com/u/24769077?v=4",
635+
"profile": "https://github.com/dufu1991",
636+
"contributions": [
637+
"doc"
638+
]
630639
}
631640
],
632641
"contributorsPerLine": 8,

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = {
5151
'@typescript-eslint/restrict-template-expressions': 'off',
5252
'@typescript-eslint/no-invalid-this': 'off',
5353
'vue/no-deprecated-dollar-scopedslots-api': 'off',
54-
'@typescript-eslint/lines-between-class-members': 'off'
54+
'@typescript-eslint/lines-between-class-members': 'off',
55+
'@typescript-eslint/no-this-alias': 'off'
5556
}
5657
}

.github/workflows/auto-all-publish.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
build:
1010
runs-on: windows-latest
1111
outputs:
12-
publishVersion: ${{ steps.parseTag.outputs.publishVersion }}
1312
branchVersion: ${{ steps.parseTag.outputs.branchVersion }}
1413
steps:
1514
- name: Parse Tag
@@ -18,9 +17,7 @@ jobs:
1817
with:
1918
script: |
2019
const tag = `${{ github.ref_name }}`
21-
const publishVersion = tag.slice(3)
22-
const branchVersion = tag.slice(1)
23-
core.setOutput('publishVersion', publishVersion)
20+
const branchVersion = tag.slice(1).split('.').slice(0, 2).join('.') + '.0'
2421
core.setOutput('branchVersion', branchVersion)
2522
2623
- name: CheckOut Code
@@ -36,42 +33,48 @@ jobs:
3633
with:
3734
node-version: 20.10.0
3835
registry-url: 'https://registry.npmjs.org'
39-
36+
4037
- name: Get pnpm store directory
4138
id: pnpm-cache
4239
run: |
43-
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
44-
40+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
41+
4542
- uses: actions/cache@v3
4643
name: Setup pnpm cache
4744
with:
4845
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
4946
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5047
restore-keys: |
51-
${{ runner.os }}-pnpm-store-
48+
${{ runner.os }}-pnpm-store-
5249
- name: Install dependencies
5350
run: pnpm i --no-frozen-lockfile
5451

5552
- name: Run Build Components
56-
run: pnpm build:ui -t ${{ steps.parseTag.outputs.publishVersion }}
57-
53+
run: pnpm build:ui
54+
5855
- name: Run Build Sass Common
59-
run: pnpm build:ui saas-common -t ${{ steps.parseTag.outputs.publishVersion }} -d saas
56+
run: pnpm build:ui saas-common -d saas
6057

6158
- name: Run Build Theme
6259
run: pnpm build:theme
6360

6461
- name: Run Build Renderless
6562
run: pnpm build:renderless
66-
63+
6764
- name: Run Build ThemeSaas
6865
run: pnpm build:themeSaas
69-
70-
- name: Run Build ThemeMobile
71-
run: pnpm build:themeMobile
66+
67+
- name: Run Build Utils
68+
run: pnpm build:utils
69+
70+
- name: Run Build Hooks
71+
run: pnpm build:hooks
72+
73+
- name: Run Build Runtime
74+
run: pnpm build:runtime
7275

7376
- name: Publish Vue3 And Vue2 components
74-
run: pnpm pub:all
77+
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks
7578
env:
7679
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7780

.github/workflows/auto-deploy-site.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
# Build job
2424
build:
2525
runs-on: ubuntu-latest
26+
permissions:
27+
contents: write
2628
steps:
2729
- name: Checkout
2830
uses: actions/checkout@v3
@@ -31,27 +33,34 @@ jobs:
3133
with:
3234
version: 9
3335
- name: Install deps
34-
run: pnpm -F @opentiny/vue-docs i --ignore-scripts --no-frozen-lockfile
36+
run: pnpm i --no-frozen-lockfile
3537
- name: Build site
36-
run: pnpm -F @opentiny/vue-docs build
38+
run: export NODE_OPTIONS="--max-old-space-size=8192" && pnpm -F @opentiny/vue-docs build
3739
- name: Setup Pages
38-
uses: actions/configure-pages@v2
40+
uses: actions/configure-pages@v5
3941
- name: Build with Jekyll
4042
uses: actions/jekyll-build-pages@v1
4143
with:
4244
source: ./examples/sites/dist
4345
destination: ./_site
46+
- name: Repair build artifact
47+
run: |
48+
sudo chmod -R 777 ./_site
49+
cp ./examples/sites/dist/assets/_commonjsHelpers*.js ./_site/assets
50+
cp ./_site/index.html ./_site/404.html
51+
sed -i 's/\/static/\/tiny-vue\/static/' ./_site/static/js/design-common.js
52+
sh ./examples/sites/dist/cp-component-md.sh
4453
- name: Upload artifact
45-
uses: actions/upload-pages-artifact@v1
54+
uses: actions/upload-pages-artifact@v3
4655

4756
# Deployment job
4857
deploy:
49-
environment:
50-
name: github-pages
51-
url: ${{ steps.deployment.outputs.page_url }}
5258
runs-on: ubuntu-latest
5359
needs: build
5460
steps:
5561
- name: Deploy to GitHub Pages
5662
id: deployment
57-
uses: actions/deploy-pages@v1
63+
uses: actions/deploy-pages@v4
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Dispatch Alpha All Publish
2+
run-name: Dispatch All Publish Alpha--${{ inputs.version }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: |
9+
输入您将要发布的版本号,
10+
例如: `3.xx.xx`.
11+
required: true
12+
type: string
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.sha }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: windows-latest
20+
outputs:
21+
publishVersion: ${{ steps.parseVersion.outputs.publishVersion }}
22+
steps:
23+
- name: Parse Version
24+
id: parseVersion
25+
uses: actions/github-script@v6
26+
with:
27+
script: |
28+
const version = `${{ inputs.version }}`
29+
if(!/^\d\.\d+\.\d+/.test(version)) {
30+
throw new Error('版本号格式不正确')
31+
}
32+
const publishVersion = version.slice(2)
33+
core.setOutput('publishVersion', publishVersion)
34+
35+
- name: CheckOut Code
36+
uses: actions/checkout@master
37+
with:
38+
ref: ${{ github.ref_name }}
39+
40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v2
42+
43+
- name: Setup Node
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: 20.10.0
47+
registry-url: 'https://registry.npmjs.org'
48+
49+
- name: Get pnpm store directory
50+
id: pnpm-cache
51+
run: |
52+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
53+
54+
- uses: actions/cache@v3
55+
name: Setup pnpm cache
56+
with:
57+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
58+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
59+
restore-keys: |
60+
${{ runner.os }}-pnpm-store-
61+
- name: Install dependencies
62+
run: pnpm i --no-frozen-lockfile
63+
64+
- name: Run Build Components
65+
run: pnpm build:ui -t ${{ steps.parseVersion.outputs.publishVersion }}
66+
67+
- name: Run Build Sass Common
68+
run: pnpm build:ui saas-common -t ${{ steps.parseVersion.outputs.publishVersion }} -d saas
69+
70+
- name: Run Build Theme
71+
run: pnpm build:theme
72+
73+
- name: Run Build Renderless
74+
run: pnpm build:renderless
75+
76+
- name: Run Build ThemeSaas
77+
run: pnpm build:themeSaas
78+
79+
- name: Run Build Utils
80+
run: pnpm build:utils
81+
82+
- name: Run Build Hooks
83+
run: pnpm build:hooks
84+
85+
- name: Run Build Runtime
86+
run: pnpm build:runtime
87+
88+
- name: Run Release alpha
89+
run: pnpm release:alpha
90+
91+
- name: Publish Vue3 And Vue2 components
92+
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks && pnpm pub:site
93+
env:
94+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Dispatch Alpha Renderless Theme Runtime
2+
run-name: Dispatch Alpha Renderless Theme Runtime--${{ inputs.components }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
components:
8+
description: |
9+
输入需要打包的模块名称,多个以英文逗号分隔,
10+
例如: `theme,renderless,runtime,docs,utils,hooks`
11+
required: true
12+
type: string
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.sha }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: windows-latest
20+
steps:
21+
- name: Parse Components
22+
id: parseComponents
23+
uses: actions/github-script@v6
24+
with:
25+
script: |
26+
const branchName = `${{ github.ref_name }}`
27+
const moduleName = `${{ inputs.components }}`
28+
const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils','hooks']
29+
30+
if (!validModuleNames.some(name => moduleName.includes(name))) {
31+
throw new Error('请输入正确的包名称')
32+
}
33+
34+
- name: CheckOut Code
35+
uses: actions/checkout@master
36+
with:
37+
ref: ${{ github.ref_name }}
38+
39+
- name: Setup pnpm
40+
uses: pnpm/action-setup@v2
41+
42+
- name: Setup Node
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version: 20.10.0
46+
registry-url: 'https://registry.npmjs.org'
47+
48+
- name: Get pnpm store directory
49+
id: pnpm-cache
50+
run: |
51+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
52+
53+
- uses: actions/cache@v3
54+
name: Setup pnpm cache
55+
with:
56+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
57+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
58+
restore-keys: |
59+
${{ runner.os }}-pnpm-store-
60+
61+
- name: Install dependencies
62+
run: pnpm i --no-frozen-lockfile
63+
64+
- name: Run Build Theme
65+
if: contains(inputs.components, 'theme') == true
66+
run: pnpm build:theme
67+
68+
- name: Run Build Renderless
69+
if: contains(inputs.components, 'renderless') == true
70+
run: pnpm build:renderless
71+
72+
- name: Run Build ThemeSaas
73+
if: contains(inputs.components, 'theme-saas') == true
74+
run: pnpm build:themeSaas
75+
76+
- name: Run Build Runtime
77+
if: contains(inputs.components, 'runtime') == true
78+
run: pnpm build:runtime
79+
80+
- name: Run Build Utils
81+
if: contains(inputs.components, 'utils') == true
82+
run: pnpm build:utils
83+
84+
- name: Run Build Hooks
85+
if: contains(inputs.components, 'hooks') == true
86+
run: pnpm build:hooks
87+
88+
- name: Run Release alpha
89+
run: pnpm release:alpha -u
90+
91+
- name: Publish
92+
run: |
93+
pnpm pub:all
94+
env:
95+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
96+
97+
- name: Publish Utils
98+
if: contains(inputs.components, 'utils') == true
99+
run: |
100+
pnpm pub:utils
101+
env:
102+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
103+
104+
- name: Publish Hooks
105+
if: contains(inputs.components, 'hooks') == true
106+
run: |
107+
pnpm pub:hooks
108+
env:
109+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
110+
111+
- name: Publish Docs
112+
if: contains(inputs.components, 'docs') == true
113+
run: |
114+
pnpm pub:site
115+
env:
116+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

.github/workflows/dispatch-renderless-theme-publish.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Dispatch Renderless Theme
2-
run-name: Dispatch Renderless Theme--${{ inputs.components }}
1+
name: Dispatch Renderless Theme Runtime
2+
run-name: Dispatch Renderless Theme Runtime--${{ inputs.components }}
33

44
on:
55
workflow_dispatch:
@@ -26,7 +26,7 @@ jobs:
2626
const branchName = `${{ github.ref_name }}`
2727
const moduleName = `${{ inputs.components }}`
2828
29-
if (!moduleName.includes('theme') && !moduleName.includes('renderless')) {
29+
if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('runtime')) {
3030
throw new Error('请输入正确的包名称')
3131
}
3232
@@ -76,10 +76,6 @@ jobs:
7676
if: contains(inputs.components, 'theme-saas') == true
7777
run: pnpm build:themeSaas
7878

79-
- name: Run Build ThemeMobile
80-
if: contains(inputs.components, 'theme-mobile') == true
81-
run: pnpm build:themeMobile
82-
8379
- name: Run Build Runtime
8480
if: contains(inputs.components, 'runtime') == true
8581
run: pnpm build:runtime

0 commit comments

Comments
 (0)