Skip to content

Commit 28176e6

Browse files
authored
Merge pull request #350 from lightninglabs/update-cra
deps: update react-scripts to v5.0.0
2 parents c0f0b30 + f793ca5 commit 28176e6

File tree

13 files changed

+4817
-5141
lines changed

13 files changed

+4817
-5141
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
strategy:
2626
matrix:
27-
node_version: [12.x]
27+
node_version: [16.x]
2828
os: [ubuntu-latest, windows-latest, macOS-latest]
2929

3030
steps:
@@ -109,10 +109,10 @@ jobs:
109109
id: yarn-cache
110110
with:
111111
path: ${{ steps.yarn-cache-dir.outputs.dir }}
112-
key: ${{ runner.os }}-yarn-12.x-${{ hashFiles('**/yarn.lock') }}
112+
key: ${{ runner.os }}-yarn-16.x-${{ hashFiles('**/yarn.lock') }}
113113
restore-keys: |
114-
${{ runner.os }}-yarn-12.x-${{ hashFiles('**/yarn.lock') }}
115-
${{ runner.os }}-yarn-12.x-
114+
${{ runner.os }}-yarn-16.x-${{ hashFiles('**/yarn.lock') }}
115+
${{ runner.os }}-yarn-16.x-
116116
${{ runner.os }}-yarn-
117117
118118
- name: setup go v${{ matrix.go_version }}
@@ -138,10 +138,10 @@ jobs:
138138
- name: git checkout
139139
uses: actions/checkout@v2
140140

141-
- name: setup nodejs v${{ matrix.node_version }}
141+
- name: setup nodejs v16.x
142142
uses: actions/setup-node@v1
143143
with:
144-
node-version: 12.x
144+
node-version: 16.x
145145

146146
- name: download cache
147147
uses: actions/cache@v1
@@ -192,7 +192,7 @@ jobs:
192192
- name: setup nodejs v${{ matrix.node_version }}
193193
uses: actions/setup-node@v1
194194
with:
195-
node-version: 12.x
195+
node-version: 16.x
196196

197197
- name: download cache
198198
uses: actions/cache@v1

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Start with a NodeJS base image that also contains yarn.
2-
FROM node:12.17.0-alpine as nodejsbuilder
2+
FROM node:16.14.2-alpine as nodejsbuilder
33

44
# Pass a tag, branch or a commit using build-arg. This allows a docker image to
55
# be built from a specified Git state. The default image will use the Git tip of
@@ -20,8 +20,8 @@ ARG public_url=""
2020
# be mitigated by switching to HTTP and increasing the network timeout.
2121
# See https://github.com/yarnpkg/yarn/issues/5259 for more info.
2222
RUN apk add --no-cache --update alpine-sdk \
23-
python \
24-
git \
23+
python \
24+
git \
2525
&& git clone https://github.com/lightninglabs/lightning-terminal /go/src/github.com/lightninglabs/lightning-terminal \
2626
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
2727
&& git checkout $checkout \
@@ -51,7 +51,7 @@ ENV GO111MODULE on
5151

5252
# Install dependencies and install/build lightning-terminal.
5353
RUN apk add --no-cache --update alpine-sdk \
54-
make \
54+
make \
5555
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
5656
&& make go-install PUBLIC_URL=$public_url \
5757
&& make go-install-cli
@@ -75,9 +75,9 @@ COPY --from=golangbuilder /go/bin/pool /bin/
7575

7676
# Add bash.
7777
RUN apk add --no-cache \
78-
bash \
79-
jq \
80-
ca-certificates
78+
bash \
79+
jq \
80+
ca-certificates
8181

8282
# Specify the start command and entrypoint as the lightning-terminal daemon.
8383
ENTRYPOINT ["litd"]

