Skip to content

Commit 7865030

Browse files
authored
feat: add tooltip and secure bundle
1 parent 8d2470c commit 7865030

File tree

16 files changed

+3927
-13115
lines changed

16 files changed

+3927
-13115
lines changed

.github/workflows/pr.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ jobs:
2020
- name: Enable corepack
2121
run: corepack enable
2222

23-
- name: Install dependencies
24-
run: make deps
25-
26-
- name: Build
27-
run: make build
28-
2923
- name: Generate assets
30-
run: make static-assets
24+
run: make static-assets-pr
25+
env:
26+
IS_PR: 'true'

.github/workflows/publish.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ jobs:
2222
- name: Enable corepack
2323
run: corepack enable
2424

25-
- name: Install dependencies
26-
run: make deps
27-
28-
- name: Build
29-
run: make build
30-
3125
- name: Generate assets
3226
run: make static-assets
27+
env:
28+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
3329

3430
# https://github.com/marketplace/actions/github-pages
3531
- name: Deploy to GitHub Pages

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/coverage
1010

1111
# production
12-
/build
12+
/dist
1313
/static-assets
1414

1515
# misc

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ clean:
1313
mkdir -p static-assets
1414

1515
static-assets: build
16-
cp build/static/js/*.js static-assets/main-v1.js
16+
cp dist/hub-button-app.js static-assets/main-v1.js
17+
cp dist/hub-button-app.js.sig static-assets/main-v1.js.sig
18+
cp dist/hub-button-app.js.map static-assets/main-v1.js.map
19+
sed -i -E '[email protected]@https:\/\/traefik.github.io\/traefiklabs-hub-button-app\/main-v1.js@' static-assets/main-v1.js.map
20+
21+
static-assets-pr: build
22+
cp dist/hub-button-app.js static-assets/main-v1.js
1723
sed -i '1s@.*@\/* eslint-disable *\/@' static-assets/main-v1.js
1824
sed -i '23s@.*@\/\/# sourceMappingURL=https:\/\/traefik.github.io\/traefiklabs-hub-button-app\/main-v1.js.map@' static-assets/main-v1.js
19-
cp build/static/js/*.js.map static-assets/main-v1.js.map
20-
sed -i -E '1s@static\/js\/main.[0-9a-zA-Z]{8}.js@https:\/\/traefik.github.io\/traefiklabs-hub-button-app\/main-v1.js@' static-assets/main-v1.js.map
25+
26+
cp dist/hub-button-app.js.map static-assets/main-v1.js.map
27+
sed -i -E '[email protected]@https:\/\/traefik.github.io\/traefiklabs-hub-button-app\/main-v1.js@' static-assets/main-v1.js.map

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ Check the page that opens if the Header is properly rendered and if the latest p
2121
- `yarn install`
2222
- `yarn build`
2323

24-
It will create a `build` folder with the compiled assets.
24+
It will create a `dist` folder with the compiled assets.
25+
26+
**Note**: You will need a `PRIVATE_KEY` env variable to complete the build process. You can find the value on Bitwarden.
2527

2628
## How to use
2729

@@ -56,4 +58,5 @@ lines:
5658
### Deployment URLs
5759

5860
- https://traefik.github.io/traefiklabs-hub-button-app/main-v1.js
61+
- https://traefik.github.io/traefiklabs-hub-button-app/main-v1.js.sig
5962
- https://traefik.github.io/traefiklabs-hub-button-app/main-v1.js.map

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Hub button app</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,26 @@
1616
"@types/styled-components": "^5.1.26",
1717
"@typescript-eslint/eslint-plugin": "^8.38.0",
1818
"@typescript-eslint/parser": "^8.38.0",
19+
"@vitejs/plugin-react": "^5.1.0",
1920
"eslint": "^8.57.1",
2021
"eslint-config-prettier": "^10.1.8",
2122
"eslint-plugin-import": "^2.32.0",
2223
"prettier": "^3.6.2",
2324
"react": "^18.2.0",
2425
"react-dom": "^18.2.0",
25-
"react-scripts": "5.0.1",
2626
"styled-components": "^5.3.5",
2727
"typescript": "^4.9.5",
28+
"vite": "^7.1.12",
29+
"vite-tsconfig-paths": "^5.1.4",
2830
"web-vitals": "^2.1.4"
2931
},
3032
"scripts": {
3133
"format": "prettier './src/**/*.{ts,tsx}' --config .prettierrc.json --write",
3234
"lint": "eslint './src/**/*.{ts,tsx}'",
3335
"lint:fix": "eslint --fix './src/**/*.{ts,tsx}'",
34-
"start": "react-scripts start",
35-
"build": "react-scripts build",
36-
"test": "react-scripts test",
37-
"eject": "react-scripts eject"
36+
"dev": "vite",
37+
"build": "vite build",
38+
"preview": "vite preview"
3839
},
3940
"browserslist": {
4041
"production": [
@@ -48,5 +49,5 @@
4849
"last 1 safari version"
4950
]
5051
},
51-
"packageManager": "yarn@4.9.2"
52+
"packageManager": "yarn@4.10.3"
5253
}

public/index.html

Lines changed: 0 additions & 165 deletions
This file was deleted.

src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import HubButton from 'components/HubButton'
22

33
export const App = ({ style }: { style?: string }) => {
4-
return <HubButton style={style} />
4+
return (
5+
<div style={{ height: 500, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
6+
<HubButton style={style} />
7+
</div>
8+
)
59
}
610

711
export default App

src/WebComponent.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import HubButton from 'components/HubButton'
2+
3+
export const WebComponent = ({
4+
style,
5+
side,
6+
align,
7+
}: {
8+
style?: string
9+
side?: 'top' | 'bottom'
10+
align: 'left' | 'center' | 'right'
11+
}) => {
12+
return <HubButton style={style} side={side} align={align} />
13+
}
14+
15+
export default WebComponent

0 commit comments

Comments
 (0)