Skip to content

Commit

Permalink
Merge pull request #133 from crazy-max/update-yarn
Browse files Browse the repository at this point in the history
update to yarn 3.6.3
  • Loading branch information
crazy-max committed May 7, 2024
2 parents b724902 + 8eb8b36 commit a318853
Show file tree
Hide file tree
Showing 13 changed files with 6,718 additions and 4,062 deletions.
12 changes: 11 additions & 1 deletion .dockerignore
@@ -1,2 +1,12 @@
/coverage
/node_modules

# Dependency directories
node_modules/
jspm_packages/

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
2 changes: 2 additions & 0 deletions .gitattributes
@@ -1,2 +1,4 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true
68 changes: 15 additions & 53 deletions .gitignore
@@ -1,14 +1,13 @@
node_modules
lib
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand All @@ -19,34 +18,14 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

Expand All @@ -56,36 +35,19 @@ typings/
# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/
.env.development.local
.env.test.local
.env.production.local
.env.local

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
6 changes: 6 additions & 0 deletions .prettierignore
@@ -0,0 +1,6 @@
# Dependency directories
node_modules/
jspm_packages/

# yarn v2
.yarn/
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .yarnrc.yml
@@ -0,0 +1,13 @@
logFilters:
- code: YN0013
level: discard
- code: YN0019
level: discard
- code: YN0076
level: discard

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
15 changes: 13 additions & 2 deletions dev.Dockerfile
Expand Up @@ -5,9 +5,16 @@ ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache <<EOT
corepack enable
yarn --version
yarn config set --home enableTelemetry 0
EOT

FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor

Expand All @@ -20,14 +27,15 @@ RUN --mount=type=bind,target=.,rw <<EOT
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT

FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/

Expand All @@ -48,20 +56,23 @@ EOT

FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out

FROM scratch AS format-update
COPY --from=format /out /

FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run lint

FROM deps AS test
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverage --coverageDirectory=/tmp/coverage

Expand Down
10 changes: 5 additions & 5 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

80 changes: 70 additions & 10 deletions dist/licenses.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docker-bake.hcl
Expand Up @@ -3,7 +3,7 @@ group "default" {
}

group "pre-checkin" {
targets = ["vendor-update", "format", "build"]
targets = ["vendor", "format", "build"]
}

group "validate" {
Expand Down Expand Up @@ -34,7 +34,7 @@ target "lint" {
output = ["type=cacheonly"]
}

target "vendor-update" {
target "vendor" {
dockerfile = "dev.Dockerfile"
target = "vendor-update"
output = ["."]
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "docker-setup-qemu",
"description": "Install QEMU static binaries",
"main": "lib/main.js",
"main": "src/main.ts",
"scripts": {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"lint": "yarn run prettier && yarn run eslint",
Expand All @@ -10,8 +10,7 @@
"eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "jest",
"all": "yarn run build && yarn run format && yarn test"
"test": "jest"
},
"repository": {
"type": "git",
Expand All @@ -24,6 +23,7 @@
],
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "^0.21.1"
Expand Down

0 comments on commit a318853

Please sign in to comment.