Skip to content

Commit a7976b3

Browse files
authored
Merge pull request #43 from TopCli/major-maintenance
refactor: update dependencies and fix deprecated APIs
2 parents e5cbac8 + 08d6258 commit a7976b3

File tree

9 files changed

+54
-34
lines changed

9 files changed

+54
-34
lines changed

.eslintrc

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

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ updates:
44
directory: /
55
schedule:
66
interval: monthly
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
711

812
- package-ecosystem: npm
913
directory: /
1014
versioning-strategy: widen
1115
schedule:
1216
interval: weekly
17+
groups:
18+
dependencies:
19+
dependency-type: "production"
20+
development-dependencies:
21+
dependency-type: "development"

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ jobs:
4343

4444
steps:
4545
- name: Harden Runner
46-
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
46+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
4747
with:
4848
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
4949
- name: Checkout repository
50-
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5151

5252
# Initializes the CodeQL tools for scanning.
5353
- name: Initialize CodeQL
54-
uses: github/codeql-action/init@ddccb873888234080b77e9bc2d4764d5ccaaccf9
54+
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
5555
with:
5656
languages: ${{ matrix.language }}
5757
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -65,7 +65,7 @@ jobs:
6565
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6666
# If this step fails, then you should remove it and run the build manually (see below)
6767
- name: Autobuild
68-
uses: github/codeql-action/autobuild@ddccb873888234080b77e9bc2d4764d5ccaaccf9
68+
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
6969

7070
# ℹ️ Command-line programs to run using the OS shell.
7171
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -78,6 +78,6 @@ jobs:
7878
# ./location_of_script_within_repo/buildscript.sh
7979

8080
- name: Perform CodeQL Analysis
81-
uses: github/codeql-action/analyze@ddccb873888234080b77e9bc2d4764d5ccaaccf9
81+
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
8282
with:
8383
category: "/language:${{matrix.language}}"

.github/workflows/node.js.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,29 @@ jobs:
1818
fail-fast: false
1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
21+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
2222
with:
2323
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
24-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
26+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
- name: Install dependencies
3030
run: npm i
3131
- name: Run tests
3232
run: npm run test
33+
automerge:
34+
if: >
35+
github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]'
36+
needs:
37+
- test
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: write
41+
pull-requests: write
42+
steps:
43+
- name: Merge Dependabot PR
44+
uses: fastify/github-action-merge-dependabot@c3bde0759d4f24db16f7b250b2122bc2df57e817 # v3.11.0
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636
with:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
40+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -59,14 +59,14 @@ jobs:
5959
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6060
# format to the repository Actions tab.
6161
- name: "Upload artifact"
62-
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
62+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
6363
with:
6464
name: SARIF file
6565
path: results.sarif
6666
retention-days: 5
6767

6868
# Upload the results to GitHub's code scanning dashboard.
6969
- name: "Upload to code-scanning"
70-
uses: github/codeql-action/upload-sarif@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
70+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
7171
with:
7272
sarif_file: results.sarif

eslint.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// eslint.config.mjs
2+
import { ESLintConfig } from "@openally/config.eslint";
3+
4+
export default [
5+
...ESLintConfig,
6+
{
7+
languageOptions: {
8+
sourceType: "module",
9+
parserOptions: {
10+
requireConfigFile: false
11+
}
12+
}
13+
}
14+
];

index.d.ts

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

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import wcwidth from "@topcli/wcwidth";
1313
* console.log(align.left("boo", 5)); // "boo ";
1414
*/
1515
export function left(str, width) {
16-
const trimmed = str.trimRight();
16+
const trimmed = str.trimEnd();
1717
if (trimmed.length === 0 && str.length >= width) {
1818
return str;
1919
}
@@ -34,7 +34,7 @@ export function left(str, width) {
3434
* console.log(align.right("boo", 5)); // " boo";
3535
*/
3636
export function right(str, width) {
37-
const trimmed = str.trimLeft();
37+
const trimmed = str.trimStart();
3838
if (trimmed.length === 0 && str.length >= width) {
3939
return str;
4040
}

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"pad"
2424
],
2525
"files": [
26-
"index.js",
27-
"index.d.ts"
26+
"index.js"
2827
],
2928
"author": "GENTILHOMME Thomas <[email protected]>",
3029
"license": "MIT",
@@ -36,9 +35,8 @@
3635
"@topcli/wcwidth": "^1.0.1"
3736
},
3837
"devDependencies": {
39-
"@nodesecure/eslint-config": "^1.7.0",
40-
"c8": "^8.0.0",
41-
"eslint": "^8.39.0",
38+
"@openally/config.eslint": "^1.1.0",
39+
"c8": "^10.1.3",
4240
"pkg-ok": "^3.0.0"
4341
},
4442
"engines": {

0 commit comments

Comments
 (0)