Skip to content

Commit 04df2ee

Browse files
committed
chore: sync config from vscode-ext-template
- Upgrade GitHub Actions: checkout@v4 → v6, setup-node@v4 → v6 - Remove `cache: npm` and switch `npm ci` → `npm install` (no lockfile) - Add `overwrite` input to release workflow; switch to `gh` CLI for release creation - Add eslint-plugin-prettier — report formatting violations as ESLint errors - Pin all devDependencies to `latest` - Add `coverage/` and `package-lock.json` to .gitignore; untrack lockfile - Update ci script description to read-only checks (test + lint + format:check) - Update RELEASE.md: remove lockfile reference in step 4, add overwrite usage in step 5
1 parent 7a1962c commit 04df2ee

File tree

9 files changed

+49
-3766
lines changed

9 files changed

+49
-3766
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717

1818
- name: Setup Node.js
19-
uses: actions/setup-node@v4
19+
uses: actions/setup-node@v6
2020
with:
2121
node-version: 22
22-
cache: npm
2322

2423
- name: Install dependencies
25-
run: npm ci
24+
run: npm install
2625

2726
- name: Create config
2827
run: |

.github/workflows/release.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
overwrite:
7+
description: Overwrite existing release if tag already exists
8+
type: boolean
9+
default: false
510

611
jobs:
712
release:
@@ -12,20 +17,19 @@ jobs:
1217

1318
steps:
1419
- name: Checkout repository
15-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1621

1722
- name: Read version from package.json
1823
id: version
1924
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
2025

2126
- name: Setup Node.js
22-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2328
with:
2429
node-version: 22
25-
cache: npm
2630

2731
- name: Install dependencies
28-
run: npm ci
32+
run: npm install
2933

3034
- name: Create config
3135
run: |
@@ -38,11 +42,15 @@ jobs:
3842
run: npm run build
3943

4044
- name: Create GitHub Release
41-
uses: softprops/action-gh-release@v2
42-
with:
43-
tag_name: v${{ steps.version.outputs.version }}
44-
name: v${{ steps.version.outputs.version }}
45-
generate_release_notes: true
46-
files: |
47-
dist/github-notifier-pro-chrome.zip
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
TAG="v${{ steps.version.outputs.version }}"
49+
if [[ "${{ inputs.overwrite }}" == "true" ]]; then
50+
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
51+
fi
52+
gh release create "$TAG" \
53+
--title "$TAG" \
54+
--generate-notes \
55+
dist/github-notifier-pro-chrome.zip \
4856
dist/github-notifier-pro-firefox.zip

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ src/config/config.js
66
.DS_Store
77
*.log
88
node_modules/
9+
package-lock.json
910

1011
# Build artifacts
1112
*.zip
1213
dist/
1314
build/
15+
coverage/
1416

1517
# IDE
1618
.vscode/

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
After modifying code, ensure to run the following commands to maintain code quality:
66

7-
- `npm run ci` - Run all checks (test + lint:fix + format)
7+
- `npm run ci` - Run all checks (test + lint + format check)
88
- `npm run dev` - Prepare Firefox dev environment (ci + dev:firefox)
99
- `npm run all` - Full build for release (ci + build Chrome & Firefox)
1010

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
| Command | Description |
2323
| ---------------------- | ------------------------------------------- |
24-
| `npm run ci` | Run all checks (test + lint:fix + format) |
24+
| `npm run ci` | Run all checks (test + lint + format check) |
2525
| `npm run dev` | Run CI then prepare Firefox dev environment |
2626
| `npm run all` | Run CI then build Chrome & Firefox packages |
2727
| `npm test` | Run tests (Vitest) |

RELEASE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
4. Commit changes:
2929

3030
```sh
31-
git add CHANGELOG.md package.json package-lock.json manifest.json manifest-firefox.json
31+
git add CHANGELOG.md package.json manifest.json manifest-firefox.json
3232
git commit -m "chore: update version to vX.Y.Z"
3333
git push origin main
3434
```
@@ -41,6 +41,12 @@
4141

4242
This will run tests, build Chrome & Firefox packages, and create a GitHub Release with the zip files.
4343

44+
To overwrite an existing release for the same version:
45+
46+
```sh
47+
gh workflow run release.yml -f overwrite=true
48+
```
49+
4450
6. Verify the release was created successfully:
4551

4652
```sh

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import js from '@eslint/js';
22
import globals from 'globals';
33
import prettier from 'eslint-config-prettier';
4+
import prettierPlugin from 'eslint-plugin-prettier';
45

56
export default [
67
js.configs.recommended,
@@ -99,4 +100,9 @@ export default [
99100
},
100101
// Disable ESLint rules that conflict with Prettier (must be last)
101102
prettier,
103+
// Report Prettier formatting violations as ESLint errors
104+
{
105+
plugins: { prettier: prettierPlugin },
106+
rules: { 'prettier/prettier': 'error' },
107+
},
102108
];

0 commit comments

Comments
 (0)