app/.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"extends": [
44
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
55
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
6-
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
76
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
87
],
98
"parserOptions": {

app/package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"start": "BROWSER=none react-scripts start",
99
"build": "react-scripts build",
10-
"test": "react-scripts test --env=jest-environment-jsdom-sixteen",
10+
"test": "react-scripts test --env=jest-environment-jsdom",
1111
"test:ci": "cross-env CI=true yarn test --coverage",
1212
"eject": "react-scripts eject",
1313
"lint": "eslint --ext .ts,.tsx --ignore-path .eslintignore .",
@@ -22,6 +22,7 @@
2222
"@improbable-eng/grpc-web": "0.14.0",
2323
"big.js": "6.1.1",
2424
"bootstrap": "4.6.1",
25+
"buffer": "6.0.3",
2526
"copy-to-clipboard": "3.3.1",
2627
"d3": "6.3.1",
2728
"date-fns": "2.14.0",
@@ -42,7 +43,7 @@
4243
"react-dom": "17.0.2",
4344
"react-i18next": "11.7.0",
4445
"react-router": "5.2.0",
45-
"react-scripts": "4.0.2",
46+
"react-scripts": "5.0.0",
4647
"react-toastify": "6.0.6",
4748
"react-virtualized": "9.21.2",
4849
"reactour": "1.18.0",
@@ -64,28 +65,31 @@
6465
"@types/file-saver": "2.0.1",
6566
"@types/google-protobuf": "3.7.2",
6667
"@types/history": "4.7.6",
67-
"@types/jest": "26.0.3",
68+
"@types/jest": "27.4.1",
6869
"@types/lodash": "4.14.157",
6970
"@types/node": "14.0.14",
7071
"@types/react": "17.0.13",
7172
"@types/react-dom": "17.0.8",
7273
"@types/react-router": "5.1.8",
7374
"@types/react-virtualized": "9.21.10",
7475
"@types/reactour": "1.17.1",
75-
"@typescript-eslint/eslint-plugin": "4.7.0",
76-
"@typescript-eslint/parser": "4.7.0",
76+
"@typescript-eslint/eslint-plugin": "5.17.0",
77+
"@typescript-eslint/parser": "5.17.0",
7778
"cross-env": "7.0.2",
78-
"eslint-config-prettier": "6.15.0",
79-
"eslint-plugin-prettier": "3.1.4",
80-
"eslint-plugin-react": "7.21.5",
79+
"eslint-config-prettier": "8.5.0",
80+
"eslint-plugin-prettier": "4.0.0",
81+
"eslint-plugin-react": "7.29.4",
8182
"google-protobuf": "3.12.2",
8283
"jest-canvas-mock": "2.3.0",
83-
"jest-environment-jsdom-sixteen": "1.0.3",
84+
"jest-environment-jsdom": "27.5.1",
8485
"prettier": "2.1.2",
8586
"sass": "1.43.4",
8687
"ts-protoc-gen": "0.12.0",
8788
"typescript": "4.1.6"
8889
},
90+
"resolutions": {
91+
"history": "4.10.1"
92+
},
8993
"eslintConfig": {
9094
"extends": "react-app",
9195
"ignorePatterns": [

app/src/__tests__/components/pool/BatchStats.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('BatchStats', () => {
3333
expect(getByText('1m 30s')).toBeInTheDocument();
3434

3535
act(() => {
36-
jest.runTimersToTime(1000);
36+
jest.advanceTimersByTime(1000);
3737
});
3838
await waitFor(() => {
3939
expect(getByText('1m 29s')).toBeInTheDocument();

app/src/__tests__/store/batchStore.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,20 +254,22 @@ describe('BatchStore', () => {
254254
// allow polling in this test
255255
Object.defineProperty(config, 'IS_TEST', { get: () => false });
256256
jest.useFakeTimers();
257+
jest.spyOn(global, 'setInterval');
257258

258259
store.startPolling();
259-
expect(window.setInterval).toBeCalled();
260+
expect(setInterval).toBeCalled();
260261
expect(callCount).toBe(0);
261262
// fast forward 1 minute
262-
jest.runTimersToTime(60 * 1000);
263+
jest.advanceTimersByTime(60 * 1000);
263264
await waitFor(() => {
264265
expect(callCount).toBe(1);
265266
});
266267

268+
jest.spyOn(global, 'clearInterval');
267269
store.stopPolling();
268-
expect(window.clearInterval).toBeCalled();
270+
expect(clearInterval).toBeCalled();
269271
// fast forward 1 more minute
270-
jest.runTimersToTime(120 * 1000);
272+
jest.advanceTimersByTime(120 * 1000);
271273
expect(callCount).toBe(1);
272274

273275
// revert IS_TEST

app/src/api/pool.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as AUCT from 'types/generated/auctioneerrpc/auctioneer_pb';
22
import * as POOL from 'types/generated/trader_pb';
33
import { Trader } from 'types/generated/trader_pb_service';
44
import Big from 'big.js';
5+
import { Buffer } from 'buffer';
56
import { b64 } from 'util/strings';
67
import { OrderType, Tier } from 'store/models/order';
78
import BaseApi from './base';

app/src/store/stores/authStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { makeAutoObservable, runInAction } from 'mobx';
2+
import { Buffer } from 'buffer';
23
import { prefixTranslation } from 'util/translate';
34
import { Store } from 'store';
45

app/src/util/strings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Buffer } from 'buffer';
2+
13
/**
24
* Shortens text by removing a portion of characters from the middle and only
35
* keeping a small subset of the outer left and right sides

0 commit comments

Comments
 (0)