Skip to content

Commit

Permalink
v2.0.5: add build process + minor tweaks to code structure (#25)
Browse files Browse the repository at this point in the history
* update package.json + remove eslint-airbnb
* feat: add & setup prettier code formatting
* feat: add & setup husky + lint-staged
* refactor: sync changes introduced in 2.0.4
* feat: cleanup content.js + update manifest.json
* fix issues with vite.config.js not being able to read env variables
* docs: update README
* style: cleanup
* remove old files

---------

Co-authored-by: Californ1a <[email protected]>
  • Loading branch information
nrednav and Californ1a authored Oct 12, 2023
1 parent 2eb483c commit f35b8db
Show file tree
Hide file tree
Showing 25 changed files with 14,419 additions and 485 deletions.
1 change: 1 addition & 0 deletions .env.chrome
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_TARGET_BROWSER=chrome
1 change: 1 addition & 0 deletions .env.firefox
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_TARGET_BROWSER=firefox
16 changes: 16 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true
},
extends: ["eslint:recommended", "prettier"],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module"
},
rules: {
"no-unused-vars": "warn"
}
};
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# Local
docs/

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

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Config files
.webextrc
.webextrc.*

# Env files
.env
.env.*
!.env.firefox
!.env.chrome
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dependencies
node_modules

# Ambient TS files
*.d.ts

# Ignore artifacts
build
dist
dist-ssr
*.local
coverage

# Config files
.webextrc
.webextrc.*
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,27 @@ For Firefox:
5. Follow the instructions available in Mozilla's web-ext workshop at the link provided above to sign the extension yourself with `web-ext sign`
6. Once you have signed it, you should find a .xpi file located within a folder named 'web-ext-artifacts' inside the ytpdc-firefox folder
7. Navigate to `about:addons` via the address bar in Firefox, click the cog-wheel on the top right, choose `Install Add-on from file` and select the `.xpi` file from the previous step

## Development

- Clone this repository
- Install dependencies

```
npm install
```

- Build the extension

```
npm run build:chrome
npm run build:firefox
```

This will output the extension into the `dist` folder

- Run the extension in development mode

```
npm run dev
```
23 changes: 0 additions & 23 deletions content.js

This file was deleted.

Loading

0 comments on commit f35b8db

Please sign in to comment.