Skip to content

Commit 78e59d1

Browse files
authored
feat!: Require Node20 (#1400)
1 parent 65cd8f7 commit 78e59d1

20 files changed

+5281
-5249
lines changed

.eslintrc.js

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
11
module.exports = {
2-
env: {
3-
node: true,
4-
jest: true,
5-
es2020: true,
6-
},
7-
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
8-
extends: [
9-
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
10-
],
11-
parserOptions: {
12-
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
13-
sourceType: 'module', // Allows for the use of imports
14-
},
15-
ignorePatterns: [
16-
'action/',
17-
'**/*.d.ts',
18-
'**/node_modules/**'
19-
],
20-
rules: {
21-
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
22-
'quotes': [ 'warn', 'single', { 'avoidEscape': true } ],
2+
env: {
3+
node: true,
4+
jest: true,
5+
es2020: true,
6+
},
7+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
8+
extends: [
9+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
10+
],
11+
parserOptions: {
12+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
13+
sourceType: 'module', // Allows for the use of imports
14+
},
15+
ignorePatterns: ['action/', '**/*.d.ts', '**/node_modules/**', 'fixtures'],
16+
rules: {
17+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
18+
quotes: ['warn', 'single', { avoidEscape: true }],
2319

24-
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
25-
'@typescript-eslint/explicit-function-return-type': 'off',
26-
'@typescript-eslint/no-use-before-define': 'off',
27-
'@typescript-eslint/no-empty-interface': 'off',
28-
'@typescript-eslint/no-inferrable-types': 'off',
29-
'@typescript-eslint/no-empty-function': 'off',
30-
'@typescript-eslint/no-non-null-assertion': 'off',
31-
'@typescript-eslint/no-explicit-any': 'off',
32-
'@typescript-eslint/no-unused-vars': [ 'warn', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ],
33-
},
34-
overrides: [
35-
{
36-
files: ['*.json'],
37-
rules: {
38-
'quotes': [ 'error', 'double' ],
39-
}
40-
}
41-
],
20+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/no-use-before-define': 'off',
23+
'@typescript-eslint/no-empty-interface': 'off',
24+
'@typescript-eslint/no-inferrable-types': 'off',
25+
'@typescript-eslint/no-empty-function': 'off',
26+
'@typescript-eslint/no-non-null-assertion': 'off',
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
29+
},
30+
overrides: [
31+
{
32+
files: ['*.json'],
33+
rules: {
34+
quotes: ['error', 'double'],
35+
},
36+
},
37+
],
4238
};

.github/workflows/test.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,36 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Use Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
cache: yarn
20-
- run: yarn install --frozen-lockfile
16+
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
17+
- run: pnpm i
2118
- run: git --no-pager diff --compact-summary --exit-code
2219

2320
unit-test: # make sure unit-tests run
2421
runs-on: ubuntu-latest
2522
steps:
2623
- uses: actions/checkout@v4
27-
- name: Use Node.js
28-
uses: actions/setup-node@v3
29-
with:
30-
cache: yarn
31-
- run: yarn install --frozen-lockfile
24+
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
25+
- run: pnpm i
3226
# Build should not be necessary to run tests
33-
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} GITHUB_OUTPUT="" yarn test
27+
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} GITHUB_OUTPUT="" pnpm test
3428

3529
clean-build: # make sure nothing changes with a clean build
3630
runs-on: ubuntu-latest
3731
steps:
3832
- uses: actions/checkout@v4
39-
- name: Use Node.js
40-
uses: actions/setup-node@v3
41-
with:
42-
cache: yarn
43-
- run: yarn install --frozen-lockfile
33+
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
34+
- run: pnpm i
4435
# Ensure the repository is clean after build
45-
- run: yarn clean-build
36+
- run: pnpm clean-build
4637
- run: git --no-pager diff --compact-summary --exit-code
4738

4839
coverage: # run coverage
4940
runs-on: ubuntu-latest
5041
steps:
5142
- uses: actions/checkout@v4
52-
- name: Use Node.js
53-
uses: actions/setup-node@v3
54-
with:
55-
cache: yarn
56-
- run: yarn install --frozen-lockfile
57-
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} GITHUB_OUTPUT="" yarn coverage
43+
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
44+
- run: pnpm i
45+
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} GITHUB_OUTPUT="" pnpm coverage
5846

5947
- name: Upload coverage Coveralls
6048
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # 2.2.3

.github/workflows/update-cspell.yml

Lines changed: 70 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: " 📚 Update CSpell"
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
base:
7+
description: The Base Ref to apply the diff
8+
required: false
9+
default: "main"
10+
411
push:
512
branches:
613
- main
7-
workflow_dispatch:
14+
815
schedule:
916
- cron: "0 12 * * *"
1017

