diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d2139f9..e9c8bfe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,35 +1,35 @@ name: Deploy to GitHub Pages on: - push: - branches: [ main ] + push: + branches: [main] jobs: - deploy: - runs-on: ubuntu-latest - permissions: - contents: write # Needed to push to the gh-pages branch + deploy: + runs-on: ubuntu-latest + permissions: + contents: write # Needed to push to the gh-pages branch - steps: - - name: Checkout Code - uses: actions/checkout@v3 + steps: + - name: Checkout Code + uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '22' - cache: 'npm' + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '22' + cache: 'npm' - - name: Install Dependencies - run: npm ci + - name: Install Dependencies + run: npm ci - - name: Build - run: npm run build + - name: Build + run: npm run build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist - publish_branch: deployed-ver - force_orphan: true + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + publish_branch: deployed-ver + force_orphan: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c7a1671 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,53 @@ +name: Lint Codebase + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: write + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Fix JS Lint + run: npm run lint:js -- --fix + continue-on-error: true + + - name: Fix CSS Lint + run: npm run lint:css -- --fix + continue-on-error: true + + - name: Format with Prettier + run: npm run format + continue-on-error: true + + - name: Commit and Push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'style: auto-fix linting issues' + + - name: Run HTML Lint + run: npm run lint:html \ No newline at end of file diff --git a/.htmlhintignore b/.htmlhintignore new file mode 100644 index 0000000..2730e75 --- /dev/null +++ b/.htmlhintignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +legacy/ diff --git a/.htmlhintrc b/.htmlhintrc new file mode 100644 index 0000000..33b528e --- /dev/null +++ b/.htmlhintrc @@ -0,0 +1,12 @@ +{ + "tag-pair": true, + "tagname-lowercase": true, + "attr-lowercase": true, + "attr-value-double-quotes": true, + "doctype-first": true, + "id-unique": true, + "src-not-empty": true, + "alt-require": true, + "head-script-disabled": false, + "spec-char-escape": true +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..df8a97b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +dist/ +node_modules/ +legacy/ +package-lock.json +*.min.js +.github/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b6c80cc --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "semi": true, + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5", + "printWidth": 120, + "endOfLine": "auto" +} diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 0000000..b828468 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,12 @@ +{ + "extends": "stylelint-config-standard", + "rules": { + "no-empty-source": null, + "selector-class-pattern": null, + "media-feature-range-notation": null, + "declaration-block-no-redundant-longhand-properties": null, + "color-function-notation": null, + "alpha-value-notation": null + }, + "ignoreFiles": ["dist/**/*.css", "node_modules/**/*.css", "legacy/**/*.css"] +} diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 74b24a2..791e441 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -1,33 +1,57 @@ - # Development + This project uses [Vite](https://vitejs.dev/) for local development and optimized builds. ### Prerequisites + - [Node.js](https://nodejs.org/) (Version 20+ or 22+ recommended) ### Getting Started + 1. Install dependencies: - ```bash - npm install - ``` + ```bash + npm install + ``` 2. Start the development server: - ```bash - npm run dev - ``` - The app will be available at `http://localhost:5173/`. + ```bash + npm run dev + ``` + The app will be available at `http://localhost:5173/`. ### Why Vite? + - **Instant Updates**: Support for Hot Module Replacement (HMR) means changes to JS/CSS are reflected instantly in the browser. - **Dependency Management**: No more manual path tracking or broken internal imports. - **Automated PWA**: Service Worker generation and asset hashing are handled automatically. +## Code Quality & Linting + +We use a standard stack to ensure code quality and consistency: + +- **JS**: [ESLint](https://eslint.org/) +- **CSS**: [Stylelint](https://stylelint.io/) +- **HTML**: [HTMLHint](https://htmlhint.com/) +- **Formatting**: [Prettier](https://prettier.io/) + +### Commands + +- **Check everything:** `npm run lint` +- **Auto-format code:** `npm run format` (Runs Prettier) +- **Fix JS issues:** `npm run lint:js -- --fix` +- **Fix CSS issues:** `npm run lint:css -- --fix` + +> [!IMPORTANT] +> A GitHub Action automatically runs these checks on every push and pull request. Please ensure `npm run lint` passes before committing. + ## Project Structure + - `/js`: Application source code. - `/public`: Static assets (images, manifest, instances.json) that are copied directly to the build folder. - `index.html`: The entry point of the application. - `vite.config.js`: Build and PWA configuration. ## Deployment + Deployment is automated via **GitHub Actions**. > [!NOTE] diff --git a/INSTANCES.md b/INSTANCES.md index eebf78d..367adca 100644 --- a/INSTANCES.md +++ b/INSTANCES.md @@ -1,24 +1,22 @@ API: -| Provider | Instance URL | +| Provider | Instance URL | |----------------|---------------------------------| -| Monochrome | https://monochrome-api.samidy.com ([NOTE](https://rentry.co/monochromeapi)) | -| squid.wtf | https://triton.squid.wtf | -| Lucida (QQDL) | https://wolf.qqdl.site | -| | https://maus.qqdl.site | -| | https://vogel.qqdl.site | -| | https://katze.qqdl.site | -| | https://hund.qqdl.site | -| Kinoplus | https://tidal.kinoplus.online | -| Binimum | https://tidal-api.binimum.org | +| Monochrome | https://monochrome-api.samidy.com ([NOTE](https://rentry.co/monochromeapi)) | +| squid.wtf | https://triton.squid.wtf | +| Lucida (QQDL) | https://wolf.qqdl.site | +| | https://maus.qqdl.site | +| | https://vogel.qqdl.site | +| | https://katze.qqdl.site | +| | https://hund.qqdl.site | +| Kinoplus | https://tidal.kinoplus.online | +| Binimum | https://tidal-api.binimum.org | UI: -| Provider | Instance URL | +| Provider | Instance URL | |-------------------|------------------------------------| -| Monochrome | https://monochrome.samidy.com | -| tidal-ui (bini) | https://music.binimum.org | -| squid.wtf | https://tidal.squid.wtf | -| QQDL | https://tidal.qqdl.site/ | -| Arjix | https://music.arjix.dev/ | -| Spofree | https://spo.free.nf | - - +| Monochrome | https://monochrome.samidy.com | +| tidal-ui (bini) | https://music.binimum.org | +| squid.wtf | https://tidal.squid.wtf | +| QQDL | https://tidal.qqdl.site/ | +| Arjix | https://music.arjix.dev/ | +| Spofree | https://spo.free.nf | diff --git a/README.md b/README.md index 5c12f0f..0c36c0d 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,38 @@
-
](https://monochrome.samidy.com/#album/378149557)
-
-Check it out live at: [**monochrome.samidy.com**](https://monochrome.samidy.com)
+
+### Features
+
+