Skip to content

Commit cf81a29

Browse files
Merge branch 'main' of https://github.com/RedisInsight/RedisInsight into be/bugfix/RI-4661_cloud_recommendation
2 parents 5030b34 + 803c459 commit cf81a29

File tree

221 files changed

+6436
-5778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+6436
-5778
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
# Test jobs
184184
unit-tests-ui:
185185
docker:
186-
- image: cimg/node:16.15.1
186+
- image: cimg/node:18.15.0
187187
steps:
188188
- checkout
189189
- restore_cache:
@@ -227,7 +227,7 @@ jobs:
227227
- ./node_modules
228228
unit-tests-api:
229229
docker:
230-
- image: cimg/node:16.15.1
230+
- image: cimg/node:18.15.0
231231
steps:
232232
- checkout
233233
- restore_cache:
@@ -385,7 +385,7 @@ jobs:
385385
- checkout
386386
- attach_workspace:
387387
at: .
388-
- run: choco install nodejs --version=16.15.1
388+
- run: choco install nodejs --version=18.15.0
389389
- run:
390390
command: |
391391
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
@@ -534,7 +534,7 @@ jobs:
534534
steps:
535535
- checkout
536536
- node/install:
537-
node-version: '16.15.1'
537+
node-version: '18.15.0'
538538
- attach_workspace:
539539
at: .
540540
- run:
@@ -599,7 +599,7 @@ jobs:
599599
- release/redisstack
600600
macosx:
601601
macos:
602-
xcode: 14.3.0
602+
xcode: 14.2.0
603603
resource_class: macos.x86.medium.gen2
604604
parameters:
605605
env:
@@ -610,7 +610,7 @@ jobs:
610610
steps:
611611
- checkout
612612
- node/install:
613-
node-version: '16.15.1'
613+
node-version: '18.15.0'
614614
- attach_workspace:
615615
at: .
616616
- run:
@@ -684,7 +684,7 @@ jobs:
684684
- run:
685685
name: Build windows exe
686686
command: |
687-
choco install nodejs --version=16.15.1
687+
choco install nodejs --version=18.15.0
688688
# set ALL_REDIS_COMMANDS=$(curl $ALL_REDIS_COMMANDS_RAW_URL)
689689
yarn install
690690
yarn --cwd redisinsight/api/ install

.eslintrc.js

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,63 @@
11
module.exports = {
22
root: true,
3+
env: {
4+
node: true,
5+
},
36
extends: ['airbnb-typescript'],
47
plugins: ['@typescript-eslint'],
58
parser: '@typescript-eslint/parser',
69
rules: {
7-
'max-len': ['warn', 120],
10+
semi: ['error', 'never'],
11+
quotes: [2, 'single', { avoidEscape: true }],
12+
'max-len': ['error', { ignoreComments: true, ignoreStrings: true, ignoreRegExpLiterals: true, code: 120 }],
813
'class-methods-use-this': 'off',
914
'import/no-extraneous-dependencies': 'off', // temporary disabled
15+
'@typescript-eslint/semi': ['error', 'never'],
16+
'object-curly-newline': 'off',
17+
'import/prefer-default-export': 'off',
18+
'@typescript-eslint/comma-dangle': 'off',
19+
'implicit-arrow-linebreak': 'off',
20+
'import/order': [
21+
1,
22+
{
23+
groups: [
24+
'external',
25+
'builtin',
26+
'internal',
27+
'sibling',
28+
'parent',
29+
'index',
30+
],
31+
pathGroups: [
32+
{
33+
pattern: 'desktopSrc/**',
34+
group: 'internal',
35+
position: 'after'
36+
},
37+
{
38+
pattern: 'uiSrc/**',
39+
group: 'internal',
40+
position: 'after'
41+
},
42+
{
43+
pattern: 'apiSrc/**',
44+
group: 'internal',
45+
position: 'after'
46+
},
47+
],
48+
warnOnUnassignedImports: true,
49+
pathGroupsExcludedImportTypes: ['builtin']
50+
},
51+
],
1052
},
1153
parserOptions: {
1254
project: './tsconfig.json',
55+
ecmaVersion: 2020,
56+
sourceType: 'module',
57+
createDefaultProgram: true,
1358
},
1459
ignorePatterns: [
1560
'redisinsight/ui',
61+
'redisinsight/api',
1662
],
17-
};
63+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ dll
5656
main.js
5757
main.js.map
5858
vendor
59+
redisinsight/main.js.LICENSE.txt
60+
redisinsight/main.prod.js.LICENSE.txt
61+
5962

6063
# E2E tests report
6164
/tests/e2e/report

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.15.1-alpine as front
1+
FROM node:18.15.0-alpine as front
22
RUN apk update
33
RUN apk add --no-cache --virtual .gyp \
44
python3 \
@@ -20,7 +20,7 @@ ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
2020
RUN yarn build:web
2121
RUN yarn build:statics
2222

23-
FROM node:16.15.1-alpine as back
23+
FROM node:18.15.0-alpine as back
2424
WORKDIR /usr/src/app
2525
COPY redisinsight/api/package.json redisinsight/api/yarn.lock ./
2626
RUN yarn install
@@ -29,7 +29,7 @@ COPY --from=front /usr/src/app/redisinsight/api/static ./static
2929
COPY --from=front /usr/src/app/redisinsight/api/defaults ./defaults
3030
RUN yarn run build:prod
3131

32-
FROM node:16.15.1-slim
32+
FROM node:18.15.0-slim
3333
# Set up mDNS functionality, to play well with Redis Enterprise
3434
# clusters on the network.
3535
RUN set -ex \

api.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.15.1-alpine as build
1+
FROM node:18.15.0-alpine as build
22

