Skip to content

Commit e2e49ff

Browse files
authored
Support for pnpm, bun as well as ARM64 images (#13)
* Added support for pnpm * Added support for Bun * Added multi-arch docker build
1 parent 4083c8c commit e2e49ff

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ jobs:
3434
type=semver,pattern={{version}}
3535
type=semver,pattern={{major}}.{{minor}}
3636
type=semver,pattern={{major}}
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v3
3741
- name: Build and push Docker image
3842
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
3943
with:
4044
context: .
4145
push: true
4246
tags: ${{ steps.meta.outputs.tags }}
47+
platforms: linux/amd64,linux/arm64
4348
labels: ${{ steps.meta.outputs.labels }}

src/tools/proxy.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func ProxyRequestHandler(p *httputil.ReverseProxy) func(http.ResponseWriter, *ht
4949
}
5050
}
5151

52+
// Handles the response back to the client once intercepted from CodeArtifact
5253
func ProxyResponseHandler() func(*http.Response) error {
5354
return func(r *http.Response) error {
5455
log.Printf("Received %d response from %s", r.StatusCode, r.Request.URL.String())
@@ -80,7 +81,10 @@ func ProxyResponseHandler() func(*http.Response) error {
8081
}
8182

8283
// Do some quick fixes to the HTTP response for NPM install requests
83-
if strings.HasPrefix(r.Request.UserAgent(), "npm") {
84+
// Also support for pnpm and bun
85+
if strings.HasPrefix(r.Request.UserAgent(), "npm") ||
86+
strings.HasPrefix(r.Request.UserAgent(), "pnpm") ||
87+
strings.HasPrefix(r.Request.UserAgent(), "Bun") {
8488

8589
// Respond to only requests that respond with JSON
8690
// There might eventually be additional headers i don't know about?

0 commit comments

Comments
 (0)