Skip to content

Commit

Permalink
Upgrade dependencies and node runtime v20 (#121)
Browse files Browse the repository at this point in the history
Upgrade dependencies to latest and node runtime to v20. Following
dependencies were upgraded with major version changes:
- typescript and eslint: not an issue because the build and lint steps
still pass
- prettier: new formatting does not affect code
- @actions/github: the only breaking change appears to be dropped
support for Node 16

Follows from bufbuild/buf-setup-action#185
  • Loading branch information
emcfarlane authored Feb 20, 2024
1 parent d1e9d7a commit 03078a3
Show file tree
Hide file tree
Showing 13 changed files with 1,411 additions and 1,031 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.22
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Generate
run: make generate && make checkgenerate
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14.0
20.11.1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2021 Buf Technologies, Inc.
Copyright 2020-2024 Buf Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-print-directory
BIN := .tmp/bin
COPYRIGHT_YEARS := 2020-2022
COPYRIGHT_YEARS := 2020-2024
LICENSE_IGNORE := -e dist\/

.PHONY: all
Expand Down
74 changes: 67 additions & 7 deletions dist/main.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/main.js.map

Large diffs are not rendered by default.

2,300 changes: 1,310 additions & 990 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"name": "buf-breaking",
"version": "1.0.0",
"scripts": {
"build": "esbuild --minify --bundle --sourcemap '--define:process.env.NODE_ENV=\"production\"' --outdir=dist --platform=node --target=node16 ./src/main.ts",
"build": "esbuild --minify --bundle --sourcemap '--define:process.env.NODE_ENV=\"production\"' --outdir=dist --platform=node --target=node20 ./src/main.ts",
"eslint": "eslint --max-warnings 0 .",
"format": "prettier --write '**/*.{json,js,jsx,ts,tsx,css}' --loglevel error",
"lint": "npm run eslint && npm run types-check",
"types-check": "tsc --noemit"
},
"engineStrict": true,
"engines": {
"node": ">=16",
"node": ">=20",
"npm": ">=8"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@actions/io": "^1.1.2"
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@actions/io": "^1.1.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"@types/node": "^18.11.18",
"@types/semver": "^7.3.13",
"esbuild": "^0.16.12",
"prettier": "^2.8.1",
"typescript": "^4.9.4"
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@types/node": "^20.11.19",
"@types/semver": "^7.5.7",
"esbuild": "^0.20.1",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
}
}
10 changes: 5 additions & 5 deletions src/buf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,16 +52,16 @@ interface ExecException {
export function breaking(
binaryPath: string,
input: string,
against: string
against: string,
): BreakingResult | Error {
const rawOutput = runBreakingCommand(
`${binaryPath} breaking ${input} --against ${against}`
`${binaryPath} breaking ${input} --against ${against}`,
);
if (isError(rawOutput)) {
return rawOutput;
}
const jsonOutput = runBreakingCommand(
`${binaryPath} breaking ${input} --against ${against} --error-format=json`
`${binaryPath} breaking ${input} --against ${against} --error-format=json`,
);
if (isError(jsonOutput)) {
return jsonOutput;
Expand All @@ -72,7 +72,7 @@ export function breaking(
.split("\n")
.filter((elem) => {
return elem !== "";
})
}),
);
if (isError(fileAnnotations)) {
return fileAnnotations;
Expand Down
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -136,7 +136,7 @@ async function runBreaking(): Promise<null | Error> {
// For more information, see the documentation:
// https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
core.info(
`::error file=${path},line=${start_line},col=${start_column}::${message}`
`::error file=${path},line=${start_line},col=${start_column}::${message}`,
);
});
return {
Expand Down

0 comments on commit 03078a3

Please sign in to comment.