33
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
44
RUN dbus-uuidgen > /var/lib/dbus/machine-id
@@ -19,7 +19,7 @@ RUN yarn install --production
1919
RUN cp .yarnclean.prod .yarnclean && yarn autoclean --force
2020

2121
# Production image
22-
FROM node:16.15.1-alpine as production
22+
FROM node:18.15.0-alpine as production
2323

2424
RUN apk update && apk add bash libsecret dbus-x11 gnome-keyring
2525
RUN dbus-uuidgen > /var/lib/dbus/machine-id

configs/paths.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

configs/webpack.config.base.js renamed to configs/webpack.config.base.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import path from 'path';
21
import webpack from 'webpack';
3-
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
2+
import TsconfigPathsPlugins from 'tsconfig-paths-webpack-plugin';
3+
import webpackPaths from './webpack.paths';
44
import { dependencies as externals } from '../redisinsight/package.json';
55

6-
export default {
6+
const configuration: webpack.Configuration = {
77
externals: [...Object.keys(externals || {})],
88

9+
stats: 'errors-only',
10+
911
module: {
1012
rules: [
1113
{
@@ -22,28 +24,22 @@ export default {
2224
},
2325

2426
output: {
25-
path: path.join(__dirname, '..'),
26-
// commonjs2 https://github.com/webpack/webpack/issues/1114
27-
libraryTarget: 'commonjs2',
27+
path: webpackPaths.riPath,
28+
// https://github.com/webpack/webpack/issues/1114
29+
library: {
30+
type: 'commonjs2',
31+
},
2832
},
2933

3034
resolve: {
3135
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx', '.scss'],
32-
plugins: [
33-
new TsconfigPathsPlugin({
34-
configFile: path.join(__dirname, '..', 'tsconfig.json'),
35-
}),
36-
],
37-
alias: {
38-
src: path.resolve(__dirname, '../redisinsight/api/src'),
39-
apiSrc: path.resolve(__dirname, '../redisinsight/api/src'),
40-
uiSrc: path.resolve(__dirname, '../redisinsight/ui/src'),
41-
},
42-
modules: [path.join(__dirname, '../redisinsight/api'), 'node_modules'],
36+
modules: [webpackPaths.apiPath, 'node_modules'],
37+
plugins: [new TsconfigPathsPlugins()],
4338
},
4439

4540
plugins: [
4641
new webpack.EnvironmentPlugin({
42+
NODE_ENV: 'production',
4743
}),
4844

4945
new webpack.IgnorePlugin({
@@ -81,3 +77,5 @@ export default {
8177
}),
8278
],
8379
};
80+
81+
export default configuration;

configs/webpack.config.eslint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/* eslint import/no-unresolved: off, import/no-self-import: off */
33
require('@babel/register');
44

5-
module.exports = require('./webpack.config.renderer.dev.babel').default;
5+
module.exports = require('./webpack.config.renderer.dev').default;

configs/webpack.config.main.prod.babel.js renamed to configs/webpack.config.main.prod.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import path from 'path';
22
import webpack from 'webpack';
33
import { merge } from 'webpack-merge';
4-
import { toString } from 'lodash'
4+
import { toString } from 'lodash';
55
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
66
import baseConfig from './webpack.config.base';
77
import DeleteSourceMaps from '../scripts/DeleteSourceMaps';
88
import { version } from '../redisinsight/package.json';
9+
import webpackPaths from './webpack.paths';
910

1011
DeleteSourceMaps();
1112

@@ -23,19 +24,17 @@ export default merge(baseConfig, {
2324

2425
target: 'electron-main',
2526

26-
entry: './redisinsight/main.dev.ts',
27-
28-
resolve: {
29-
alias: {
30-
['apiSrc']: path.resolve(__dirname, '../redisinsight/api/src'),
31-
['src']: path.resolve(__dirname, '../redisinsight/api/src'),
32-
},
33-
extensions: ['.tsx', '.ts', '.js', '.jsx'],
27+
entry: {
28+
main: path.join(webpackPaths.desktopPath, 'index.ts'),
29+
preload: path.join(webpackPaths.desktopPath, 'preload.ts'),
3430
},
3531

3632
output: {
37-
path: path.join(__dirname, '../redisinsight'),
38-
filename: 'main.prod.js',
33+
path: webpackPaths.distMainPath,
34+
filename: '[name].js',
35+
library: {
36+
type: 'umd',
37+
},
3938
},
4039

4140
// optimization: {
@@ -46,10 +45,6 @@ export default merge(baseConfig, {
4645
// ],
4746
// },
4847

49-
// alias: {
50-
// 'apiSrc': path.resolve(__dirname, '../redisinsight/api/src/')
51-
// },
52-
5348
plugins: [
5449
new BundleAnalyzerPlugin({
5550
analyzerMode: process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
@@ -75,6 +70,10 @@ export default merge(baseConfig, {
7570
? process.env.CONNECTIONS_TIMEOUT_DEFAULT
7671
: toString(30 * 1000), // 30 sec
7772
}),
73+
74+
new webpack.DefinePlugin({
75+
'process.type': '"browser"',
76+
}),
7877
],
7978

8079
/**

configs/webpack.config.main.stage.babel.js renamed to configs/webpack.config.main.stage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import webpack from 'webpack';
22
import { merge } from 'webpack-merge';
3+
import { toString } from 'lodash';
34
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
4-
import { toString } from 'lodash'
5-
import mainProdConfig from './webpack.config.main.prod.babel';
5+
import mainProdConfig from './webpack.config.main.prod';
66
import DeleteSourceMaps from '../scripts/DeleteSourceMaps';
77
import { version } from '../redisinsight/package.json';
88

0 commit comments

Comments
 (0)