Skip to content

Commit dd60c32

Browse files
authored
Merge pull request #165 from crazy-max/update-yarn
update yarn to 3.5.1
2 parents e051386 + a782626 commit dd60c32

11 files changed

+6985
-3652
lines changed

.dockerignore

+11-1
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

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/.yarn/releases/** binary
2+
/.yarn/plugins/** binary
13
/dist/** linguist-generated=true
4+
/lib/** linguist-generated=true

.gitignore

+16-59
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
31-
/coverage
22+
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

+6
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

+541
Large diffs are not rendered by default.

.yarn/releases/yarn-3.5.1.cjs

+873
Large diffs are not rendered by default.

.yarnrc.yml

+13
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

dev.Dockerfile

+23-17
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,27 +39,29 @@ 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

@@ -65,6 +70,7 @@ RUN apk add --no-cache gnupg
6570
ENV RUNNER_TEMP=/tmp/github_runner
6671
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
6772
RUN --mount=type=bind,target=.,rw \
73+
--mount=type=cache,target=/src/.yarn/cache \
6874
--mount=type=cache,target=/src/node_modules \
6975
yarn run test --coverageDirectory=/tmp/coverage
7076

docker-bake.hcl

+2-2
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "import-gpg",
33
"description": "GitHub Action to easily import a GPG key",
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",
@@ -21,6 +20,7 @@
2120
],
2221
"author": "CrazyMax",
2322
"license": "MIT",
23+
"packageManager": "yarn@3.5.1",
2424
"dependencies": {
2525
"@actions/core": "^1.10.0",
2626
"@actions/exec": "^1.1.1",

0 commit comments

Comments
 (0)