Skip to content

Commit

Permalink
Migrated to WXT
Browse files Browse the repository at this point in the history
  • Loading branch information
avi12 committed Oct 8, 2024
1 parent 9d1139f commit 889c65e
Show file tree
Hide file tree
Showing 23 changed files with 3,496 additions and 6,733 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
charset = utf-8
end_of_line = crlf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
1 change: 0 additions & 1 deletion .env.firefox

This file was deleted.

2 changes: 2 additions & 0 deletions .env.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PATH_EDGE="/usr/bin/microsoft-edge-stable"
VITE_PATH_OPERA="/usr/bin/opera"
2 changes: 2 additions & 0 deletions .env.mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PATH_EDGE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
VITE_PATH_OPERA="/Applications/Opera.app/Contents/MacOS/Opera"
2 changes: 2 additions & 0 deletions .env.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PATH_EDGE="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
VITE_PATH_OPERA="USERPROFILE\AppData\Local\Programs\Opera\opera.exe"
59 changes: 21 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1,31 @@

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.idea
.vscode

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

#cache
.turbo
.next
.vercel

# misc
.DS_Store
*.pem

# debug
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
build
stats.html
stats-*.json
.wxt

# local env files
chrome.env
firefox.env
opera.env
edge.env
opera.env

# output
build
web-ext-artifacts

# plasmo - https://www.plasmo.com
.plasmo

# bpp - http://bpp.browser.market/
keys.json

