Skip to content

Commit

Permalink
Merge pull request #91 from Serhii-DV/dev
Browse files Browse the repository at this point in the history
Version 0.15.0
  • Loading branch information
Serhii-DV authored Sep 30, 2024
2 parents 0704a21 + 9773877 commit a7b9bb0
Show file tree
Hide file tree
Showing 18 changed files with 536 additions and 196 deletions.
23 changes: 19 additions & 4 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
#!/bin/sh
# Run prettier on staged files
# Run Prettier only on staged files

npm run prettier:fix
# Get a list of staged files that match JavaScript, TypeScript, or other file extensions you want to format
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx|css|scss|html|md)$')

# If there are no staged files that need Prettier, exit early
if [ -z "$STAGED_FILES" ]; then
echo "No staged files to format."
exit 0
fi

# Run Prettier on the staged files
echo "Running Prettier on staged files..."
echo "$STAGED_FILES" | xargs npx prettier --write

# Re-add the formatted files to the staging area
echo "$STAGED_FILES" | xargs git add

# Check if Prettier made changes
if [ -n "$(git diff --name-only --cached)" ]; then
if [ -n "$(git diff --cached --name-only)" ]; then
echo "Prettier has fixed files. Please review the changes."
git add .
else
echo "No changes were made by Prettier."
fi
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Change log

## 0.14.0 (2024-09-24)
## 0.15.0 (2024-09-30)

### Features

- core: Save release visited history
- popup: Show releases history sorted by visited date by default
- popup: Show latest visited releases on the Dashboard tab

## 0.14.1 (2024-09-24)

### Fixed

Expand Down
136 changes: 74 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"version": "0.14.1",
"version": "0.15.0",
"devDependencies": {
"@swc/html": "^1.7.23",
"@types/chrome": "^0.0.271",
"@swc/html": "^1.7.28",
"@types/chrome": "^0.0.273",
"@types/isotope-layout": "^3.0.13",
"@types/uuid": "^10.0.0",
"@webcomponents/custom-elements": "^1.6.0",
"bootstrap": "^5.3.3",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"eslint-webpack-plugin": "^4.2.0",
"html-loader": "^5.1.0",
"html-minimizer-webpack-plugin": "^5.0.0",
Expand All @@ -24,7 +24,7 @@
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"uuid": "^10.0.0",
"webpack": "^5.94.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"webpack-merge": "^6.0.1"
Expand Down
9 changes: 8 additions & 1 deletion src/app/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,16 @@ export class Release {
return this.releaseItem.title;
}

get uuid() {
return this.releaseItem.uuid;
}

get year() {
return this.published.getFullYear();
}

toStorageObject() {
return {
uuid: this.releaseItem.uuid,
artist: this.releaseItem.artist,
title: this.releaseItem.title,
url: this.releaseItem.url,
Expand Down
9 changes: 1 addition & 8 deletions src/bandcamp/pages/page-album.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ export function setupPageAlbum() {
logInfo('Setup page album');
const schema = getMusicAlbumSchemaData();
const release = createReleaseFromSchema(schema);
setupRelease(release);
setupMessageListener(schema);
}

/**
* @param {Release} release
*/
function setupRelease(release) {
saveRelease(release);
setupMessageListener(schema);
}

/**
Expand Down
Loading

0 comments on commit a7b9bb0

Please sign in to comment.