four-stroke 0.1.4 → 0.2.1
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.
- package/oxlint.config.mjs +10 -1
- package/package.json +14 -14
- package/src/components/viewer-menu.tsx +31 -31
package/oxlint.config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from "oxlint";
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
plugins: ["eslint", "typescript", "unicorn", "oxc", "import", "promise", "vitest"],
|
|
4
|
+
plugins: ["eslint", "typescript", "unicorn", "oxc", "import", "promise", "vitest", "react"],
|
|
5
5
|
options: {
|
|
6
6
|
typeAware: true,
|
|
7
7
|
},
|
|
@@ -64,6 +64,15 @@ export default defineConfig({
|
|
|
64
64
|
"unicorn/number-literal-case": "off",
|
|
65
65
|
"eslint/one-var": "off",
|
|
66
66
|
"vitest/prefer-called-once": "off",
|
|
67
|
+
"react/react-in-jsx-scope": "off",
|
|
68
|
+
"react/jsx-max-depth": "off",
|
|
69
|
+
"react/function-component-definition": [
|
|
70
|
+
"error",
|
|
71
|
+
{
|
|
72
|
+
namedComponents: "arrow-function",
|
|
73
|
+
unnamedComponents: "arrow-function",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
67
76
|
},
|
|
68
77
|
overrides: [
|
|
69
78
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "four-stroke",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Simple Cloudflare Worker SSR SPA framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"main": "src/fake.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@types/react": "^19.
|
|
23
|
-
"openapi-typescript": "^7.13.0"
|
|
22
|
+
"@types/react": "^19.3.0",
|
|
23
|
+
"openapi-typescript": "^7.13.0",
|
|
24
|
+
"typescript": "^6.0.3"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@cloudflare/vitest-pool-workers": "^0.22.0",
|
|
27
|
-
"knip": "^6.
|
|
28
|
-
"oxfmt": "^0.
|
|
29
|
-
"oxlint": "^1.
|
|
28
|
+
"knip": "^6.35.1",
|
|
29
|
+
"oxfmt": "^0.67.0",
|
|
30
|
+
"oxlint": "^1.82.0",
|
|
30
31
|
"oxlint-tsgolint": "^7.0.2001",
|
|
31
|
-
"typescript": "^7.0.2",
|
|
32
32
|
"vitest": "^4.1.11"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@sentry/cli": "
|
|
36
|
-
"knip": "
|
|
37
|
-
"oxfmt": "
|
|
38
|
-
"oxlint": "
|
|
39
|
-
"oxlint-tsgolint": "
|
|
40
|
-
"typescript": "^
|
|
41
|
-
"vitest": "
|
|
35
|
+
"@sentry/cli": ">=3.6.0",
|
|
36
|
+
"knip": ">=6.26.0",
|
|
37
|
+
"oxfmt": ">=0.59.0",
|
|
38
|
+
"oxlint": ">=1.74.0",
|
|
39
|
+
"oxlint-tsgolint": ">=0.24.0",
|
|
40
|
+
"typescript": "^6.0.3",
|
|
41
|
+
"vitest": "^4",
|
|
42
42
|
"wrangler": ">=3"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
@@ -5,35 +5,35 @@ interface ViewerMenuProps {
|
|
|
5
5
|
viewer: Viewer;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className="grid size-9 place-items-center rounded-full bg-emerald-950 text-sm font-semibold text-white"
|
|
23
|
-
>
|
|
24
|
-
{viewer.name.slice(0, 1).toUpperCase()}
|
|
25
|
-
</span>
|
|
26
|
-
)}
|
|
27
|
-
<span className="max-w-48 truncate text-sm font-medium">{viewer.name}</span>
|
|
28
|
-
</summary>
|
|
29
|
-
<nav className="absolute right-0 mt-2 w-40 rounded-md border border-stone-200 bg-white py-1 shadow-lg">
|
|
30
|
-
<a
|
|
31
|
-
className="block px-4 py-2 text-sm font-medium text-neutral-700 hover:bg-stone-100 focus:bg-stone-100 focus:outline-none"
|
|
32
|
-
href={logoutUrl}
|
|
8
|
+
const ViewerMenu = ({ logoutUrl, viewer }: ViewerMenuProps): React.ReactNode => (
|
|
9
|
+
<details className="group relative">
|
|
10
|
+
<summary className="flex cursor-pointer list-none items-center gap-3 rounded-md px-2 py-1.5 hover:bg-stone-100 focus:outline-none focus:ring-2 focus:ring-emerald-900 focus:ring-offset-2 [&::-webkit-details-marker]:hidden">
|
|
11
|
+
{viewer.picture ? (
|
|
12
|
+
<img
|
|
13
|
+
alt=""
|
|
14
|
+
className="size-9 rounded-full object-cover"
|
|
15
|
+
referrerPolicy="no-referrer"
|
|
16
|
+
src={viewer.picture}
|
|
17
|
+
/>
|
|
18
|
+
) : (
|
|
19
|
+
<span
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
className="grid size-9 place-items-center rounded-full bg-emerald-950 text-sm font-semibold text-white"
|
|
33
22
|
>
|
|
34
|
-
|
|
35
|
-
</
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
{viewer.name.slice(0, 1).toUpperCase()}
|
|
24
|
+
</span>
|
|
25
|
+
)}
|
|
26
|
+
<span className="max-w-48 truncate text-sm font-medium">{viewer.name}</span>
|
|
27
|
+
</summary>
|
|
28
|
+
<nav className="absolute right-0 mt-2 w-40 rounded-md border border-stone-200 bg-white py-1 shadow-lg">
|
|
29
|
+
<a
|
|
30
|
+
className="block px-4 py-2 text-sm font-medium text-neutral-700 hover:bg-stone-100 focus:bg-stone-100 focus:outline-none"
|
|
31
|
+
href={logoutUrl}
|
|
32
|
+
>
|
|
33
|
+
Logout
|
|
34
|
+
</a>
|
|
35
|
+
</nav>
|
|
36
|
+
</details>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default ViewerMenu;
|