Skip to content

Commit f4e94f7

Browse files
committed
feat(react): create react package
fixes: #56
1 parent e7ea577 commit f4e94f7

36 files changed

+1520
-2160
lines changed

.github/workflows/build-react.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build - Vue
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- packages/react/**
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- packages/react/**
15+
16+
# When pushing a new commit we should
17+
# cancel the previous test run to not
18+
# consume more runners than we need to.
19+
concurrency:
20+
group: ${{ github.ref }}_build_react
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
node-version:
29+
- 20.x
30+
- 22.x
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Setup Node v${{ matrix.node-version }}
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
39+
- name: Install Core
40+
run: npm install -w @poppy-ui/core
41+
shell: bash
42+
43+
- name: Build Core
44+
run: |
45+
npm run build -w @poppy-ui/core --if-present
46+
npm pack -w @poppy-ui/core
47+
PKG=$(ls poppy-ui-core-*.tgz)
48+
mv $PKG poppy-ui-core-${{ matrix.node-version }}.tgz
49+
shell: bash
50+
51+
- name: Install Vue
52+
run: |
53+
npm install ./poppy-ui-core-${{ matrix.node-version }}.tgz -w @poppy-ui/react
54+
npm install -w @poppy-ui/react
55+
shell: bash
56+
57+
- name: Build
58+
run: npm run build -w @poppy-ui/react --if-present

.github/workflows/quality.yml

+43
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,49 @@ jobs:
4646
package: core
4747
node-version: ${{ matrix.node-version }}
4848

49+
test-react:
50+
name: React
51+
needs:
52+
- biome
53+
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
node-version:
57+
- 20.x
58+
- 22.x
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ matrix.node-version }}
64+
65+
- name: Prepare
66+
run: |
67+
npm install -w @poppy-ui/core
68+
npm run build -w @poppy-ui/core
69+
npm pack -w @poppy-ui/core
70+
PKG=$(ls poppy-ui-core-*.tgz)
71+
mv $PKG poppy-ui-core-${{ matrix.node-version }}.tgz
72+
shell: bash
73+
74+
- name: Install
75+
run: |
76+
npm install ./poppy-ui-core-${{ matrix.node-version }}.tgz -w @poppy-ui/react
77+
npm install -w @poppy-ui/react
78+
shell: bash
79+
80+
- name: Test
81+
run: npm run test:spec -w @poppy-ui/react --if-present -- --passWithNoTests --coverage
82+
shell: bash
83+
84+
- name: Test e2e
85+
run: npm run test:e2e -w @poppy-ui/react --if-present -- --pass-with-no-tests --reporter github
86+
shell: bash
87+
- uses: ./.github/workflows/actions/test
88+
with:
89+
package: react
90+
node-version: ${{ matrix.node-version }}
91+
4992
test-vue:
5093
name: Vue
5194
needs:

.github/workflows/release.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@ jobs:
7070
- test
7171
uses: ./.github/workflows/build-vue.yml
7272

73+
build-react:
74+
name: Build - React
75+
needs:
76+
- test
77+
uses: ./.github/workflows/build-react.yml
78+
7379
publish:
7480
needs:
7581
- build-core
82+
- build-react
7683
- build-vue
7784
runs-on: ubuntu-latest
7885
steps:
@@ -114,7 +121,7 @@ jobs:
114121
npm uninstall @poppy-ui/docs -w @poppy-ui/vue
115122
npm install @poppy-ui/core@${{ steps.bump.outputs.version }} -w @poppy-ui/vue
116123
npm install -D @poppy-ui/docs@${{ steps.bump.outputs.version }} -w @poppy-ui/vue
117-
124+
118125
- name: Publish Vue
119126
run: |
120127
npm run build
@@ -123,6 +130,19 @@ jobs:
123130
env:
124131
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
125132

133+
- name: Upgrade - React
134+
run: |
135+
npm uninstall @poppy-ui/core -w @poppy-ui/react
136+
npm install @poppy-ui/core@${{ steps.bump.outputs.version }} -w @poppy-ui/react
137+
138+
- name: Publish React
139+
run: |
140+
npm run build
141+
npm publish
142+
working-directory: packages/react
143+
env:
144+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
145+
126146
# Push only if the package as been published on registry
127147
- name: Commit & Tag
128148
run: |

biome.jsonc

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
"**/package.json",
66
"**/*.d.ts",
77
"packages/docs/*",
8+
"packages/react/src/component.ts",
89
"packages/vue/src/vue-component-lib/utils.ts",
9-
"packages/vue/src/proxies.ts"
10+
"packages/vue/src/component.ts",
11+
"tests/**"
1012
]
1113
},
1214
"assists": {

0 commit comments

Comments
 (0)