@onepercentio/one-ui 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ name: Release Browser Bundle
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - package.json
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ detect-version-change:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ changed: ${{ steps.version.outputs.changed }}
16
+ version: ${{ steps.version.outputs.version }}
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 2
22
+
23
+ - name: Detect package version change
24
+ id: version
25
+ shell: bash
26
+ run: |
27
+ current_version=$(node -p "require('./package.json').version")
28
+ previous_sha="${{ github.event.before }}"
29
+
30
+ if [ -z "$previous_sha" ] || [ "$previous_sha" = "0000000000000000000000000000000000000000" ]; then
31
+ previous_version=""
32
+ else
33
+ previous_version=$(git show "$previous_sha:package.json" 2>/dev/null | node -p "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync(0, 'utf8')); pkg.version" 2>/dev/null || true)
34
+ fi
35
+
36
+ if [ "$current_version" != "$previous_version" ]; then
37
+ echo "changed=true" >> "$GITHUB_OUTPUT"
38
+ else
39
+ echo "changed=false" >> "$GITHUB_OUTPUT"
40
+ fi
41
+
42
+ echo "version=$current_version" >> "$GITHUB_OUTPUT"
43
+
44
+ - name: Skip when version is unchanged
45
+ if: steps.version.outputs.changed != 'true'
46
+ run: echo "package.json changed, but version stayed the same."
47
+
48
+ release-browser-bundle:
49
+ needs: detect-version-change
50
+ if: needs.detect-version-change.outputs.changed == 'true'
51
+ runs-on: ubuntu-latest
52
+ steps:
53
+ - name: Checkout repository
54
+ uses: actions/checkout@v4
55
+
56
+ - name: Setup Node.js
57
+ uses: actions/setup-node@v4
58
+ with:
59
+ node-version: 20
60
+ cache: yarn
61
+
62
+ - name: Install dependencies
63
+ run: yarn install --frozen-lockfile
64
+
65
+ - name: Build browser bundle
66
+ run: yarn build:bundle
67
+
68
+ - name: Create GitHub release
69
+ uses: softprops/action-gh-release@v2
70
+ with:
71
+ tag_name: v${{ needs.detect-version-change.outputs.version }}
72
+ name: v${{ needs.detect-version-change.outputs.version }}
73
+ generate_release_notes: true
74
+ files: |
75
+ dist-browser/bundle.js
76
+ dist-browser/bundle.js.map
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ Install via npm:
2
+
3
+ ```bash
4
+ npm install @onepercentio/one-ui
5
+ ```
6
+
7
+ Or include it directly in HTML:
8
+
9
+ ```html
10
+ <script src="https://github.com/onepercentio/one-ui/releases/download/v1.3.2/bundle.js"></script>
11
+ ```
12
+
13
+ When loaded via script in HTML, the library is exposed as the global `OneUI` object:
14
+
15
+ ```tsx
16
+ function App() {
17
+ return (
18
+ <OneUI.Button type="button">
19
+ Hello from OneUI
20
+ </OneUI.Button>
21
+ );
22
+ }
23
+ ```