Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Bug Report
description: Report a bug in LinkPull
labels: [bug]

body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '...'
3. See error
validations:
required: true

- type: dropdown
id: browser
attributes:
label: Browser
options:
- Chrome
- Firefox
- Other
validations:
required: true

- type: input
id: version
attributes:
label: Extension version
placeholder: e.g. 1.2.0
validations:
required: true

- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context, screenshots, or screen recordings.
validations:
required: false
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature Request
description: Suggest a new feature for LinkPull
labels: [enhancement]

body:
- type: textarea
id: description
attributes:
label: Describe the feature
description: A clear and concise description of the feature you'd like.
validations:
required: true

- type: textarea
id: motivation
attributes:
label: Why is this useful?
description: Explain the problem this feature would solve or the value it would add.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Describe any alternative solutions or features you've considered.
validations:
required: false
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## What

<!-- What does this PR do? -->

## Why

<!-- Why is this change needed? -->

## How to test

<!-- Steps to verify the change works correctly -->

## Checklist

- [ ] `npx eslint .` passes
- [ ] `npx tsc --noEmit` passes
- [ ] Tested in Chrome
- [ ] Tested in Firefox (if applicable)
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install --ignore-scripts

- name: Prepare WXT
run: npx wxt prepare

- name: Cache node_modules and .wxt
uses: actions/cache/save@v4
with:
path: |
node_modules
.wxt
key: deps-${{ github.sha }}

lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
node_modules
.wxt
key: deps-${{ github.sha }}

- name: Lint
run: npx eslint .

typecheck:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
node_modules
.wxt
key: deps-${{ github.sha }}

- name: Type-check
run: npx tsc --noEmit

build:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
node_modules
.wxt
key: deps-${{ github.sha }}

- name: Build (Chrome)
run: npx wxt build

- name: Build (Firefox)
run: npx wxt build -b firefox
11 changes: 11 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const useExtraction = (settings: Settings) => {
try {
await browser.scripting.executeScript({
target: { tabId: tab.id },
files: ['content-scripts/content.js'],
files: ['/content-scripts/content.js'],
})
await new Promise((r) => setTimeout(r, 500))
context = await sendMessage('get-context', undefined, tab.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const useSupportPrompt = (postCount: number) => {
;(async () => {
try {
const stored = await browser.storage.local.get(SUPPORT_KEY)
const state: SupportState = { ...DEFAULT_STATE, ...stored[SUPPORT_KEY] }
const prev = stored[SUPPORT_KEY] as Partial<SupportState> | undefined
const state: SupportState = { ...DEFAULT_STATE, ...prev }

// Increment extraction count
state.extractionCount++
Expand Down Expand Up @@ -59,7 +60,8 @@ export const useSupportPrompt = (postCount: number) => {
setVisible(false)
try {
const stored = await browser.storage.local.get(SUPPORT_KEY)
const state: SupportState = { ...DEFAULT_STATE, ...stored[SUPPORT_KEY] }
const prev = stored[SUPPORT_KEY] as Partial<SupportState> | undefined
const state: SupportState = { ...DEFAULT_STATE, ...prev }
state.lastDismissed = Date.now()
await browser.storage.local.set({ [SUPPORT_KEY]: state })
} catch {
Expand All @@ -71,7 +73,8 @@ export const useSupportPrompt = (postCount: number) => {
setVisible(false)
try {
const stored = await browser.storage.local.get(SUPPORT_KEY)
const state: SupportState = { ...DEFAULT_STATE, ...stored[SUPPORT_KEY] }
const prev = stored[SUPPORT_KEY] as Partial<SupportState> | undefined
const state: SupportState = { ...DEFAULT_STATE, ...prev }
state.ratedOrSupported = true
await browser.storage.local.set({ [SUPPORT_KEY]: state })
} catch {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"autoprefixer": "^10.4.24",
"eslint": "^9.39.3",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-perfectionist": "^5.6.0",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
Expand Down