Skip to content

Commit 1e02cb6

Browse files
author
ntwigg
committed
Naive implementation.
1 parent 3c91f3a commit 1e02cb6

File tree

16 files changed

+7868
-1
lines changed

16 files changed

+7868
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ TODO: screenshot of GitHub comment syntax highlighting
99

1010
TODO: screenshot of comment draft storage and restoration
1111

12-
If there's something you'd like to add or fix, see [CONTRIBUTING.md](CONTRIBUTING.md).
12+
If there's something you'd like to add or fix, see [CONTRIBUTING.md](CONTRIBUTING.md).
13+
14+
Special thanks to:
15+
- [overtype](https://github.com/panphora/overtype) for the trick which makes syntax highlighting possible
16+
- [shiki](https://github.com/shikijs/shiki) for the broad library of syntax highlighters
17+
- [Yukai Huang](https://github.com/Yukaii) for [the PRs](https://github.com/panphora/overtype/issues?q=is%3Apr+author%3AYukaii) which made the two work together

browser-extension/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Gitcasso browser extension
2+
3+
## Developer quickstart
4+
5+
### Hotreload development
6+
7+
- `npm install`
8+
- `npm run dev`
9+
- open [`chrome://extensions`](chrome://extensions)
10+
- toggle **Developer mode** (top-right)
11+
- click "Load unpacked" (far left)
12+
- `browser-extension/.output/chrome-mv3-dev`
13+
- if you can't find `.output`, it's probably hidden, `command+shift+period` will show it
14+
- click the puzzle icon next to the url bar, then pin the Gitcasso icon
15+
16+
### Testing and quality
17+
- `npm run biome` - runs `biome check` (lint & formatting)
18+
- `npm run biome:fix` - fixes most of what `biome check` finds
19+
- `npm run compile` - typechecking
20+
- `npm run test` - vitest
21+
22+
### Deployment
23+
- `npm run build` - build for mv3 for most browsers
24+
- `npm run build:firefox` - build mv2 specifically for Firefox
25+
26+
## How it works
27+
28+
This is a [WXT](https://wxt.dev/)-based browser extension that
29+
30+
- finds `textarea` components and decorates them with [overtype](https://overtype.dev/) and [shiki](https://github.com/shikijs/shiki).
31+
- stores unposted comment drafts, and makes them easy to find via the extension popup
32+
33+
### Entry points
34+
35+
- src/entrypoints/content.ts - injected into every webpage
36+
- src/entrypoints/popup - html/css/ts which opens when the extension's button gets clicked

browser-extension/biome.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3+
"assist": {
4+
"actions": {
5+
"source": {
6+
"useSortedKeys": "on"
7+
}
8+
},
9+
"enabled": true
10+
},
11+
"files": {
12+
"ignoreUnknown": false,
13+
"includes": [".*", "src/**", "tests/**"]
14+
},
15+
"formatter": {
16+
"enabled": true,
17+
"formatWithErrors": false,
18+
"indentStyle": "space",
19+
"indentWidth": 2,
20+
"lineEnding": "lf",
21+
"lineWidth": 100
22+
},
23+
"javascript": {
24+
"formatter": {
25+
"arrowParentheses": "always",
26+
"attributePosition": "auto",
27+
"bracketSameLine": false,
28+
"bracketSpacing": true,
29+
"jsxQuoteStyle": "single",
30+
"quoteProperties": "asNeeded",
31+
"quoteStyle": "single",
32+
"semicolons": "asNeeded",
33+
"trailingCommas": "all"
34+
}
35+
},
36+
"json": {
37+
"formatter": {
38+
"trailingCommas": "none"
39+
}
40+
},
41+
"linter": {
42+
"rules": {
43+
"complexity": {
44+
"noExcessiveCognitiveComplexity": "warn"
45+
},
46+
"correctness": {
47+
"noUnusedVariables": "error",
48+
"useValidTypeof": "error"
49+
},
50+
"recommended": true,
51+
"style": {
52+
"noDefaultExport": "off",
53+
"noNonNullAssertion": "warn",
54+
"noParameterAssign": {
55+
"options": {
56+
"propertyAssignment": "deny"
57+
}
58+
},
59+
"useConst": "error",
60+
"useTemplate": "error"
61+
},
62+
"suspicious": {
63+
"noConsole": {
64+
"options": {
65+
"allow": ["assert", "error", "info", "warn"]
66+
}
67+
},
68+
"noExplicitAny": "error",
69+
"noVar": "error"
70+
}
71+
}
72+
},
73+
"vcs": {
74+
"clientKind": "git",
75+
"enabled": false,
76+
"useIgnoreFile": true
77+
}
78+
}

0 commit comments

Comments
 (0)