Skip to content

Commit

Permalink
Migrated to Plasmo
Browse files Browse the repository at this point in the history
  • Loading branch information
avi12 committed Sep 25, 2022
1 parent c783766 commit eccd954
Show file tree
Hide file tree
Showing 8 changed files with 3,796 additions and 980 deletions.
54 changes: 37 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
# Yarn and npm
yarn-error.log
npm-debug.log
node_modules

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

.idea
.vscode

# Vim swap files
*.swp
*.swo
# dependencies
node_modules
.pnp
.pnp.js

# Sublime files
*.sublime-workspace
*.sublime-project
# testing
coverage

# Mac and windows files
#cache
.turbo
.next
.vercel

# misc
.DS_Store
.tmp
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# Distribution
/dist_packed
/dist/build

# local env files
*.env

out
build
dist_packed

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

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

# typescript
.tsbuildinfo
17 changes: 17 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @type {import('prettier').Options}
*/
module.exports = {
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: false,
trailingComma: "none",
bracketSpacing: true,
bracketSameLine: true,
plugins: [require.resolve("@plasmohq/prettier-plugin-sort-imports")],
importOrder: ["^@plasmohq/(.*)$", "^~(.*)$", "^[./]"],
importOrderSeparation: true,
importOrderSortSpecifiers: true
}
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Twitch Channel Points Bonus Collector

A browser extension to make Twitch users' life easier to get some good ![Channel Points](https://github.com/avi12/twitch-cp-bonus-collector/blob/main/images/icons/Normal%20icon-16.png?raw=true)
A browser extension to make Twitch users' life easier to get some
good ![Channel Points](https://user-images.githubusercontent.com/6422804/192149173-027f0941-cf4a-4fe3-b2cb-cbb3beb57a3c.png)
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)
Expand All @@ -20,45 +21,43 @@ Install [Node.js](https://nodejs.org) and [PNPM](https://pnpm.js.org/en/installa
pnpm i
```

## Start Rollup for development
## Start development server

```shell script
```shell
pnpm dev
```

## Running
Or

### Chromium/Chrome

```shell script
pnpm run-chromium
```shell
pnpm dev:firefox
```

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

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

### Browsers that don't support Manifest v3
Or

1. Build the extension for Firefox/Opera (see below).
2. Open the extensions page in your browser.
3. Enable the developer mode (top-right corner usually).
4. Either drag-drop the browser-compatible ZIP onto the browser or click "Load unpacked extension" and choose it.
```shell
pnpm run:firefox
```

## Build & pack

```shell
pnpm build-pack
```

### Build for Firefox (run `pnpm build-pack` first)
### Build & pack for Firefox

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

## Do you want to contribute?

Feel free to! Make sure to comply with the license, [GPL v3](https://github.com/avi12/twitch-cp-bonus-collector/blob/main/LICENSE).
Feel free to! Make sure to comply with the
license, [GPL v3](https://github.com/avi12/twitch-cp-bonus-collector/blob/main/LICENSE).
Binary file added assets/icon512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 36 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
{
"name": "twitch-cp-bonus-collector",
"version": "1.2.1",
"description": "A browser extension that automates clicking on the Channel Points bonus button during a Twitch live stream when it appears.",
"repository": "https://github.com/avi12/twitch-cp-bonus-collector",
"license": "GPL-3.0-or-later",
"author": "avi12 <avi6106@gmail.com>",
"homepage": "https://avi12.com",
"bugs": {
"email": "avi6106@gmail.com"
},
"displayName": "Twitch Channel Points Bonus Collector",
"version": "2.0.0",
"description": "Auto-clicks the Channel Points bonus button when it appears.",
"author": "avi12",
"homepage": "https://avi12.com/twitch-cp-bonus-collector",
"scripts": {
"dev": "rollup -c -w",
"build": "rollup -c",
"pack": "web-ext build --overwrite-dest --artifacts-dir dist_packed --source-dir dist --filename twitch-cp-bonus-collector-{version}.zip",
"pack-self": "zip-self -o dist_packed/twitch-cp-bonus-collector-{version}-source.zip",
"build-pack": "pnpm run build && pnpm run pack && pnpm run webext-incompat-fix && pnpm run pack-self",
"build-for-firefox": "build-for-browser --i dist_packed/twitch-cp-bonus-collector-{version}.zip --browser=firefox",
"webext-incompat-fix": "webext-store-incompat-fixer -i dist_packed/twitch-cp-bonus-collector-{version}.zip -s edge,firefox,chrome,opera",
"set-version": "set-json-version -f package.json dist/manifest.json dist/manifest.json -v",
"run-browser": "web-ext run --no-config-discovery --start-url https://www.twitch.tv/codinggarden --source-dir dist --verbose --target",
"run-firefox": "pnpm run-browser firefox-desktop",
"run-chromium": "pnpm run-browser chromium",
"run-edge-windows": "\"\"%ProgramFiles(x86)%\\Microsoft\\Edge\\Application\\msedge.exe\"\" https://www.twitch.tv/codinggarden --load-extension=%cd%\\dist"
"dev": "plasmo dev",
"dev:firefox": "plasmo dev --target=firefox-mv2",
"build": "plasmo build",
"build:firefox": "plasmo build --target=firefox-mv2",
"pack": "web-ext build --overwrite-dest --artifacts-dir dist_packed --source-dir build/chrome-mv3-prod --filename skillshare-player-control-{version}.zip",
"pack:firefox": "web-ext build --overwrite-dest --artifacts-dir dist_packed --source-dir build/firefox-mv2-prod --filename skillshare-player-control-{version}_adapted_for_firefox.zip",
"pack:self": "zip-self -o dist_packed/skillshare-player-control-{version}_adapted_for_firefox-source.zip",
"build-pack": "pnpm build && pnpm build && pnpm run pack",
"build-pack:firefox": "pnpm build:firefox && pnpm pack:firefox && pnpm pack:self",
"build-pack:all": "pnpm build && pnpm build:firefox && pnpm run pack && pnpm pack:firefox && pnpm pack:self",
"set-version": "set-json-version -f package.json -v",
"run-browser": "web-ext run --no-config-discovery --start-url https://www.skillshare.com/classes/Practical-C-Programming-Beginner-Course/919943529 --verbose --target",
"run:chrome": "pnpm run-browser chromium --source-dir build/chrome-mv3-dev",
"run:firefox": "pnpm run-browser firefox-desktop --source-dir build/firefox-mv2-dev"
},
"dependencies": {
"plasmo": "0.55.0-alpha.2"
},
"devDependencies": {
"@types/chrome": "^0.0.175",
"build-for-browser": "github:avi12/build-for-browser",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"prettier": "^2.6.2",
"rollup": "^2.63.0",
"rollup-plugin-terser": "^7.0.2",
"set-json-version": "^1.0.7",
"web-ext": "^6.6.0",
"webext-store-incompat-fixer": "^0.3.1",
"zip-self": "^0.4.5"
"@plasmohq/prettier-plugin-sort-imports": "3.5.1",
"@types/chrome": "0.0.197",
"@types/node": "18.7.21",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"prettier": "2.7.1",
"set-json-version": "^2.1.0",
"typescript": "4.8.3",
"web-ext": "^7.2.0",
"zip-self": "^0.5.2"
},
"manifest": {
"offline_enabled": true
}
}
}
Loading

0 comments on commit eccd954

Please sign in to comment.