Skip to content

Commit afaafe7

Browse files
authored
chore: repo maintenance (#252)
* chore: repo maintenance * Create nervous-fishes-arrive.md * update * update * update doc
1 parent ce448d3 commit afaafe7

File tree

20 files changed

+371
-140
lines changed

20 files changed

+371
-140
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"jsonc-eslint-parser": patch
3+
---
4+
5+
use npm trusted publishing

.eslintignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/GHPages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: GHPages
22

33
on:
4+
workflow_dispatch: null
45
push:
56
branches: [master]
6-
workflow_dispatch: null
77

88
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
99
permissions:
@@ -13,7 +13,7 @@ permissions:
1313

1414
# Allow one concurrent deployment
1515
concurrency:
16-
group: pages
16+
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828
- uses: actions/setup-node@v6
2929
- name: Install And Build
3030
run: |+

.github/workflows/NodeCI.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ on:
66
pull_request:
77
branches: [master]
88

9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
lint:
1116
runs-on: ubuntu-latest
1217
steps:
13-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1419
- uses: actions/setup-node@v6
20+
- uses: actions/cache@v4
21+
with:
22+
path: node_modules
23+
key: ${{ runner.os }}-${{ hashFiles('package.json') }}-${{ github.ref }}
1524
- name: Install Packages
1625
run: npm install -f
1726
- name: Lint
@@ -22,16 +31,15 @@ jobs:
2231
runs-on: ubuntu-latest
2332
strategy:
2433
matrix:
25-
node-version: [16.x, 18.x, 20.x]
34+
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
2635
steps:
27-
- uses: actions/checkout@v5
36+
- uses: actions/checkout@v6
2837
- name: Use Node.js ${{ matrix.node-version }}
2938
uses: actions/setup-node@v6
3039
with:
3140
node-version: ${{ matrix.node-version }}
32-
- name: Install Target Packages
33-
run: |+
34-
npm install --legacy-peer-deps
41+
- name: Install Packages
42+
run: npm install -f
3543
- name: Test
3644
run: npm test
3745
test-for-old-node:
@@ -51,18 +59,3 @@ jobs:
5159
npm install --legacy-peer-deps
5260
- name: Test
5361
run: npm test
54-
test-and-coverage:
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v5
58-
- uses: actions/setup-node@v6
59-
with:
60-
node-version: 24.x
61-
- name: Install Packages
62-
run: npm install
63-
- name: Test
64-
run: npm run test:nyc
65-
- name: Coveralls GitHub Action
66-
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
67-
with:
68-
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Release.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,37 @@ on:
55
branches:
66
- master
77

8-
permissions:
9-
contents: write
10-
issues: write
11-
pull-requests: write
8+
permissions: {}
9+
10+
# Allow one concurrent deployment
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1214

1315
jobs:
1416
release:
17+
# prevents this action from running on forks
18+
if: github.repository == 'ota-meshi/jsonc-eslint-parser'
19+
permissions:
20+
contents: write # to create release (changesets/action)
21+
id-token: write # OpenID Connect token needed for provenance
22+
pull-requests: write # to create pull request (changesets/action)
1523
name: Release
1624
runs-on: ubuntu-latest
1725
steps:
1826
- name: Checkout Repo
19-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2028
with:
2129
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2230
fetch-depth: 0
23-
2431
- name: Setup Node.js
2532
uses: actions/setup-node@v6
26-
33+
with:
34+
node-version: lts/*
2735
- name: Install Dependencies
28-
run: npm install --legacy-peer-deps
36+
run: npm install
37+
- name: Build
38+
run: npm run build
2939

3040
- name: Create Release Pull Request or Publish to npm
3141
id: changesets
@@ -39,4 +49,3 @@ jobs:
3949
title: "chore: release jsonc-eslint-parser"
4050
env:
4151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/format.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,24 @@ on:
66
permissions:
77
contents: write
88

9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
format:
1116
runs-on: ubuntu-latest
1217

1318
steps:
1419
- name: Checkout repo
15-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
1621
- name: Setup node
1722
uses: actions/setup-node@v6
1823
- name: Install deps
19-
run: npm install -f
24+
run: npm install
25+
- name: Build
26+
run: npm run build
2027
- name: Format
2128
run: npm run eslint-fix
2229
- name: Commit
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update pkg.pr.new comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Publish to pkg.pr.new]
6+
types:
7+
- completed
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
# Allow one concurrent deployment
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
if: github.repository == 'ota-meshi/jsonc-eslint-parser'
21+
name: Update comment
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Download artifact
26+
uses: actions/download-artifact@v6
27+
with:
28+
name: output
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
run-id: ${{ github.event.workflow_run.id }}
31+
- run: ls -R .
32+
- name: Post or update comment
33+
uses: actions/github-script@v8
34+
with:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
script: |
37+
const fs = require('fs');
38+
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
39+
const { default: process } = await import('${{ github.workspace }}/tools/pkg.pr.new-comment.mjs')
40+
41+
await process({github, context, core, output})

.github/workflows/pkg.pr.new.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to pkg.pr.new
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
tags: ["!**"]
8+
9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
if: github.repository == 'ota-meshi/jsonc-eslint-parser'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
- uses: actions/setup-node@v6
22+
- name: Install Packages
23+
run: npm install
24+
- name: Build
25+
run: npm run build
26+
- run: npx pkg-pr-new publish --compact '.' --json output.json --comment=off
27+
- name: Add metadata to output
28+
uses: actions/github-script@v8
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
const fs = require('fs');
33+
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
34+
output.number = context.issue.number;
35+
output.event_name = context.eventName;
36+
output.ref = context.ref;
37+
output.sha = context.eventName === 'pull_request'
38+
? context.payload.pull_request.head.sha
39+
: context.payload.after;
40+
fs.writeFileSync('output.json', JSON.stringify(output), 'utf8');
41+
- name: Upload output
42+
uses: actions/upload-artifact@v5
43+
with:
44+
name: output
45+
path: ./output.json
46+
47+
- run: ls -R .

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package-lock=false
1+
package-lock=false
2+
force=true

0 commit comments

Comments
 (0)