Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Node, Yarn, and packages #125

Merged
merged 5 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version-file: ".tool-versions"
- name: Get the Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Check formatting
run: yarn run format:check
- name: Lint the code
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
extension/js/
node_modules/
web-ext-artifacts/

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.lock
.yarn
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
extension/js/
package.json
*.yml
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 20.11.1
yarn 1.22.11
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-berry.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defaultSemverRangePrefix: ""

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-berry.cjs
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"author": {
"name": "Danny Guo",
"email": "dannyguo91@gmail.com",
"email": "danny@dannyguo.com",
"url": "https://dannyguo.com"
},
"repository": {
Expand All @@ -26,18 +26,19 @@
"start": "yarn install && yarn run build:watch"
},
"dependencies": {
"font-color-contrast": "^1.0.3",
"image-promise": "^6.0.2",
"node-vibrant": "^3.1.4",
"parse-color": "^1.0.0"
"font-color-contrast": "1.1.1",
"image-promise": "6.0.2",
"node-vibrant": "3.1.6",
"parse-color": "1.0.0"
},
"devDependencies": {
"eslint": "^6.3.0",
"eslint-config-prettier": "^6.2.0",
"prettier": "^1.18.2",
"web-ext": "^3.1.1",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.8"
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"prettier": "3.2.5",
"rimraf": "5.0.5",
"web-ext": "7.11.0",
"webpack": "5.90.3",
"webpack-cli": "5.1.4"
},
"eslintConfig": {
"env": {
Expand All @@ -56,6 +57,7 @@
"prettier": {
"bracketSpacing": false,
"singleQuote": true,
"tabWidth": 4
"tabWidth": 4,
"trailingComma": "none"
}
}
2 changes: 1 addition & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function getFaviconColor(url) {
const favicon = await loadImage(url);
const palette = await Vibrant.from(favicon).getPalette();
const swatch = palette.Vibrant || palette.Muted;
color = swatch.getRgb().map(rgb => Math.min(255, Math.round(rgb)));
color = swatch.getRgb().map((rgb) => Math.min(255, Math.round(rgb)));
} catch (error) {
console.error(error);
}
Expand Down
Loading