Skip to content

Commit f424e9d

Browse files
authored
chore: update yarn to 3.5.1 (#412)
* chore: update yarn to 3.5.1 * chore: add plugin-interactive-tools yarn pkg * chore: update dev dependencies * chore: eslint fixes * chore: update generated content --------- Co-authored-by: CrazyMax <[email protected]>
1 parent 7e0ddfe commit f424e9d

File tree

16 files changed

+6745
-3698
lines changed

16 files changed

+6745
-3698
lines changed

.dockerignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
/coverage
2-
/node_modules
2+
3+
# Dependency directories
4+
node_modules/
5+
jspm_packages/
6+
7+
# yarn v2
8+
.yarn/cache
9+
.yarn/unplugged
10+
.yarn/build-state.yml
11+
.yarn/install-state.gz
12+
.pnp.*

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
/.yarn/releases/** binary
2+
/.yarn/plugins/** binary
13
/dist/** linguist-generated=true
24
/lib/** linguist-generated=true

.gitignore

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
/.dev
2-
node_modules/
3-
lib
4-
5-
# Jetbrains
6-
/.idea
7-
/*.iml
1+
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
82

9-
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
103
# Logs
114
logs
125
*.log
136
npm-debug.log*
147
yarn-debug.log*
158
yarn-error.log*
169
lerna-debug.log*
10+
.pnpm-debug.log*
1711

1812
# Diagnostic reports (https://nodejs.org/api/report.html)
1913
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -24,34 +18,14 @@ pids
2418
*.seed
2519
*.pid.lock
2620

27-
# Directory for instrumented libs generated by jscoverage/JSCover
28-
lib-cov
29-
3021
# Coverage directory used by tools like istanbul
3122
coverage
3223
*.lcov
3324

34-
# nyc test coverage
35-
.nyc_output
36-
37-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
38-
.grunt
39-
40-
# Bower dependency directory (https://bower.io/)
41-
bower_components
42-
43-
# node-waf configuration
44-
.lock-wscript
45-
46-
# Compiled binary addons (https://nodejs.org/api/addons.html)
47-
build/Release
48-
4925
# Dependency directories
26+
node_modules/
5027
jspm_packages/
5128

52-
# TypeScript v1 declaration files
53-
typings/
54-
5529
# TypeScript cache
5630
*.tsbuildinfo
5731

@@ -61,36 +35,19 @@ typings/
6135
# Optional eslint cache
6236
.eslintcache
6337

64-
# Optional REPL history
65-
.node_repl_history
66-
67-
# Output of 'npm pack'
68-
*.tgz
69-
7038
# Yarn Integrity file
7139
.yarn-integrity
7240

73-
# dotenv environment variables file
41+
# dotenv environment variable files
7442
.env
75-
.env.test
76-
77-
# parcel-bundler cache (https://parceljs.org/)
78-
.cache
79-
80-
# next.js build output
81-
.next
82-
83-
# nuxt.js build output
84-
.nuxt
85-
86-
# vuepress build output
87-
.vuepress/dist
88-
89-
# Serverless directories
90-
.serverless/
91-
92-
# FuseBox cache
93-
.fusebox/
94-
95-
# DynamoDB Local files
96-
.dynamodb/
43+
.env.development.local
44+
.env.test.local
45+
.env.production.local
46+
.env.local
47+
48+
# yarn v2
49+
.yarn/cache
50+
.yarn/unplugged
51+
.yarn/build-state.yml
52+
.yarn/install-state.gz
53+
.pnp.*

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Dependency directories
2+
node_modules/
3+
jspm_packages/
4+
5+
# yarn v2
6+
.yarn/

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.5.1.cjs

Lines changed: 873 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
logFilters:
2+
- code: YN0013
3+
level: discard
4+
- code: YN0076
5+
level: discard
6+
7+
nodeLinker: node-modules
8+
9+
plugins:
10+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
11+
spec: "@yarnpkg/plugin-interactive-tools"
12+
13+
yarnPath: .yarn/releases/yarn-3.5.1.cjs

__tests__/github.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('getRelease', () => {
2121
});
2222

2323
it('unknown GoReleaser release', async () => {
24-
await expect(github.getRelease('goreleaser', 'foo')).rejects.toThrowError(
24+
await expect(github.getRelease('goreleaser', 'foo')).rejects.toThrow(
2525
new Error('Cannot find GoReleaser release foo in https://goreleaser.com/static/releases.json')
2626
);
2727
});
@@ -45,7 +45,7 @@ describe('getRelease', () => {
4545
});
4646

4747
it('unknown GoReleaser Pro release', async () => {
48-
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrowError(
48+
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow(
4949
new Error('Cannot find GoReleaser release foo-pro in https://goreleaser.com/static/releases-pro.json')
5050
);
5151
});

dev.Dockerfile

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ ARG NODE_VERSION=16
44

55
FROM node:${NODE_VERSION}-alpine AS base
66
RUN apk add --no-cache cpio findutils git
7+
RUN yarn config set --home enableTelemetry 0
78
WORKDIR /src
89

910
FROM base AS deps
1011
RUN --mount=type=bind,target=.,rw \
12+
--mount=type=cache,target=/src/.yarn/cache \
1113
--mount=type=cache,target=/src/node_modules \
1214
yarn install && mkdir /vendor && cp yarn.lock /vendor
1315

@@ -16,18 +18,19 @@ COPY --from=deps /vendor /
1618

1719
FROM deps AS vendor-validate
1820
RUN --mount=type=bind,target=.,rw <<EOT
19-
set -e
20-
git add -A
21-
cp -rf /vendor/* .
22-
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
23-
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
24-
git status --porcelain -- yarn.lock
25-
exit 1
26-
fi
21+
set -e
22+
git add -A
23+
cp -rf /vendor/* .
24+
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
25+
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
26+
git status --porcelain -- yarn.lock
27+
exit 1
28+
fi
2729
EOT
2830

2931
FROM deps AS build
3032
RUN --mount=type=bind,target=.,rw \
33+
--mount=type=cache,target=/src/.yarn/cache \
3134
--mount=type=cache,target=/src/node_modules \
3235
yarn run build && mkdir /out && cp -Rf dist /out/
3336

@@ -36,34 +39,37 @@ COPY --from=build /out /
3639

3740
FROM build AS build-validate
3841
RUN --mount=type=bind,target=.,rw <<EOT
39-
set -e
40-
git add -A
41-
cp -rf /out/* .
42-
if [ -n "$(git status --porcelain -- dist)" ]; then
43-
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
44-
git status --porcelain -- dist
45-
exit 1
46-
fi
42+
set -e
43+
git add -A
44+
cp -rf /out/* .
45+
if [ -n "$(git status --porcelain -- dist)" ]; then
46+
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
47+
git status --porcelain -- dist
48+
exit 1
49+
fi
4750
EOT
4851

4952
FROM deps AS format
5053
RUN --mount=type=bind,target=.,rw \
54+
--mount=type=cache,target=/src/.yarn/cache \
5155
--mount=type=cache,target=/src/node_modules \
5256
yarn run format \
53-
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
57+
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
5458

5559
FROM scratch AS format-update
5660
COPY --from=format /out /
5761

5862
FROM deps AS lint
5963
RUN --mount=type=bind,target=.,rw \
64+
--mount=type=cache,target=/src/.yarn/cache \
6065
--mount=type=cache,target=/src/node_modules \
6166
yarn run lint
6267

6368
FROM deps AS test
6469
ENV RUNNER_TEMP=/tmp/github_runner
6570
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
6671
RUN --mount=type=bind,target=.,rw \
72+
--mount=type=cache,target=/src/.yarn/cache \
6773
--mount=type=cache,target=/src/node_modules \
6874
yarn run test --coverageDirectory=/tmp/coverage
6975

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-bake.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ group "default" {
33
}
44

55
group "pre-checkin" {
6-
targets = ["vendor-update", "format", "build"]
6+
targets = ["vendor", "format", "build"]
77
}
88

99
group "validate" {
@@ -34,7 +34,7 @@ target "lint" {
3434
output = ["type=cacheonly"]
3535
}
3636

37-
target "vendor-update" {
37+
target "vendor" {
3838
dockerfile = "dev.Dockerfile"
3939
target = "vendor-update"
4040
output = ["."]

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "goreleaser-action",
33
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
4-
"main": "lib/main.js",
4+
"main": "src/main.ts",
55
"scripts": {
6-
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
6+
"build": "ncc build --source-map --minify --license licenses.txt",
77
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
88
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
9-
"test": "jest --coverage",
10-
"all": "yarn run build && yarn run format && yarn test"
9+
"test": "jest --coverage"
1110
},
1211
"repository": {
1312
"type": "git",
@@ -20,6 +19,7 @@
2019
],
2120
"author": "CrazyMax",
2221
"license": "MIT",
22+
"packageManager": "[email protected]",
2323
"dependencies": {
2424
"@actions/core": "^1.10.0",
2525
"@actions/exec": "^1.1.1",
@@ -30,20 +30,20 @@
3030
"yargs": "^17.7.1"
3131
},
3232
"devDependencies": {
33-
"@types/node": "^16.11.26",
34-
"@typescript-eslint/eslint-plugin": "^5.14.0",
35-
"@typescript-eslint/parser": "^5.14.0",
36-
"@vercel/ncc": "^0.33.3",
37-
"dotenv": "^16.0.0",
38-
"eslint": "^8.11.0",
39-
"eslint-config-prettier": "^8.5.0",
40-
"eslint-plugin-jest": "^26.1.1",
41-
"eslint-plugin-prettier": "^4.0.0",
42-
"jest": "^27.2.5",
43-
"prettier": "^2.3.1",
33+
"@types/node": "^16.18.26",
34+
"@typescript-eslint/eslint-plugin": "^5.59.2",
35+
"@typescript-eslint/parser": "^5.59.2",
36+
"@vercel/ncc": "^0.36.1",
37+
"dotenv": "^16.0.3",
38+
"eslint": "^8.40.0",
39+
"eslint-config-prettier": "^8.8.0",
40+
"eslint-plugin-jest": "^27.2.1",
41+
"eslint-plugin-prettier": "^4.2.1",
42+
"jest": "^29.5.0",
43+
"prettier": "^2.8.8",
4444
"tmp": "^0.2.1",
45-
"ts-jest": "^27.1.2",
46-
"ts-node": "^10.7.0",
47-
"typescript": "^4.4.4"
45+
"ts-jest": "^29.1.0",
46+
"ts-node": "^10.9.1",
47+
"typescript": "^4.9.5"
4848
}
4949
}

src/goreleaser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const getFilename = (distribution: string): string => {
6565
break;
6666
}
6767
case 'arm': {
68+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6869
const arm_version = (process.config.variables as any).arm_version;
6970
arch = arm_version ? 'armv' + arm_version : 'arm';
7071
break;

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function run(): Promise<void> {
2828
}
2929

3030
let yamlfile: string | unknown;
31-
const argv = yargs.parse(inputs.args);
31+
const argv: {config: string} = yargs.parse(inputs.args) as never;
3232
if (argv.config) {
3333
yamlfile = argv.config;
3434
} else {

0 commit comments

Comments
 (0)