@@ -16,76 +23,104 @@ jobs:
1623
if: github.repository_owner == 'streetsidesoftware'
1724
runs-on: ubuntu-latest
1825
env:
19-
NEW_BRANCH: "update-cspell"
20-
REF_BRANCH: main
26+
NEW_BRANCH: update-cspell-${{ inputs.base || 'main' }}
27+
REF_BRANCH: ${{ inputs.base || 'main' }}
2128
steps:
2229
- name: Checkout code
2330
uses: actions/checkout@v4
2431
with:
2532
ref: ${{ env.REF_BRANCH }}
26-
- name: Use Node.js
27-
uses: actions/setup-node@v3
28-
with:
29-
cache: yarn
33+
34+
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
35+
3036
- name: Install
31-
run: yarn --frozen-lockfile
37+
run: pnpm i
38+
3239
- name: Update CSpell
3340
run: |
3441
cd action-src
35-
echo CSPELL_VERSION_OLD=$(yarn exec -s cspell -- -V) >> $GITHUB_ENV
36-
yarn add cspell@latest cspell-glob@latest
37-
yarn
38-
yarn exec -s cspell -- -V
39-
echo "CSPELL_VERSION=$(yarn exec -s cspell -- -V)" >> $GITHUB_ENV
42+
echo CSPELL_VERSION_OLD=$(pnpm exec cspell -V) >> $GITHUB_ENV
43+
pnpm add cspell@latest cspell-glob@latest
44+
pnpm i
45+
pnpm exec cspell -V
46+
echo "CSPELL_VERSION=$(pnpm exec cspell -V)" >> $GITHUB_ENV
47+
4048
- name: Minor Versions
4149
run: |
4250
echo CSPELL_MINOR_OLD=$(echo '"${{ env.CSPELL_VERSION_OLD }}"' | jq 'sub("\\.[0-9]+$";"")') >> $GITHUB_ENV
4351
echo CSPELL_MINOR_NEW=$(echo '"${{ env.CSPELL_VERSION }}"' | jq 'sub("\\.[0-9]+$";"")') >> $GITHUB_ENV
52+
4453
- name: Determine Update type
4554
env:
4655
type: ${{ (env.CSPELL_MINOR_OLD == env.CSPELL_MINOR_NEW && 'fix') || 'feat' }}
4756
run: |
4857
echo PR_TYPE=$type >> $GITHUB_ENV
4958
50-
- name: Update Dictionaries
51-
run: |
52-
cd action
53-
yarn add @cspell/cspell-bundled-dicts@latest
54-
5559
- name: Install Updates
5660
run: |
57-
yarn install
58-
npx package-json-dependency-updater -u
59-
yarn
61+
pnpm i
62+
6063
- name: Update packages Src
61-
run: yarn clean-build
64+
run: pnpm clean-build
65+
66+
- name: Git Status
67+
id: git-status
68+
uses: streetsidesoftware/actions/public/dirty@v1
69+
6270
- name: Has changes
6371
run: |
6472
git --no-pager diff --compact-summary --exit-code && echo "git_status=clean" >> $GITHUB_ENV || echo "git_status=dirty" >> $GITHUB_ENV
6573
git --no-pager diff --compact-summary
74+
6675
- name: Echo git_status
76+
env:
77+
REPORT: |
78+
Dirty: ${{ steps.git-status.outputs.isDirty && 'yes' || 'no' }}
79+
Status: ${{ env.git_status }}
80+
CSpell Version: ${{ env.CSPELL_VERSION }}
81+
Old Version: ${{ env.CSPELL_VERSION_OLD }}
82+
6783
run: |
68-
echo Status: ${{ env.git_status }}
69-
echo CSpell Version: ${{ env.CSPELL_VERSION }}
84+
echo "$REPORT"
85+
7086
- name: Gen Body
7187
run: |
7288
echo 'git_body<<DIFF' >> $GITHUB_ENV
7389
git --no-pager diff --compact-summary >> $GITHUB_ENV
7490
echo 'DIFF' >> $GITHUB_ENV
75-
- uses: tibdex/github-app-token@v2 # cspell:ignore tibdex
76-
if: env.git_status == 'dirty'
77-
id: generate-token
91+
92+
- name: Summary
93+
id: summary
94+
uses: streetsidesoftware/actions/public/output@v1
7895
with:
79-
app_id: ${{ secrets.AUTOMATION_APP_ID }}
80-
private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
81-
- name: Create Pull Request
82-
if: env.git_status == 'dirty'
83-
uses: peter-evans/create-pull-request@v5
96+
value: |
97+
CSpell Version: ${{ env.CSPELL_VERSION }}
98+
Old Version: ${{ env.CSPELL_VERSION_OLD }}
99+
Type: ${{ env.PR_TYPE }}
100+
101+
Status: ${{ steps.git-status.outputs.isDirty && 'dirty' || 'clean' }}
102+
```
103+
${{ steps.git-status.outputs.status }}
104+
```
105+
106+
diff:
107+
```
108+
${{ env.git_body }}
109+
```
110+
111+
- name: Show Summary
112+
uses: streetsidesoftware/actions/public/summary@v1
113+
with:
114+
text: ${{ steps.summary.outputs.value }}
115+
116+
- name: PR
117+
if: steps.git-status.outputs.isDirty
118+
uses: streetsidesoftware/actions/.github/actions/pr@v1
84119
with:
85120
commit-message: "${{ env.PR_TYPE }}: Update CSpell to (${{ env.CSPELL_VERSION }})"
86121
branch: ${{ env.NEW_BRANCH }}
87122
base: ${{ env.REF_BRANCH }}
88123
title: "${{ env.PR_TYPE }}: Update CSpell to (${{ env.CSPELL_VERSION }}) (${{ env.REF_BRANCH }})"
89-
token: ${{ steps.generate-token.outputs.token }}
90-
body: ${{ env.git_body }}
91-
delete-branch: true
124+
body: ${{ steps.summary.outputs.value }}
125+
app_id: ${{ secrets.AUTOMATION_APP_ID }}
126+
app_private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}

0 commit comments

Comments
 (0)