Skip to content

Commit

Permalink
Update Lofi to latest packages (#257)
Browse files Browse the repository at this point in the history
- Use latest Electron
- Added linter config
- Use React function components
- Remove node-sass and use styled-components
- New config file system
- Visualization can now go over the cover (with opacity)
- Bunch of code cleanup
- Proper feedback to freemium users
  • Loading branch information
stamoun committed Apr 22, 2023
1 parent 0c590e6 commit aeb7266
Show file tree
Hide file tree
Showing 112 changed files with 6,452 additions and 10,797 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/**
/node_modules/**
/pack/**
/src/renderer/static/**
webpack.*
89 changes: 89 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"airbnb",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import", "prettier", "react", "react-hooks", "simple-import-sort"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"react/jsx-filename-extension": [
"warn",
{
"extensions": [".tsx"]
}
],
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never"
}
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"prettier/prettier": [
"error",
{
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"jsxBracketSameLine": true,
"endOfLine": "auto",
"printWidth": 120,
"semi": true,
"bracketSpacing": true
}
],
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/jsx-props-no-spreading": "off",
"react/prop-types": "off",
"react/require-default-props": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/prefer-default-export": "off",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error"
},
"settings": {
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/core-modules": ["electron"]
}
}
25 changes: 0 additions & 25 deletions .github/workflows/linter.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: release
on:
push:
branches:
- master
on: [workflow_dispatch]
jobs:
release:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
8 changes: 0 additions & 8 deletions .pretierrc.json

This file was deleted.

10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"files.associations": {
"*.mm": "cpp"
},

"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1 align="center"><strong>Lofi: a tiny Spotify player</strong></h1>

<p align="center">
<a target="_blank" href="https://www.lofi.rocks">Website</a> • <a target="_blank" href="https://www.lofi.rocks/help">FAQ</a>
<a target="_blank" href="https://www.lofi.rocks">Website</a> • <a target="_blank" href="https://www.lofi.rocks/help">FAQ</a> • <a target="_blank" href="https://discord.gg/YuH9UJk">Discord</a>
</p>

<table width="100%">
Expand Down Expand Up @@ -64,12 +64,6 @@ $ yarn run development
$ yarn run start
```

## `node-sass` compatibility

You might need to change the `node-sass` version inside `package.json` to be compliant with your `nodejs` version or the `node-gyp` build might fail.

Please refer to the [Node version support policy matrix](https://github.com/sass/node-sass) on the `node-sass` web site.

# Bugs, issues, and contributing

Found a 🐛? Have a feature request? Feel free to open an [issue](https://github.com/dvx/lofi/issues) or [contribute](https://github.com/dvx/lofi).
Expand Down
61 changes: 39 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{
"name": "lofi",
"version": "1.6.1",
"version": "2.0.0",
"description": "Mini Spotify player with visualizations.",
"homepage": "http://lofi.rocks",
"main": "./pack/main.bundle.js",
"scripts": {
"install": "yarn run build",
"config-xcode": "node-gyp configure -- -f xcode",
"build": "node-gyp rebuild --target=4.0.1 --arch=x64 --dist-url=https://electronjs.org/headers --openssl_fips=X && genversion --es6 --semi version.generated.ts",
"build": "node-gyp rebuild --target=4.0.1 --dist-url=https://electronjs.org/headers --openssl_fips=X && genversion --es6 --semi version.generated.ts",
"start": "electron ./pack/main.bundle.js",
"dev": "yarn run development",
"development": "rimraf pack && webpack --watch --config ./webpack.dev.js --progress --color",
"production": "rimraf pack && webpack --config ./webpack.prod.js --progress --color",
"pack": "yarn run build && yarn run production && rimraf dist && electron-builder --dir",
"dist": "yarn run build && yarn run production && rimraf dist && electron-builder",
"clean": "rimraf build && rimraf pack && rimraf dist",
"prettier": "npx prettier --config .pretierrc.json --write **/*{ts,tsx,js,css,scss,html,json}"
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"prepare": "husky install"
},
"repository": "https://github.com/dvx/lofi.git",
"author": "David Titarenco <david.titarenco@gmail.com>",
"license": "MIT",
"private": false,
"private": true,
"build": {
"files": [
"./pack/**/*",
Expand All @@ -42,42 +44,57 @@
]
},
"devDependencies": {
"@types/electron-settings": "2.2.3",
"@types/electron-util": "^0.11.1",
"@types/express": "^4.17.11",
"@types/lodash": "^4.14.168",
"@types/node": "^14.14.22",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"copy-pkg-json-webpack-plugin": "^0.0.40",
"copy-webpack-plugin": "^7.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^5.0.1",
"electron": "^11.2.1",
"electron-builder": "^22.11.7",
"electron": "^24.0.0",
"electron-builder": "^23.6.0",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"file-loader": "^6.2.0",
"genversion": "^3.0.1",
"html-webpack-plugin": "^4.5.1",
"husky": "^8.0.3",
"native-ext-loader": "^2.3.0",
"node-addon-api": "^3.1.0",
"node-gyp": "^8.4.1",
"node-sass": "^6.0.1",
"node-gyp": "^9.3.1",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"sass-loader": "^10.1.1",
"style-loader": "^2.0.0",
"ts-loader": "^8.0.14",
"typescript": "^4.1.3",
"webpack": "^5.52.0",
"webpack-cli": "^4.8.0",
"webpack-permissions-plugin": "^1.0.8"
"webpack": "^5.76.2",
"webpack-cli": "^5.0.1",
"webpack-permissions-plugin": "^1.0.9"
},
"dependencies": {
"@types/node": "^14.14.22",
"bindings": "^1.3.1",
"electron-settings": "2.2.3",
"electron-transparency-mouse-fix": "^1.0.0-beta",
"electron-util": "^0.14.2",
"frameless-titlebar": "^2.1.4",
"dayjs": "^1.11.7",
"electron-store": "^8.1.0",
"electron-util": "^0.17.2",
"lodash": "^4.17.21",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-new-window": "^0.1.3"
"react-hook-form": "^7.41.2",
"styled-components": "^5.3.6",
"zod": "^3.21.4"
},
"resolutions": {
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2"
}
}
83 changes: 0 additions & 83 deletions src/api/spotify-api.ts

This file was deleted.

Loading

0 comments on commit aeb7266

Please sign in to comment.