Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d04d5d948 | ||
|
|
cd74e05d9b | ||
|
|
eee38ec7b3 | ||
|
|
7a83f65b5a | ||
|
|
a5aa96747d | ||
|
|
e73d53fa4e | ||
|
|
28a438e9ed | ||
|
|
034e9d37dd | ||
|
|
b4664d8fd0 | ||
|
|
a8257dec35 | ||
|
|
9cd4410b76 | ||
|
|
7064bb6cb0 | ||
|
|
57d4a8d20c | ||
|
|
0dadf93d54 | ||
|
|
1a12f33edd | ||
|
|
1282d41a96 | ||
|
|
01144634a7 | ||
|
|
cb437c6618 | ||
|
|
4b6c254447 | ||
|
|
3d95d526ba | ||
|
|
2231aab25d | ||
|
|
483f4842ce | ||
|
|
a43d49b256 | ||
|
|
64bf327336 | ||
|
|
94782da071 | ||
|
|
d6c542fbcd | ||
|
|
eaf69fbc6f | ||
|
|
f95826b456 | ||
|
|
fb37e2879d | ||
|
|
099630bcb6 | ||
|
|
70d132ddbe | ||
|
|
7c525be6cc | ||
|
|
ca8948fcde | ||
|
|
86fc44fcc0 | ||
|
|
c7c4c00f3e | ||
|
|
7a35da204c | ||
|
|
d965a53926 | ||
|
|
16c25413c8 | ||
|
|
b278ce4ad9 | ||
|
|
8d2750c68a | ||
|
|
e81846bcc4 | ||
|
|
65d18f8f8a | ||
|
|
000d75d273 | ||
|
|
1583c0f09d | ||
|
|
ed158e7963 | ||
|
|
4cc794f83e | ||
|
|
4dfc3d6c5d | ||
|
|
af1b253b8d | ||
|
|
3c6ab92b04 | ||
|
|
2c8bcdab54 | ||
|
|
1051acaba6 | ||
|
|
e8cd182ec7 | ||
|
|
8c5c87276d | ||
|
|
90fa7ac870 | ||
|
|
7ebadadf6b | ||
|
|
ee3eb2f3a4 | ||
|
|
c65d441f38 | ||
|
|
da183f8ca3 | ||
|
|
f7a6c723e1 | ||
|
|
8424fa0070 | ||
|
|
c52693d481 | ||
|
|
5efa6e34fd | ||
|
|
774224adf6 | ||
|
|
5d221e8956 | ||
|
|
68163b97ca | ||
|
|
ae7d6893e8 | ||
|
|
ac3a803dd3 | ||
|
|
e468171a9d | ||
|
|
a3e7502fd0 | ||
|
|
b145473295 | ||
|
|
18ce135bb5 | ||
|
|
0e198e93af | ||
|
|
05f3f3ac10 | ||
|
|
622913496d | ||
|
|
c6f6a07025 | ||
|
|
6c5e29d848 | ||
|
|
548b297749 | ||
|
|
36590ad0c1 | ||
|
|
4143b5899b | ||
|
|
3f1544eb9e | ||
|
|
f3204bbfac | ||
|
|
4ba329ef89 | ||
|
|
e600775e52 | ||
|
|
b2b2ffa946 | ||
|
|
fe905840cd | ||
|
|
8998bbe94b | ||
|
|
830833e0c7 | ||
|
|
941183f0a0 | ||
|
|
311b62b254 | ||
|
|
afeb29a6e0 | ||
|
|
b560416601 | ||
|
|
516bb780e5 | ||
|
|
11445527f0 | ||
|
|
b5ca514318 | ||
|
|
1418a4ef33 | ||
|
|
93acf831ce | ||
|
|
f7ce87c1d6 | ||
|
|
aa1e2a0b49 | ||
|
|
673e008776 | ||
|
|
ba31df4664 | ||
|
|
5475af18ec | ||
|
|
acacad903e | ||
|
|
6a25f988bd | ||
|
|
ca1af179f5 | ||
|
|
6524bf65af | ||
|
|
8d5e0747fc | ||
|
|
7199e57b35 | ||
|
|
db63cee3de | ||
|
|
043ebe137f | ||
|
|
686da9073d | ||
|
|
a3d74876b8 | ||
|
|
4dcdbcec48 | ||
|
|
1a8ac74316 | ||
|
|
e827ebe8ba | ||
|
|
adacc1474e | ||
|
|
0f069ddc17 | ||
|
|
d036b3238c | ||
|
|
460e45646d | ||
|
|
93aa1c807f | ||
|
|
d391aad55c | ||
|
|
e5b688ea46 | ||
|
|
c47758b77c | ||
|
|
8fea382513 | ||
|
|
2874e980e8 | ||
|
|
8026d2bc36 | ||
|
|
e51aab53e9 | ||
|
|
fd7390e14d | ||
|
|
910a304005 | ||
|
|
3623ee443e | ||
|
|
e0e5ecf670 | ||
|
|
5334dd0cdd | ||
|
|
214bb6dac1 | ||
|
|
818c69a4ea | ||
|
|
b467d6aa7a | ||
|
|
7594cf3831 | ||
|
|
988b5a0280 | ||
|
|
2c215620b8 | ||
|
|
3382292cd5 | ||
|
|
3d68780484 | ||
|
|
d069e98648 | ||
|
|
8b850f86dc | ||
|
|
aa33708b10 | ||
|
|
2d99e3412d | ||
|
|
4dab43650b | ||
|
|
49a04d6890 | ||
|
|
a6ade2e34f | ||
|
|
2f2694b8d1 | ||
|
|
0a4bab6632 | ||
|
|
2ad185228a | ||
|
|
560ac469d6 | ||
|
|
b3a341759e | ||
|
|
4fd812986e | ||
|
|
3386dc4251 | ||
|
|
d191aef416 | ||
|
|
f686054aab | ||
|
|
78547859d7 | ||
|
|
830928c706 | ||
|
|
26d2aec173 | ||
|
|
ab17e3ec80 | ||
|
|
d79cb80903 | ||
|
|
13cf78894f | ||
|
|
0e592087a0 | ||
|
|
47032b9b53 | ||
|
|
abe89fb761 | ||
|
|
e027232c25 | ||
|
|
5d9397e7ca | ||
|
|
e9ab4c6a14 | ||
|
|
748835b452 | ||
|
|
554c728605 | ||
|
|
1c1261e632 | ||
|
|
5138f76647 | ||
|
|
eddcf46655 | ||
|
|
2740b29678 | ||
|
|
1113efed2b | ||
|
|
8a2a7ad780 | ||
|
|
e3c7deb79b | ||
|
|
be3701b211 | ||
|
|
e2ed622d10 | ||
|
|
b73b950903 | ||
|
|
157d6d0106 | ||
|
|
a530e948ad | ||
|
|
28ecb964cd | ||
|
|
dc25d8b2ee | ||
|
|
d70bba72b1 | ||
|
|
7638634cb7 | ||
|
|
c68420fe0b |
No files matched your search
+11
-1
@@ -1,2 +1,12 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/node_modules
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/dist/**
|
|
||||||
/coverage/**
|
|
||||||
/node_modules/**
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"es6": true,
|
|
||||||
"jest": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"plugin:jest/recommended",
|
|
||||||
"plugin:prettier/recommended"
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": "latest",
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"@typescript-eslint",
|
|
||||||
"jest",
|
|
||||||
"prettier"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
|
/.yarn/releases/** binary
|
||||||
|
/.yarn/plugins/** binary
|
||||||
/dist/** linguist-generated=true
|
/dist/** linguist-generated=true
|
||||||
/lib/** linguist-generated=true
|
/lib/** linguist-generated=true
|
||||||
+97
-79
@@ -5,6 +5,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *'
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
@@ -25,12 +26,13 @@ jobs:
|
|||||||
- ""
|
- ""
|
||||||
- "latest"
|
- "latest"
|
||||||
- "v0.4.1"
|
- "v0.4.1"
|
||||||
|
- "cloud:latest"
|
||||||
|
- "cloud:v0.11.2-desktop.2"
|
||||||
- "lab:latest"
|
- "lab:latest"
|
||||||
- "lab:v0.11.2-desktop.2"
|
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@@ -49,7 +51,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx 1
|
name: Set up Docker Buildx 1
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -62,7 +64,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Stop docker
|
name: Stop docker
|
||||||
run: |
|
run: |
|
||||||
@@ -90,7 +92,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create Dockerfile
|
name: Create Dockerfile
|
||||||
run: |
|
run: |
|
||||||
@@ -100,7 +102,7 @@ jobs:
|
|||||||
EOL
|
EOL
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -108,27 +110,11 @@ jobs:
|
|||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
||||||
|
|
||||||
install:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
|
||||||
name: Check cmd
|
|
||||||
run: |
|
|
||||||
docker build --help
|
|
||||||
|
|
||||||
use:
|
use:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -140,7 +126,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -163,7 +149,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -176,7 +162,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -209,7 +195,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create context
|
name: Create context
|
||||||
run: |
|
run: |
|
||||||
@@ -226,12 +212,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_CONTEXT: mycontext
|
DOCKER_CONTEXT: mycontext
|
||||||
|
|
||||||
config:
|
buildkitd-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create buildkitd conf
|
name: Create buildkitd conf
|
||||||
run: |
|
run: |
|
||||||
@@ -254,16 +240,16 @@ jobs:
|
|||||||
buildkitd-config: /tmp/buildkitd.toml
|
buildkitd-config: /tmp/buildkitd.toml
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
config-inline:
|
buildkitd-config-inline:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create Dockerfile
|
name: Create Dockerfile
|
||||||
run: |
|
run: |
|
||||||
@@ -281,7 +267,7 @@ jobs:
|
|||||||
mirrors = ["mirror.gcr.io"]
|
mirrors = ["mirror.gcr.io"]
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
@@ -299,10 +285,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.qemu-platforms }}
|
platforms: ${{ matrix.qemu-platforms }}
|
||||||
-
|
-
|
||||||
@@ -328,7 +314,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -351,7 +337,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Uninstall docker cli
|
name: Uninstall docker cli
|
||||||
run: |
|
run: |
|
||||||
@@ -379,7 +365,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Uninstall docker cli
|
name: Uninstall docker cli
|
||||||
run: |
|
run: |
|
||||||
@@ -405,42 +391,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
standalone-install-error:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
-
|
|
||||||
name: Uninstall docker cli
|
|
||||||
run: |
|
|
||||||
if dpkg -s "docker-ce" >/dev/null 2>&1; then
|
|
||||||
sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin
|
|
||||||
else
|
|
||||||
sudo apt-get purge -y moby-cli moby-buildx
|
|
||||||
fi
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
continue-on-error: true
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
|
||||||
name: Check
|
|
||||||
run: |
|
|
||||||
echo "${{ toJson(steps.buildx) }}"
|
|
||||||
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
|
||||||
echo "::error::Should have failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
append:
|
append:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create dummy contexts
|
name: Create dummy contexts
|
||||||
run: |
|
run: |
|
||||||
@@ -469,10 +425,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -484,7 +440,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create Docker context
|
name: Create Docker context
|
||||||
run: |
|
run: |
|
||||||
@@ -507,7 +463,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -515,22 +471,21 @@ jobs:
|
|||||||
cleanup: ${{ matrix.cleanup }}
|
cleanup: ${{ matrix.cleanup }}
|
||||||
|
|
||||||
k3s:
|
k3s:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
|
- latest
|
||||||
- v0.11.0
|
- v0.11.0
|
||||||
- v0.10.5
|
- v0.10.5
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Install k3s
|
name: Install k3s
|
||||||
uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60
|
uses: crazy-max/.github/.github/actions/install-k3s@a94383ec9e125b23907fb6fcebf7ff87964595e5
|
||||||
with:
|
|
||||||
version: "v1.21.2-k3s1"
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@@ -575,10 +530,73 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: v0.11.2
|
version: v0.11.2
|
||||||
cache-binary: ${{ matrix.cache }}
|
cache-binary: ${{ matrix.cache }}
|
||||||
|
|
||||||
|
windows-error:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
continue-on-error: true
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
run: |
|
||||||
|
echo "${{ toJson(steps.buildx) }}"
|
||||||
|
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||||
|
echo "::error::Should have failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
keep-state:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: foo
|
||||||
|
keep-state: true
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: foo
|
||||||
|
keep-state: true
|
||||||
|
|
||||||
|
keep-state-error:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
continue-on-error: true
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
driver: docker
|
||||||
|
keep-state: true
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
run: |
|
||||||
|
echo "${{ toJson(steps.buildx) }}"
|
||||||
|
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||||
|
echo "::error::Should have failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: pr-assign-author
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
name: publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Publish
|
||||||
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
@@ -17,18 +17,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
files: ./coverage/clover.xml
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
name: update-dist
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-dist:
|
||||||
|
if: github.actor == 'dependabot[bot]'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: GitHub auth token from GitHub App
|
||||||
|
id: docker-read-app
|
||||||
|
uses: actions/create-github-app-token@v2
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||||
|
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||||
|
owner: docker
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.docker-read-app.outputs.token || github.token }}
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/bake-action@v6
|
||||||
|
with:
|
||||||
|
source: .
|
||||||
|
targets: build
|
||||||
|
-
|
||||||
|
name: Commit and push dist
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add dist
|
||||||
|
git commit -m "chore: update generated content"
|
||||||
|
git push
|
||||||
|
)
|
||||||
|
else
|
||||||
|
echo "No changes in dist"
|
||||||
|
fi
|
||||||
@@ -15,16 +15,17 @@ jobs:
|
|||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
targets: ${{ steps.targets.outputs.matrix }}
|
targets: ${{ steps.generate.outputs.targets }}
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Targets matrix
|
name: List targets
|
||||||
id: targets
|
id: generate
|
||||||
run: |
|
uses: docker/bake-action/subaction/list-targets@v6
|
||||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
with:
|
||||||
|
target: validate
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -35,11 +36,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
-
|
-
|
||||||
name: Validate
|
name: Validate
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
+14
-57
@@ -1,12 +1,5 @@
|
|||||||
/.dev
|
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
node_modules
|
|
||||||
lib
|
|
||||||
|
|
||||||
# Jetbrains
|
|
||||||
/.idea
|
|
||||||
/*.iml
|
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
@@ -24,34 +18,14 @@ pids
|
|||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage
|
||||||
*.lcov
|
*.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
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
# TypeScript cache
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
@@ -61,36 +35,19 @@ typings/
|
|||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
# dotenv environment variable files
|
||||||
.env
|
.env
|
||||||
.env.test
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# yarn v2
|
||||||
.cache
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
# next.js build output
|
.yarn/build-state.yml
|
||||||
.next
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/
|
||||||
+1
-2
@@ -6,6 +6,5 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": false,
|
"bracketSpacing": false,
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid"
|
||||||
"parser": "typescript"
|
|
||||||
}
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
# https://yarnpkg.com/configuration/yarnrc
|
||||||
|
|
||||||
|
compressionLevel: mixed
|
||||||
|
enableGlobalCache: false
|
||||||
|
enableHardenedMode: true
|
||||||
|
|
||||||
|
logFilters:
|
||||||
|
- code: YN0013
|
||||||
|
level: discard
|
||||||
|
- code: YN0019
|
||||||
|
level: discard
|
||||||
|
- code: YN0076
|
||||||
|
level: discard
|
||||||
|
- code: YN0086
|
||||||
|
level: discard
|
||||||
|
|
||||||
|
nodeLinker: node-modules
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
# Add support for more platforms with QEMU (optional)
|
# Add support for more platforms with QEMU (optional)
|
||||||
# https://github.com/docker/setup-qemu-action
|
# https://github.com/docker/setup-qemu-action
|
||||||
@@ -85,23 +85,30 @@ The following inputs can be used as `step.with` keys:
|
|||||||
> platforms: linux/amd64,linux/arm64
|
> platforms: linux/amd64,linux/arm64
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|------------------------------|----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------|----------|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
||||||
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
|
| `name` | String | | Name of the builder. If not specified, one will be generated or if it already exists, it will be used instead of creating a new one |
|
||||||
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
|
||||||
| `buildkitd-flags` | String | | [BuildKit daemon flags](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) |
|
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
||||||
| `buildkitd-config` \* | String | | [BuildKit daemon config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
| `buildkitd-flags` | String | | [BuildKit daemon flags](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) |
|
||||||
| `buildkitd-config-inline` \* | String | | Same as `buildkitd-config` but inline |
|
| `buildkitd-config` \* | String | | [BuildKit daemon config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
||||||
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
|
| `buildkitd-config-inline` \* | String | | Same as `buildkitd-config` but inline |
|
||||||
| `use` | Bool | `true` | Switch to this builder instance |
|
| `use` | Bool | `true` | Switch to this builder instance |
|
||||||
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
||||||
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones. |
|
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones |
|
||||||
| `append` | YAML | | [Append additional nodes](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder) to the builder |
|
| `append` | YAML | | [Append additional nodes](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder) to the builder |
|
||||||
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
|
| `keep-state` | Bool | `false` | Keep BuildKit state on `cleanup`. This is only useful on persistent self-hosted runners |
|
||||||
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |
|
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
|
||||||
|
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |
|
||||||
|
|
||||||
_\* `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive_
|
> [!IMPORTANT]
|
||||||
|
> If you set the `buildkitd-flags` input, the default flags (`--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host`)
|
||||||
|
> will be reset. If you want to retain the default behavior, make sure to
|
||||||
|
> include these flags in your custom `buildkitd-flags` value.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive.
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
|
|||||||
+225
-32
@@ -1,35 +1,40 @@
|
|||||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
import {beforeEach, describe, expect, test, vi} from 'vitest';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as uuid from 'uuid';
|
|
||||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
|
|
||||||
import {Context} from '@docker/actions-toolkit/lib/context';
|
|
||||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
|
||||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
|
||||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
|
||||||
|
|
||||||
import * as context from '../src/context';
|
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||||
|
import {Context} from '@docker/actions-toolkit/lib/context.js';
|
||||||
|
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||||
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||||
|
|
||||||
|
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||||
|
|
||||||
|
import * as context from '../src/context.js';
|
||||||
|
|
||||||
const fixturesDir = path.join(__dirname, 'fixtures');
|
const fixturesDir = path.join(__dirname, 'fixtures');
|
||||||
// prettier-ignore
|
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'context-'));
|
||||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'setup-buildx-jest');
|
const tmpName = path.join(tmpDir, '.tmpname-vi');
|
||||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
vi.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||||
if (!fs.existsSync(tmpDir)) {
|
if (!fs.existsSync(tmpDir)) {
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
}
|
}
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
vi.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
||||||
return tmpName;
|
return tmpName;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('uuid');
|
vi.mock('crypto', async () => {
|
||||||
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
|
return {
|
||||||
|
...(await vi.importActual('crypto')),
|
||||||
|
randomUUID: vi.fn(() => '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d')
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
jest.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
vi.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
||||||
return Promise.resolve('default');
|
return Promise.resolve('default');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -49,10 +54,10 @@ describe('getCreateArgs', () => {
|
|||||||
0,
|
0,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -67,10 +72,10 @@ describe('getCreateArgs', () => {
|
|||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['driver', 'docker'],
|
['driver', 'docker'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -84,11 +89,11 @@ describe('getCreateArgs', () => {
|
|||||||
2,
|
2,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -105,10 +110,10 @@ describe('getCreateArgs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['driver', 'remote'],
|
['driver', 'remote'],
|
||||||
['endpoint', 'tls://foo:1234'],
|
['endpoint', 'tls://foo:1234'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -125,10 +130,10 @@ describe('getCreateArgs', () => {
|
|||||||
['driver', 'remote'],
|
['driver', 'remote'],
|
||||||
['platforms', 'linux/arm64,linux/arm/v7'],
|
['platforms', 'linux/arm64,linux/arm/v7'],
|
||||||
['endpoint', 'tls://foo:1234'],
|
['endpoint', 'tls://foo:1234'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -143,11 +148,11 @@ describe('getCreateArgs', () => {
|
|||||||
5,
|
5,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -161,11 +166,11 @@ describe('getCreateArgs', () => {
|
|||||||
6,
|
6,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -179,11 +184,11 @@ describe('getCreateArgs', () => {
|
|||||||
7,
|
7,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['driver', 'unknown'],
|
['driver', 'unknown'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -195,11 +200,11 @@ describe('getCreateArgs', () => {
|
|||||||
8,
|
8,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['buildkitd-config', path.join(fixturesDir, 'buildkitd.toml')],
|
['buildkitd-config', path.join(fixturesDir, 'buildkitd.toml')],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -213,11 +218,11 @@ describe('getCreateArgs', () => {
|
|||||||
9,
|
9,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['buildkitd-config-inline', 'debug = true'],
|
['buildkitd-config-inline', 'debug = true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -226,15 +231,69 @@ describe('getCreateArgs', () => {
|
|||||||
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
'--config', tmpName,
|
'--config', tmpName,
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
10,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'false'],
|
||||||
|
['driver', 'cloud'],
|
||||||
|
['buildkitd-flags', '--allow-insecure-entitlement network.host'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'cloud',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement network.host',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
11,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
|
['name', 'test-builder-name'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'test-builder-name',
|
||||||
|
'--driver', 'docker-container',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
'--use'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
12,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['keep-state', 'true'],
|
||||||
|
['name', 'test-builder-name'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'test-builder-name',
|
||||||
|
'--driver', 'docker-container',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
'--use',
|
||||||
|
]
|
||||||
|
],
|
||||||
])(
|
])(
|
||||||
'[%d] given buildx %s and %p as inputs, returns %p',
|
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
||||||
inputs.forEach((value: string, name: string) => {
|
inputs.forEach((value: string, name: string) => {
|
||||||
setInput(name, value);
|
setInput(name, value);
|
||||||
});
|
});
|
||||||
const toolkit = new Toolkit();
|
const toolkit = new Toolkit();
|
||||||
jest.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
return buildxVersion;
|
return buildxVersion;
|
||||||
});
|
});
|
||||||
const inp = await context.getInputs();
|
const inp = await context.getInputs();
|
||||||
@@ -260,10 +319,10 @@ describe('getAppendArgs', () => {
|
|||||||
0,
|
0,
|
||||||
'v0.10.3',
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
['cache-binary', 'true'],
|
['cache-binary', 'true'],
|
||||||
['cleanup', 'true'],
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
"name": "aws_graviton2",
|
"name": "aws_graviton2",
|
||||||
@@ -286,13 +345,13 @@ describe('getAppendArgs', () => {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
'[%d] given buildx %s and %p as inputs, returns %p',
|
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, node: Node, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, node: Node, expected: Array<string>) => {
|
||||||
inputs.forEach((value: string, name: string) => {
|
inputs.forEach((value: string, name: string) => {
|
||||||
setInput(name, value);
|
setInput(name, value);
|
||||||
});
|
});
|
||||||
const toolkit = new Toolkit();
|
const toolkit = new Toolkit();
|
||||||
jest.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
return buildxVersion;
|
return buildxVersion;
|
||||||
});
|
});
|
||||||
const inp = await context.getInputs();
|
const inp = await context.getInputs();
|
||||||
@@ -302,6 +361,140 @@ describe('getAppendArgs', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('getVersion', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
|
});
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
test.each([
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
new Map<string, string>([
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
''
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'latest'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'latest'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'edge'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'edge'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'v0.19.2'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'v0.19.2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'latest'],
|
||||||
|
['driver', 'cloud'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'cloud:latest'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
5,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'edge'],
|
||||||
|
['driver', 'cloud'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'cloud:edge'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
6,
|
||||||
|
new Map<string, string>([
|
||||||
|
['driver', 'cloud'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'cloud:latest'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
7,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'cloud:v0.11.2-desktop.2'],
|
||||||
|
['driver', 'cloud'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'cloud:v0.11.2-desktop.2'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'cloud:v0.11.2-desktop.2'],
|
||||||
|
// defaults
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
'cloud:v0.11.2-desktop.2'
|
||||||
|
],
|
||||||
|
])(
|
||||||
|
'[%d] given %o as inputs, returns version %o',
|
||||||
|
async (num: number, inputs: Map<string, string>, expected: string) => {
|
||||||
|
inputs.forEach((value: string, name: string) => {
|
||||||
|
setInput(name, value);
|
||||||
|
});
|
||||||
|
const inp = await context.getInputs();
|
||||||
|
expect(context.getVersion(inp)).toEqual(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
|
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
|
||||||
function getInputName(name: string): string {
|
function getInputName(name: string): string {
|
||||||
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import fs from 'node:fs';
|
||||||
|
import os from 'node:os';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-action-'));
|
||||||
|
|
||||||
|
process.env = Object.assign({}, process.env, {
|
||||||
|
TEMP: tmpDir,
|
||||||
|
GITHUB_REPOSITORY: 'docker/setup-buildx-action',
|
||||||
|
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||||
|
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||||
|
});
|
||||||
+8
-15
@@ -19,7 +19,6 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
buildkitd-flags:
|
buildkitd-flags:
|
||||||
description: 'BuildKit daemon flags'
|
description: 'BuildKit daemon flags'
|
||||||
default: '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
|
|
||||||
required: false
|
required: false
|
||||||
buildkitd-config:
|
buildkitd-config:
|
||||||
description: 'BuildKit daemon config file'
|
description: 'BuildKit daemon config file'
|
||||||
@@ -27,14 +26,13 @@ inputs:
|
|||||||
buildkitd-config-inline:
|
buildkitd-config-inline:
|
||||||
description: 'Inline BuildKit daemon config'
|
description: 'Inline BuildKit daemon config'
|
||||||
required: false
|
required: false
|
||||||
install:
|
|
||||||
description: 'Sets up docker build command as an alias to docker buildx build'
|
|
||||||
default: 'false'
|
|
||||||
required: false
|
|
||||||
use:
|
use:
|
||||||
description: 'Switch to this builder instance'
|
description: 'Switch to this builder instance'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
required: false
|
||||||
|
name:
|
||||||
|
description: 'Name of the builder. If not specified, one will be generated or if it already exists, it will be used instead of creating a new one.'
|
||||||
|
required: false
|
||||||
endpoint:
|
endpoint:
|
||||||
description: 'Optional address for docker socket or context from `docker context ls`'
|
description: 'Optional address for docker socket or context from `docker context ls`'
|
||||||
required: false
|
required: false
|
||||||
@@ -44,6 +42,10 @@ inputs:
|
|||||||
append:
|
append:
|
||||||
description: 'Append additional nodes to the builder'
|
description: 'Append additional nodes to the builder'
|
||||||
required: false
|
required: false
|
||||||
|
keep-state:
|
||||||
|
description: 'Keep BuildKit state on cleanup. This is only useful on persistent self-hosted runners.'
|
||||||
|
default: 'false'
|
||||||
|
required: false
|
||||||
cache-binary:
|
cache-binary:
|
||||||
description: 'Cache buildx binary to GitHub Actions cache backend'
|
description: 'Cache buildx binary to GitHub Actions cache backend'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
@@ -52,15 +54,6 @@ inputs:
|
|||||||
description: 'Cleanup temp files and remove builder at the end of a job'
|
description: 'Cleanup temp files and remove builder at the end of a job'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
required: false
|
||||||
# deprecated inputs
|
|
||||||
config:
|
|
||||||
description: 'BuildKit daemon config file'
|
|
||||||
deprecationMessage: 'Use buildkitd-config instead'
|
|
||||||
required: false
|
|
||||||
config-inline:
|
|
||||||
description: 'Inline BuildKit daemon config'
|
|
||||||
deprecationMessage: 'Use buildkitd-config-inline instead'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
name:
|
name:
|
||||||
@@ -79,6 +72,6 @@ outputs:
|
|||||||
description: 'Builder node flags (deprecated, use nodes output instead)'
|
description: 'Builder node flags (deprecated, use nodes output instead)'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/index.js'
|
post: 'dist/index.js'
|
||||||
+45
-27
@@ -1,13 +1,21 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=24
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS base
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
RUN apk add --no-cache cpio findutils git
|
RUN apk add --no-cache cpio findutils git rsync
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||||
|
set -e
|
||||||
|
corepack enable
|
||||||
|
yarn --version
|
||||||
|
yarn config set --home enableTelemetry 0
|
||||||
|
EOT
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||||
|
|
||||||
@@ -16,56 +24,66 @@ COPY --from=deps /vendor /
|
|||||||
|
|
||||||
FROM deps AS vendor-validate
|
FROM deps AS vendor-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=type=bind,target=.,rw <<EOT
|
||||||
set -e
|
set -e
|
||||||
git add -A
|
git add -A
|
||||||
cp -rf /vendor/* .
|
cp -rf /vendor/* .
|
||||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
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
|
git status --porcelain -- yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=target=/context \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
--mount=type=cache,target=/src/node_modules <<EOT
|
||||||
|
set -e
|
||||||
|
rsync -a /context/. .
|
||||||
|
rm -rf dist
|
||||||
|
yarn run build
|
||||||
|
mkdir /out
|
||||||
|
cp -r dist /out
|
||||||
|
EOT
|
||||||
|
|
||||||
FROM scratch AS build-update
|
FROM scratch AS build-update
|
||||||
COPY --from=build /out /
|
COPY --from=build /out /
|
||||||
|
|
||||||
FROM build AS build-validate
|
FROM build AS build-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=target=/context \
|
||||||
set -e
|
--mount=target=.,type=tmpfs <<EOT
|
||||||
git add -A
|
set -e
|
||||||
cp -rf /out/* .
|
rsync -a /context/. .
|
||||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
git add -A
|
||||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
rm -rf dist
|
||||||
git status --porcelain -- dist
|
cp -rf /out/* .
|
||||||
exit 1
|
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||||
fi
|
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||||
|
git status --porcelain -- dist
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS format
|
FROM deps AS format
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run format \
|
yarn run format && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
|
||||||
|
|
||||||
FROM scratch AS format-update
|
FROM scratch AS format-update
|
||||||
COPY --from=format /out /
|
COPY --from=format /out /
|
||||||
|
|
||||||
FROM deps AS lint
|
FROM deps AS lint
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
FROM deps AS test
|
FROM deps AS test
|
||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage /
|
COPY --from=test /tmp/coverage /
|
||||||
+301
@@ -0,0 +1,301 @@
|
|||||||
|
export const id = 606;
|
||||||
|
export const ids = [606];
|
||||||
|
export const modules = {
|
||||||
|
|
||||||
|
/***/ 606:
|
||||||
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ pMap)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* unused harmony exports pMapIterable, pMapSkip */
|
||||||
|
async function pMap(
|
||||||
|
iterable,
|
||||||
|
mapper,
|
||||||
|
{
|
||||||
|
concurrency = Number.POSITIVE_INFINITY,
|
||||||
|
stopOnError = true,
|
||||||
|
signal,
|
||||||
|
} = {},
|
||||||
|
) {
|
||||||
|
return new Promise((resolve_, reject_) => {
|
||||||
|
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||||
|
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof mapper !== 'function') {
|
||||||
|
throw new TypeError('Mapper function is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = [];
|
||||||
|
const errors = [];
|
||||||
|
const skippedIndexesMap = new Map();
|
||||||
|
let isRejected = false;
|
||||||
|
let isResolved = false;
|
||||||
|
let isIterableDone = false;
|
||||||
|
let resolvingCount = 0;
|
||||||
|
let currentIndex = 0;
|
||||||
|
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
||||||
|
|
||||||
|
const signalListener = () => {
|
||||||
|
reject(signal.reason);
|
||||||
|
};
|
||||||
|
|
||||||
|
const cleanup = () => {
|
||||||
|
signal?.removeEventListener('abort', signalListener);
|
||||||
|
};
|
||||||
|
|
||||||
|
const resolve = value => {
|
||||||
|
resolve_(value);
|
||||||
|
cleanup();
|
||||||
|
};
|
||||||
|
|
||||||
|
const reject = reason => {
|
||||||
|
isRejected = true;
|
||||||
|
isResolved = true;
|
||||||
|
reject_(reason);
|
||||||
|
cleanup();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (signal) {
|
||||||
|
if (signal.aborted) {
|
||||||
|
reject(signal.reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
signal.addEventListener('abort', signalListener, {once: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
const next = async () => {
|
||||||
|
if (isResolved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextItem = await iterator.next();
|
||||||
|
|
||||||
|
const index = currentIndex;
|
||||||
|
currentIndex++;
|
||||||
|
|
||||||
|
// Note: `iterator.next()` can be called many times in parallel.
|
||||||
|
// This can cause multiple calls to this `next()` function to
|
||||||
|
// receive a `nextItem` with `done === true`.
|
||||||
|
// The shutdown logic that rejects/resolves must be protected
|
||||||
|
// so it runs only one time as the `skippedIndex` logic is
|
||||||
|
// non-idempotent.
|
||||||
|
if (nextItem.done) {
|
||||||
|
isIterableDone = true;
|
||||||
|
|
||||||
|
if (resolvingCount === 0 && !isResolved) {
|
||||||
|
if (!stopOnError && errors.length > 0) {
|
||||||
|
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isResolved = true;
|
||||||
|
|
||||||
|
if (skippedIndexesMap.size === 0) {
|
||||||
|
resolve(result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pureResult = [];
|
||||||
|
|
||||||
|
// Support multiple `pMapSkip`'s.
|
||||||
|
for (const [index, value] of result.entries()) {
|
||||||
|
if (skippedIndexesMap.get(index) === pMapSkip) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
pureResult.push(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(pureResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
resolvingCount++;
|
||||||
|
|
||||||
|
// Intentionally detached
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
const element = await nextItem.value;
|
||||||
|
|
||||||
|
if (isResolved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = await mapper(element, index);
|
||||||
|
|
||||||
|
// Use Map to stage the index of the element.
|
||||||
|
if (value === pMapSkip) {
|
||||||
|
skippedIndexesMap.set(index, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
result[index] = value;
|
||||||
|
|
||||||
|
resolvingCount--;
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
if (stopOnError) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
errors.push(error);
|
||||||
|
resolvingCount--;
|
||||||
|
|
||||||
|
// In that case we can't really continue regardless of `stopOnError` state
|
||||||
|
// since an iterable is likely to continue throwing after it throws once.
|
||||||
|
// If we continue calling `next()` indefinitely we will likely end up
|
||||||
|
// in an infinite loop of failed iteration.
|
||||||
|
try {
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create the concurrent runners in a detached (non-awaited)
|
||||||
|
// promise. We need this so we can await the `next()` calls
|
||||||
|
// to stop creating runners before hitting the concurrency limit
|
||||||
|
// if the iterable has already been marked as done.
|
||||||
|
// NOTE: We *must* do this for async iterators otherwise we'll spin up
|
||||||
|
// infinite `next()` calls by default and never start the event loop.
|
||||||
|
(async () => {
|
||||||
|
for (let index = 0; index < concurrency; index++) {
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIterableDone || isRejected) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function pMapIterable(
|
||||||
|
iterable,
|
||||||
|
mapper,
|
||||||
|
{
|
||||||
|
concurrency = Number.POSITIVE_INFINITY,
|
||||||
|
backpressure = concurrency,
|
||||||
|
} = {},
|
||||||
|
) {
|
||||||
|
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||||
|
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof mapper !== 'function') {
|
||||||
|
throw new TypeError('Mapper function is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
async * [Symbol.asyncIterator]() {
|
||||||
|
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
||||||
|
|
||||||
|
const promises = [];
|
||||||
|
let pendingPromisesCount = 0;
|
||||||
|
let isDone = false;
|
||||||
|
let index = 0;
|
||||||
|
|
||||||
|
function trySpawn() {
|
||||||
|
if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pendingPromisesCount++;
|
||||||
|
|
||||||
|
const promise = (async () => {
|
||||||
|
const {done, value} = await iterator.next();
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
pendingPromisesCount--;
|
||||||
|
return {done: true};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spawn if still below concurrency and backpressure limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const returnValue = await mapper(await value, index++);
|
||||||
|
|
||||||
|
pendingPromisesCount--;
|
||||||
|
|
||||||
|
if (returnValue === pMapSkip) {
|
||||||
|
const index = promises.indexOf(promise);
|
||||||
|
|
||||||
|
if (index > 0) {
|
||||||
|
promises.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spawn if still below backpressure limit and just dropped below concurrency limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
return {done: false, value: returnValue};
|
||||||
|
} catch (error) {
|
||||||
|
pendingPromisesCount--;
|
||||||
|
isDone = true;
|
||||||
|
return {error};
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
promises.push(promise);
|
||||||
|
}
|
||||||
|
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
while (promises.length > 0) {
|
||||||
|
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
|
||||||
|
|
||||||
|
promises.shift();
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spawn if just dropped below backpressure limit and below the concurrency limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
if (value === pMapSkip) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const pMapSkip = Symbol('skip');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//# sourceMappingURL=606.index.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"606.index.js","mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the elemeLine truncated
|
||||||
+39
-20
@@ -1,32 +1,51 @@
|
|||||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7799:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var a=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.saveCache=t.restoreCache=t.isFeatureAvailable=t.ReserveCacheError=t.ValidationError=void 0;const o=s(r(2186));const l=s(r(1017));const c=s(r(1518));const p=s(r(8245));const d=r(3434);class ValidationError extends Error{constructor(e){super(e);this.name="ValidationError";Object.setPrototypeOf(this,ValidationError.prototype)}}t.ValidationError=ValidationError;class ReserveCacheError extends Error{constructor(e){super(e);this.name="ReserveCacheError";Object.setPrototypeOf(this,ReserveCacheError.prototype)}}t.ReserveCacheError=ReserveCacheError;function checkPaths(e){if(!e||e.length===0){throw new ValidationError(`Path Validation Error: At least one directory or file path is required`)}}function checkKey(e){if(e.length>512){throw new ValidationError(`Key Validation Error: ${e} cannot be larger than 512 characters.`)}const t=/^[^,]*$/;if(!t.test(e)){throw new ValidationError(`Key Validation Error: ${e} cannot contain commas.`)}}function isFeatureAvailable(){return!!process.env["ACTIONS_CACHE_URL"]}t.isFeatureAvailable=isFeatureAvailable;function restoreCache(e,t,r,i,n=false){return a(this,void 0,void 0,(function*(){checkPaths(e);r=r||[];const s=[t,...r];o.debug("Resolved Keys:");o.debug(JSON.stringify(s));if(s.length>10){throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`)}for(const e of s){checkKey(e)}const a=yield c.getCompressionMethod();let A="";try{const t=yield p.getCacheEntry(s,e,{compressionMethod:a,enableCrossOsArchive:n});if(!(t===null||t===void 0?void 0:t.archiveLocation)){return undefined}if(i===null||i===void 0?void 0:i.lookupOnly){o.info("Lookup only - skipping download");return t.cacheKey}A=l.join(yield c.createTempDirectory(),c.getCacheFileName(a));o.debug(`Archive Path: ${A}`);yield p.downloadCache(t.archiveLocation,A,i);if(o.isDebug()){yield(0,d.listTar)(A,a)}const r=c.getArchiveFileSizeInBytes(A);o.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);yield(0,d.extractTar)(A,a);o.info("Cache restored successfully");return t.cacheKey}catch(e){const t=e;if(t.name===ValidationError.name){throw e}else{o.warning(`Failed to restore: ${e.message}`)}}finally{try{yield c.unlinkFile(A)}catch(e){o.debug(`Failed to delete archive: ${e}`)}}return undefined}))}t.restoreCache=restoreCache;function saveCache(e,t,r,i=false){var n,s,A,u,m;return a(this,void 0,void 0,(function*(){checkPaths(e);checkKey(t);const a=yield c.getCompressionMethod();let g=-1;const h=yield c.resolvePaths(e);o.debug("Cache Paths:");o.debug(`${JSON.stringify(h)}`);if(h.length===0){throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`)}const E=yield c.createTempDirectory();const y=l.join(E,c.getCacheFileName(a));o.debug(`Archive Path: ${y}`);try{yield(0,d.createTar)(E,h,a);if(o.isDebug()){yield(0,d.listTar)(y,a)}const l=10*1024*1024*1024;const C=c.getArchiveFileSizeInBytes(y);o.debug(`File Size: ${C}`);if(C>l&&!c.isGhes()){throw new Error(`Cache size of ~${Math.round(C/(1024*1024))} MB (${C} B) is over the 10GB limit, not saving cache.`)}o.debug("Reserving Cache");const b=yield p.reserveCache(t,e,{compressionMethod:a,enableCrossOsArchive:i,cacheSize:C});if((n=b===null||b===void 0?void 0:b.result)===null||n===void 0?void 0:n.cacheId){g=(s=b===null||b===void 0?void 0:b.result)===null||s===void 0?void 0:s.cacheId}else if((b===null||b===void 0?void 0:b.statusCode)===400){throw new Error((u=(A=b===null||b===void 0?void 0:b.error)===null||A===void 0?void 0:A.message)!==null&&u!==void 0?u:`Cache size of ~${Math.round(C/(1024*1024))} MB (${C} B) is over the data cap limit, not saving cache.`)}else{throw new ReserveCacheError(`Unable to reserve cache with key ${t}, another job may be creating this cache. More details: ${(m=b===null||b===Line truncated
|
import './sourcemap-register.cjs';import{createRequire as i}from"module";var u={23311:function(i,u){var p=this&&this.__awaiter||function(i,u,p,A){function adopt(i){return i instanceof p?i:new p((function(u){u(i)}))}return new(p||(p=Promise))((function(p,g){function fulfilled(i){try{step(A.next(i))}catch(i){g(i)}}function rejected(i){try{step(A["throw"](i))}catch(i){g(i)}}function step(i){i.done?p(i.value):adopt(i.value).then(fulfilled,rejected)}step((A=A.apply(i,u||[])).next())}))};Object.defineProperty(u,"__esModule",{value:true});u.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(i,u,p,A,g,C,S){this.method=i;this.requestHeaders=u;this.requests=p;this.headers=A;this.response=g;this.status=C;this.trailers=S}then(i,u){return this.promiseFinished().then((u=>i?Promise.resolve(i(u)):u),(i=>u?Promise.resolve(u(i)):Promise.reject(i)))}promiseFinished(){return p(this,void 0,void 0,(function*(){let[i,u,p,A]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:i,response:u,status:p,trailers:A}}))}}u.ClientStreamingCall=ClientStreamingCall},69499:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.Deferred=u.DeferredState=void 0;var p;(function(i){i[i["PENDING"]=0]="PENDING";i[i["REJECTED"]=1]="REJECTED";i[i["RESOLVED"]=2]="RESOLVED"})(p=u.DeferredState||(u.DeferredState={}));class Deferred{constructor(i=true){this._state=p.PENDING;this._promise=new Promise(((i,u)=>{this._resolve=i;this._reject=u}));if(i){this._promise.catch((i=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(i){if(this.state!==p.PENDING)throw new Error(`cannot resolve ${p[this.state].toLowerCase()}`);this._resolve(i);this._state=p.RESOLVED}reject(i){if(this.state!==p.PENDING)throw new Error(`cannot reject ${p[this.state].toLowerCase()}`);this._reject(i);this._state=p.REJECTED}resolvePending(i){if(this._state===p.PENDING)this.resolve(i)}rejectPending(i){if(this._state===p.PENDING)this.reject(i)}}u.Deferred=Deferred},40800:function(i,u){var p=this&&this.__awaiter||function(i,u,p,A){function adopt(i){return i instanceof p?i:new p((function(u){u(i)}))}return new(p||(p=Promise))((function(p,g){function fulfilled(i){try{step(A.next(i))}catch(i){g(i)}}function rejected(i){try{step(A["throw"](i))}catch(i){g(i)}}function step(i){i.done?p(i.value):adopt(i.value).then(fulfilled,rejected)}step((A=A.apply(i,u||[])).next())}))};Object.defineProperty(u,"__esModule",{value:true});u.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(i,u,p,A,g,C,S){this.method=i;this.requestHeaders=u;this.requests=p;this.headers=A;this.responses=g;this.status=C;this.trailers=S}then(i,u){return this.promiseFinished().then((u=>i?Promise.resolve(i(u)):u),(i=>u?Promise.resolve(u(i)):Promise.reject(i)))}promiseFinished(){return p(this,void 0,void 0,(function*(){let[i,u,p]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:i,status:u,trailers:p}}))}}u.DuplexStreamingCall=DuplexStreamingCall},76762:(i,u,p)=>{var A;A={value:true};var g=p(42554);Object.defineProperty(u,"C0",{enumerable:true,get:function(){return g.ServiceType}});var C=p(83402);A={enumerable:true,get:function(){return C.readMethodOptions}};A={enumerable:true,get:function(){return C.readMethodOption}};A={enumerable:true,get:function(){return C.readServiceOption}};var S=p(50422);A={enumerable:true,get:function(){return S.RpcError}};var w=p(63474);A={enumerable:true,get:function(){return w.mergeRpcOptions}};var B=p(58788);A={enumerable:true,get:function(){return B.RpcOutputStreamController}};var v=p(37816);A={enumerable:true,get:function(){return v.TestTransport}};var N=p(69499);A={enumerable:true,get:function(){return N.Deferred}};A={enumerable:true,get:function(){return N.DeferredState}};var T=p(40800);A={enumerable:true,get:function(){return T.DuplexStreamingCall}};var Q=p(23311);A={enumerable:true,get:function(){return Q.ClientStreamingCall}};var x=p(22715);A={enumerable:true,get:function(){return x.ServerStreamingCall}};var _=p(80738);A={enumerable:true,get:function(){return _.UnaryCall}};var k=p(84359);A={enumerable:true,get:function(){return k.stackIntercept}};A={enumerable:true,get:function(){return k.stackDuplexStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackClientStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackServerStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackUnaryInterceptors}};var O=p(44626);A={enumerable:true,get:function(){return O.ServerCallContextController}}},83402:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.readServiceOption=u.readMethodOption=u.readMethodOptions=u.normalizeMethodInfo=void 0;const A=p(88372);function normalizeMethodInfo(i,u){var p,g,C;let S=i;S.service=u;S.localName=(p=S.localName)!==null&&p!==void 0?p:A.lowerCamelCase(S.name);S.serverStreaming=!!S.serverStreaming;S.Line truncated
|
||||||
/*!
|
/**
|
||||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
* @preserve
|
||||||
|
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
||||||
* Released under the MIT License.
|
* @see http://github.com/homebrewing/brauhaus-diff
|
||||||
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},1917:(e,t,r)=>{"use strict";var i=r(1161);var n=r(8866);function renamed(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. "+"Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=r(6073);e.exports.Schema=r(1082);e.exports.FAILSAFE_SCHEMA=r(8562);e.exports.JSON_SCHEMA=r(1035);e.exports.CORE_SCHEMA=r(2011);e.exports.DEFAULT_SCHEMA=r(8759);e.exports.load=i.load;e.exports.loadAll=i.loadAll;e.exports.dump=n.dump;e.exports.YAMLException=r(8179);e.exports.types={binary:r(7900),float:r(2705),map:r(6150),null:r(721),pairs:r(6860),set:r(9548),timestamp:r(9212),bool:r(4993),int:r(1615),merge:r(6104),omap:r(9046),seq:r(7283),str:r(3619)};e.exports.safeLoad=renamed("safeLoad","load");e.exports.safeLoadAll=renamed("safeLoadAll","loadAll");e.exports.safeDump=renamed("safeDump","dump")},6829:e=>{"use strict";function isNothing(e){return typeof e==="undefined"||e===null}function isObject(e){return typeof e==="object"&&e!==null}function toArray(e){if(Array.isArray(e))return e;else if(isNothing(e))return[];return[e]}function extend(e,t){var r,i,n,s;if(t){s=Object.keys(t);for(r=0,i=s.length;r<i;r+=1){n=s[r];e[n]=t[n]}}return e}function repeat(e,t){var r="",i;for(i=0;i<t;i+=1){r+=e}return r}function isNegativeZero(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}e.exports.isNothing=isNothing;e.exports.isObject=isObject;e.exports.toArray=toArray;e.exports.repeat=repeat;e.exports.isNegativeZero=isNegativeZero;e.exports.extend=extend},8866:(e,t,r)=>{"use strict";var i=r(6829);var n=r(8179);var s=r(8759);var a=Object.prototype.toString;var o=Object.prototype.hasOwnProperty;var l=65279;var c=9;var p=10;var d=13;var A=32;var u=33;var m=34;var g=35;var h=37;var E=38;var y=39;var C=42;var b=44;var I=45;var B=58;var v=61;var Q=62;var w=63;var x=64;var S=91;var N=93;var R=96;var D=123;var T=124;var _=125;var k={};k[0]="\\0";k[7]="\\a";k[8]="\\b";k[9]="\\t";k[10]="\\n";k[11]="\\v";k[12]="\\f";k[13]="\\r";k[27]="\\e";k[34]='\\"';k[92]="\\\\";k[133]="\\N";k[160]="\\_";k[8232]="\\L";k[8233]="\\P";var O=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var P=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(e,t){var r,i,n,s,a,l,c;if(t===null)return{};r={};i=Object.keys(t);for(n=0,s=i.length;n<s;n+=1){a=i[n];l=String(t[a]);if(a.slice(0,2)==="!!"){a="tag:yaml.org,2002:"+a.slice(2)}c=e.compiledTypeMap["fallback"][a];if(c&&o.call(c.styleAliases,l)){l=c.styleAliases[l]}r[a]=l}return r}function encodeHex(e){var t,r,s;t=e.toString(16).toUpperCase();if(e<=255){r="x";s=2}else if(e<=65535){r="u";s=4}else if(e<=4294967295){r="U";s=8}else{throw new n("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+r+i.repeat("0",s-t.length)+t}var L=1,M=2;function State(e){this.schema=e["schema"]||s;this.indent=Math.max(1,e["indent"]||2);this.noArrayIndent=e["noArrayIndent"]||false;this.skipInvalid=e["skipInvalid"]||false;this.flowLevel=i.isNothing(e["flowLevel"])?-1:e["flowLevel"];this.styleMap=compileStyleMap(this.schema,e["styles"]||null);this.sortKeys=e["sortKeys"]||false;this.lineWidth=e["lineWidth"]||80;this.noRefs=e["noRefs"]||false;this.noCompatMode=e["noCompatMode"]||false;this.condenseFlow=e["condenseFlow"]||false;this.quotingType=e["quotingType"]==='"'?M:L;this.forceQuotes=e["forceQuotes"]||false;this.replacer=typeof e["replacer"]==="function"?e["replacer"]:null;this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function indentString(e,t){var r=i.repeat(" ",t),n=0,s=-1,a="",o,l=e.length;while(n<l){s=e.indexOf("\n",n);if(s===-1){o=e.slice(n);n=l}else{o=e.slice(n,s+1);n=s+1}if(o.length&&o!=="\n")a+=r;a+=o}return a}function generateNextLine(e,t){return"\n"+i.repeat(" ",e.indent*t)}function testImplicitResolving(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1){n=e.implicitTypes[r];if(n.resolve(t)){return true}}return false}function isWhitespace(e){return e===A||e===c}function isPrintable(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==l||65536<=e&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==l&&e!==d&&e!==p}function isPlainSafe(e,t,r){var i=isNsCharOrWhitespace(e);var n=i&&!isWhitespace(e);return(r?i:i&&e!==b&&e!==S&&e!==N&&e!==D&&e!==_)&&e!==g&&!(t===B&&!n)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===g||t===B&&n}function isPlainSafeFirst(e){return isPrintable(e)&&e!==l&&!isWhitespace(e)&&e!==I&&e!==w&&e!==B&&e!==b&&e!==S&&e!==N&&e!==D&&e!==_&&e!==g&&e!==E&&e!==C&&e!==u&&e!==T&&e!==v&&e!==Q&&e!=Line truncated
|
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
||||||
/*!
|
* @see http://github.com/garycourt/murmurhash-js
|
||||||
* mime-db
|
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
||||||
* Copyright(c) 2014 Jonathan Ong
|
* @see http://sites.google.com/site/murmurhash/
|
||||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
*/
|
||||||
e.exports=r(3765)},3583:(e,t,r)=>{"use strict";
|
(function(){var u;function MurmurHash3(i,p){var A=this instanceof MurmurHash3?this:u;A.reset(p);if(typeof i==="string"&&i.length>0){A.hash(i)}if(A!==this){return A}}MurmurHash3.prototype.hash=function(i){var u,p,A,g,C;C=i.length;this.len+=C;p=this.k1;A=0;switch(this.rem){case 0:p^=C>A?i.charCodeAt(A++)&65535:0;case 1:p^=C>A?(i.charCodeAt(A++)&65535)<<8:0;case 2:p^=C>A?(i.charCodeAt(A++)&65535)<<16:0;case 3:p^=C>A?(i.charCodeAt(A)&255)<<24:0;p^=C>A?(i.charCodeAt(A++)&65280)>>8:0}this.rem=C+this.rem&3;C-=this.rem;if(C>0){u=this.h1;while(1){p=p*11601+(p&65535)*3432906752&4294967295;p=p<<15|p>>>17;p=p*13715+(p&65535)*461832192&4294967295;u^=p;u=u<<13|u>>>19;u=u*5+3864292196&4294967295;if(A>=C){break}p=i.charCodeAt(A++)&65535^(i.charCodeAt(A++)&65535)<<8^(i.charCodeAt(A++)&65535)<<16;g=i.charCodeAt(A++);p^=(g&255)<<24^(g&65280)>>8}p=0;switch(this.rem){case 3:p^=(i.charCodeAt(A+2)&65535)<<16;case 2:p^=(i.charCodeAt(A+1)&65535)<<8;case 1:p^=i.charCodeAt(A)&65535}this.h1=u}this.k1=p;return this};MurmurHash3.prototype.result=function(){var i,u;i=this.k1;u=this.h1;if(i>0){i=i*11601+(i&65535)*3432906752&4294967295;i=i<<15|i>>>17;i=i*13715+(i&65535)*461832192&4294967295;u^=i}u^=this.len;u^=u>>>16;u=u*51819+(u&65535)*2246770688&4294967295;u^=u>>>13;u=u*44597+(u&65535)*3266445312&4294967295;u^=u>>>16;return u>>>0};MurmurHash3.prototype.reset=function(i){this.h1=typeof i==="number"?i:0;this.rem=this.k1=this.len=0;return this};u=new MurmurHash3;if(true){i.exports=MurmurHash3}else{}})()},68850:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.AddressError=void 0;class AddressError extends Error{constructor(i,u){super(i);this.name="AddressError";if(u!==null){this.parseMessage=u}}}u.AddressError=AddressError},45864:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.isCorrect=u.isInSubnet=void 0;function isInSubnet(i){if(this.subnetMask<i.subnetMask){return false}if(this.mask(i.subnetMask)===i.mask()){return true}return false}u.isInSubnet=isInSubnet;function isCorrect(i){return function(){if(this.addressMinusSuffix!==this.correctForm()){return false}if(this.subnetMask===i&&!this.parsedSubnet){return true}return this.parsedSubnet===String(this.subnetMask)}}u.isCorrect=isCorrect},79253:function(i,u,p){var A=this&&this.__createBinding||(Object.create?function(i,u,p,A){if(A===undefined)A=p;var g=Object.getOwnPropertyDescriptor(u,p);if(!g||("get"in g?!u.__esModule:g.writable||g.configurable)){g={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,A,g)}:function(i,u,p,A){if(A===undefined)A=p;i[A]=u[p]});var g=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var C=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p in i)if(p!=="default"&&Object.prototype.hasOwnProperty.call(i,p))A(u,i,p);g(u,i);return u};Object.defineProperty(u,"__esModule",{value:true});u.v6=u.AddressError=u.Address6=u.Address4=void 0;const S=p(17946);Object.defineProperty(u,"Address4",{enumerable:true,get:function(){return S.Address4}});const w=p(38096);Object.defineProperty(u,"Address6",{enumerable:true,get:function(){return w.Address6}});const B=p(68850);Object.defineProperty(u,"AddressError",{enumerable:true,get:function(){return B.AddressError}});const v=C(p(20339));u.v6={helpers:v}},17946:function(i,u,p){var A=this&&this.__createBinding||(Object.create?function(i,u,p,A){if(A===undefined)A=p;var g=Object.getOwnPropertyDescriptor(u,p);if(!g||("get"in g?!u.__esModule:g.writable||g.configurable)){g={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,A,g)}:function(i,u,p,A){if(A===undefined)A=p;i[A]=u[p]});var g=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var C=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p in i)if(p!=="default"&&Object.prototype.hasOwnProperty.call(i,p))A(u,i,p);g(u,i);return u};Object.defineProperty(u,"__esModule",{value:true});u.Address4=void 0;const S=C(p(45864));const w=C(p(66437));const B=p(68850);const v=p(95947);const N=p(19973);class Address4{constructor(i){this.groups=w.GROUPS;this.parsedAddress=[];this.parsedSubnet="";this.subnet="/32";this.subnetMask=32;this.v4=true;this.isCorrect=S.isCorrect(w.BITS);this.isInSubnet=S.isInSubnet;this.address=i;const u=w.RE_SUBNET_STRING.exec(i);if(u){this.parsedSubnet=u[0].replace("/","");this.subnetMask=parseInt(this.parsedSubnet,10);this.subnet=`/${this.subnetMask}`;if(this.subnetMask<0||this.subnetMask>w.BITS){throw new B.AddressError("Invalid subnet mask.")}i=i.replace(w.RE_SUBNET_STRING,"")}this.addressMinusSuffix=i;this.parsedAddress=this.parse(i)}static isValid(i){try{new Address4(i);return true}catch(i){return false}}parse(i){const u=i.split(".");if(!i.match(w.RE_ADDRESS)){throw new B.AddressError("Invalid IPv4 address.")}return u}correctForLine truncated
|
||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright (c) 2010-2012 Mikeal Rogers
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an "AS
|
||||||
|
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||||
|
* express or implied. See the License for the specific language
|
||||||
|
* governing permissions and limitations under the License.
|
||||||
|
*/if(new S.URL(i.url).hostname!==w.hostname){i.headers.delete("authorization");i.headers.delete("cookie")}if(u.status===303||i.method==="POST"&&[301,302].includes(u.status)){A.method="GET";A.body=null;i.headers.delete("content-length")}A.headers={};i.headers.forEach(((i,u)=>{A.headers[u]=i}));A.counter=++i.counter;const B=new g(S.format(w),A);return{request:B,options:A}};const fetch=async(i,u)=>{const p=w.storable(i,u)?await B(i,u):await v(i,u);if(!["GET","HEAD"].includes(i.method)&&p.status>=200&&p.status<=399){await B.invalidate(i,u)}if(!canFollowRedirect(i,p,u)){return p}const A=getRedirect(i,p,u);return fetch(A.request,A.options)};i.exports=fetch},39310:(i,u,p)=>{const{FetchError:A,Headers:g,Request:C,Response:S}=p(88483);const w=p(99824);const B=p(67242);const makeFetchHappen=(i,u)=>{const p=w(u);const A=new C(i,p);return B(A,p)};makeFetchHappen.defaults=(i,u={},p=makeFetchHappen)=>{if(typeof i==="object"){u=i;i=null}const defaultedFetch=(A,g={})=>{const C=A||i;const S={...u,...g,headers:{...u.headers,...g.headers}};return p(C,S)};defaultedFetch.defaults=(i,u={})=>makeFetchHappen.defaults(i,u,defaultedFetch);return defaultedFetch};i.exports=makeFetchHappen;i.exports.FetchError=A;i.exports.Headers=g;i.exports.Request=C;i.exports.Response=S},99824:(i,u,p)=>{const A=p(72250);const g=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"];const configureOptions=i=>{const{strictSSL:u,...p}={...i};p.method=p.method?p.method.toUpperCase():"GET";if(u===undefined||u===null){p.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}else{p.rejectUnauthorized=u!==false}if(!p.retry){p.retry={retries:0}}else if(typeof p.retry==="string"){const i=parseInt(p.retry,10);if(isFinite(i)){p.retry={retries:i}}else{p.retry={retries:0}}}else if(typeof p.retry==="number"){p.retry={retries:p.retry}}else{p.retry={retries:0,...p.retry}}p.dns={ttl:5*60*1e3,lookup:A.lookup,...p.dns};p.cache=p.cache||"default";if(p.cache==="default"){const i=Object.keys(p.headers||{}).some((i=>g.includes(i.toLowerCase())));if(i){p.cache="no-store"}}p.cacheAdditionalHeaders=p.cacheAdditionalHeaders||[];if(p.cacheManager&&!p.cachePath){p.cachePath=p.cacheManager}return p};i.exports=configureOptions},22314:(i,u,p)=>{const A=p(52899);class CachingMinipassPipeline extends A{#a=[];#c=new Map;constructor(i,...u){super();this.#a=i.events;if(u.length){this.push(...u)}}on(i,u){if(this.#a.includes(i)&&this.#c.has(i)){return u(...this.#c.get(i))}return super.on(i,u)}emit(i,...u){if(this.#a.includes(i)){this.#c.set(i,u)}return super.emit(i,...u)}}i.exports=CachingMinipassPipeline},20766:(i,u,p)=>{const{Minipass:A}=p(78275);const g=p(88483);const{promiseRetry:C}=p(49498);const S=p(68951);const{log:w}=p(26687);const B=p(22314);const{getAgent:v}=p(57995);const N=p(96734);const T=`${N.name}/${N.version} (+https://npm.im/${N.name})`;const Q=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"];const x=["request-timeout"];const remoteFetch=(i,u)=>{const p=v(i.url,{...u,signal:undefined});if(!i.headers.has("connection")){i.headers.set("connection",p?"keep-alive":"close")}if(!i.headers.has("user-agent")){i.headers.set("user-agent",T)}const N={...u,agent:p,redirect:"manual"};return C((async(p,C)=>{const v=new g.Request(i,N);try{let i=await g(v,N);if(N.integrity&&i.status===200){const u=S.integrityStream({algorithms:N.algorithms,integrity:N.integrity,size:N.size});const p=new B({events:["integrity","size"]},i.body,u);u.on("integrity",(i=>p.emit("integrity",i)));u.on("size",(i=>p.emit("size",i)));i=new g.Response(p,i);i.body.hasIntegrityEmitter=true}i.headers.set("x-fetch-attempts",C);const T=A.isStream(v.body);const Q=v.method!=="POST"&&!T&&([408,420,429].includes(i.status)||i.status>=500);if(Q){if(typeof u.onRetry==="function"){u.onRetry(i)}w.http("fetch",`${v.method} ${v.url} attempt ${C} failed with ${i.status}`);return p(i)}return i}catch(i){const A=i.code==="EPROMISERETRY"?i.retried.code:i.code;const S=i.retried instanceof g.Response||Q.includes(A)&&x.includes(i.type);if(v.method==="POST"||S){throw i}if(typeof u.onRetry==="function"){u.onRetry(i)}w.http("fetch",`${v.method} ${v.url} attempt ${C} failed with ${i.code}`);return p(i)}}),u.retry).catch((i=>{if(i.status>=400&&i.type!=="system"){return i}throw i}))};i.exports=remoteFetch},43772:(i,u,p)=>{i.exports=minimatch;minimatch.Minimatch=Minimatch;var A=function(){try{return p(16928)}catch(i){}}()||{sep:"/"};minimatch.sep=A.sep;var g=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var C=p(73783);var S={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var w="[^/]";var B=w+"*?";var v="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var N="(?:(?!(?:\\/|^)\\.).)*?";var T=charSet("().*{}+?[]^$\\!");function charSet(i){return i.split("").reduce((function(i,u){i[u]=true;return i}),{})}var Q=/\/+/;minimatch.filter=filter;fu
Line truncated
|
||||||
/*!
|
/*!
|
||||||
* mime-types
|
* negotiator
|
||||||
* Copyright(c) 2014 Jonathan Ong
|
* Copyright(c) 2012 Federico Romero
|
||||||
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
||||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/var i=r(7426);var n=r(1017).extname;var s=/^\s*([^;\s]*)(?:;|\s|$)/;var a=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=s.exec(e);var r=t&&i[t[1].toLowerCase()];if(r&&r.charset){return r.charset}if(t&&a.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var r=e.indexOf("/")===-1?t.lookup(e):e;if(!r){return false}if(r.indexOf("charset")===-1){var i=t.charset(r);if(i)r+="; charset="+i.toLowerCase()}return r}function extension(e){if(!e||typeof e!=="string"){return false}var r=s.exec(e);var i=r&&t.extensions[r[1].toLowerCase()];if(!i||!i.length){return false}return i[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var r=n("x."+e).toLowerCase().substr(1);if(!r){return false}return t.types[r]||false}function populateMaps(e,t){var r=["nginx","apache",undefined,"iana"];Object.keys(i).forEach((function forEachMimeType(n){var s=i[n];var a=s.extensions;if(!a||!a.length){return}e[n]=a;for(var o=0;o<a.length;o++){var l=a[o];if(t[l]){var c=r.indexOf(i[t[l]].source);var p=r.indexOf(s.source);if(t[l]!=="application/octet-stream"&&(c>p||c===p&&t[l].substr(0,12)==="application/")){continue}}t[l]=n}}))}},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var i=function(){try{return r(1017)}catch(e){}}()||{sep:"/"};minimatch.sep=i.sep;var n=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var s=r(3717);var a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var o="[^/]";var l=o+"*?";var c="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var p="(?:(?!(?:\\/|^)\\.).)*?";var d=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var A=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,i,n){return minimatch(r,e,t)}}function ext(e,t){t=t||{};var r={};Object.keys(e).forEach((function(t){r[t]=e[t]}));Object.keys(t).forEach((function(e){r[e]=t[e]}));return r}minimatch.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}var t=minimatch;var r=function minimatch(r,i,n){return t(r,i,ext(e,n))};r.Minimatch=function Minimatch(r,i){return new t.Minimatch(r,ext(e,i))};r.Minimatch.defaults=function defaults(r){return t.defaults(ext(e,r)).Minimatch};r.filter=function filter(r,i){return t.filter(r,ext(e,i))};r.defaults=function defaults(r){return t.defaults(ext(e,r))};r.makeRe=function makeRe(r,i){return t.makeRe(r,ext(e,i))};r.braceExpand=function braceExpand(r,i){return t.braceExpand(r,ext(e,i))};r.match=function(r,i,n){return t.match(r,i,ext(e,n))};return r};Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){assertValidPattern(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}assertValidPattern(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&i.sep!=="/"){e=e.split(i.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(A)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);this.set=r}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern;var t=false;var r=this.options;var i=0;if(r.nonegate)return;for(var n=0,s=e.length;n<s&&e.charAt(n)==="!";n++){t=!t;i++}if(i)this.pattern=e.substr(i);this.negate=t}minimatch.braceExpand=function(e,t){return braceExpand(e,t)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(e,t){if(!t){if(this instanceof Minimatch){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;assertValidPattern(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return s(e)}var u=1024*64;var assertValidPattern=function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>u){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var m={};function parse(e,t){assertValidPattern(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return n;else e="*"}iLine truncated
|
*/
|
||||||
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var i=[];var n;var s;var a=-1;var o=arguments.length;if(!o){return""}var l="";while(++a<o){var c=Number(arguments[a]);if(!isFinite(c)||c<0||c>1114111||t(c)!==c){throw RangeError("Invalid code point: "+c)}if(c<=65535){i.push(c)}else{c-=65536;n=(c>>10)+55296;s=c%1024+56320;i.push(n,s)}if(a+1===o||i.length>r){l+=e.apply(null,i);i.length=0}}return l};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},5911:(e,t)=>{t=e.exports=SemVer;var r;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){r=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{r=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var i=256;var n=Number.MAX_SAFE_INTEGER||9007199254740991;var s=16;var a=i-6;var o=t.re=[];var l=t.safeRe=[];var c=t.src=[];var p=t.tokens={};var d=0;function tok(e){p[e]=d++}var A="[a-zA-Z0-9-]";var u=[["\\s",1],["\\d",i],[A,a]];function makeSafeRe(e){for(var t=0;t<u.length;t++){var r=u[t][0];var i=u[t][1];e=e.split(r+"*").join(r+"{0,"+i+"}").split(r+"+").join(r+"{1,"+i+"}")}return e}tok("NUMERICIDENTIFIER");c[p.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");c[p.NUMERICIDENTIFIERLOOSE]="\\d+";tok("NONNUMERICIDENTIFIER");c[p.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+A+"*";tok("MAINVERSION");c[p.MAINVERSION]="("+c[p.NUMERICIDENTIFIER]+")\\."+"("+c[p.NUMERICIDENTIFIER]+")\\."+"("+c[p.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");c[p.MAINVERSIONLOOSE]="("+c[p.NUMERICIDENTIFIERLOOSE]+")\\."+"("+c[p.NUMERICIDENTIFIERLOOSE]+")\\."+"("+c[p.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");c[p.PRERELEASEIDENTIFIER]="(?:"+c[p.NUMERICIDENTIFIER]+"|"+c[p.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");c[p.PRERELEASEIDENTIFIERLOOSE]="(?:"+c[p.NUMERICIDENTIFIERLOOSE]+"|"+c[p.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");c[p.PRERELEASE]="(?:-("+c[p.PRERELEASEIDENTIFIER]+"(?:\\."+c[p.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");c[p.PRERELEASELOOSE]="(?:-?("+c[p.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+c[p.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");c[p.BUILDIDENTIFIER]=A+"+";tok("BUILD");c[p.BUILD]="(?:\\+("+c[p.BUILDIDENTIFIER]+"(?:\\."+c[p.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");c[p.FULLPLAIN]="v?"+c[p.MAINVERSION]+c[p.PRERELEASE]+"?"+c[p.BUILD]+"?";c[p.FULL]="^"+c[p.FULLPLAIN]+"$";tok("LOOSEPLAIN");c[p.LOOSEPLAIN]="[v=\\s]*"+c[p.MAINVERSIONLOOSE]+c[p.PRERELEASELOOSE]+"?"+c[p.BUILD]+"?";tok("LOOSE");c[p.LOOSE]="^"+c[p.LOOSEPLAIN]+"$";tok("GTLT");c[p.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");c[p.XRANGEIDENTIFIERLOOSE]=c[p.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");c[p.XRANGEIDENTIFIER]=c[p.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");c[p.XRANGEPLAIN]="[v=\\s]*("+c[p.XRANGEIDENTIFIER]+")"+"(?:\\.("+c[p.XRANGEIDENTIFIER]+")"+"(?:\\.("+c[p.XRANGEIDENTIFIER]+")"+"(?:"+c[p.PRERELEASE]+")?"+c[p.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");c[p.XRANGEPLAINLOOSE]="[v=\\s]*("+c[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+c[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+c[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+c[p.PRERELEASELOOSE]+")?"+c[p.BUILD]+"?"+")?)?";tok("XRANGE");c[p.XRANGE]="^"+c[p.GTLT]+"\\s*"+c[p.XRANGEPLAIN]+"$";tok("XRANGELOOSE");c[p.XRANGELOOSE]="^"+c[p.GTLT]+"\\s*"+c[p.XRANGEPLAINLOOSE]+"$";tok("COERCE");c[p.COERCE]="(^|[^\\d])"+"(\\d{1,"+s+"})"+"(?:\\.(\\d{1,"+s+"}))?"+"(?:\\.(\\d{1,"+s+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");o[p.COERCERTL]=new RegExp(c[p.COERCE],"g");l[p.COERCERTL]=new RegExp(makeSafeRe(c[p.COERCE]),"g");tok("LONETILDE");c[p.LONETILDE]="(?:~>?)";tok("TILDETRIM");c[p.TILDETRIM]="(\\s*)"+c[p.LONETILDE]+"\\s+";o[p.TILDETRIM]=new RegExp(c[p.TILDETRIM],"g");l[p.TILDETRIM]=new RegExp(makeSafeRe(c[p.TILDETRIM]),"g");var m="$1~";tok("TILDE");c[p.TILDE]="^"+c[p.LONETILDE]+c[p.XRANGEPLAIN]+"$";tok("TILDELOOSE");c[p.TILDELOOSE]="^"+c[p.LONETILDE]+c[p.XRANGEPLAINLOOSE]+"$";tok("LONECARET");c[p.LONECARET]="(?:\\^)";tok("CARETTRIM");c[p.CARETTRIM]="(\\s*)"+c[p.LONECARET]+"\\s+";o[p.CARETTRIM]=new RegExp(c[p.CARETTRIM],"g");l[p.CARETTRIM]=new RegExp(makeSafeRe(c[p.CARETTRIM]),"g");var g="$1^";tok("CARET");c[p.CARET]="^"+c[p.LONECARET]+c[p.XRANGEPLAIN]+"$";tok("CARETLOOSE");c[p.CARETLOOSE]="^"+c[p.LONECARET]+c[p.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");c[p.COMPARATORLOOSE]="^"+c[p.GTLT]+"\\s*("+c[p.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");c[p.COMPARATOR]="^"+c[p.GTLT]+"\\s*("+c[p.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");c[p.COMPARATORTRIM]="(\\s*)"+c[p.GTLT]+"\\s*("+c[p.LOOSEPLAIN]+"|"+c[p.XRANGEPLAIN]+")";o[p.COMPARATORTRIM]=new RegExp(c[p.COMPARATORTRIM],"g");l[p.COMPARATORTRIM]=new RegExp(makeSafeRe(c[p.COMPARATORTRIM]),"g");var h="$1$2$3";tok("HYPLine truncated
|
var A=p(79168);var g=p(25111);var C=p(56008);var S=p(53672);i.exports=Negotiator;i.exports.Negotiator=Negotiator;function Negotiator(i){if(!(this instanceof Negotiator)){return new Negotiator(i)}this.request=i}Negotiator.prototype.charset=function charset(i){var u=this.charsets(i);return u&&u[0]};Negotiator.prototype.charsets=function charsets(i){return A(this.request.headers["accept-charset"],i)};Negotiator.prototype.encoding=function encoding(i,u){var p=this.encodings(i,u);return p&&p[0]};Negotiator.prototype.encodings=function encodings(i,u){var p=u||{};return g(this.request.headers["accept-encoding"],i,p.preferred)};Negotiator.prototype.language=function language(i){var u=this.languages(i);return u&&u[0]};Negotiator.prototype.languages=function languages(i){return C(this.request.headers["accept-language"],i)};Negotiator.prototype.mediaType=function mediaType(i){var u=this.mediaTypes(i);return u&&u[0]};Negotiator.prototype.mediaTypes=function mediaTypes(i){return S(this.request.headers.accept,i)};Negotiator.prototype.preferredCharset=Negotiator.prototype.charset;Negotiator.prototype.preferredCharsets=Negotiator.prototype.charsets;Negotiator.prototype.preferredEncoding=Negotiator.prototype.encoding;Negotiator.prototype.preferredEncodings=Negotiator.prototype.encodings;Negotiator.prototype.preferredLanguage=Negotiator.prototype.language;Negotiator.prototype.preferredLanguages=Negotiator.prototype.languages;Negotiator.prototype.preferredMediaType=Negotiator.prototype.mediaType;Negotiator.prototype.preferredMediaTypes=Negotiator.prototype.mediaTypes},79168:i=>{i.exports=preferredCharsets;i.exports.preferredCharsets=preferredCharsets;var u=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptCharset(i){var u=i.split(",");for(var p=0,A=0;p<u.length;p++){var g=parseCharset(u[p].trim(),p);if(g){u[A++]=g}}u.length=A;return u}function parseCharset(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=1;if(A[2]){var S=A[2].split(";");for(var w=0;w<S.length;w++){var B=S[w].trim().split("=");if(B[0]==="q"){C=parseFloat(B[1]);break}}}return{charset:g,q:C,i:p}}function getCharsetPriority(i,u,p){var A={o:-1,q:0,s:0};for(var g=0;g<u.length;g++){var C=specify(i,u[g],p);if(C&&(A.s-C.s||A.q-C.q||A.o-C.o)<0){A=C}}return A}function specify(i,u,p){var A=0;if(u.charset.toLowerCase()===i.toLowerCase()){A|=1}else if(u.charset!=="*"){return null}return{i:p,o:u.i,q:u.q,s:A}}function preferredCharsets(i,u){var p=parseAcceptCharset(i===undefined?"*":i||"");if(!u){return p.filter(isQuality).sort(compareSpecs).map(getFullCharset)}var A=u.map((function getPriority(i,u){return getCharsetPriority(i,p,u)}));return A.filter(isQuality).sort(compareSpecs).map((function getCharset(i){return u[A.indexOf(i)]}))}function compareSpecs(i,u){return u.q-i.q||u.s-i.s||i.o-u.o||i.i-u.i||0}function getFullCharset(i){return i.charset}function isQuality(i){return i.q>0}},25111:i=>{i.exports=preferredEncodings;i.exports.preferredEncodings=preferredEncodings;var u=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptEncoding(i){var u=i.split(",");var p=false;var A=1;for(var g=0,C=0;g<u.length;g++){var S=parseEncoding(u[g].trim(),g);if(S){u[C++]=S;p=p||specify("identity",S);A=Math.min(A,S.q||1)}}if(!p){u[C++]={encoding:"identity",q:A,i:g}}u.length=C;return u}function parseEncoding(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=1;if(A[2]){var S=A[2].split(";");for(var w=0;w<S.length;w++){var B=S[w].trim().split("=");if(B[0]==="q"){C=parseFloat(B[1]);break}}}return{encoding:g,q:C,i:p}}function getEncodingPriority(i,u,p){var A={encoding:i,o:-1,q:0,s:0};for(var g=0;g<u.length;g++){var C=specify(i,u[g],p);if(C&&(A.s-C.s||A.q-C.q||A.o-C.o)<0){A=C}}return A}function specify(i,u,p){var A=0;if(u.encoding.toLowerCase()===i.toLowerCase()){A|=1}else if(u.encoding!=="*"){return null}return{encoding:i,i:p,o:u.i,q:u.q,s:A}}function preferredEncodings(i,u,p){var A=parseAcceptEncoding(i||"");var g=p?function comparator(i,u){if(i.q!==u.q){return u.q-i.q}var A=p.indexOf(i.encoding);var g=p.indexOf(u.encoding);if(A===-1&&g===-1){return u.s-i.s||i.o-u.o||i.i-u.i}if(A!==-1&&g!==-1){return A-g}return A===-1?1:-1}:compareSpecs;if(!u){return A.filter(isQuality).sort(g).map(getFullEncoding)}var C=u.map((function getPriority(i,u){return getEncodingPriority(i,A,u)}));return C.filter(isQuality).sort(g).map((function getEncoding(i){return u[C.indexOf(i)]}))}function compareSpecs(i,u){return u.q-i.q||u.s-i.s||i.o-u.o||i.i-u.i}function getFullEncoding(i){return i.encoding}function isQuality(i){return i.q>0}},56008:i=>{i.exports=preferredLanguages;i.exports.preferredLanguages=preferredLanguages;var u=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function parseAcceptLanguage(i){var u=i.split(",");for(var p=0,A=0;p<u.length;p++){var g=parseLanguage(u[p].trim(),p);if(g){u[A++]=g}}u.length=A;return u}function parseLanguage(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=A[2];var S=g;if(C)S+="-"+C;var w=1;if(A[3]){var B=A[3].split(";");for(var v=0;v<B.length;v++){var N=B[v].split(Line truncated
|
||||||
/*!
|
/*!
|
||||||
* Tmp
|
* Tmp
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||||
*
|
*
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/const g=p(79896);const C=p(70857);const S=p(16928);const w=p(76982);const B={fs:g.constants,os:C.constants};const v="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",N=/XXXXXX/,T=3,Q=(B.O_CREAT||B.fs.O_CREAT)|(B.O_EXCL||B.fs.O_EXCL)|(B.O_RDWR||B.fs.O_RDWR),x=C.platform()==="win32",_=B.EBADF||B.os.errno.EBADF,k=B.ENOENT||B.os.errno.ENOENT,O=448,D=384,P="exit",L=[],U=g.rmdirSync.bind(g);let H=false;function rimraf(i,u){return g.rm(i,{recursive:true},u)}function FN_RIMRAF_SYNC(i){return g.rmSync(i,{recursive:true})}function tmpName(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];_assertAndSanitizeOptions(A,(function(i,u){if(i)return C(i);let p=u.tries;(function _getUniqueName(){try{const i=_generateTmpName(u);g.stat(i,(function(u){if(!u){if(p-- >0)return _getUniqueName();return C(new Error("Could not get a unique tmp filename, max tries reached "+i))}C(null,i)}))}catch(i){C(i)}})()}))}function tmpNameSync(i){const u=_parseArguments(i),p=u[0];const A=_assertAndSanitizeOptionsSync(p);let C=A.tries;do{const i=_generateTmpName(A);try{g.statSync(i)}catch(u){return i}}while(C-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];tmpName(A,(function _tmpNameCreated(i,u){if(i)return C(i);g.open(u,Q,A.mode||D,(function _fileCreated(i,p){if(i)return C(i);if(A.discardDescriptor){return g.close(p,(function _discardCallback(i){return C(i,u,undefined,_prepareTmpFileRemoveCallback(u,-1,A,false))}))}else{const i=A.discardDescriptor||A.detachDescriptor;C(null,u,p,_prepareTmpFileRemoveCallback(u,i?-1:p,A,false))}}))}))}function fileSync(i){const u=_parseArguments(i),p=u[0];const A=p.discardDescriptor||p.detachDescriptor;const C=tmpNameSync(p);let S=g.openSync(C,Q,p.mode||D);if(p.discardDescriptor){g.closeSync(S);S=undefined}return{name:C,fd:S,removeCallback:_prepareTmpFileRemoveCallback(C,A?-1:S,p,true)}}function dir(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];tmpName(A,(function _tmpNameCreated(i,u){if(i)return C(i);g.mkdir(u,A.mode||O,(function _dirCreated(i){if(i)return C(i);C(null,u,_prepareTmpDirRemoveCallback(u,A,false))}))}))}function dirSync(i){const u=_parseArguments(i),p=u[0];const A=tmpNameSync(p);g.mkdirSync(A,p.mode||O);return{name:A,removeCallback:_prepareTmpDirRemoveCallback(A,p,true)}}function _removeFileAsync(i,u){const _handler=function(i){if(i&&!_isENOENT(i)){return u(i)}u()};if(0<=i[0])g.close(i[0],(function(){g.unlink(i[1],_handler)}));else g.unlink(i[1],_handler)}function _removeFileSync(i){let u=null;try{if(0<=i[0])g.closeSync(i[0])}catch(i){if(!_isEBADF(i)&&!_isENOENT(i))throw i}finally{try{g.unlinkSync(i[1])}catch(i){if(!_isENOENT(i))u=i}}if(u!==null){throw u}}function _prepareTmpFileRemoveCallback(i,u,p,A){const g=_prepareRemoveCallback(_removeFileSync,[u,i],A);const C=_prepareRemoveCallback(_removeFileAsync,[u,i],A,g);if(!p.keep)L.unshift(g);return A?g:C}function _prepareTmpDirRemoveCallback(i,u,p){const A=u.unsafeCleanup?rimraf:g.rmdir.bind(g);const C=u.unsafeCleanup?FN_RIMRAF_SYNC:U;const S=_prepareRemoveCallback(C,i,p);const w=_prepareRemoveCallback(A,i,p,S);if(!u.keep)L.unshift(S);return p?S:w}function _prepareRemoveCallback(i,u,p,A){let g=false;return function _cleanupCallback(C){if(!g){const S=A||_cleanupCallback;const w=L.indexOf(S);if(w>=0)L.splice(w,1);g=true;if(p||i===U||i===FN_RIMRAF_SYNC){return i(u)}else{return i(u,C||function(){})}}}}function _garbageCollector(){if(!H)return;while(L.length){try{L[0]()}catch(i){}}}function _randomChars(i){let u=[],p=null;try{p=w.randomBytes(i)}catch(u){p=w.pseudoRandomBytes(i)}for(let A=0;A<i;A++){u.push(v[p[A]%v.length])}return u.join("")}function _isUndefined(i){return typeof i==="undefined"}function _parseArguments(i,u){if(typeof i==="function"){return[{},i]}if(_isUndefined(i)){return[{},u]}const p={};for(const u of Object.getOwnPropertyNames(i)){p[u]=i[u]}return[p,u]}function _resolvePath(i,u,p){const A=S.isAbsolute(i)?i:S.join(u,i);g.stat(A,(function(i){if(i){g.realpath(S.dirname(A),(function(i,u){if(i)return p(i);p(null,S.join(u,S.basename(A)))}))}else{g.realpath(A,p)}}))}function _resolvePathSync(i,u){const p=S.isAbsolute(i)?i:S.join(u,i);try{g.statSync(p);return g.realpathSync(p)}catch(i){const u=g.realpathSync(S.dirname(p));return S.join(u,S.basename(p))}}function _generateTmpName(i){const u=i.tmpdir;if(!_isUndefined(i.name)){return S.join(u,i.dir,i.name)}if(!_isUndefined(i.template)){return S.join(u,i.dir,i.template).replace(N,_randomChars(6))}const p=[i.prefix?i.prefix:"tmp","-",process.pid,"-",_randomChars(12),i.postfix?"-"+i.postfix:""].join("");return S.join(u,i.dir,p)}function _assertOptionsBase(i){if(!_isUndefined(i.name)){const u=i.name;if(S.isAbsolute(u))throw new Error(`name option must not contain an absolute path, found "${u}".`);const p=S.basename(u);if(p===".."||p==="."||p!==u)throw new Error(`name option must not contain a path, found "${u}".`)}if(!_isUndefined(i.template)&&!i.template.match(N)){throw new Error(`Invalid teLine truncated
|
||||||
const i=r(7147);const n=r(2037);const s=r(1017);const a=r(6113);const o={fs:i.constants,os:n.constants};const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c=/XXXXXX/,p=3,d=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),A=n.platform()==="win32",u=o.EBADF||o.os.errno.EBADF,m=o.ENOENT||o.os.errno.ENOENT,g=448,h=384,E="exit",y=[],C=i.rmdirSync.bind(i);let b=false;function rimraf(e,t){return i.rm(e,{recursive:true},t)}function FN_RIMRAF_SYNC(e){return i.rmSync(e,{recursive:true})}function tmpName(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];try{_assertAndSanitizeOptions(n)}catch(e){return s(e)}let a=n.tries;(function _getUniqueName(){try{const e=_generateTmpName(n);i.stat(e,(function(t){if(!t){if(a-- >0)return _getUniqueName();return s(new Error("Could not get a unique tmp filename, max tries reached "+e))}s(null,e)}))}catch(e){s(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];_assertAndSanitizeOptions(r);let n=r.tries;do{const e=_generateTmpName(r);try{i.statSync(e)}catch(t){return e}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return s(e);i.open(t,d,n.mode||h,(function _fileCreated(e,r){if(e)return s(e);if(n.discardDescriptor){return i.close(r,(function _discardCallback(e){return s(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,n,false))}))}else{const e=n.discardDescriptor||n.detachDescriptor;s(null,t,r,_prepareTmpFileRemoveCallback(t,e?-1:r,n,false))}}))}))}function fileSync(e){const t=_parseArguments(e),r=t[0];const n=r.discardDescriptor||r.detachDescriptor;const s=tmpNameSync(r);var a=i.openSync(s,d,r.mode||h);if(r.discardDescriptor){i.closeSync(a);a=undefined}return{name:s,fd:a,removeCallback:_prepareTmpFileRemoveCallback(s,n?-1:a,r,true)}}function dir(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return s(e);i.mkdir(t,n.mode||g,(function _dirCreated(e){if(e)return s(e);s(null,t,_prepareTmpDirRemoveCallback(t,n,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const n=tmpNameSync(r);i.mkdirSync(n,r.mode||g);return{name:n,removeCallback:_prepareTmpDirRemoveCallback(n,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])i.close(e[0],(function(){i.unlink(e[1],_handler)}));else i.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])i.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{i.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,i){const n=_prepareRemoveCallback(_removeFileSync,[t,e],i);const s=_prepareRemoveCallback(_removeFileAsync,[t,e],i,n);if(!r.keep)y.unshift(n);return i?n:s}function _prepareTmpDirRemoveCallback(e,t,r){const n=t.unsafeCleanup?rimraf:i.rmdir.bind(i);const s=t.unsafeCleanup?FN_RIMRAF_SYNC:C;const a=_prepareRemoveCallback(s,e,r);const o=_prepareRemoveCallback(n,e,r,a);if(!t.keep)y.unshift(a);return r?a:o}function _prepareRemoveCallback(e,t,r,i){let n=false;return function _cleanupCallback(s){if(!n){const a=i||_cleanupCallback;const o=y.indexOf(a);if(o>=0)y.splice(o,1);n=true;if(r||e===C||e===FN_RIMRAF_SYNC){return e(t)}else{return e(t,s||function(){})}}}}function _garbageCollector(){if(!b)return;while(y.length){try{y[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=a.randomBytes(e)}catch(t){r=a.pseudoRandomBytes(e)}for(var i=0;i<e;i++){t.push(l[r[i]%l.length])}return t.join("")}function _isBlank(e){return e===null||_isUndefined(e)||!e.trim()}function _isUndefined(e){return typeof e==="undefined"}function _parseArguments(e,t){if(typeof e==="function"){return[{},e]}if(_isUndefined(e)){return[{},t]}const r={};for(const t of Object.getOwnPropertyNames(e)){r[t]=e[t]}return[r,t]}function _generateTmpName(e){const t=e.tmpdir;if(!_isUndefined(e.name))return s.join(t,e.dir,e.name);if(!_isUndefined(e.template))return s.join(t,e.dir,e.template).replace(c,_randomChars(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",_randomChars(12),e.postfix?"-"+e.postfix:""].join("");return s.join(t,e.dir,r)}function _assertAndSanitizeOptions(e){e.tmpdir=_getTmpDir(e);const t=e.tmpdir;if(!_isUndefined(e.name))_assertIsRelative(e.name,"name",t);if(!_isUndefined(e.dir))_assertIsRelative(e.dir,"dir",t);if(!_isUndefined(e.template)){_assertIsRelative(e.template,"template",t);if(!e.template.match(c))throw new Error(`Invalid template, found "${e.template}".`)}if(!_isUndefined(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=_isUndefined(e.name)?e.tries||p:1;e.keep=!!e.keep;e.detachDescriptor=!!e.detachDescriptor;e.discardDescriptor=!!e.discardDescriptor;e.unsafeCleanup=!!e.unsafeCleanup;e.dir=_isUndefined(e.dir)?"":s.relative(t,_resolvePath(e.dir,t));e.template=_isUndefined(e.template)?unLine truncated
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const A=[];const g=new Uint8Array([13,10]);N=0;let C=false;for(const[u,S]of i){if(typeof S==="string"){const i=j.encode(p+`; name="${escape(normalizeLinefeeds(u))}"`+`\r\n\r\n${normalizeLinefeeds(S)}\r\n`);A.push(i);N+=i.byteLength}else{const i=j.encode(`${p}; name="${escape(normalizeLinefeeds(u))}"`+(S.name?`; filename="${escape(S.name)}"`:"")+"\r\n"+`Content-Type: ${S.type||"application/octet-stream"}\r\n\r\n`);A.push(i,S,g);if(typeof S.size==="number"){N+=i.byteLength+S.size+g.byteLength}else{C=true}}}const S=j.encode(`--${u}--\r\n`);A.push(S);N+=S.byteLength;if(C){N=null}v=i;B=async function*(){for(const i of A){if(i.stream){yield*i.stream()}else{yield i}}};T=`multipart/form-data; boundary=${u}`}else if(C(i)){v=i;N=i.size;if(i.type){T=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(u){throw new TypeError("keepalive")}if(A.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}p=i instanceof ReadableStream?i:g(i)}if(typeof v==="string"||A.isBuffer(v)){N=Buffer.byteLength(v)}if(B!=null){let u;p=new ReadableStream({async start(){u=B(i)[Symbol.asyncIterator]()},async pull(i){const{value:A,done:g}=await u.next();if(g){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!D(p)){const u=new Uint8Array(A);if(u.byteLength){i.enqueue(u)}}}return i.desiredSize>0},async cancel(i){await u.return()},type:"bytes"})}const Q={stream:p,source:v,length:N};return[Q,T]}function safelyExtractBody(i,u=false){if(i instanceof ReadableStream){O(!A.isDisturbed(i),"The body has already been consumed.");O(!i.locked,"The stream is locked.")}return extractBody(i,u)}function cloneBody(i,u){const[p,A]=u.stream.tee();u.stream=p;return{stream:A,length:u.length,source:u.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const u={blob(){return consumeBody(this,(i=>{let u=bodyMimeType(this);if(u===null){u=""}else if(u){u=U(u)}return new k([i],{type:u})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,T,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const u=bodyMimeType(this);if(u!==null){switch(u.essence){case"multipart/form-data":{const p=H(i,u);if(p==="failure"){throw new TypeError("Failed to parse body as FormData.")}const A=new Q;A[x]=p;return A}case"application/x-www-form-urlencoded":{const u=new URLSearchParams(i.toString());const p=new Q;for(const[i,A]of u){p.append(i,A)}return p}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),i)},bytes(){return consumeBody(this,(i=>new Uint8Array(i)),i)}};return u}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,u,p){_.brandCheck(i,p);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[x]);const A=B();const errorSteps=i=>A.reject(i);const successSteps=i=>{try{A.resolve(u(i))}catch(i){errorSteps(i)}};if(i[x].body==null){successSteps(Buffer.allocUnsafe(0));return A.promise}await v(i[x].body,successSteps,errorSteps);return A.promise}function bodyUnusable(i){const u=i[x].body;return u!=null&&(u.stream.locked||A.isDisturbed(u.stream))}function parseJSONFromBytes(i){return JSON.parse(T(i))}function bodyMimeType(i){const u=i[x].headersList;const p=N(u);if(p==="failure"){return null}return p}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:$,hasFinalizationRegistry:q,bodyUnusable:bodyUnusable}},4495:i=>{const u=["GET","HEAD","POST"];const p=new Set(u);const A=[101,204,205,304];const g=[301,302,303,307,308];const C=new Set(g);const S=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const w=new Set(S);const B=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const v=new Set(B);const N=["follow","manual","error"];const T=["GET","HEAD","OPTIONS","TRACE"];const Q=new Set(T);const x=["navigate","same-origin","no-cors","cors"];const _=["omit","same-origin","include"];const k=["default","no-store","reload","no-cache","force-cLine truncated
|
||||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const i=[];const n=new Uint8Array([13,10]);d=0;let s=false;for(const[t,a]of e){if(typeof a==="string"){const e=N.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(a)}\r\n`);i.push(e);d+=e.byteLength}else{const e=N.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(a.name?`; filename="${escape(a.name)}"`:"")+"\r\n"+`Content-Type: ${a.type||"application/octet-stream"}\r\n\r\n`);i.push(e,a,n);if(typeof a.size==="number"){d+=e.byteLength+a.size+n.byteLength}else{s=true}}}const a=N.encode(`--${t}--`);i.push(a);d+=a.byteLength;if(s){d=null}p=e;c=async function*(){for(const e of i){if(e.stream){yield*e.stream()}else{yield e}}};A="multipart/form-data; boundary="+t}else if(a(e)){p=e;d=e.size;if(e.type){A=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(n.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}i=e instanceof x?e:s(e)}if(typeof p==="string"||n.isBuffer(p)){d=Buffer.byteLength(p)}if(c!=null){let t;i=new x({async start(){t=c(e)[Symbol.asyncIterator]()},async pull(e){const{value:r,done:n}=await t.next();if(n){queueMicrotask((()=>{e.close()}))}else{if(!b(i)){e.enqueue(new Uint8Array(r))}}return e.desiredSize>0},async cancel(e){await t.return()},type:undefined})}const u={stream:i,source:p,length:d};return[u,A]}function safelyExtractBody(e,t=false){if(!x){x=r(5356).ReadableStream}if(e instanceof x){C(!n.isDisturbed(e),"The body has already been consumed.");C(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e){const[t,r]=e.stream.tee();const i=g(r,{transfer:[r]});const[,n]=i.tee();e.stream=t;return{stream:n,length:e.length,source:e.source}}async function*consumeBody(e){if(e){if(I(e)){yield e}else{const t=e.stream;if(n.isDisturbed(t)){throw new TypeError("The body has already been consumed.")}if(t.locked){throw new TypeError("The stream is locked.")}t[y]=true;yield*t}}}function throwIfAborted(e){if(e.aborted){throw new m("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return specConsumeBody(this,(e=>{let t=bodyMimeType(this);if(t==="failure"){t=""}else if(t){t=w(t)}return new h([e],{type:t})}),e)},arrayBuffer(){return specConsumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return specConsumeBody(this,utf8DecodeBytes,e)},json(){return specConsumeBody(this,parseJSONFromBytes,e)},async formData(){u.brandCheck(this,e);throwIfAborted(this[A]);const t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){const e={};for(const[t,r]of this.headers)e[t.toLowerCase()]=r;const t=new d;let r;try{r=new i({headers:e,preservePath:true})}catch(e){throw new m(`${e}`,"AbortError")}r.on("field",((e,r)=>{t.append(e,r)}));r.on("file",((e,r,i,n,s)=>{const a=[];if(n==="base64"||n.toLowerCase()==="base64"){let n="";r.on("data",(e=>{n+=e.toString().replace(/[\r\n]/gm,"");const t=n.length-n.length%4;a.push(Buffer.from(n.slice(0,t),"base64"));n=n.slice(t)}));r.on("end",(()=>{a.push(Buffer.from(n,"base64"));t.append(e,new S(a,i,{type:s}))}))}else{r.on("data",(e=>{a.push(e)}));r.on("end",(()=>{t.append(e,new S(a,i,{type:s}))}))}}));const n=new Promise(((e,t)=>{r.on("finish",e);r.on("error",(e=>t(new TypeError(e))))}));if(this.body!==null)for await(const e of consumeBody(this[A].body))r.write(e);r.end();await n;return t}else if(/application\/x-www-form-urlencoded/.test(t)){let e;try{let t="";const r=new TextDecoder("utf-8",{ignoreBOM:true});for await(const e of consumeBody(this[A].body)){if(!I(e)){throw new TypeError("Expected Uint8Array chunk")}t+=r.decode(e,{stream:true})}t+=r.decode();e=new URLSearchParams(t)}catch(e){throw Object.assign(new TypeError,{cause:e})}const t=new d;for(const[r,i]of e){t.append(r,i)}return t}else{await Promise.resolve();throwIfAborted(this[A]);throw u.errors.exception({header:`${e.name}.formData`,message:"Could not parse content as FormData."})}}};return t}function mixinBody(e){Object.assign(e.prototype,bodyMixinMethods(e))}async function specConsumeBody(e,t,r){u.brandCheck(e,r);throwIfAborted(e[A]);if(bodyUnusable(e[A].body)){throw new TypeError("Body is unusable")}const i=c();const errorSteps=e=>i.reject(e);const successSteps=e=>{try{i.resolve(t(e))}catch(e){errorSteps(e)}};if(e[A].body==null){successSteps(new Uint8Array);return i.promise}await p(e[A].body,successSteps,errorSteps);return i.promise}function bodyUnusable(e){return e!=null&&(e.stream.locked||n.isDisturbed(e.stream))}function utf8DecodeBytes(e){if(e.length===0){return""}if(e[0]===239&&e[1]===187&&e[2]===191){e=e.subarray(3)}const t=R.decode(e);return t}function parseJSONFromBytes(e){return JSON.parse(utf8DecodeBytes(e))}function bodyMimeType(e){const{headersList:t}=e[A];const r=t.get("content-Line truncated
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */w[S-4]=p[0];w[S-3]=p[1];w[S-2]=p[2];w[S-1]=p[3];w[1]=C;if(C===126){w.writeUInt16BE(g,2)}else if(C===127){w[2]=w[3]=0;w.writeUIntBE(g,4,6)}w[1]|=128;for(let i=0;i<g;++i){w[S+i]=u[i]^p[i&3]}return w}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},19469:(i,u,p)=>{const{createInflateRaw:A,Z_DEFAULT_WINDOWBITS:g}=p(38522);const{isValidClientWindowBits:C}=p(98625);const S=Buffer.from([0,0,255,255]);const w=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#ce;#e={};constructor(i){this.#e.serverNoContextTakeover=i.has("server_no_context_takeover");this.#e.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,u,p){if(!this.#ce){let i=g;if(this.#e.serverMaxWindowBits){if(!C(this.#e.serverMaxWindowBits)){p(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#e.serverMaxWindowBits)}this.#ce=A({windowBits:i});this.#ce[w]=[];this.#ce[B]=0;this.#ce.on("data",(i=>{this.#ce[w].push(i);this.#ce[B]+=i.length}));this.#ce.on("error",(i=>{this.#ce=null;p(i)}))}this.#ce.write(i);if(u){this.#ce.write(S)}this.#ce.flush((()=>{const i=Buffer.concat(this.#ce[w],this.#ce[B]);this.#ce[w].length=0;this.#ce[B]=0;p(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},81652:(i,u,p)=>{const{Writable:A}=p(57075);const g=p(34589);const{parserStates:C,opcodes:S,states:w,emptyBuffer:B,sentCloseFrameState:v}=p(20736);const{kReadyState:N,kSentClose:T,kResponse:Q,kReceivedClose:x}=p(61216);const{channels:_}=p(42414);const{isValidStatusCode:k,isValidOpcode:O,failWebsocketConnection:D,websocketMessageReceived:P,utf8Decode:L,isControlFrame:U,isTextBinaryFrame:H,isContinuationFrame:z}=p(98625);const{WebsocketFrameSend:j}=p(3264);const{closeWebSocketConnection:q}=p(86897);const{PerMessageDeflate:$}=p(19469);class ByteParser extends A{#le=[];#ue=0;#de=false;#k=C.INFO;#he={};#pe=[];#fe;constructor(i,u){super();this.ws=i;this.#fe=u==null?new Map:u;if(this.#fe.has("permessage-deflate")){this.#fe.set("permessage-deflate",new $(u))}}_write(i,u,p){this.#le.push(i);this.#ue+=i.length;this.#de=true;this.run(p)}run(i){while(this.#de){if(this.#k===C.INFO){if(this.#ue<2){return i()}const u=this.consume(2);const p=(u[0]&128)!==0;const A=u[0]&15;const g=(u[1]&128)===128;const w=!p&&A!==S.CONTINUATION;const B=u[1]&127;const v=u[0]&64;const N=u[0]&32;const T=u[0]&16;if(!O(A)){D(this.ws,"Invalid opcode received");return i()}if(g){D(this.ws,"Frame cannot be masked");return i()}if(v!==0&&!this.#fe.has("permessage-deflate")){D(this.ws,"Expected RSV1 to be clear.");return}if(N!==0||T!==0){D(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(w&&!H(A)){D(this.ws,"Invalid frame type was fragmented.");return}if(H(A)&&this.#pe.length>0){D(this.ws,"Expected continuation frame");return}if(this.#he.fragmented&&w){D(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||w)&&U(A)){D(this.ws,"Control frame either too large or fragmented");return}if(z(A)&&this.#pe.length===0&&!this.#he.compressed){D(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#he.payloadLength=B;this.#k=C.READ_DATA}else if(B===126){this.#k=C.PAYLOADLENGTH_16}else if(B===127){this.#k=C.PAYLOADLENGTH_64}if(H(A)){this.#he.binaryType=A;this.#he.compressed=v!==0}this.#he.opcode=A;this.#he.masked=g;this.#he.fin=p;this.#he.fragmented=w}else if(this.#k===C.PAYLOADLENGTH_16){if(this.#ue<2){return i()}const u=this.consume(2);this.#he.payloadLength=u.readUInt16BE(0);this.#k=C.READ_DATA}else if(this.#k===C.PAYLOADLENGTH_64){if(this.#ue<8){return i()}const u=this.consume(8);const p=u.readUInt32BE(0);if(p>2**31-1){D(this.ws,"Received payload length > 2^31 bytes.");return}const A=u.readUInt32BE(4);this.#he.payloadLength=(p<<8)+A;this.#k=C.READ_DATA}else if(this.#k===C.READ_DATA){if(this.#ue<this.#he.payloadLength){return i()}const u=this.consume(this.#he.payloadLength);if(U(this.#he.opcode)){this.#de=this.parseControlFrame(u);this.#k=C.INFO}else{if(!this.#he.compressed){this.#pe.push(u);if(!this.#he.fragmented&&this.#he.fin){const i=Buffer.concat(this.#pe);P(this.ws,this.#he.binaryType,i);this.#pe.length=0}this.#k=C.INFO}else{this.#fe.get("permessage-deflate").decompress(u,this.#he.fin,((u,p)=>{if(u){q(this.ws,1007,u.message,u.message.length);return}this.#pe.push(p);if(!this.#he.fin){this.#k=C.INFO;this.#de=true;this.run(i);return}P(this.ws,this.#he.binaryType,Buffer.concat(this.#pe));this.#de=true;this.#k=C.INFO;this.#pe.length=0;this.run(i)}));this.#de=false;break}}}}}consume(i){if(i>this.#ue){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return B}if(this.#le[0].length===i){this.#ue-=this.#le[0].length;return this.#le.shift()}const u=Buffer.allocUnsafe(i);let p=0;while(p!==i){const A=this.#le[0];const{length:g}=A;if(g+p===i){u.set(this.#le.shift(),p);break}else if(g+p>i){u.set(A.subarray(0,i-p),p);this.#le[0]=A.subarray(i-p);break}else{u.set(this.#le.shift(),p);p+=A.length}}this.#ue-=i;return u}parseCloseBody(i){g(i.length!==1);let u;if(i.lengtLine truncated
|
||||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */s[n-4]=this.maskKey[0];s[n-3]=this.maskKey[1];s[n-2]=this.maskKey[2];s[n-1]=this.maskKey[3];s[1]=r;if(r===126){s.writeUInt16BE(t,2)}else if(r===127){s[2]=s[3]=0;s.writeUIntBE(t,4,6)}s[1]|=128;for(let e=0;e<t;e++){s[n+e]=this.frameData[e]^this.maskKey[e%4]}return s}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(e,t,r)=>{"use strict";const{Writable:i}=r(2781);const n=r(7643);const{parserStates:s,opcodes:a,states:o,emptyBuffer:l}=r(9188);const{kReadyState:c,kSentClose:p,kResponse:d,kReceivedClose:A}=r(7578);const{isValidStatusCode:u,failWebsocketConnection:m,websocketMessageReceived:g}=r(5515);const{WebsocketFrameSend:h}=r(5444);const E={};E.ping=n.channel("undici:websocket:ping");E.pong=n.channel("undici:websocket:pong");class ByteParser extends i{#a=[];#o=0;#l=s.INFO;#c={};#p=[];constructor(e){super();this.ws=e}_write(e,t,r){this.#a.push(e);this.#o+=e.length;this.run(r)}run(e){while(true){if(this.#l===s.INFO){if(this.#o<2){return e()}const t=this.consume(2);this.#c.fin=(t[0]&128)!==0;this.#c.opcode=t[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==a.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==a.BINARY&&this.#c.opcode!==a.TEXT){m(this.ws,"Invalid frame type was fragmented.");return}const r=t[1]&127;if(r<=125){this.#c.payloadLength=r;this.#l=s.READ_DATA}else if(r===126){this.#l=s.PAYLOADLENGTH_16}else if(r===127){this.#l=s.PAYLOADLENGTH_64}if(this.#c.fragmented&&r>125){m(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===a.PING||this.#c.opcode===a.PONG||this.#c.opcode===a.CLOSE)&&r>125){m(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===a.CLOSE){if(r===1){m(this.ws,"Received close frame with a 1-byte body.");return}const e=this.consume(r);this.#c.closeInfo=this.parseCloseBody(false,e);if(!this.ws[p]){const e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#c.closeInfo.code,0);const t=new h(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),(e=>{if(!e){this.ws[p]=true}}))}this.ws[c]=o.CLOSING;this.ws[A]=true;this.end();return}else if(this.#c.opcode===a.PING){const t=this.consume(r);if(!this.ws[A]){const e=new h(t);this.ws[d].socket.write(e.createFrame(a.PONG));if(E.ping.hasSubscribers){E.ping.publish({payload:t})}}this.#l=s.INFO;if(this.#o>0){continue}else{e();return}}else if(this.#c.opcode===a.PONG){const t=this.consume(r);if(E.pong.hasSubscribers){E.pong.publish({payload:t})}if(this.#o>0){continue}else{e();return}}}else if(this.#l===s.PAYLOADLENGTH_16){if(this.#o<2){return e()}const t=this.consume(2);this.#c.payloadLength=t.readUInt16BE(0);this.#l=s.READ_DATA}else if(this.#l===s.PAYLOADLENGTH_64){if(this.#o<8){return e()}const t=this.consume(8);const r=t.readUInt32BE(0);if(r>2**31-1){m(this.ws,"Received payload length > 2^31 bytes.");return}const i=t.readUInt32BE(4);this.#c.payloadLength=(r<<8)+i;this.#l=s.READ_DATA}else if(this.#l===s.READ_DATA){if(this.#o<this.#c.payloadLength){return e()}else if(this.#o>=this.#c.payloadLength){const e=this.consume(this.#c.payloadLength);this.#p.push(e);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===a.CONTINUATION){const e=Buffer.concat(this.#p);g(this.ws,this.#c.originalOpcode,e);this.#c={};this.#p.length=0}this.#l=s.INFO}}if(this.#o>0){continue}else{e();break}}}consume(e){if(e>this.#o){return null}else if(e===0){return l}if(this.#a[0].length===e){this.#o-=this.#a[0].length;return this.#a.shift()}const t=Buffer.allocUnsafe(e);let r=0;while(r!==e){const i=this.#a[0];const{length:n}=i;if(n+r===e){t.set(this.#a.shift(),r);break}else if(n+r>e){t.set(i.subarray(0,e-r),r);this.#a[0]=i.subarray(e-r);break}else{t.set(this.#a.shift(),r);r+=i.length}}this.#o-=e;return t}parseCloseBody(e,t){let r;if(t.length>=2){r=t.readUInt16BE(0)}if(e){if(!u(r)){return null}return{code:r}}let i=t.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191){i=i.subarray(3)}if(r!==undefined&&!u(r)){return null}try{i=new TextDecoder("utf-8",{fatal:true}).decode(i)}catch{return null}return{code:r,reason:i}}get closingInfo(){return this.#c.closeInfo}}e.exports={ByteParser:ByteParser}},7578:e=>{"use strict";e.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},5515:(e,t,r)=>{"use strict";const{kReadyState:i,kController:n,kResponse:s,kBinaryType:a,kWebSocketURL:o}=r(7578);const{states:l,opcodes:c}=r(9188);const{MessageEvent:p,ErrorEvent:d}=r(2611);function isEstablished(e){return e[i]===l.OPEN}function isClosing(e){return e[i]===l.CLOSING}function isClosed(e){return e[i]===l.CLOSED}function fireEvent(e,t,r=Event,i){const n=new r(e,i);t.dispatchEvent(n)}function websocketMessageReceived(e,t,r){if(e[i]!==l.OPEN){return}let n;if(t===c.TEXT){try{n=new TextDecoder("utf-8",{fatal:true}).decode(r)Line truncated
|
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
||||||
|
function isNothing(i){return typeof i==="undefined"||i===null}function isObject(i){return typeof i==="object"&&i!==null}function toArray(i){if(Array.isArray(i))return i;else if(isNothing(i))return[];return[i]}function extend(i,u){var p,A,g,C;if(u){C=Object.keys(u);for(p=0,A=C.length;p<A;p+=1){g=C[p];i[g]=u[g]}}return i}function repeat(i,u){var p="",A;for(A=0;A<u;A+=1){p+=i}return p}function isNegativeZero(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}var w=isNothing;var B=isObject;var v=toArray;var N=repeat;var T=isNegativeZero;var Q=extend;var x={isNothing:w,isObject:B,toArray:v,repeat:N,isNegativeZero:T,extend:Q};function formatError(i,u){var p="",A=i.reason||"(unknown reason)";if(!i.mark)return A;if(i.mark.name){p+='in "'+i.mark.name+'" '}p+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")";if(!u&&i.mark.snippet){p+="\n\n"+i.mark.snippet}return A+" "+p}function YAMLException$1(i,u){Error.call(this);this.name="YAMLException";this.reason=i;this.mark=u;this.message=formatError(this,false);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack||""}}YAMLException$1.prototype=Object.create(Error.prototype);YAMLException$1.prototype.constructor=YAMLException$1;YAMLException$1.prototype.toString=function toString(i){return this.name+": "+formatError(this,i)};var _=YAMLException$1;function getLine(i,u,p,A,g){var C="";var S="";var w=Math.floor(g/2)-1;if(A-u>w){C=" ... ";u=A-w+C.length}if(p-A>w){S=" ...";p=A+w-S.length}return{str:C+i.slice(u,p).replace(/\t/g,"→")+S,pos:A-u+C.length}}function padStart(i,u){return x.repeat(" ",u-i.length)+i}function makeSnippet(i,u){u=Object.create(u||null);if(!i.buffer)return null;if(!u.maxLength)u.maxLength=79;if(typeof u.indent!=="number")u.indent=1;if(typeof u.linesBefore!=="number")u.linesBefore=3;if(typeof u.linesAfter!=="number")u.linesAfter=2;var p=/\r?\n|\r|\0/g;var A=[0];var g=[];var C;var S=-1;while(C=p.exec(i.buffer)){g.push(C.index);A.push(C.index+C[0].length);if(i.position<=C.index&&S<0){S=A.length-2}}if(S<0)S=A.length-1;var w="",B,v;var N=Math.min(i.line+u.linesAfter,g.length).toString().length;var T=u.maxLength-(u.indent+N+3);for(B=1;B<=u.linesBefore;B++){if(S-B<0)break;v=getLine(i.buffer,A[S-B],g[S-B],i.position-(A[S]-A[S-B]),T);w=x.repeat(" ",u.indent)+padStart((i.line-B+1).toString(),N)+" | "+v.str+"\n"+w}v=getLine(i.buffer,A[S],g[S],i.position,T);w+=x.repeat(" ",u.indent)+padStart((i.line+1).toString(),N)+" | "+v.str+"\n";w+=x.repeat("-",u.indent+N+3+v.pos)+"^"+"\n";for(B=1;B<=u.linesAfter;B++){if(S+B>=g.length)break;v=getLine(i.buffer,A[S+B],g[S+B],i.position-(A[S]-A[S+B]),T);w+=x.repeat(" ",u.indent)+padStart((i.line+B+1).toString(),N)+" | "+v.str+"\n"}return w.replace(/\n$/,"")}var k=makeSnippet;var O=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];var D=["scalar","sequence","mapping"];function compileStyleAliases(i){var u={};if(i!==null){Object.keys(i).forEach((function(p){i[p].forEach((function(i){u[String(i)]=p}))}))}return u}function Type$1(i,u){u=u||{};Object.keys(u).forEach((function(u){if(O.indexOf(u)===-1){throw new _('Unknown option "'+u+'" is met in definition of "'+i+'" YAML type.')}}));this.options=u;this.tag=i;this.kind=u["kind"]||null;this.resolve=u["resolve"]||function(){return true};this.construct=u["construct"]||function(i){return i};this.instanceOf=u["instanceOf"]||null;this.predicate=u["predicate"]||null;this.represent=u["represent"]||null;this.representName=u["representName"]||null;this.defaultStyle=u["defaultStyle"]||null;this.multi=u["multi"]||false;this.styleAliases=compileStyleAliases(u["styleAliases"]||null);if(D.indexOf(this.kind)===-1){throw new _('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}}var P=Type$1;function compileList(i,u){var p=[];i[u].forEach((function(i){var u=p.length;p.forEach((function(p,A){if(p.tag===i.tag&&p.kind===i.kind&&p.multi===i.multi){u=A}}));p[u]=i}));return p}function compileMap(){var i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},u,p;function collectType(u){if(u.multi){i.multi[u.kind].push(u);i.multi["fallback"].push(u)}else{i[u.kind][u.tag]=i["fallback"][u.tag]=u}}for(u=0,p=arguments.length;u<p;u+=1){arguments[u].forEach(collectType)}return i}function Schema$1(i){return this.extend(i)}Schema$1.prototype.extend=function extend(i){var u=[];var p=[];if(i instanceof P){p.push(i)}else if(Array.isArray(i)){p=p.concat(i)}else if(i&&(Array.isArray(i.implicit)||Array.isArray(i.explicit))){if(i.implicit)u=u.concat(i.implicit);if(i.explicit)p=p.concat(i.explicit)}else{throw new _("Schema.extend argument should be a Type, [ Type ], "+"or a schema definition ({ implicit: [...], explicit: [...] })")}u.forEach((function(i){if(!(i instanceof P)){throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")}if(i.loadKind&&i.loadKind!=="scalar"){throw new _("There is a non-scalar type inLine truncated
|
||||||
|
/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */if("response"in p){this.response=p.response}const A=Object.assign({},p.request);if(p.request.headers.authorization){A.headers=Object.assign({},p.request.headers,{authorization:p.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})}A.url=A.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=A}}var Km="10.0.8";var Zm={headers:{"user-agent":`octokit-request.js/${Km} ${getUserAgent()}`}};function dist_bundle_isPlainObject(i){if(typeof i!=="object"||i===null)return false;if(Object.prototype.toString.call(i)!=="[object Object]")return false;const u=Object.getPrototypeOf(i);if(u===null)return true;const p=Object.prototype.hasOwnProperty.call(u,"constructor")&&u.constructor;return typeof p==="function"&&p instanceof p&&Function.prototype.call(p)===Function.prototype.call(i)}var noop=()=>"";async function fetchWrapper(i){const u=i.request?.fetch||globalThis.fetch;if(!u){throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing")}const p=i.request?.log||console;const A=i.request?.parseSuccessResponseBody!==false;const g=dist_bundle_isPlainObject(i.body)||Array.isArray(i.body)?JSONStringify(i.body):i.body;const C=Object.fromEntries(Object.entries(i.headers).map((([i,u])=>[i,String(u)])));let S;try{S=await u(i.url,{method:i.method,body:g,redirect:i.request?.redirect,headers:C,signal:i.request?.signal,...i.body&&{duplex:"half"}})}catch(u){let p="Unknown Error";if(u instanceof Error){if(u.name==="AbortError"){u.status=500;throw u}p=u.message;if(u.name==="TypeError"&&"cause"in u){if(u.cause instanceof Error){p=u.cause.message}else if(typeof u.cause==="string"){p=u.cause}}}const A=new RequestError(p,500,{request:i});A.cause=u;throw A}const w=S.status;const B=S.url;const v={};for(const[i,u]of S.headers){v[i]=u}const N={url:B,status:w,headers:v,data:""};if("deprecation"in v){const u=v.link&&v.link.match(/<([^<>]+)>; rel="deprecation"/);const A=u&&u.pop();p.warn(`[@octokit/request] "${i.method} ${i.url}" is deprecated. It is scheduled to be removed on ${v.sunset}${A?`. See ${A}`:""}`)}if(w===204||w===205){return N}if(i.method==="HEAD"){if(w<400){return N}throw new RequestError(S.statusText,w,{response:N,request:i})}if(w===304){N.data=await getResponseData(S);throw new RequestError("Not modified",w,{response:N,request:i})}if(w>=400){N.data=await getResponseData(S);throw new RequestError(toErrorMessage(N.data),w,{response:N,request:i})}N.data=A?await getResponseData(S):S.body;return N}async function getResponseData(i){const u=i.headers.get("content-type");if(!u){return i.text().catch(noop)}const p=(0,Fm.xL)(u);if(isJSONResponse(p)){let u="";try{u=await i.text();return JSONParse(u)}catch(i){return u}}else if(p.type.startsWith("text/")||p.parameters.charset?.toLowerCase()==="utf-8"){return i.text().catch(noop)}else{return i.arrayBuffer().catch((
|
||||||
|
/* v8 ignore next -- @preserve */
|
||||||
|
()=>new ArrayBuffer(0)))}}function isJSONResponse(i){return i.type==="application/json"||i.type==="application/scim+json"}function toErrorMessage(i){if(typeof i==="string"){return i}if(i instanceof ArrayBuffer){return"Unknown error"}if("message"in i){const u="documentation_url"in i?` - ${i.documentation_url}`:"";return Array.isArray(i.errors)?`${i.message}: ${i.errors.map((i=>JSON.stringify(i))).join(", ")}${u}`:`${i.message}${u}`}return`Unknown error: ${JSON.stringify(i)}`}function dist_bundle_withDefaults(i,u){const p=i.defaults(u);const newApi=function(i,u){const A=p.merge(i,u);if(!A.request||!A.request.hook){return fetchWrapper(p.parse(A))}const request2=(i,u)=>fetchWrapper(p.parse(p.merge(i,u)));Object.assign(request2,{endpoint:p,defaults:dist_bundle_withDefaults.bind(null,p)});return A.request.hook(request2,A)};return Object.assign(newApi,{endpoint:p,defaults:dist_bundle_withDefaults.bind(null,p)})}var Xm=dist_bundle_withDefaults(Lm,Zm);
|
||||||
|
/* v8 ignore next -- @preserve */
|
||||||
|
/* v8 ignore else -- @preserve */var ey="0.0.0-development";function _buildMessageForResponseErrors(i){return`Request failed due to following response errors:\n`+i.errors.map((i=>` - ${i.message}`)).join("\n")}var ty=class extends Error{constructor(i,u,p){super(_buildMessageForResponseErrors(p));this.request=i;this.headers=u;this.response=p;this.errors=p.errors;this.data=p.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var ry=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var sy=["query","method","url"];var ny=/\/api\/v3\/?$/;function graphql(i,u,p){if(p){if(typeof u==="string"&&"query"in p){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const i in p){if(!sy.includes(i))continue;return Promise.reject(new Error(`[@octokit/graphql] "${i}" cannot be used as variable name`))}}const A=typeof u==="string"?Object.assign({query:u},p):u;const g=Object.keys(A).reduce(((i,u)=>{if(ry.includes(u)){i[u]=A[u];return i}if(!i.variables){i.variables={}}i.variables[u]=A[u];return i}),{});const C=A.baseUrl||i.endpoint.DEFAULTS.baseUrl;if(ny.test(C)){g.url=C.replace(ny,"/api/graphql")}return i(g).then((i=>{if(i.data.errors){const u={};for(const p of Object.keys(i.headers)){u[p]=i.headers[p]}throw new ty(g,u,i.data)}return i.data.data}))}function graphql_dist_bundle_withDefaults(i,u){const p=i.defaults(u);const newApi=(i,u)=>graphql(p,i,u);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,p),endpoint:p.endpoint})}var iy=graphql_dist_bundle_withDefaults(Xm,{headers:{"user-agent":`octokit-graphql.js/${ey} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(i){return graphql_dist_bundle_withDefaults(i,{method:"POST",url:"/graphql"})}var oy="(?:[a-zA-Z0-9_-]+)";var ay="\\.";var cy=new RegExp(`^${oy}${ay}${oy}${ay}${oy}$`);var ly=cy.test.bind(cy);async function auth(i){const u=ly(i);const p=i.startsWith("v1.")||i.startsWith("ghs_");const A=i.startsWith("ghu_");const g=u?"app":p?"installation":A?"user-to-server":"oauth";return{type:"token",token:i,tokenType:g}}function withAuthorizationPrefix(i){if(i.split(/\./).length===3){return`bearer ${i}`}return`token ${i}`}async function hook(i,u,p,A){const g=u.endpoint.merge(p,A);g.headers.authorization=withAuthorizationPrefix(i);return u(g)}var uy=function createTokenAuth2(i){if(!i){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof i!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}i=i.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,i),{hook:hook.bind(null,i)})};const dy="7.0.6";const dist_src_noop=()=>{};const hy=console.warn.bind(console);const py=console.error.bind(console);function createLogger(i={}){if(typeof i.debug!=="function"){i.debug=dist_src_noop}if(typeof i.info!=="function"){i.info=dist_src_noop}if(typeof i.warn!=="function"){i.warn=hy}if(typeof i.error!=="function"){i.error=py}return i}const fy=`octokit-core.js/${dy} ${getUserAgent()}`;class Octokit{static VERSION=dy;static defaults(i){const u=class extends(this){constructor(...u){const p=u[0]||{};if(typeof i==="function"){super(i(p));return}super(Object.assign({},i,p,p.userAgent&&i.userAgent?{userAgent:`${p.userAgent} ${i.userAgent}`}:null))}};return u}static plugins=[];static plugin(...i){const u=this.plugins;const p=class extends(this){static plugins=u.concat(i.filter((i=>!u.includes(i))))};return p}constructor(i={}){const u=new km.Collection;const p={baseUrl:Xm.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},i.request,{hook:u.bind(null,"request")}),mediaType:{previews:[],format:""}};p.headers["user-agent"]=i.userAgent?`${i.userAgent} ${fy}`:fy;if(i.baseUrl){p.baseUrl=i.baseUrl}if(i.previews){p.mediaType.previews=i.previews}if(i.timeZone){p.headers["time-zone"]=i.timeZone}this.request=Xm.defaults(p);this.graphql=withCustomRequest(this.request).defaults(p);this.log=createLogger(i.log);this.hook=u;if(!i.authStrategy){if(!i.auth){this.auth=async()=>({type:"unauthenticated"})}else{const p=uy(i.auth);u.wrap("request",p.hook);this.auth=p}}else{const{authStrategy:p,...A}=i;const g=p(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:A},i.auth));u.wrap("request",g.hook);this.auth=g}const A=this.constructor;for(let u=0;u<A.plugins.length;++u){Object.assign(this,A.plugins[u](this,i))}}request;graphql;log;hook;auth}const Ay="17.0.0";const gy={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repositoLine truncated
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"index.js","names":["__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","mod","result","prototype","hasOwnProperty","call","__awaiter","thisArg","_arguments","P","generator","adopt","resolve","Promise","reject","fulfilled","step","next","e","rejected","done","then","apply","exports","saveCache","restoreCache","isFeatureAvailable","ReserveCacheError","ValidationError","core","__webpack_require__","path","utils","cacheHttpClient","tar_1","Error","constructor","message","super","name","setPrototypeOf","checkPaths","paths","length","checkKey","key","regex","test","process","env","primaryKey","restoreKeys","options","enableCrossOsArchive","keys","debug","JSON","stringify","compressionMethod","getCompressionMethod","archivePath","cacheEntry","getCacheEntry","archiveLocation","lookupOnly","info","cacheKey","join","createTempDirectory","getCacheFileName","downloadCache","isDebug","listTar","archiveFileSize","getArchiveFileSizeInBytes","Math","round","extractTar","error","typedError","warning","unlinkFile","_a","_b","_c","_d","_e","cacheId","cachePaths","resolvePaths","archiveFolder","createTar","fileSizeLimit","isGhes","reserveCacheResponse","reserveCache","cacheSize","statusCode","getCacheVersion","http_client_1","auth_1","crypto","fs","url_1","downloadUtils_1","options_1","requestUtils_1","versionSalt","getCacheApiUrl","resource","baseUrl","url","createAcceptHeader","type","apiVersion","getRequestOptions","requestOptions","headers","Accept","createHttpClient","token","bearerCredentialHandler","BearerCredentialHandler","HttpClient","components","slice","push","platform","createHash","update","digest","httpClient","version","encodeURIComponent","response","retryTypedResponse","getJson","printCachesListForDiagnostics","isSuccessStatusCode","cacheResult","cacheDownloadUrl","setSecret","cacheListResult","totalCount","artifactCaches","cacheVersion","scope","creationTime","archiveUrl","URL","downloadOptions","getDownloadOptions","hostname","endsWith","useAzureSdk","downloadCacheStorageSDK","concurrentBlobDownloads","downloadCacheHttpClientConcurrent","downloadCacheHttpClient","reserveCacheRequest","postJson","getContentRange","start","end","uploadChunk","resourceUrl","openStream","additionalHeaders","uploadChunkResponse","retryHttpClientResponse","sendStream","uploadFile","fileSize","toString","fd","openSync","uploadOptions","getUploadOptions","concurrency","assertDefined","uploadConcurrency","maxChunkSize","uploadChunkSize","parallelUploads","Array","offset","all","map","chunkSize","min","createReadStream","autoClose","on","closeSync","commitCache","filesize","commitCacheRequest","size","commitCacheResponse","__asyncValues","Symbol","asyncIterator","TypeError","i","__values","iterator","verb","n","settle","d","getGnuTarPathOnWindows","exec","glob","io","semver","util","uuid_1","constants_1","IS_WINDOWS","tempDirectory","baseLocation","dest","v4","mkdirP","filePath","statSync","patterns","e_1","workspace","cwd","globber","implicitDescendants","_f","globGenerator","_g","file","relativeFile","relative","replace","RegExp","sep","e_1_1","return","promisify","unlink","getVersion","app","additionalArgs","versionOutput","ignoreReturnCode","silent","listeners","stdout","data","stderr","err","trim","clean","CompressionMethod","Gzip","ZstdWithoutLong","CacheFilename","Zstd","existsSync","GnuTarPathOnWindows","toLowerCase","includes","which","ghUrl","trimEnd","toUpperCase","isGitHubHost","isGheHost","ManifestFilename","TarFilename","SystemTarPathOnWindows","SocketTimeout","DefaultRetryDelay","DefaultRetryAttempts","ArchiveToolType","DownloadProgress","storage_blob_1","buffer","stream","abort_controller_1","pipeResponseToStream","output","pipeline","contentLength","segmentIndex","segmentSize","segmentOffset","receivedBytes","displayedComplete","startTime","Date","now","nextSegment","setReceivedBytes","getTransferredBytes","isDone","display","transferredBytes","percentage","toFixed","elapsedTime","downloadSpeed","onProgress","progress","loadedBytes","startDisplayTimer","delayInMs","displayCallback","timeoutHandle","setTimeout","stopDisplayTimer","clearTimeout","writeStream","createWriteStream","downloadResponse","socket","destroy","contentLengthHeader","expectedLength","parseInt","actualLength","archiveDescriptor","promises","open","socketTimeout","timeoutInMs","keepAlive","res","request","lengthHeader","Number","isNaN","downloads","blockSize","count","promiseGetter","downloadSegmentRetry","reverse","actives","bytesDownloaded","progressFn","activeDownloads","nextDownload","waitAndWrite","segment","race","values","write","pop","downloadConcurrency","dispose","close","retries","failures","timeout","promiseWithTimeout","downloadSegment","partRes","Range","readBodyBuffer","client","BlockBlobClient","retryOptions","tryTimeoutInMs","properties"Line truncated
|
{"version":3,"file":"index.js","names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","Object","defineProperty","exports","ClientStreamingCall","constructor","method","requestHeaders","request","headers","response","status","trailers","requests","onfulfilled","onrejected","promiseFinished","reason","all","Deferred","DeferredState","preventUnhandledRejectionWarning","_state","PENDING","_promise","_resolve","_reject","catch","_","state","promise","Error","toLowerCase","RESOLVED","REJECTED","resolvePending","val","rejectPending","DuplexStreamingCall","responses","__webpack_unused_export__","service_type_1","__webpack_require__","enumerable","get","ServiceType","reflection_info_1","readMethodOptions","readMethodOption","readServiceOption","rpc_error_1","RpcError","rpc_options_1","mergeRpcOptions","rpc_output_stream_1","RpcOutputStreamController","test_transport_1","TestTransport","deferred_1","duplex_streaming_call_1","client_streaming_call_1","server_streaming_call_1","ServerStreamingCall","unary_call_1","UnaryCall","rpc_interceptor_1","stackIntercept","stackDuplexStreamingInterceptors","stackClientStreamingInterceptors","stackServerStreamingInterceptors","stackUnaryInterceptors","server_call_context_1","ServerCallContextController","normalizeMethodInfo","runtime_1","service","_a","_b","_c","m","localName","lowerCamelCase","name","serverStreaming","clientStreaming","options","idempotency","undefined","methodName","extensionName","extensionType","methods","find","i","fromJson","optionVal","message","code","meta","super","setPrototypeOf","prototype","toString","l","push","serviceName","entries","length","k","v","join","kind","transport","input","_d","tail","mtd","inp","opt","unary","curr","interceptors","filter","interceptUnary","reverse","interceptServerStreaming","interceptClientStreaming","duplex","interceptDuplex","assertNever","defaults","o","copy","key","keys","jsonOptions","mergeJsonOptions","binaryOptions","mergeBinaryOptions","concat","a","into","c","Date","getTime","Array","isArray","_lis","nxt","msg","err","cmp","_closed","_itState","q","onNext","callback","addLis","onMessage","onError","onComplete","list","indexOf","splice","clearLis","values","closed","notifyNext","error","complete","assert","notifyMessage","notifyError","notifyComplete","pushIt","forEach","Symbol","asyncIterator","p","first","shift","deadline","sendResponseHeadersFn","defaultStatus","detail","_cancelled","_listeners","_sendRH","notifyCancelled","sendResponseHeaders","data","cancelled","onCancel","typeName","map","suppressUncaughtRejections","headerDelay","responseDelay","betweenResponseDelay","afterResponseDelay","sentMessages","lastInput","TestInputStream","sent","single","sendComplete","completed","promiseHeaders","defaultHeaders","promiseSingleResponse","r","O","create","is","streamResponses","stream","abort","messages","delay","promiseStatus","promiseTrailers","defaultTrailers","maybeSuppressUncaught","mergeOptions","headersPromise","responsePromise","statusPromise","trailersPromise","outputStream","responseStreamClosedPromise","responseHeader","responseTrailer","ms","aborted","id","setTimeout","addEventListener","ev","clearTimeout","_completed","_sent","send","inputMessage","delayMs","inputComplete","assertFloat32","assertUInt32","assertInt32","condition","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","arg","Number","isInteger","isFinite","base64encode","base64decode","encTable","split","decTable","charCodeAt","base64Str","es","bytes","Uint8Array","bytePos","groupPos","b","subarray","base64","WireType","UnknownFieldHandler","symbol","for","onRead","fieldNo","wireType","container","no","onWrite","writer","tag","raw","uf","last","slice","assign","BinaryReader","binaryReadOptions","binary_format_contract_1","pb_long_1","goog_varint_1","defaultsRead","readUnknownField","readerFactory","buf","textDecoder","varint64","varint64read","uint32","varint32read","len","pos","view","DataView","buffer","byteOffset","byteLength","TextDecoder","fatal","ignoreBOM","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","t","EndGroup","assertBounds","RangeError","int32","sint32","zze","int64","PbLong","uint64","PbULong","sint64","lo","hi","s","bool","fixed32","getUint32","sfixed32","getInt32","fixed64","sfixed64","float","getFloat32","double","getFloat64","string","decode","BinaryWriter","binaryWriteOptions","assert_1","defaultsWrite","writeUnknownFields","writerFactory","textEncoder","stack","TextEncoder","chunks","finish","offset","set","fork","chunk","prev","pop","type","varint32write","encode","setFloat32","setFloat64","setUint32","setInt32","long","from","varint64write","sign","listEnumNumbers","listEnumNames","listEnumValues","isEnumObject","hasOwnProperty","num","parseInt","isNaN","nam","enumObject","number","index","arr","int64toString","int64fromString","lowBits","highBits","mLine truncated
|
||||||
+2
-1862
File diff suppressed because it is too large.
Load diff
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
(()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n<e.length;n++){var t=e[n](r);if(t){return t}}return null}}var m=handlerExec(d);d.push((function(e){e=e.trim();if(/^file:/.test(e)){e=e.replace(/file:\/\/\/(\w:)?/,(function(e,r){return r?"":"/"}))}if(e in p){return p[e]}var r="";try{if(!i){var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);if(n.readyState===4&&n.status===200){r=n.responseText}}else if(i.existsSync(e)){r=i.readFileSync(e,"utf8")}}catch(e){}return p[e]=r}));function supportRelativeURL(e,r){if(!e)return r;var n=o.dirname(e);var t=/^\w+:\/\/[^\/]*/.exec(n);var i=t?t[0]:"";var a=n.slice(i.length);if(i&&/^\/\w\:/.test(a)){i+="/";return i+o.resolve(n.slice(i.length),r).replace(/\\/g,"/")}return i+o.resolve(n.slice(i.length),r)}function retrieveSourceMapURL(e){var r;if(isInBrowser()){try{var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);r=n.readyState===4?n.responseText:null;var t=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(t){return t}}catch(e){}}r=m(e);var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;var i,a;while(a=o.exec(r))i=a;if(!i)return null;return i[1]}var v=handlerExec(h);h.push((function(e){var r=retrieveSourceMapURL(e);if(!r)return null;var n;if(g.test(r)){var t=r.slice(r.indexOf(",")+1);n=a(t,"base64").toString();r=e}else{r=supportRelativeURL(e,r);n=m(r)}if(!n){return null}return{url:r,map:n}}));function mapSourcePosition(e){var r=f[e.source];if(!r){var n=v(e.source);if(n){r=f[e.source]={url:n.url,map:new t(n.map)};if(r.map.sourcesContent){r.map.sources.forEach((function(e,n){var t=r.map.sourcesContent[n];if(t){var o=supportRelativeURL(r.url,e);p[o]=t}}))}}else{r=f[e.source]={url:null,map:null}}}if(r&&r.map&&typeof r.map.originalPositionFor==="function"){var o=r.map.originalPositionFor(e);if(o.source!==null){o.source=supportRelativeURL(r.url,o.source);return o}}return e}function mapEvalOrigin(e){var r=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);if(r){var n=mapSourcePosition({source:r[2],line:+r[3],column:r[4]-1});return"eval at "+r[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}r=/^eval at ([^(]+) \((.+)\)$/.exec(e);if(r){return"eval at "+r[1]+" ("+mapEvalOrigin(r[2])+")"}return e}function CallSiteToString(){var e;var r="";if(this.isNative()){r="native"}else{e=this.getScriptNameOrSourceURL();if(!e&&this.isEval()){r=this.getEvalOrigin();r+=", "}if(e){r+=e}else{r+="<anonymous>"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"<anonymous>")}}else if(u){o+="new "+(i||"<aLine truncated
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t<o;t++){n.add(e[t],r)}return n};ArraySet.prototype.size=function ArraySet_size(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length};ArraySet.prototype.add=function ArraySet_add(e,r){var n=i?e:t.toSetString(e);var a=i?this.has(e):o.call(this._set,n);var u=this._array.length;if(!a||r){this._array.push(e)}if(!a){if(i){this._set.set(e,u)}else{this._set[n]=u}}};ArraySet.prototype.has=function ArraySet_has(e){if(i){return this._set.has(e)}else{var r=t.toSetString(e);return o.call(this._set,r)}};ArraySet.prototype.indexOf=function ArraySet_indexOf(e){if(i){var r=this._set.get(e);if(r>=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length){return this._array[e]}throw new Error("No element indexed by "+e)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};r.I=ArraySet},449:(e,r,n)=>{var t=n(190);var o=5;var i=1<<o;var a=i-1;var u=i;function toVLQSigned(e){return e<0?(-e<<1)+1:(e<<1)+0}function fromVLQSigned(e){var r=(e&1)===1;var n=e>>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<<l);l+=o}while(c);n.value=fromVLQSigned(s);n.rest=r}},190:(e,r)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e<n.length){return n[e]}throw new TypeError("Must be between 0 and 63: "+e)};r.decode=function(e){var r=65;var n=90;var t=97;var o=122;var i=48;var a=57;var u=43;var s=47;var l=26;var c=52;if(r<=e&&e<=n){return e-r}if(t<=e&&e<=o){return e-t+l}if(i<=e&&e<=a){return e-i+c}if(e==u){return 62}if(e==s){return 63}return-1}},345:(e,r)=>{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n<o.length?n:-1}else{return u}}else{if(u-e>1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n<t){var o=randomIntInRange(n,t);var i=n-1;swap(e,o,t);var a=e[t];for(var u=n;u<t;u++){if(r(e[u],Line truncated
|
|
||||||
+15
-2
@@ -1,9 +1,15 @@
|
|||||||
|
target "_common" {
|
||||||
|
args = {
|
||||||
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "pre-checkin" {
|
group "pre-checkin" {
|
||||||
targets = ["vendor-update", "format", "build"]
|
targets = ["vendor", "format", "build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
@@ -11,42 +17,49 @@ group "validate" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target "build" {
|
target "build" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-update"
|
target = "build-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "format" {
|
target "format" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "format-update"
|
target = "format-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "lint" {
|
target "lint" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "lint"
|
target = "lint"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-update" {
|
target "vendor" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "test-coverage"
|
target = "test-coverage"
|
||||||
output = ["./coverage"]
|
output = ["./coverage"]
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import {defineConfig} from 'eslint/config';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||||
|
import vitest from '@vitest/eslint-plugin';
|
||||||
|
import globals from 'globals';
|
||||||
|
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
||||||
|
import eslintPluginPrettier from 'eslint-plugin-prettier';
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{
|
||||||
|
ignores: ['.yarn/**/*', 'coverage/**/*', 'dist/**/*']
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
...tseslint.configs['flat/recommended'],
|
||||||
|
eslintConfigPrettier,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['__tests__/**'],
|
||||||
|
...vitest.configs.recommended,
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
...vitest.environments.env.globals
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...vitest.configs.recommended.rules,
|
||||||
|
'vitest/no-conditional-expect': 'error',
|
||||||
|
'vitest/no-disabled-tests': 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
prettier: eslintPluginPrettier
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'prettier/prettier': 'error',
|
||||||
|
'@typescript-eslint/no-require-imports': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowAsImport: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import fs from 'fs';
|
|
||||||
import os from 'os';
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-action-')).split(path.sep).join(path.posix.sep);
|
|
||||||
|
|
||||||
process.env = Object.assign({}, process.env, {
|
|
||||||
TEMP: tmpDir,
|
|
||||||
GITHUB_REPOSITORY: 'docker/setup-buildx-action',
|
|
||||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp').split(path.sep).join(path.posix.sep),
|
|
||||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache').split(path.sep).join(path.posix.sep)
|
|
||||||
}) as {
|
|
||||||
[key: string]: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
clearMocks: true,
|
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
|
||||||
testMatch: ['**/*.test.ts'],
|
|
||||||
transform: {
|
|
||||||
'^.+\\.ts$': 'ts-jest'
|
|
||||||
},
|
|
||||||
moduleNameMapper: {
|
|
||||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
|
||||||
},
|
|
||||||
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
|
|
||||||
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__tests__/'],
|
|
||||||
verbose: true
|
|
||||||
};
|
|
||||||
+25
-28
@@ -1,17 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "docker-setup-buildx",
|
"name": "docker-setup-buildx",
|
||||||
"description": "Set up Docker Buildx",
|
"description": "Set up Docker Buildx",
|
||||||
"main": "lib/main.js",
|
"type": "module",
|
||||||
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||||
"lint": "yarn run prettier && yarn run eslint",
|
"lint": "eslint --max-warnings=0 .",
|
||||||
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
"format": "eslint --fix .",
|
||||||
"eslint": "eslint --max-warnings=0 .",
|
"test": "vitest run"
|
||||||
"eslint:fix": "eslint --fix .",
|
|
||||||
"prettier": "prettier --check \"./**/*.ts\"",
|
|
||||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
|
||||||
"test": "jest",
|
|
||||||
"all": "yarn run build && yarn run format && yarn test"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -24,26 +20,27 @@
|
|||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"packageManager": "yarn@4.9.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^3.0.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@docker/actions-toolkit": "^0.79.0",
|
||||||
"@docker/actions-toolkit": "^0.19.0",
|
"js-yaml": "^4.1.1"
|
||||||
"js-yaml": "^4.1.0",
|
|
||||||
"uuid": "^9.0.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.5.9",
|
"@eslint/js": "^9.39.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@typescript-eslint/parser": "^6.6.0",
|
"@types/node": "^24.11.0",
|
||||||
"@vercel/ncc": "^0.38.0",
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||||
"eslint": "^8.48.0",
|
"@typescript-eslint/parser": "^8.56.1",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"@vercel/ncc": "^0.38.4",
|
||||||
"eslint-plugin-jest": "^27.2.3",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"@vitest/eslint-plugin": "^1.6.9",
|
||||||
"jest": "^29.6.4",
|
"eslint": "^9.39.3",
|
||||||
"prettier": "^3.0.3",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"ts-jest": "^29.1.1",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"ts-node": "^10.9.1",
|
"globals": "^17.3.0",
|
||||||
"typescript": "^5.2.2"
|
"prettier": "^3.8.1",
|
||||||
|
"typescript": "^5.9.3",
|
||||||
|
"vitest": "^4.0.18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+44
-25
@@ -1,11 +1,14 @@
|
|||||||
import * as uuid from 'uuid';
|
import * as crypto from 'crypto';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
|
||||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||||
|
|
||||||
|
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||||
|
|
||||||
export const builderNodeEnvPrefix = 'BUILDER_NODE';
|
export const builderNodeEnvPrefix = 'BUILDER_NODE';
|
||||||
|
const defaultBuildkitdFlags = '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host';
|
||||||
|
|
||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
version: string;
|
version: string;
|
||||||
@@ -16,45 +19,47 @@ export interface Inputs {
|
|||||||
buildkitdConfig: string;
|
buildkitdConfig: string;
|
||||||
buildkitdConfigInline: string;
|
buildkitdConfigInline: string;
|
||||||
platforms: string[];
|
platforms: string[];
|
||||||
install: boolean;
|
|
||||||
use: boolean;
|
use: boolean;
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
append: string;
|
append: string;
|
||||||
cacheBinary: boolean;
|
cacheBinary: boolean;
|
||||||
cleanup: boolean;
|
cleanup: boolean;
|
||||||
|
keepState: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getInputs(): Promise<Inputs> {
|
export async function getInputs(): Promise<Inputs> {
|
||||||
return {
|
return {
|
||||||
version: core.getInput('version'),
|
version: core.getInput('version'),
|
||||||
name: await getBuilderName(core.getInput('driver') || 'docker-container'),
|
name: await getBuilderName(core.getInput('name'), core.getInput('driver') || 'docker-container'),
|
||||||
driver: core.getInput('driver') || 'docker-container',
|
driver: core.getInput('driver') || 'docker-container',
|
||||||
driverOpts: Util.getInputList('driver-opts', {ignoreComma: true, quote: false}),
|
driverOpts: Util.getInputList('driver-opts', {ignoreComma: true, quote: false}),
|
||||||
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
buildkitdFlags: core.getInput('buildkitd-flags'),
|
||||||
platforms: Util.getInputList('platforms'),
|
platforms: Util.getInputList('platforms'),
|
||||||
install: core.getBooleanInput('install'),
|
|
||||||
use: core.getBooleanInput('use'),
|
use: core.getBooleanInput('use'),
|
||||||
endpoint: core.getInput('endpoint'),
|
endpoint: core.getInput('endpoint'),
|
||||||
buildkitdConfig: core.getInput('buildkitd-config') || core.getInput('config'),
|
buildkitdConfig: core.getInput('buildkitd-config'),
|
||||||
buildkitdConfigInline: core.getInput('buildkitd-config-inline') || core.getInput('config-inline'),
|
buildkitdConfigInline: core.getInput('buildkitd-config-inline'),
|
||||||
append: core.getInput('append'),
|
append: core.getInput('append'),
|
||||||
|
keepState: core.getBooleanInput('keep-state'),
|
||||||
cacheBinary: core.getBooleanInput('cache-binary'),
|
cacheBinary: core.getBooleanInput('cache-binary'),
|
||||||
cleanup: core.getBooleanInput('cleanup')
|
cleanup: core.getBooleanInput('cleanup')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getBuilderName(driver: string): Promise<string> {
|
export async function getBuilderName(name: string, driver: string): Promise<string> {
|
||||||
return driver == 'docker' ? await Docker.context() : `builder-${uuid.v4()}`;
|
return driver == 'docker' ? await Docker.context() : name || `builder-${crypto.randomUUID()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
||||||
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
|
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
|
||||||
await Util.asyncForEach(inputs.driverOpts, async driverOpt => {
|
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
|
||||||
args.push('--driver-opt', driverOpt);
|
args.push('--driver-opt', driverOpt);
|
||||||
});
|
});
|
||||||
if (driverSupportsFlags(inputs.driver) && inputs.buildkitdFlags) {
|
if (inputs.buildkitdFlags) {
|
||||||
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inputs.platforms.length > 0) {
|
if (inputs.platforms.length > 0) {
|
||||||
@@ -63,12 +68,10 @@ export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<A
|
|||||||
if (inputs.use) {
|
if (inputs.use) {
|
||||||
args.push('--use');
|
args.push('--use');
|
||||||
}
|
}
|
||||||
if (driverSupportsFlags(inputs.driver)) {
|
if (inputs.buildkitdConfig) {
|
||||||
if (inputs.buildkitdConfig) {
|
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
|
||||||
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
|
} else if (inputs.buildkitdConfigInline) {
|
||||||
} else if (inputs.buildkitdConfigInline) {
|
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
|
||||||
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (inputs.endpoint) {
|
if (inputs.endpoint) {
|
||||||
args.push(inputs.endpoint);
|
args.push(inputs.endpoint);
|
||||||
@@ -81,14 +84,16 @@ export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit
|
|||||||
if (node.name) {
|
if (node.name) {
|
||||||
args.push('--node', node.name);
|
args.push('--node', node.name);
|
||||||
} else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) {
|
} else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) {
|
||||||
args.push('--node', `node-${uuid.v4()}`);
|
args.push('--node', `node-${crypto.randomUUID()}`);
|
||||||
}
|
}
|
||||||
if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) {
|
if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) {
|
||||||
await Util.asyncForEach(node['driver-opts'], async driverOpt => {
|
await Util.asyncForEach(node['driver-opts'], async (driverOpt: string) => {
|
||||||
args.push('--driver-opt', driverOpt);
|
args.push('--driver-opt', driverOpt);
|
||||||
});
|
});
|
||||||
if (driverSupportsFlags(inputs.driver) && node['buildkitd-flags']) {
|
if (node['buildkitd-flags']) {
|
||||||
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node.platforms) {
|
if (node.platforms) {
|
||||||
@@ -108,6 +113,20 @@ export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<
|
|||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
function driverSupportsFlags(driver: string): boolean {
|
function driverSupportsBuildkitdFlags(driver: string): boolean {
|
||||||
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
|
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getVersion(inputs: Inputs): string {
|
||||||
|
const version = inputs.version;
|
||||||
|
if (inputs.driver === 'cloud') {
|
||||||
|
if (!version || version === 'latest') {
|
||||||
|
return 'cloud:latest';
|
||||||
|
}
|
||||||
|
if (version.startsWith('cloud:') || version.startsWith('lab:')) {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
return `cloud:${version}`;
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
}
|
||||||
+132
-56
@@ -1,28 +1,39 @@
|
|||||||
|
import * as crypto from 'crypto';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as yaml from 'js-yaml';
|
import * as yaml from 'js-yaml';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
|
|
||||||
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
|
|
||||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
|
||||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
|
||||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
|
||||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
|
||||||
|
|
||||||
import * as context from './context';
|
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||||
import * as stateHelper from './state-helper';
|
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder.js';
|
||||||
|
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||||
|
import {Exec} from '@docker/actions-toolkit/lib/exec.js';
|
||||||
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||||
|
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||||
|
|
||||||
|
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||||
|
import {ContextInfo} from '@docker/actions-toolkit/lib/types/docker/docker.js';
|
||||||
|
|
||||||
|
import * as context from './context.js';
|
||||||
|
import * as stateHelper from './state-helper.js';
|
||||||
|
|
||||||
actionsToolkit.run(
|
actionsToolkit.run(
|
||||||
// main
|
// main
|
||||||
async () => {
|
async () => {
|
||||||
const inputs: context.Inputs = await context.getInputs();
|
const inputs: context.Inputs = await context.getInputs();
|
||||||
stateHelper.setCleanup(inputs.cleanup);
|
stateHelper.setCleanup(inputs.cleanup);
|
||||||
|
const version = context.getVersion(inputs);
|
||||||
|
|
||||||
const toolkit = new Toolkit();
|
const toolkit = new Toolkit();
|
||||||
const standalone = await toolkit.buildx.isStandalone();
|
const standalone = await toolkit.buildx.isStandalone();
|
||||||
stateHelper.setStandalone(standalone);
|
stateHelper.setStandalone(standalone);
|
||||||
|
|
||||||
|
if (inputs.keepState && inputs.driver !== 'docker-container') {
|
||||||
|
// https://docs.docker.com/reference/cli/docker/buildx/rm/#keep-state
|
||||||
|
throw new Error(`Cannot use keep-state with ${inputs.driver} driver`);
|
||||||
|
}
|
||||||
|
stateHelper.setKeepState(inputs.keepState);
|
||||||
|
|
||||||
await core.group(`Docker info`, async () => {
|
await core.group(`Docker info`, async () => {
|
||||||
try {
|
try {
|
||||||
await Docker.printVersion();
|
await Docker.printVersion();
|
||||||
@@ -33,16 +44,19 @@ actionsToolkit.run(
|
|||||||
});
|
});
|
||||||
|
|
||||||
let toolPath;
|
let toolPath;
|
||||||
if (Util.isValidRef(inputs.version)) {
|
if (Util.isValidRef(version)) {
|
||||||
if (standalone) {
|
if (standalone) {
|
||||||
throw new Error(`Cannot build from source without the Docker CLI`);
|
throw new Error(`Cannot build from source without the Docker CLI`);
|
||||||
}
|
}
|
||||||
await core.group(`Build buildx from source`, async () => {
|
await core.group(`Build buildx from source`, async () => {
|
||||||
toolPath = await toolkit.buildxInstall.build(inputs.version, !inputs.cacheBinary);
|
toolPath = await toolkit.buildxInstall.build(version, !inputs.cacheBinary);
|
||||||
});
|
});
|
||||||
} else if (!(await toolkit.buildx.isAvailable()) || inputs.version) {
|
} else if (!(await toolkit.buildx.isAvailable()) || version) {
|
||||||
await core.group(`Download buildx from GitHub Releases`, async () => {
|
await core.group(`Download buildx from GitHub Releases`, async () => {
|
||||||
toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest', !inputs.cacheBinary);
|
toolPath = await toolkit.buildxInstall.download({
|
||||||
|
version: version || 'latest',
|
||||||
|
ghaNoCache: !inputs.cacheBinary
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (toolPath) {
|
if (toolPath) {
|
||||||
@@ -66,18 +80,73 @@ actionsToolkit.run(
|
|||||||
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
||||||
stateHelper.setCertsDir(Buildx.certsDir);
|
stateHelper.setCertsDir(Buildx.certsDir);
|
||||||
|
|
||||||
|
// if the default context has TLS data loaded and endpoint is not set, then
|
||||||
|
// we create a temporary docker context only if driver is docker-container
|
||||||
|
// https://github.com/docker/buildx/blob/b96ad59f64d40873e4959336d294b648bb3937fe/builder/builder.go#L489
|
||||||
|
// https://github.com/docker/setup-buildx-action/issues/105
|
||||||
|
if (!standalone && inputs.driver == 'docker-container' && (await Docker.context()) == 'default' && inputs.endpoint.length == 0) {
|
||||||
|
let defaultContextWithTLS: boolean = false;
|
||||||
|
await core.group(`Inspecting default docker context`, async () => {
|
||||||
|
await Docker.getExecOutput(['context', 'inspect', '--format=json', 'default'], {
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
core.info(`Cannot inspect default docker context: ${res.stderr.trim()}`);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const contextInfo = (<Array<ContextInfo>>JSON.parse(res.stdout.trim()))[0];
|
||||||
|
core.info(JSON.stringify(JSON.parse(res.stdout.trim()), undefined, 2));
|
||||||
|
const hasTLSData = Object.keys(contextInfo.Endpoints).length > 0 && Object.values(contextInfo.Endpoints)[0].TLSData !== undefined;
|
||||||
|
const hasTLSMaterial = Object.keys(contextInfo.TLSMaterial).length > 0 && Object.values(contextInfo.TLSMaterial)[0].length > 0;
|
||||||
|
defaultContextWithTLS = hasTLSData || hasTLSMaterial;
|
||||||
|
} catch (e) {
|
||||||
|
core.info(`Unable to parse default docker context info: ${e}`);
|
||||||
|
core.info(res.stdout.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (defaultContextWithTLS) {
|
||||||
|
const tmpDockerContext = `buildx-${crypto.randomUUID()}`;
|
||||||
|
await core.group(`Creating temp docker context (TLS data loaded in default one)`, async () => {
|
||||||
|
await Docker.getExecOutput(['context', 'create', tmpDockerContext], {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
core.warning(`Cannot create docker context ${tmpDockerContext}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||||
|
} else {
|
||||||
|
core.info(`Setting builder endpoint to ${tmpDockerContext} context`);
|
||||||
|
inputs.endpoint = tmpDockerContext;
|
||||||
|
stateHelper.setTmpDockerContext(tmpDockerContext);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (inputs.driver !== 'docker') {
|
if (inputs.driver !== 'docker') {
|
||||||
await core.group(`Creating a new builder instance`, async () => {
|
await core.group(`Creating a new builder instance`, async () => {
|
||||||
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
|
if (await toolkit.builder.exists(inputs.name)) {
|
||||||
cacert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CACERT`],
|
core.info(`Builder ${inputs.name} already exists, skipping creation`);
|
||||||
cert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CERT`],
|
} else {
|
||||||
key: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_KEY`]
|
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
|
||||||
});
|
cacert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CACERT`],
|
||||||
if (certsDriverOpts.length > 0) {
|
cert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CERT`],
|
||||||
inputs.driverOpts = [...inputs.driverOpts, ...certsDriverOpts];
|
key: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_KEY`]
|
||||||
|
});
|
||||||
|
if (certsDriverOpts.length > 0) {
|
||||||
|
inputs.driverOpts = [...inputs.driverOpts, ...certsDriverOpts];
|
||||||
|
}
|
||||||
|
const createCmd = await toolkit.buildx.getCommand(await context.getCreateArgs(inputs, toolkit));
|
||||||
|
await Exec.getExecOutput(createCmd.command, createCmd.args, {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const createCmd = await toolkit.buildx.getCommand(await context.getCreateArgs(inputs, toolkit));
|
|
||||||
await exec.exec(createCmd.command, createCmd.args);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +164,13 @@ actionsToolkit.run(
|
|||||||
node['driver-opts'] = [...(node['driver-opts'] || []), ...certsDriverOpts];
|
node['driver-opts'] = [...(node['driver-opts'] || []), ...certsDriverOpts];
|
||||||
}
|
}
|
||||||
const appendCmd = await toolkit.buildx.getCommand(await context.getAppendArgs(inputs, node, toolkit));
|
const appendCmd = await toolkit.buildx.getCommand(await context.getAppendArgs(inputs, node, toolkit));
|
||||||
await exec.exec(appendCmd.command, appendCmd.args);
|
await Exec.getExecOutput(appendCmd.command, appendCmd.args, {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
throw new Error(`Failed to append node ${node.name}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
nodeIndex++;
|
nodeIndex++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -103,18 +178,14 @@ actionsToolkit.run(
|
|||||||
|
|
||||||
await core.group(`Booting builder`, async () => {
|
await core.group(`Booting builder`, async () => {
|
||||||
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
|
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
|
||||||
await exec.exec(inspectCmd.command, inspectCmd.args);
|
await Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
|
||||||
});
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
if (inputs.install) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
if (standalone) {
|
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||||
throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
|
}
|
||||||
}
|
|
||||||
await core.group(`Setting buildx as default builder`, async () => {
|
|
||||||
const installCmd = await toolkit.buildx.getCommand(['install']);
|
|
||||||
await exec.exec(installCmd.command, installCmd.args);
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
const builderInspect = await toolkit.builder.inspect(inputs.name);
|
const builderInspect = await toolkit.builder.inspect(inputs.name);
|
||||||
const firstNode = builderInspect.nodes[0];
|
const firstNode = builderInspect.nodes[0];
|
||||||
@@ -133,9 +204,6 @@ actionsToolkit.run(
|
|||||||
core.setOutput('driver', builderInspect.driver);
|
core.setOutput('driver', builderInspect.driver);
|
||||||
core.setOutput('platforms', reducedPlatforms.join(','));
|
core.setOutput('platforms', reducedPlatforms.join(','));
|
||||||
core.setOutput('nodes', JSON.stringify(builderInspect.nodes, undefined, 2));
|
core.setOutput('nodes', JSON.stringify(builderInspect.nodes, undefined, 2));
|
||||||
core.setOutput('endpoint', firstNode.endpoint); // TODO: deprecated, to be removed in a later version
|
|
||||||
core.setOutput('status', firstNode.status); // TODO: deprecated, to be removed in a later version
|
|
||||||
core.setOutput('flags', firstNode['buildkitd-flags']); // TODO: deprecated, to be removed in a later version
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!standalone && builderInspect.driver == 'docker-container') {
|
if (!standalone && builderInspect.driver == 'docker-container') {
|
||||||
@@ -155,15 +223,13 @@ actionsToolkit.run(
|
|||||||
async () => {
|
async () => {
|
||||||
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
|
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
|
||||||
await core.group(`BuildKit container logs`, async () => {
|
await core.group(`BuildKit container logs`, async () => {
|
||||||
await exec
|
await Docker.getExecOutput(['logs', `${stateHelper.containerName}`], {
|
||||||
.getExecOutput('docker', ['logs', `${stateHelper.containerName}`], {
|
ignoreReturnCode: true
|
||||||
ignoreReturnCode: true
|
}).then(res => {
|
||||||
})
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
.then(res => {
|
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
}
|
||||||
core.warning(res.stderr.trim());
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,22 +242,32 @@ actionsToolkit.run(
|
|||||||
const buildx = new Buildx({standalone: stateHelper.standalone});
|
const buildx = new Buildx({standalone: stateHelper.standalone});
|
||||||
const builder = new Builder({buildx: buildx});
|
const builder = new Builder({buildx: buildx});
|
||||||
if (await builder.exists(stateHelper.builderName)) {
|
if (await builder.exists(stateHelper.builderName)) {
|
||||||
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
|
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName, ...(stateHelper.keepState ? ['--keep-state'] : [])]);
|
||||||
await exec
|
await Exec.getExecOutput(rmCmd.command, rmCmd.args, {
|
||||||
.getExecOutput(rmCmd.command, rmCmd.args, {
|
ignoreReturnCode: true
|
||||||
ignoreReturnCode: true
|
}).then(res => {
|
||||||
})
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
.then(res => {
|
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
}
|
||||||
core.warning(res.stderr.trim());
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
core.info(`${stateHelper.builderName} does not exist`);
|
core.info(`${stateHelper.builderName} does not exist`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stateHelper.tmpDockerContext) {
|
||||||
|
await core.group(`Removing temp docker context`, async () => {
|
||||||
|
await Exec.getExecOutput('docker', ['context', 'rm', '-f', stateHelper.tmpDockerContext], {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
|
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
|
||||||
await core.group(`Cleaning up certificates`, async () => {
|
await core.group(`Cleaning up certificates`, async () => {
|
||||||
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ export const builderName = process.env['STATE_builderName'] || '';
|
|||||||
export const builderDriver = process.env['STATE_builderDriver'] || '';
|
export const builderDriver = process.env['STATE_builderDriver'] || '';
|
||||||
export const containerName = process.env['STATE_containerName'] || '';
|
export const containerName = process.env['STATE_containerName'] || '';
|
||||||
export const certsDir = process.env['STATE_certsDir'] || '';
|
export const certsDir = process.env['STATE_certsDir'] || '';
|
||||||
|
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
|
||||||
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
||||||
|
export const keepState = /true/i.test(process.env['STATE_keepState'] || '');
|
||||||
|
|
||||||
export function setDebug(debug: string) {
|
export function setDebug(debug: string) {
|
||||||
core.saveState('isDebug', debug);
|
core.saveState('isDebug', debug);
|
||||||
@@ -32,6 +34,14 @@ export function setCertsDir(certsDir: string) {
|
|||||||
core.saveState('certsDir', certsDir);
|
core.saveState('certsDir', certsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setTmpDockerContext(tmpDockerContext: string) {
|
||||||
|
core.saveState('tmpDockerContext', tmpDockerContext);
|
||||||
|
}
|
||||||
|
|
||||||
export function setCleanup(cleanup: boolean) {
|
export function setCleanup(cleanup: boolean) {
|
||||||
core.saveState('cleanup', cleanup);
|
core.saveState('cleanup', cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setKeepState(keepState: boolean) {
|
||||||
|
core.saveState('keepState', keepState);
|
||||||
|
}
|
||||||
+4
-8
@@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"module": "nodenext",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "es6",
|
|
||||||
"module": "commonjs",
|
|
||||||
"strict": true,
|
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
@@ -12,10 +11,7 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"include": [
|
||||||
"./__tests__/**/*",
|
"src/**/*.ts"
|
||||||
"./lib/**/*",
|
|
||||||
"node_modules",
|
|
||||||
"jest.config.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import {defineConfig} from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
clearMocks: true,
|
||||||
|
environment: 'node',
|
||||||
|
setupFiles: ['./__tests__/setup.unit.ts'],
|
||||||
|
include: ['**/*.test.ts'],
|
||||||
|
coverage: {
|
||||||
|
provider: 'v8',
|
||||||
|
reporter: ['clover'],
|
||||||
|
include: ['src/**/*.ts'],
|
||||||
|
exclude: ['src/**/main.ts']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Reference in new issue
Block a user