From e1174293735b71c1eafab129ad708ee6bce16054 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 15 May 2022 08:35:59 +0200 Subject: [PATCH] Updated replace-version script to use ESM and updated to node 16.14 --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-preview.yml | 2 +- .github/workflows/publish-release.yml | 2 +- Dockerfile | 2 +- docker-compose.yml | 2 +- package.json | 2 +- scripts/{replace-version.js => replace-version.mjs} | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename scripts/{replace-version.js => replace-version.mjs} (96%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ce7315d..fc639987 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,6 @@ jobs: ci: uses: shlinkio/github-actions/.github/workflows/web-app-ci.yml@main with: - node-version: 16.13 + node-version: 16.14 with-mutation-tests: true publish-coverage: true diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 69b4cdb3..7761747d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -16,7 +16,7 @@ jobs: - name: Use node.js uses: actions/setup-node@v1 with: - node-version: 16.13 + node-version: 16.14 - name: Build run: | npm ci && \ diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8306b7e7..18ff70d8 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -14,7 +14,7 @@ jobs: - name: Use node.js uses: actions/setup-node@v1 with: - node-version: 16.13 + node-version: 16.14 - name: Generate release assets run: npm ci && VERSION=${GITHUB_REF#refs/tags/v} npm run build:dist - name: Publish release with assets diff --git a/Dockerfile b/Dockerfile index 2c6eb41f..b9bb22ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.13-alpine as node +FROM node:16.14-alpine as node COPY . /shlink-web-client ARG VERSION="latest" ENV VERSION ${VERSION} diff --git a/docker-compose.yml b/docker-compose.yml index a2a9db6b..4fdce7d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: shlink_web_client_node: container_name: shlink_web_client_node - image: node:16.13-alpine + image: node:16.14-alpine command: /bin/sh -c "cd /home/shlink/www && npm install && npm run start" volumes: - ./:/home/shlink/www diff --git a/package.json b/package.json index 6da609c6..6f86668e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:css:fix": "npm run lint:css -- --fix", "lint:js:fix": "npm run lint:js -- --fix", "start": "DISABLE_ESLINT_PLUGIN=true react-scripts start", - "build": "DISABLE_ESLINT_PLUGIN=true react-scripts build && node scripts/replace-version.js", + "build": "DISABLE_ESLINT_PLUGIN=true react-scripts build && node scripts/replace-version.mjs", "build:dist": "npm run build && node scripts/create-dist-file.mjs", "build:serve": "serve -p 5000 ./build", "test": "jest --env=jsdom --colors --verbose", diff --git a/scripts/replace-version.js b/scripts/replace-version.mjs similarity index 96% rename from scripts/replace-version.js rename to scripts/replace-version.mjs index 970d4583..38e49682 100644 --- a/scripts/replace-version.js +++ b/scripts/replace-version.mjs @@ -1,4 +1,4 @@ -const fs = require('fs'); +import fs from 'fs'; function replaceVersionPlaceholder(version) { const staticJsFilesPath = './build/static/js';