Skip to content

Commit 1dfefeb

Browse files
Merge pull request #123 from RedisInsight/main
a new release candidate
2 parents 36e82ef + 4e92057 commit 1dfefeb

File tree

132 files changed

+1230
-8068
lines changed

Some content is hidden

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

132 files changed

+1230
-8068
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ jobs:
432432
exit 0;
433433
fi
434434
435-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
435+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
436436
- persist_to_workspace:
437437
root: .
438438
paths:
@@ -474,7 +474,7 @@ jobs:
474474
exit 0;
475475
fi
476476
477-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
477+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
478478
rm -rf release/mac
479479
no_output_timeout: 15m
480480
- persist_to_workspace:
@@ -514,7 +514,7 @@ jobs:
514514
exit 0;
515515
fi
516516
517-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
517+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
518518
rm -rf release/win-unpacked
519519
shell: bash.exe
520520
no_output_timeout: 20m
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main, latest, release/*, codeql ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '37 11 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

configs/webpack.config.main.prod.babel.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'path';
22
import webpack from 'webpack';
33
import { merge } from 'webpack-merge';
4-
import TerserPlugin from 'terser-webpack-plugin';
54
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
65
import baseConfig from './webpack.config.base';
76
import DeleteSourceMaps from '../scripts/DeleteSourceMaps';

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
"build:main": "webpack --config ./configs/webpack.config.main.prod.babel.js",
1414
"build:main:stage": "webpack --config ./configs/webpack.config.main.stage.babel.js",
1515
"build:web": "webpack --config ./configs/webpack.config.web.prod.babel.js",
16-
"build:statics": "sh ./scripts/build-statics.sh",
17-
"build:statics:win": "./scripts/build-statics.cmd",
16+
"build:defaults": "yarn --cwd redisinsight/api build:defaults",
17+
"build:statics": "yarn build:defaults & sh ./scripts/build-statics.sh",
18+
"build:statics:win": "yarn build:defaults & ./scripts/build-statics.cmd",
1819
"build:renderer": "webpack --config ./configs/webpack.config.renderer.prod.babel.js",
1920
"build:renderer:stage": "webpack --config ./configs/webpack.config.renderer.stage.babel.js",
2021
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir redisinsight/ui",

redisinsight/api/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# compiled output
22
/dist
33
/node_modules
4-
/src/static
4+
/static
5+
/defaults
56

67
# Logs
78
logs

redisinsight/api/config/default.ts

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,21 @@ const staticDir = process.env.BUILD_TYPE === 'ELECTRON' && process['resourcesPat
66
? join(process['resourcesPath'], 'static')
77
: join(__dirname, '..', 'static');
88

9+
const defaultsDir = process.env.BUILD_TYPE === 'ELECTRON' && process['resourcesPath']
10+
? join(process['resourcesPath'], 'defaults')
11+
: join(__dirname, '..', 'defaults');
12+
913
export default {
1014
dir_path: {
1115
homedir,
1216
staticDir,
17+
defaultsDir,
1318
logs: join(homedir, 'logs'),
1419
defaultPlugins: join(staticDir, 'plugins'),
1520
customPlugins: join(homedir, 'plugins'),
1621
pluginsAssets: join(staticDir, 'resources', 'plugins'),
1722
commands: join(homedir, 'commands'),
23+
defaultCommandsDir: join(defaultsDir, 'commands'),
1824
caCertificates: join(homedir, 'ca_certificates'),
1925
clientCertificates: join(homedir, 'client_certificates'),
2026
},
@@ -72,18 +78,36 @@ export default {
7278
omitSensitiveData: process.env.LOGGER_OMIT_DATA ? process.env.LOGGER_OMIT_DATA === 'true' : true,
7379
pipelineSummaryLimit: parseInt(process.env.LOGGER_PIPELINE_SUMMARY_LIMIT, 10) || 5,
7480
},
75-
commands: {
76-
mainUrl: process.env.COMMANDS_MAIN_URL
77-
|| 'https://raw.githubusercontent.com/redis/redis-doc/master/commands.json',
78-
redisearchUrl: process.env.COMMANDS_REDISEARCH_URL
79-
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
80-
redijsonUrl: process.env.COMMANDS_REDIJSON_URL
81-
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
82-
redistimeseriesUrl: process.env.COMMANDS_REDISTIMESERIES_URL
83-
|| 'https://raw.githubusercontent.com/RedisTimeSeries/RedisTimeSeries/master/commands.json',
84-
redisaiUrl: process.env.COMMANDS_REDISAI_URL
85-
|| 'https://raw.githubusercontent.com/RedisAI/RedisAI/master/commands.json',
86-
redisgraphUrl: process.env.COMMANDS_REDISGRAPH_URL
87-
|| 'https://raw.githubusercontent.com/RedisGraph/RedisGraph/master/commands.json',
88-
},
81+
commands: [
82+
{
83+
name: 'main',
84+
url: process.env.COMMANDS_MAIN_URL
85+
|| 'https://raw.githubusercontent.com/redis/redis-doc/master/commands.json',
86+
},
87+
{
88+
name: 'redisearch',
89+
url: process.env.COMMANDS_REDISEARCH_URL
90+
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
91+
},
92+
{
93+
name: 'redijson',
94+
url: process.env.COMMANDS_REDIJSON_URL
95+
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
96+
},
97+
{
98+
name: 'redistimeseries',
99+
url: process.env.COMMANDS_REDISTIMESERIES_URL
100+
|| 'https://raw.githubusercontent.com/RedisTimeSeries/RedisTimeSeries/master/commands.json',
101+
},
102+
{
103+
name: 'redisai',
104+
url: process.env.COMMANDS_REDISAI_URL
105+
|| 'https://raw.githubusercontent.com/RedisAI/RedisAI/master/commands.json',
106+
},
107+
{
108+
name: 'redisgraph',
109+
url: process.env.COMMANDS_REDISGRAPH_URL
110+
|| 'https://raw.githubusercontent.com/RedisGraph/RedisGraph/master/commands.json',
111+
},
112+
],
89113
};

redisinsight/api/config/production.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { join } from 'path';
22

3-
const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2.0');
3+
const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-preview');
44

55
export default {
66
dir_path: {

redisinsight/api/nest-cli.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
"sourceRoot": "src",
44
"compilerOptions": {
55
"assets": [
6-
"static/**/*"
6+
{
7+
"include": "../static/**/*",
8+
"outDir": "dist/static"
9+
},
10+
{
11+
"include": "../defaults/**/*",
12+
"outDir": "dist/defaults"
13+
}
714
]
815
}
916
}