# typescript
.tsbuildinfo
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
trailingComma: "none",
bracketSpacing: true,
bracketSameLine: true,
importOrder: ["^@plasmohq/(.*)$", "^~(.*)$", "^[./]"],
importOrder: ["^~(.*)$", "^[./]"],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
arrowParens: "avoid"
Expand Down
51 changes: 19 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,63 @@ good ![Channel Points](https://user-images.githubusercontent.com/6422804/1921491
Available for:

- [Google Chrome](https://chrome.google.com/webstore/detail/kbbdnbaghpcjpdhbjbccadodjejlkkgg) ![Chrome Web Store](https://img.shields.io/chrome-web-store/users/kbbdnbaghpcjpdhbjbccadodjejlkkgg?color=white&label=users&style=flat-square)
- [Mozilla Firefox](https://addons.mozilla.org/en-US/firefox/addon/twitch-cp-bonus-collector) 109+ ![Mozilla Add-on](https://img.shields.io/amo/users/twitch-cp-bonus-collector?color=white&label=users&style=flat-square)
- [Mozilla Firefox](https://addons.mozilla.org/en-US/firefox/addon/twitch-cp-bonus-collector)
109+ ![Mozilla Add-on](https://img.shields.io/amo/users/twitch-cp-bonus-collector?color=white&label=users&style=flat-square)
- [Microsoft Edge](https://microsoftedge.microsoft.com/addons/detail/igneodbpmkniacbglbpphcbnimpelkec) ![users count](https://img.shields.io/badge/dynamic/json?label=users&query=activeInstallCount&style=flat-square&color=white&url=https://microsoftedge.microsoft.com/addons/getproductdetailsbycrxid/igneodbpmkniacbglbpphcbnimpelkec)
- [Opera](https://addons.opera.com/en/extensions/details/twitch-channel-points-bonus-collector)

Made by [avi12](https://avi12.com).
Made by [Avi](https://avi12.com)

## Requirements for setting up

Install [Node.js](https://nodejs.org) and [PNPM](https://pnpm.js.org/en/installation).
Install [Node.js](https://nodejs.org) and [PNPM](https://pnpm.io/installation)

## Install dependencies

```shell script
pnpm i
```

## Start development server
## Start the dev server & run in a test browser

### Chrome/Chromium
### Chrome

```shell
pnpm dev
```

### Firefox

```shell
pnpm dev:firefox
```

## Running

### Chrome/Chromium

```shell
pnpm run-chromium
```

### Edge on Windows 10/11
### Edge

```shell
pnpm run-edge:windows
pnpm dev:edge
```

### Opera on Windows 10/11
### Opera

```shell
pnpm run-opera:windows
pnpm dev:opera
```

### Firefox

```shell
pnpm run-firefox
```
Currently [unsupported](https://github.com/wxt-dev/wxt/issues/230#issuecomment-1806881653)

## Build & package

## Build & pack
### Chromium/Chrome

```shell
pnpm build-pack
pnpm build:package
```

### Build & pack for Firefox
### Firefox

```shell
pnpm build-pack:firefox
pnpm build:package:firefox
```

## Contribution

Feel free to! Make sure to comply with the
license, [GPL v3](https://github.com/avi12/twitch-cp-bonus-collector/blob/main/LICENSE).
If you want to fork, make sure to credit [avi12](https://avi12.com) and link to this repository.
license, [GPL v3](https://github.com/avi12/twitch-cp-bonus-collector/blob/main/LICENSE)
If you want to fork, make sure to credit [Avi](https://avi12.com) and link to this repository
Binary file removed assets/icon512.png
Binary file not shown.
76 changes: 36 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
{
"name": "twitch-cp-bonus-collector",
"displayName": "Twitch Channel Points Bonus Collector",
"version": "2.0.16",
"version": "2.1.0",
"type": "module",
"description": "Auto-clicks the Channel Points bonus button when it appears.",
"author": "avi12",
"author": "Avi <avi6106@gmail.com>",
"repository": "https://github.com/avi12/twitch-cp-bonus-collector",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/avi12/twitch-cp-bonus-collector",
"scripts": {
"dev": "plasmo dev --verbose",
"dev:firefox": "pnpm dev --target=firefox-mv3",
"build": "plasmo build --minify",
"build:firefox": "pnpm build --target=firefox-mv3",
"package": "web-ext build --config web-ext-config.cjs --source-dir build/chrome-mv3-prod --filename twitch-cp-bonus-collector-{version}.zip",
"package:firefox": "web-ext build --config web-ext-config.cjs --source-dir build/firefox-mv3-prod --filename twitch-cp-bonus-collector-{version}-firefox.zip",
"package:self": "zip-self -o web-ext-artifacts/twitch-cp-bonus-collector-{version}-firefox-source.zip",
"build-pack": "pnpm build && pnpm package",
"build-pack:firefox": "concurrently \"pnpm build:firefox && pnpm package:firefox\" \"pnpm package:self\" --names \"Firefox build & pack,Firefox source pack\"",
"build-pack:all": "concurrently \"pnpm build-pack\" \"pnpm build-pack:firefox\" --names Chromium,Firefox",
"run-browser": "web-ext run --start-url https://www.twitch.tv/codinggarden --verbose --target",
"run-firefox": "pnpm run-browser firefox-desktop --source-dir build/firefox-mv3-dev",
"run-chromium": "pnpm run-browser chromium --source-dir build/chrome-mv3-dev",
"run-edge:windows": "pnpm run-chromium --chromium-binary \"%ProgramFiles(x86)%\\Microsoft\\Edge\\Application\\msedge.exe\"",
"run-opera:windows": "pnpm run-chromium --chromium-binary \"%LocalAppData%\\Programs\\Opera\\opera.exe\""
"dev": "wxt",
"dev:rtl": "set VITE_LANG=he && wxt",
"dev:firefox": "pnpm dev -b firefox --mv3",
"dev:edge": "pnpm dev -b edge",
"dev:opera": "pnpm dev -b opera",
"build": "wxt build",
"build:firefox": "pnpm build -b firefox --mv3",
"package": "wxt zip",
"package:firefox": "pnpm package -b firefox --mv3",
"build:package": "pnpm build && pnpm package",
"build:package:firefox": "pnpm build:firefox && pnpm package:firefox",
"build:package:all": "concurrently \"pnpm build:package\" \"pnpm build:package:firefox\" --names Chromium,Firefox",
"check": "svelte-check --tsconfig ./tsconfig.json",
"postinstall": "wxt prepare"
},
"dependencies": {
"@plasmohq/storage": "^1.12.0",
"plasmo": "0.89.2"
"nouislider": "^15.8.1"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@types/chrome": "0.0.271",
"@types/node": "22.5.5",
"@eslint/js": "^9.12.0",
"@types/chrome": "^0.0.277",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"autoprefixer": "^10.4.20",
"concurrently": "^9.0.1",
"eslint": "^9.10.0",
"dotenv": "^16.4.5",
"eslint": "^9.12.0",
"eslint-config-avi12": "github:avi12/eslint-config-avi12",
"globals": "^15.9.0",
"prettier": "3.3.3",
"svelte-eslint-parser": "^0.41.1",
"typescript": "5.6.2",
"typescript-eslint": "^8.5.0",
"web-ext": "^8.2.0",
"zip-self": "^0.6.3"
"eslint-plugin-import": "^2.31.0",
"globals": "^15.10.0",
"postcss-nesting": "^13.0.0",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"tslib": "^2.7.0",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
"wxt": "^0.19.11"
},
"manifest": {
"offline_enabled": true,
"browser_specific_settings": {
"gecko": {
"id": "$PLASMO_PUBLIC_FIREFOX_EXT_ID"
}
}
},
"packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
"packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
}
Loading

0 comments on commit 889c65e

Please sign in to comment.