Skip to content

Commit 157d6d0

Browse files
committed
update to yarn 3.6.3
Signed-off-by: CrazyMax <[email protected]>
1 parent a530e94 commit 157d6d0

9 files changed

+6357
-4244
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

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

+15-58
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
/.dev
2-
node_modules
3-
lib
1+
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
42

5-
# Jetbrains
6-
/.idea
7-
/*.iml
8-
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

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

.yarnrc.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
logFilters:
2+
- code: YN0013
3+
level: discard
4+
- code: YN0019
5+
level: discard
6+
- code: YN0076
7+
level: discard
8+
9+
nodeLinker: node-modules

dev.Dockerfile

+28-19
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ ARG NODE_VERSION=20
55
FROM node:${NODE_VERSION}-alpine AS base
66
RUN apk add --no-cache cpio findutils git
77
WORKDIR /src
8+
RUN --mount=type=bind,target=.,rw \
9+
--mount=type=cache,target=/src/.yarn/cache <<EOT
10+
corepack enable
11+
yarn --version
12+
yarn config set --home enableTelemetry 0
13+
EOT
814

915
FROM base AS deps
1016
RUN --mount=type=bind,target=.,rw \
17+
--mount=type=cache,target=/src/.yarn/cache \
1118
--mount=type=cache,target=/src/node_modules \
1219
yarn install && mkdir /vendor && cp yarn.lock /vendor
1320

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

1724
FROM deps AS vendor-validate
1825
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
26+
set -e
27+
git add -A
28+
cp -rf /vendor/* .
29+
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
30+
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
31+
git status --porcelain -- yarn.lock
32+
exit 1
33+
fi
2734
EOT
2835

2936
FROM deps AS build
3037
RUN --mount=type=bind,target=.,rw \
38+
--mount=type=cache,target=/src/.yarn/cache \
3139
--mount=type=cache,target=/src/node_modules \
3240
yarn run build && mkdir /out && cp -Rf dist /out/
3341

@@ -36,34 +44,35 @@ COPY --from=build /out /
3644

3745
FROM build AS build-validate
3846
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
47+
set -e
48+
git add -A
49+
cp -rf /out/* .
50+
if [ -n "$(git status --porcelain -- dist)" ]; then
51+
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
52+
git status --porcelain -- dist
53+
exit 1
54+
fi
4755
EOT
4856

4957
FROM deps AS format
5058
RUN --mount=type=bind,target=.,rw \
59+
--mount=type=cache,target=/src/.yarn/cache \
5160
--mount=type=cache,target=/src/node_modules \
5261
yarn run format \
53-
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
62+
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
5463

5564
FROM scratch AS format-update
5665
COPY --from=format /out /
5766

5867
FROM deps AS lint
5968
RUN --mount=type=bind,target=.,rw \
69+
--mount=type=cache,target=/src/.yarn/cache \
6070
--mount=type=cache,target=/src/node_modules \
6171
yarn run lint
6272

6373
FROM deps AS test
64-
ENV RUNNER_TEMP=/tmp/github_runner
65-
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
6674
RUN --mount=type=bind,target=.,rw \
75+
--mount=type=cache,target=/src/.yarn/cache \
6776
--mount=type=cache,target=/src/node_modules \
6877
yarn run test --coverage --coverageDirectory=/tmp/coverage
6978

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,17 +1,16 @@
11
{
22
"name": "docker-setup-buildx",
33
"description": "Set up Docker Buildx",
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": "yarn run prettier && yarn run eslint",
88
"format": "yarn run prettier:fix && yarn run eslint:fix",
99
"eslint": "eslint --max-warnings=0 .",
1010
"eslint:fix": "eslint --fix .",
1111
"prettier": "prettier --check \"./**/*.ts\"",
1212
"prettier:fix": "prettier --write \"./**/*.ts\"",
13-
"test": "jest",
14-
"all": "yarn run build && yarn run format && yarn test"
13+
"test": "jest"
1514
},
1615
"repository": {
1716
"type": "git",
@@ -24,6 +23,7 @@
2423
],
2524
"author": "Docker Inc.",
2625
"license": "Apache-2.0",
26+
"packageManager": "[email protected]",
2727
"dependencies": {
2828
"@actions/core": "^1.10.1",
2929
"@docker/actions-toolkit": "^0.20.0",

0 commit comments

Comments
 (0)