purifier-card 2.6.9 โ†’ 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  github: denysdovhan
2
- custom: [buymeacoffee.com/denysdovhan]
2
+ buy_me_a_coffee: denysdovhan
@@ -0,0 +1,58 @@
1
+ name-template: v$RESOLVED_VERSION ๐Ÿงน
2
+ tag-template: v$RESOLVED_VERSION
3
+ exclude-contributors:
4
+ - github-actions[bot]
5
+ - github-actions
6
+ - dependabot[bot]
7
+ - dependabot
8
+ categories:
9
+ - title: โ—๏ธ Breaking Changes
10
+ labels:
11
+ - breaking
12
+ - title: ๐Ÿš€ Features
13
+ labels:
14
+ - feature
15
+ - enhancement
16
+ - title: ๐Ÿ› Bug Fixes
17
+ labels:
18
+ - fix
19
+ - bug
20
+ - title: ๐Ÿงฐ Maintenance
21
+ labels:
22
+ - chore
23
+ - dependencies
24
+ - documentation
25
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
26
+ change-title-escapes: '\\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
27
+ version-resolver:
28
+ major:
29
+ labels:
30
+ - major
31
+ - breaking
32
+ minor:
33
+ labels:
34
+ - minor
35
+ - feature
36
+ - enhancement
37
+ patch:
38
+ labels:
39
+ - patch
40
+ - dependencies
41
+ default: patch
42
+ template: |
43
+ ## What's Changed
44
+
45
+ $CHANGES
46
+
47
+ ## โญ๏ธ Contributors
48
+
49
+ $CONTRIBUTORS
50
+
51
+ ## Sponsorship
52
+
53
+ If you like this project, please consider supporting me:
54
+
55
+ - ๐Ÿ’– [Sponsor on GitHub](https://github.com/sponsors/denysdovhan)
56
+ - โ˜•๏ธ [Buy Me A Coffee](https://buymeacoffee.com/denysdovhan)
57
+ - Bitcoin: `bc1q7lfx6de8jrqt8mcds974l6nrsguhd6u30c6sg8`
58
+ - Ethereum: `0x6aF39C917359897ae6969Ad682C14110afe1a0a1`
@@ -0,0 +1,26 @@
1
+ name: Dependencies
2
+ on:
3
+ pull_request:
4
+
5
+ permissions:
6
+ contents: write
7
+ pull-requests: write
8
+
9
+ jobs:
10
+ dependabot-auto-merge:
11
+ name: Dependabot Auto-merge
12
+ runs-on: ubuntu-latest
13
+ if: github.event.pull_request.user.login == 'dependabot[bot]'
14
+ steps:
15
+ - name: ๐Ÿ’ฟ Fetch Dependabot metadata
16
+ id: metadata
17
+ uses: dependabot/fetch-metadata@v2
18
+ with:
19
+ github-token: ${{ secrets.GITHUB_TOKEN }}
20
+
21
+ - name: โ†”๏ธ Merge Dependabot PRs
22
+ if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
23
+ run: gh pr merge --auto --squash "$PR_URL"
24
+ env:
25
+ PR_URL: ${{ github.event.pull_request.html_url }}
26
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -4,7 +4,6 @@ on:
4
4
  pull_request:
5
5
 
6
6
  permissions:
7
- id-token: write # Required for OIDC
8
7
  contents: write
9
8
  pull-requests: write
10
9
 
@@ -23,7 +22,7 @@ jobs:
23
22
  - name: โฌข Setup Node.js
24
23
  uses: actions/setup-node@v6
25
24
  with:
26
- node-version: '*'
25
+ node-version: latest
27
26
  cache: npm
28
27
 
29
28
  - name: ๐Ÿ“ฆ Install Packages
@@ -31,48 +30,3 @@ jobs:
31
30
 
32
31
  - name: ๐Ÿงช Test
33
32
  run: npm test
34
-
35
- release:
36
- name: Release
37
- runs-on: ubuntu-latest
38
- needs: [validate]
39
- if: github.ref_name == 'main' && (github.event_name == 'push' || github.event.pull_request.merged)
40
- steps:
41
- - name: โฌ‡๏ธ Checkout Repo
42
- uses: actions/checkout@v6
43
-
44
- - name: โฌข Setup Node.js
45
- uses: actions/setup-node@v6
46
- with:
47
- node-version: '*'
48
- cache: npm
49
-
50
- - name: ๐Ÿ“ฆ Install Packages
51
- run: npm ci
52
-
53
- - name: ๐Ÿ— Build
54
- run: npm run build
55
-
56
- - name: ๐Ÿš€ Release
57
- run: npx semantic-release
58
- env:
59
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60
-
61
- dependabot:
62
- name: Dependabot Auto-merge
63
- runs-on: ubuntu-latest
64
- needs: [validate]
65
- if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
66
- steps:
67
- - name: ๐Ÿ’ฟ Dependabot metadata
68
- id: metadata
69
- uses: dependabot/fetch-metadata@v2
70
- with:
71
- github-token: ${{ secrets.GITHUB_TOKEN }}
72
-
73
- - name: โ†”๏ธ Enable Auto-merge for minor and patch Dependabot PRs
74
- run: gh pr merge --auto --squash "$PR_URL"
75
- if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
76
- env:
77
- PR_URL: ${{ github.event.pull_request.html_url }}
78
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,20 @@
1
+ name: Release Drafter
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ update_release_draft:
14
+ name: Update Release Draft
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: ๐Ÿ“ Update draft
18
+ uses: release-drafter/release-drafter@v6
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,44 @@
1
+ name: Release
2
+ on:
3
+ release:
4
+ types: [published]
5
+
6
+ permissions:
7
+ contents: write
8
+ id-token: write
9
+
10
+ jobs:
11
+ release:
12
+ name: Release
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: โฌ‡๏ธ Checkout Repo
16
+ uses: actions/checkout@v6
17
+
18
+ - name: โฌข Setup Node.js
19
+ uses: actions/setup-node@v6
20
+ with:
21
+ registry-url: https://registry.npmjs.org
22
+ node-version: latest
23
+ cache: npm
24
+
25
+ - name: ๐Ÿ“ฆ Install Packages
26
+ run: npm ci
27
+
28
+ - name: ๐Ÿงฎ Set version from tag
29
+ run: |
30
+ TAG="${{ github.event.release.tag_name }}"
31
+ npm version --no-git-tag-version "${TAG#v}"
32
+
33
+ - name: ๐Ÿ— Build
34
+ run: npm run build
35
+
36
+ - name: ๐Ÿš€ Publish to npm
37
+ run: npm publish --provenance --access public
38
+
39
+ - name: ๐Ÿ“ฆ Upload release asset
40
+ uses: softprops/action-gh-release@v2
41
+ with:
42
+ files: dist/vacuum-card.js
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/.husky/pre-commit CHANGED
@@ -1,4 +1 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
1
  npx lint-staged
package/AGENTS.md ADDED
@@ -0,0 +1,65 @@
1
+ # Repository Guidelines
2
+
3
+ ## Instructions
4
+
5
+ - Always refer to `home-assistant-js-websocket` library for types and functions to interact with the Home Assistant API.
6
+ - When interaction with Home Assistant API is needed, use `custom-card-helpers` library for helper utilities for the card lifecycle and events.
7
+
8
+ ## Project Structure & Module Organization
9
+
10
+ - `src/`: TypeScript source for the custom Lovelace card (entry: `src/purifier-card.ts`).
11
+ - `dist/`: Build output (bundled card JS). This is generated by Rollup.
12
+ - `rollup.config.mjs`: Build pipeline and asset handling.
13
+ - `eslint.config.mjs`: Lint configuration.
14
+ - `package.json`: Scripts, dependencies, and release config.
15
+
16
+ ## Build, Test, and Development Commands
17
+
18
+ - `npm install`: Install dependencies.
19
+ - `npm run start`: Watch mode build (Rollup) for local development.
20
+ - `npm run build`: Production bundle to `dist/`.
21
+ - `npm run lint`: Run ESLint on `src/`.
22
+ - `npm run lint:fix`: Auto-fix lint issues in `src/`.
23
+ - `npm run format`: Format with Prettier (respects `.prettier` settings in `package.json`).
24
+ - `npm test`: Runs `lint` then `build` (no separate test suite).
25
+
26
+ ## Coding Style & Naming Conventions
27
+
28
+ - Language: TypeScript, ES modules (`"type": "module"`).
29
+ - Formatting: Prettier with single quotes (`"singleQuote": true`).
30
+ - Linting: ESLint (see `eslint.config.mjs`) using `@typescript-eslint` and `eslint-plugin-import`.
31
+ - Match existing patterns in `src/` for file naming and exports; prefer descriptive, kebab-case filenames for components.
32
+
33
+ ## Technologies Used
34
+
35
+ - UI is a Home Assistant Lovelace custom card implemented as a Web Component with Lit (`LitElement`, decorators, `html` templates).
36
+ - Home Assistant integrations use `custom-card-helpers` for card lifecycle/events and `home-assistant-js-websocket` types for entities/services.
37
+ - Template rendering uses `ha-template` for dynamic text in the card.
38
+ - Localization is handled via JSON translation files in `src/translations/` and the `localize` helper.
39
+ - Build tooling is Rollup with TypeScript (`rollup-plugin-typescript2`), Babel transforms, and asset handling for JSON, images, CSS, and SVG.
40
+ - Styling uses PostCSS (`postcss-preset-env`) and `rollup-plugin-postcss-lit` to process component CSS.
41
+ - Production optimizations include HTML literal minification and Terser.
42
+ - Utility helpers include Lodash (`get`).
43
+ - Developer tooling includes ESLint, Prettier, Husky, and lint-staged.
44
+
45
+ ## Documentations
46
+
47
+ - This card uses the [custom-card-helpers](https://custom-cards.github.io/custom-card-helpers/modules.html) library with helper utilities for the card lifecycle and events. Always refer to the documentation for useful functions and utilities.
48
+ - Use the [home-assistant-js-websocket](https://www.npmjs.com/package/home-assistant-js-websocket) library for types and functions to interact with the Home Assistant API.
49
+
50
+ ## Testing Guidelines
51
+
52
+ - No dedicated test framework is configured.
53
+ - Use `npm test` to validate linting and the production build.
54
+ - Keep changes buildable; avoid introducing new build-time warnings.
55
+
56
+ ## Commit & Pull Request Guidelines
57
+
58
+ - Commit messages follow Conventional Commits (Angular preset), e.g. `feat: ...`, `fix: ...`, `chore(deps): ...`.
59
+ - Dependency updates should use `chore(deps): ...` to align with release rules.
60
+ - PRs should include: a concise description, what changed, and how it was validated (commands run). If UI changes are visible, include a screenshot or GIF.
61
+
62
+ ## Release & Automation Notes
63
+
64
+ - Releases are handled by semantic-release on `main` with assets from `dist/purifier-card.js`.
65
+ - Ensure build output remains stable when changing dependencies or build config.