Merge pull request #650 from acelaya-forks/feature/esm-scripts

Feature/esm scripts
This commit is contained in:
Alejandro Celaya 2022-05-15 08:42:28 +02:00 committed by GitHub
commit 8655d9be87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 4308 additions and 130 deletions

View file

@ -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

View file

@ -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 && \

View file

@ -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

View file

@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
## [Unreleased]
### Added
* *Nothing*
### Changed
* [#648](https://github.com/shlinkio/shlink-web-client/pull/648) Migrated some scripts to ESM and updated to chalk 5.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* *Nothing*
## [3.7.0] - 2022-05-14
### Added
* [#622](https://github.com/shlinkio/shlink-web-client/pull/622) Added support to load domain visits when consuming Shlink 3.1.0 or newer.

View file

@ -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}

View file

@ -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

4397
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -13,8 +13,8 @@
"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:dist": "npm run build && node scripts/create-dist-file.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",
"test:coverage": "npm run test -- --coverage --coverageReporters=text --coverageReporters=text-summary",
@ -91,7 +91,7 @@
"@wojtekmaj/enzyme-adapter-react-17": "0.6.5",
"adm-zip": "^0.5.9",
"babel-jest": "^28.0.3",
"chalk": "^4.1.2",
"chalk": "^5.0.1",
"enzyme": "^3.11.0",
"eslint": "^8.12.0",
"identity-obj-proxy": "^3.0.0",

View file

@ -2,9 +2,9 @@
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
const chalk = require('chalk');
const AdmZip = require('adm-zip');
const fs = require('fs');
import chalk from 'chalk';
import AdmZip from 'adm-zip';
import fs from 'fs';
function zipDist(version) {
const versionFileName = `./dist/shlink-web-client_${version}_dist.zip`;

View file

@ -1,4 +1,4 @@
const fs = require('fs');
import fs from 'fs';
function replaceVersionPlaceholder(version) {
const staticJsFilesPath = './build/static/js';