Skip to content

Commit 90223aa

Browse files
authored
Merge pull request #116 from opentiny/dev
feat: release v1.1.0
2 parents 095d527 + f3ae865 commit 90223aa

90 files changed

Lines changed: 2988 additions & 983 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/workflows/deploy-obs-playground.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Deploy GenUI SDK Playground to Huawei OBS
22

33
on:
44
push:
5-
paths:
6-
- 'sites/playground/web/**'
5+
branches:
6+
- dev
7+
- master
78
workflow_dispatch:
89
inputs:
910
env:
@@ -36,11 +37,9 @@ jobs:
3637
environment: ${{ github.event.inputs.env || 'alpha' }}
3738
steps:
3839
- name: Checkout
39-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4041
- name: Setup pnpm
41-
uses: pnpm/action-setup@v3
42-
with:
43-
version: 9
42+
uses: pnpm/action-setup@v4
4443
- name: Checkout repository (with submodules)
4544
uses: actions/checkout@v4
4645
with:

.github/workflows/pr-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
build:
9+
name: pnpm build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
submodules: recursive
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: pnpm
26+
27+
- name: Install deps
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build
31+
run: pnpm build

.github/workflows/publish-angular.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656

5757
- name: Setup pnpm
5858
uses: pnpm/action-setup@v4
59-
with:
60-
version: 10.12.1
6159

6260
- name: Setup Node.js
6361
uses: actions/setup-node@v4
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Publish GenUI SDK packages
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: '发布版本号(将写入 server / vue / angular 的 package.json,例如 1.0.0-beta.2)'
8+
required: true
9+
type: string
10+
npm_tag:
11+
description: '发布标签(latest=正式版,beta/alpha=预发版,安装时如 npm install pkg@beta)'
12+
required: true
13+
default: latest
14+
type: choice
15+
options:
16+
- latest
17+
- beta
18+
- alpha
19+
20+
jobs:
21+
publish:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
steps:
27+
- name: Check allowed publishers
28+
run: |
29+
ALLOWED="${{ vars.ALLOWED_PUBLISHERS }}"
30+
if [ -z "$ALLOWED" ]; then
31+
echo "::error::请在仓库 Settings → Secrets and variables → Actions → Variables 中配置 ALLOWED_PUBLISHERS(逗号分隔的 GitHub 用户名)"
32+
exit 1
33+
fi
34+
ACTOR="${{ github.actor }}"
35+
if echo ",${ALLOWED}," | grep -q ",${ACTOR},"; then
36+
echo "✓ 允许发布: $ACTOR"
37+
else
38+
echo "::error::无权限发布: $ACTOR 不在 ALLOWED_PUBLISHERS 列表中"
39+
exit 1
40+
fi
41+
42+
- name: Validate version (semver)
43+
run: |
44+
VERSION="${{ github.event.inputs.version }}"
45+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
46+
echo "::error::版本号需符合语义化版本(如 1.0.0、1.0.0-beta.2),当前值: $VERSION"
47+
exit 1
48+
fi
49+
echo "✓ 版本号格式正确: $VERSION"
50+
51+
- name: Checkout (with submodules)
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
submodules: true
56+
57+
- name: Setup pnpm
58+
uses: pnpm/action-setup@v4
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: '20'
64+
cache: 'pnpm'
65+
66+
- name: Install dependencies
67+
run: pnpm install
68+
69+
- name: Update package versions
70+
run: |
71+
VERSION="${{ github.event.inputs.version }}"
72+
node ./scripts/update-package-version.js packages/server/package.json "$VERSION"
73+
node ./scripts/update-package-version.js packages/frameworks/vue/package.json "$VERSION"
74+
node ./scripts/update-package-version.js packages/frameworks/angular/package.json "$VERSION"
75+
76+
- name: Build Server
77+
run: pnpm --filter @opentiny/genui-sdk-server build:lib:npm
78+
79+
- name: Build Vue
80+
run: pnpm --filter @opentiny/genui-sdk-vue build:lib:npm
81+
82+
- name: Build Angular
83+
run: pnpm --filter @opentiny/genui-sdk-angular build:lib:npm
84+
85+
- name: Setup .npmrc for publish
86+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
87+
88+
- name: Publish server to npm
89+
working-directory: packages/server/output
90+
run: pnpm publish --no-git-checks --access public --tag ${{ github.event.inputs.npm_tag }}
91+
92+
- name: Publish Vue to npm
93+
working-directory: packages/frameworks/vue/output
94+
run: pnpm publish --no-git-checks --access public --tag ${{ github.event.inputs.npm_tag }}
95+
96+
- name: Publish Angular to npm
97+
working-directory: packages/frameworks/angular/output
98+
run: pnpm publish --no-git-checks --access public --tag ${{ github.event.inputs.npm_tag }}
99+
100+
- name: Create and push tags
101+
run: |
102+
VERSION="${{ github.event.inputs.version }}"
103+
git config user.name "github-actions[bot]"
104+
git config user.email "github-actions[bot]@users.noreply.github.com"
105+
git tag "v${VERSION}"
106+
git push origin "v${VERSION}"

