-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf770b5
commit 3d69501
Showing
71 changed files
with
2,628 additions
and
11,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Build | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install packages | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Build bundles | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lint | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install packages | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Run ESLint | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Tests | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install packages | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Run tests | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules/ | ||
dist/ | ||
extension/*.zip | ||
extension/ | ||
.eslintcache | ||
.DS_Store | ||
*.log | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import path from 'node:path'; | ||
import { cp, rm, readFile, writeFile } from 'node:fs/promises'; | ||
|
||
const dir = process.cwd(); | ||
|
||
const CHROME_DIR = path.resolve(dir, './extension/chrome'); | ||
const FIREFOX_DIR = path.resolve(dir, './extension/firefox'); | ||
|
||
const copy = async () => { | ||
await rm(FIREFOX_DIR, { recursive: true, force: true }); | ||
await cp(CHROME_DIR, FIREFOX_DIR, { recursive: true }); | ||
}; | ||
|
||
const fixup = async () => { | ||
// Chrome does not like extra browser_specific_settings prop | ||
{ | ||
const manifestString = await readFile(path.join(CHROME_DIR, 'manifest.json'), 'utf-8'); | ||
const { browser_specific_settings: _drop, ...manifestUpdated } = JSON.parse(manifestString); | ||
|
||
await writeFile(path.join(CHROME_DIR, 'manifest.json'), JSON.stringify(manifestUpdated, null, 2)); | ||
} | ||
|
||
// Firefox can't do service workers in extensions, but can do background scripts | ||
{ | ||
const manifestString = await readFile(path.join(FIREFOX_DIR, 'manifest.json'), 'utf-8'); | ||
const { background, ...manifestUpdated } = JSON.parse(manifestString); | ||
|
||
manifestUpdated.background = { | ||
scripts: [background.service_worker] | ||
}; | ||
|
||
await writeFile(path.join(FIREFOX_DIR, 'manifest.json'), JSON.stringify(manifestUpdated, null, 2)); | ||
} | ||
} | ||
|
||
await copy(); | ||
await fixup(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.