-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from whale4113/feat/lujunji/support-firefox-ex…
…tension feat: support firefox extension
- Loading branch information
Showing
29 changed files
with
2,380 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@dolphin/chrome-extension': patch | ||
--- | ||
|
||
fix(chrome-extension): insert syntax for missing brackets |
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,5 @@ | ||
--- | ||
'@dolphin/chrome-extension': patch | ||
--- | ||
|
||
fix(chrome-extension): no permission to copy |
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,5 @@ | ||
--- | ||
'@dolphin/chrome-extension': minor | ||
--- | ||
|
||
feat(chrome-extension): support for firefox extension |
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,4 @@ | ||
{ | ||
"name": "Node.js & TypeScript", | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm", | ||
"postCreateCommand": "npm install -g [email protected]" | ||
} | ||
"postCreateCommand": "npm install -g [email protected] && curl -fsSL https://bun.sh/install | bash", |
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# bundles | ||
bundles | ||
|
||
dist-firefox | ||
|
||
web-ext-artifacts |
File renamed without changes
File renamed without changes
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
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,70 @@ | ||
import { execa } from 'execa' | ||
import fs from 'fs' | ||
|
||
interface Manifest { | ||
background: | ||
| { | ||
scripts: string[] | ||
} | ||
| { | ||
service_worker: string | ||
} | ||
browser_specific_settings: { | ||
gecko: { | ||
id: string | ||
} | ||
} | ||
} | ||
|
||
const main = async () => { | ||
for await (const line of execa('npx', ['turbo', 'run', 'build'])) { | ||
console.log(line) | ||
} | ||
|
||
await execa('cp', [ | ||
'-r', | ||
...(await fs.promises | ||
.readdir('dist') | ||
.then(paths => paths.map(path => `dist/${path}`))), | ||
'dist-firefox', | ||
]) | ||
console.log('building: copy dist to dist-firefox') | ||
|
||
const chromeManifestFilePath = './dist/manifest.json' | ||
const firefoxManifestFilePath = './dist-firefox/manifest.json' | ||
|
||
const manifest: Manifest = JSON.parse( | ||
await fs.promises.readFile(chromeManifestFilePath, { encoding: 'utf-8' }), | ||
) | ||
|
||
if ('service_worker' in manifest.background) { | ||
manifest.background = { | ||
scripts: [manifest.background.service_worker], | ||
} | ||
} | ||
|
||
manifest.browser_specific_settings = { | ||
gecko: { | ||
id: '[email protected]', | ||
}, | ||
} | ||
|
||
await fs.promises.writeFile( | ||
firefoxManifestFilePath, | ||
JSON.stringify(manifest), | ||
{ | ||
encoding: 'utf-8', | ||
}, | ||
) | ||
|
||
for await (const line of execa('npx', [ | ||
'web-ext', | ||
'lint', | ||
'--source-dir', | ||
'dist-firefox', | ||
])) { | ||
console.log(`web-ext lint: ${line}`) | ||
} | ||
} | ||
|
||
main() |
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 @@ | ||
/// <reference types="chrome-types" /> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.