Skip to content

Commit 772fe39

Browse files
committed
refactor: Swapped from bun to esbuild, other changes to playground app
1 parent 768bbd1 commit 772fe39

9 files changed

Lines changed: 173 additions & 1105 deletions

File tree

playground/browser-extension-js/README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,16 @@ pnpm pkglab:add
5757

5858
### 4. Install dependencies
5959

60-
This playground is not a pnpm workspace member, so use `bun install` to install dependencies:
60+
This playground is not a pnpm workspace member, so use `pnpm install` to install dependencies:
6161

6262
```bash
63-
bun install
63+
pnpm install --ignore-workspace
64+
```
65+
66+
The first time you install packages you will will may to approve builds. Use:
67+
68+
```bash
69+
pnpm approve-builds --ignore-workspace
6470
```
6571

6672
### 5. Set up environment
@@ -104,10 +110,17 @@ When you make changes to `@clerk/chrome-extension` (or its dependencies), rebuil
104110

105111
```bash
106112
# From repo root
107-
pnpm turbo build --filter=@clerk/chrome-extension...
108-
pnpm pkglab pub @clerk/chrome-extension
113+
pnpm turbo build --filter=@clerk/chrome-extension... && pnpm pkglab pub @clerk/chrome-extension
114+
109115

110116
# From this playground
111-
bun install
112-
pnpm build
117+
118+
# If you haven't approved build yet
119+
pnpm install --ignore-workspace
120+
pnpm approve-builds
121+
pnpm dev
122+
123+
# If you have approved builds already
124+
pnpm install
125+
pnpm dev
113126
```

playground/browser-extension-js/build/manifest.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
"name": "Clerk Extension JS Demo",
44
"description": "A Chrome extension demo using @clerk/chrome-extension with plain TypeScript.",
55
"version": "0.0.1",
6-
"permissions": ["cookies", "storage"],
7-
"host_permissions": ["http://localhost/*"],
6+
"permissions": [
7+
"cookies",
8+
"storage"
9+
],
10+
"host_permissions": [
11+
"http://localhost/*"
12+
],
813
"action": {
914
"default_title": "Clerk Extension Demo",
1015
"default_popup": "popup.html"

playground/browser-extension-js/build/popup.css

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,53 @@
1-
* { margin: 0; padding: 0; box-sizing: border-box; }
2-
body { width: 300px; min-height: 300px; background: #111; color: #fff; font-family: system-ui, sans-serif; }
3-
#app { display: flex; flex-direction: column; min-height: 300px; }
4-
#content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; text-align: center; }
5-
h1 { font-size: 1.1rem; font-weight: 600; }
6-
#nav { display: flex; align-items: center; justify-content: center; padding: 0.75rem 1rem; background: #222; border-top: 1px solid #333; }
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
width: 600px;
9+
max-height: 600px;
10+
height: 600px;
11+
background: #111;
12+
color: #fff;
13+
font-family: system-ui, sans-serif;
14+
}
15+
16+
#app {
17+
display: flex;
18+
flex-direction: column;
19+
min-height: 600px;
20+
}
21+
22+
#content {
23+
flex: 1;
24+
display: flex;
25+
flex-direction: column;
26+
align-items: center;
27+
justify-content: start;
28+
padding: 1rem;
29+
}
30+
31+
h1 {
32+
font-size: 1.1rem;
33+
font-weight: 600;
34+
padding: 1rem 2rem;
35+
text-align: center;
36+
}
37+
38+
#nav {
39+
display: flex;
40+
align-items: center;
41+
justify-content: flex-end;
42+
padding: 0.75rem 1rem;
43+
background: #222;
44+
border-top: 1px solid #333;
45+
}
46+
47+
#nav:has(#sign-out-btn) {
48+
justify-content: space-between;
49+
}
50+
751
#sign-in-btn {
852
background: #2563eb;
953
color: #fff;
@@ -14,8 +58,33 @@ h1 { font-size: 1.1rem; font-weight: 600; }
1458
cursor: pointer;
1559
transition: background 0.15s;
1660
}
17-
#sign-in-btn:hover { background: #1d4ed8; }
18-
#sign-in-btn:active { background: #1e40af; }
61+
62+
#sign-in-btn:hover {
63+
background: #1d4ed8;
64+
}
65+
66+
#sign-in-btn:active {
67+
background: #1e40af;
68+
}
69+
70+
#sign-out-btn {
71+
background: #6C47FF;
72+
color: #fff;
73+
border: none;
74+
border-radius: 6px;
75+
padding: 0.5rem 1.25rem;
76+
font-size: 0.875rem;
77+
cursor: pointer;
78+
transition: background 0.15s;
79+
}
80+
81+
#sign-out-btn:hover {
82+
background: #5639CC;
83+
}
84+
85+
#sign-out-btn:active {
86+
background: #4A30B3;
87+
}
1988

2089
.user-card {
2190
width: 100%;
@@ -26,32 +95,38 @@ h1 { font-size: 1.1rem; font-weight: 600; }
2695
padding: 0.75rem;
2796
text-align: left;
2897
}
98+
2999
.user-card-header {
30100
display: flex;
31101
align-items: center;
32102
gap: 0.75rem;
33103
margin-bottom: 0.75rem;
34104
}
105+
35106
.user-avatar {
36107
width: 48px;
37108
height: 48px;
38109
border-radius: 50%;
39110
object-fit: cover;
40111
}
112+
41113
.user-name {
42114
font-size: 1rem;
43115
font-weight: 600;
44116
}
117+
45118
.user-info-row {
46119
display: flex;
47120
justify-content: space-between;
48121
padding: 0.3rem 0;
49122
font-size: 0.8rem;
50123
border-top: 1px solid #2a2a2a;
51124
}
125+
52126
.info-label {
53127
color: #888;
54128
}
129+
55130
.info-value {
56131
color: #fff;
57132
text-align: right;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
<!DOCTYPE html>
22
<html>
3+
34
<head>
45
<meta charset="utf-8" />
56
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
67
<title>Clerk Extension Demo</title>
78
<link rel="stylesheet" href="popup.css" />
89
</head>
10+
911
<body>
1012
<div id="app">
13+
<div>
14+
<h1>Clerk JS Chrome Extension Quickstart</h1>
15+
</div>
1116
<div id="content"></div>
1217
<nav id="nav"></nav>
1318
</div>
1419
<script src="popup.js"></script>
1520
</body>
21+
1622
</html>

0 commit comments

Comments
 (0)