.github/workflows/publish-server.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656

5757
- name: Setup pnpm
5858
uses: pnpm/action-setup@v4
59-
with:
60-
version: 10.12.1
6159

6260
- name: Setup Node.js
6361
uses: actions/setup-node@v4

.github/workflows/publish-vue.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656

5757
- name: Setup pnpm
5858
uses: pnpm/action-setup@v4
59-
with:
60-
version: 10.12.1
6159

6260
- name: Setup Node.js
6361
uses: actions/setup-node@v4

docs/demos/renderer/custom-actions-form.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const content = ref({
2323
type: 'JSExpression',
2424
value: 'this.state.formData',
2525
},
26-
'label-position': 'top',
26+
labelPosition: 'top',
2727
},
2828
children: [
2929
{

docs/src/components/chat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ interface IBubbleSlotsProps {
591591
bubbleProps: BubbleProps;
592592
isFinished: boolean;
593593
messageManager: UseMessageReturn;
594+
chatMessage: IMessage
594595
}
595596
```
596597

docs/src/examples/chat/footer-toolbar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Chat 组件 - 自定义底部工具栏
1+
# Chat 组件 - 自定义底部工具栏
22

33
`GenuiChat` 组件支持为不同角色的消息配置自定义底部工具栏,你可以在每条消息下方添加操作按钮(复制、点赞、踩、刷新等),用于增强交互体验。
44

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build:projects": "pnpm --filter @opentiny/tiny-schema-renderer build && pnpm --filter @opentiny/tiny-schema-renderer-ng build",
1111
"build:materials": "pnpm --filter @opentiny/genui-sdk-materials-* build",
1212
"prebuild:lib": "pnpm build:materials",
13-
"build:lib": "pnpm --filter @opentiny/genui-sdk-core build && pnpm --filter @opentiny/genui-sdk-vue build",
13+
"build:lib": "pnpm --filter @opentiny/genui-sdk-core build && pnpm --filter @opentiny/genui-sdk-vue build && pnpm --filter @opentiny/genui-sdk-angular build:lib",
1414
"build:plugins": "pnpm --filter vite-commit-hash-plugin build",
1515
"dev:server": "pnpm --filter @opentiny/genui-sdk-server dev",
1616
"build:server": "pnpm --filter @opentiny/genui-sdk-server build",
@@ -20,6 +20,11 @@
2020
"build:homepage": "pnpm --filter genui-sdk-homepage-web build",
2121
"build": "pnpm build:playground"
2222
},
23+
"pnpm": {
24+
"patchedDependencies": {
25+
"ai@6.0.116": "patches/ai@6.0.116.patch"
26+
}
27+
},
2328
"keywords": [],
2429
"author": "OpenTiny",
2530
"packageManager": "pnpm@10.12.1",

0 commit comments

Comments
 (0)