redisinsight/api/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"url": "https://redis.com/redis-enterprise/redis-insight"
1010
},
1111
"scripts": {
12+
"build:defaults:commands": "ts-node ./scripts/default-commands.ts",
13+
"build:defaults": "yarn build:defaults:commands",
1214
"prebuild": "rimraf dist",
1315
"build": "nest build",
1416
"build:prod": "rimraf dist && nest build -p ./tsconfig.build.prod.json && cross-env NODE_ENV=production",
@@ -46,6 +48,7 @@
4648
"class-transformer": "^0.2.3",
4749
"class-validator": "^0.12.2",
4850
"express": "^4.17.1",
51+
"fs-extra": "^10.0.0",
4952
"ioredis": "^4.27.1",
5053
"is-glob": "^4.0.1",
5154
"jsonpath": "^1.1.1",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import axios from 'axios';
2+
import * as fs from 'fs';
3+
import * as path from 'path';
4+
import { get } from '../src/utils/config';
5+
6+
const PATH_CONFIG = get('dir_path');
7+
const COMMANDS_CONFIG = get('commands');
8+
9+
async function init() {
10+
try {
11+
await Promise.all(COMMANDS_CONFIG.map(async ({ name, url }) => {
12+
try {
13+
console.log(`Trying to get ${name} commands...`);
14+
const { data } = await axios.get(url, {
15+
responseType: 'text',
16+
transformResponse: [(raw) => raw],
17+
});
18+
19+
if (!fs.existsSync(PATH_CONFIG.defaultCommandsDir)) {
20+
fs.mkdirSync(PATH_CONFIG.defaultCommandsDir, { recursive: true });
21+
}
22+
23+
fs.writeFileSync(
24+
path.join(PATH_CONFIG.defaultCommandsDir, `${name}.json`),
25+
JSON.stringify(JSON.parse(data)), // check that we received proper json object
26+
);
27+
console.log(`Successfully generated default ${name} commands`);
28+
} catch (error) {
29+
console.error(`Unable to update ${name} commands`, error);
30+
}
31+
}));
32+
33+
process.exit(0);
34+
} catch (e) {
35+
console.error('Something went wrong trying to get default commands jsons', e);
36+
process.exit(1);
37+
}
38+
}
39+
40+
init();

0 commit comments

Comments
 (0)