Skip to content

Commit c4438ee

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

Some content is hidden

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

43 files changed

+6820
-2180
lines changed

.github/workflows/audit.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ jobs:
3131
matrix:
3232
package:
3333
- core
34+
- react
3435
- vue
3536
steps:
3637
- uses: actions/checkout@v4
3738
- name: Audit ${{ matrix.package }}
3839
run: npx -w @poppy-ui/${{ matrix.package }} audit-ci@latest --config ./audit-ci.json
39-
shell: bash
40+
shell: bash

.github/workflows/build-react.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build - React
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 React
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: |

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ prerender-static.html
5656
# stencil
5757
packages/angular/css/
5858
packages/react/css/
59-
packages/react/src/components.ts
6059
packages/vue/css/
61-
packages/vue/src/components.ts
6260
packages/core/components/
6361
packages/core/css/
6462
packages/core/hydrate/
6563
packages/core/loader/
66-
packages/core/src/components.d.ts
67-
packages/core/src/components-config.d.ts
6864
packages/core/www/
6965
packages/.stencil/
7066

biome.jsonc

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
"ignore": [
55
"**/package.json",
66
"**/*.d.ts",
7+
"packages/core/src/components.ts",
8+
"packages/core/src/components-config.ts",
79
"packages/docs/*",
10+
"packages/react/src/components.ts",
811
"packages/vue/src/vue-component-lib/utils.ts",
9-
"packages/vue/src/proxies.ts"
12+
"packages/vue/src/components.ts",
13+
"tests/**"
1014
]
1115
},
1216
"assists": {

0 commit comments

Comments
 (0)