From 22093ebffede196e3c78cddfa4c50e16bbbfb0fc Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Fri, 31 Dec 2021 18:32:20 +0100 Subject: [PATCH] feat!: Node v16 as minimum for verdaccio 6 (#2833) --- .babelrc | 19 ++++++----- .github/workflows/ci.yml | 70 ++++++++-------------------------------- Dockerfile | 6 ++-- README.md | 2 +- 4 files changed, 27 insertions(+), 70 deletions(-) diff --git a/.babelrc b/.babelrc index 9e1f44e7e..f54a439e1 100644 --- a/.babelrc +++ b/.babelrc @@ -1,15 +1,14 @@ { - "presets": [ [ - "@babel/env", - { - "targets": { - "node": 14 + "presets": [ + [ + "@babel/env", + { + "targets": { + "node": 16 + } } - } - ], + ], "@babel/typescript" ], - "ignore": [ - "**/*.d.ts" - ] + "ignore": ["**/*.d.ts"] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a77dfde1..3cb4b1eb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,10 @@ jobs: - 4873:4873 steps: - uses: actions/checkout@v2.4.0 - - name: Use Node 14 + - name: Use Node 16 uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - name: Install pnpm run: npm i pnpm@6.24.1 -g - name: set store @@ -84,43 +84,6 @@ jobs: run: pnpm recursive install --frozen-lockfile --ignore-scripts - name: Lint run: pnpm format:check - - build14: - runs-on: ubuntu-latest - name: build-node-14 - needs: [format, lint] - steps: - - uses: actions/checkout@v2.4.0 - - name: Use Node 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - - name: Install pnpm - run: npm i pnpm@6.24.1 -g - - uses: actions/cache@v2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: Install - run: pnpm recursive install --frozen-lockfile --ignore-scripts - - name: crowdin download - env: - CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }} - CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} - CONTEXT: production - run: pnpm crowdin:download - ## this step is optional, translations are not mandatory for PR - ## secrets keys are not available on forks, the failure here is guaranteed - continue-on-error: true - - name: build - run: pnpm build - - name: tar packages - run: | - tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages . - - uses: actions/upload-artifact@v2 - with: - name: verdaccio-artifact - path: pkg.tar.gz build: needs: [format, lint] strategy: @@ -128,7 +91,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] ## Node 16 breaks UI test, jest issue - node_version: [14, 16, 17] + node_version: [16, 17] name: ${{ matrix.os }} / Node ${{ matrix.node_version }} runs-on: ${{ matrix.os }} steps: @@ -150,19 +113,14 @@ jobs: - name: Test run: pnpm test ci-e2e-ui: - needs: build14 + needs: [format, lint] runs-on: ubuntu-latest - name: UI Test E2E Node 14 + name: UI Test E2E Node 16 steps: - uses: actions/checkout@v2.4.0 - uses: actions/setup-node@v1 with: - node-version: 14 - - uses: actions/download-artifact@v2 - with: - name: verdaccio-artifact - - name: untar packages - run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages + node-version: 16 - name: Install pnpm run: npm i pnpm@6.24.1 -g - uses: actions/cache@v2 @@ -172,24 +130,22 @@ jobs: - name: Install ## we need scripts, pupetter downloads aditional content run: pnpm recursive install --frozen-lockfile + - name: build + run: pnpm build - name: Test UI run: pnpm test:e2e:ui # env: # DEBUG: verdaccio:e2e* ci-e2e-cli: - needs: build14 + needs: [format, lint] runs-on: ubuntu-latest + # TODO: fails on migrate to node 16, we need to check why name: CLI Test E2E Node 14 steps: - uses: actions/checkout@v2.4.0 - uses: actions/setup-node@v1 with: node-version: 14 - - uses: actions/download-artifact@v2 - with: - name: verdaccio-artifact - - name: untar packages - run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages - name: Install pnpm run: npm i pnpm@6.24.1 -g - uses: actions/cache@v2 @@ -199,12 +155,14 @@ jobs: - name: Install ## we need scripts, pupetter downloads aditional content run: pnpm recursive install --frozen-lockfile + - name: build + run: pnpm build - name: Test CLI run: pnpm test:e2e:cli env: DEBUG: verdaccio* sync-translations: - needs: [ci-e2e-cli, ci-e2e-ui, build14] + needs: [ci-e2e-cli, ci-e2e-ui] runs-on: ubuntu-latest name: synchronize translations if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' @@ -212,7 +170,7 @@ jobs: - uses: actions/checkout@v2.4.0 - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - uses: actions/download-artifact@v2 with: name: verdaccio-artifact diff --git a/Dockerfile b/Dockerfile index 8efd6ad33..7087c1059 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.18.1-alpine as builder +FROM --platform=${BUILDPLATFORM:-linux/amd64} node:16.13.1-alpine as builder ENV NODE_ENV=development \ VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org @@ -11,7 +11,7 @@ RUN apk --no-cache add openssl ca-certificates wget && \ WORKDIR /opt/verdaccio-build COPY . . -RUN npm -g i pnpm@6.10.3 && \ +RUN npm -g i pnpm@6.24.1 && \ pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \ pnpm recursive install --frozen-lockfile --ignore-scripts && \ rm -Rf test && \ @@ -20,7 +20,7 @@ RUN npm -g i pnpm@6.10.3 && \ # FIXME: need to remove devDependencies from the build # RUN pnpm install --prod --ignore-scripts -FROM node:14.18.1-alpine +FROM node:16.13.1-alpine LABEL maintainer="https://github.com/verdaccio/verdaccio" ENV VERDACCIO_APPDIR=/opt/verdaccio \ diff --git a/README.md b/README.md index ccd164ffc..aa62eae2f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Google Cloud Storage** or create your own plugin. ## Install -> Latest Node.js v14 +> Latest Node.js v16 required Install with npm: