Skip to content

Commit 8d81c57

Browse files
authored
Merge pull request #198 from RedisInsight/main
main to release
2 parents 3943bf4 + 067f4b8 commit 8d81c57

File tree

48 files changed

+789
-210
lines changed

Some content is hidden

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

48 files changed

+789
-210
lines changed

.circleci/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ aliases:
3535
when:
3636
not: *manual-build-conditions
3737

38+
licenses-generate: &licensesGenerate
39+
run:
40+
name: Generate license file for all vscode dependencies
41+
command: |
42+
sudo npm i -g license-checker
43+
sudo license-checker --json --out licenses.json
44+
shell: /bin/bash
45+
46+
licenses-generate-windows: &licensesGenerateWindows
47+
run:
48+
name: Generate license file for all vscode dependencies
49+
command: |
50+
npm i -g license-checker
51+
license-checker --json --out licenses.json
52+
shell: powershell.exe
53+
3854
orbs:
3955
node: circleci/node@5.3.0
4056
win: circleci/windows@5.0.0
@@ -189,6 +205,7 @@ jobs:
189205
name: Install dependencies
190206
command: |
191207
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
208+
- <<: *licensesGenerate
192209
- run:
193210
name: Build .vsix package
194211
command: |
@@ -238,6 +255,7 @@ jobs:
238255
command: |
239256
yarn install
240257
no_output_timeout: 15m
258+
- <<: *licensesGenerate
241259
- run:
242260
name: Build .vsix package
243261
command: |
@@ -302,6 +320,7 @@ jobs:
302320
yarn install
303321
shell: bash.exe
304322
no_output_timeout: 15m
323+
- <<: *licensesGenerateWindows
305324
- run:
306325
name: Build .vsix package
307326
command: |
@@ -380,6 +399,15 @@ jobs:
380399
# Orchestrate jobs using workflows
381400
# See: https://circleci.com/docs/configuration-reference/#workflows
382401
workflows:
402+
license-checker:
403+
jobs:
404+
- licenses-check:
405+
name: Run License checker
406+
filters:
407+
branches:
408+
only:
409+
- /^license.*/
410+
383411
frontend-tests:
384412
<<: *ignore-for-manual-build
385413
jobs:

.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = {
1111
'plugin:react-hooks/recommended',
1212
'airbnb-base',
1313
'airbnb-typescript',
14-
'plugin:sonarjs/recommended',
1514
// TODO: in a separate pull request enable and fix all classes sorting issues for tailwind
1615
// 'plugin:tailwindcss/recommended',
1716
],
@@ -88,9 +87,6 @@ module.exports = {
8887
'prefer-regex-literals': 'off',
8988
'react/display-name': 'off',
9089
'no-promise-executor-return': 'off',
91-
'sonarjs/no-duplicate-string': 'off',
92-
'sonarjs/cognitive-complexity': [1, 20],
93-
'sonarjs/no-identical-functions': [0, 5],
9490
'import/order': [
9591
1,
9692
{

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"**/yarn.lock": true,
4242
"*.{css,sass,scss}.d.ts": true,
4343
"pnpm-lock.yaml": true,
44-
"**/pnpm-lock.yaml": true
44+
"**/pnpm-lock.yaml": true,
45+
"**/test-extensions": true
4546
},
4647
"cSpell.words": ["githubocto", "tailwindcss", "webviews", "zustand"],
4748
"testing.automaticallyOpenPeekView": "never",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Redis for VS Code is the official Visual Studio Code extension that provides an intuitive and efficient GUI for Redis databases, developed by Redis.
44

5-
![Redis for VS Code](.github/Redis_for_VS_Code_main_screen.png)
5+
![Redis for VS Code](https://github.com/RedisInsight/Redis-for-VS-Code/blob/main/.github/Redis_for_VS_Code_main_screen.png)
66

77
## Key features:
88
* Universal Redis Support: Connect to any Redis instance, including Redis Community Edition, Redis Cloud, Redis Software, and Redis on Azure Cache.

Redis_for_VS_Code_main_screen.png

-1020 KB
Binary file not shown.

l10n/bundle.l10n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"Key name*": "Key name*",
104104
"Encrypted data": "Encrypted data",
105105
"This database does not support the JSON data structure. Learn more about JSON support ": "This database does not support the JSON data structure. Learn more about JSON support ",
106-
"here.": "here.",
106+
"here. ": "here. ",
107107
"You can also create a ": "You can also create a ",
108108
"free Redis Cloud database": "free Redis Cloud database",
109109
" with built-in JSON support.": " with built-in JSON support.",

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"@types/lodash": "^4.14.200",
180180
"@types/lodash-es": "^4.17.12",
181181
"@types/node": "^16.4.13",
182+
"@types/pako": "^2.0.3",
182183
"@types/react": "^18.2.0",
183184
"@types/react-dom": "^18.2.0",
184185
"@types/react-virtualized": "^9.21.28",
@@ -196,7 +197,6 @@
196197
"@vitest/ui": "^1.3.1",
197198
"@vscode/l10n-dev": "^0.0.35",
198199
"@vscode/vsce": "^3.0.0",
199-
"autoprefixer": "^10.4.16",
200200
"cross-env": "^7.0.3",
201201
"csv-parser": "^3.0.0",
202202
"csv-stringify": "^6.5.1",
@@ -212,12 +212,10 @@
212212
"eslint-plugin-react": "^7.35.0",
213213
"eslint-plugin-react-hooks": "^4.6.2",
214214
"eslint-plugin-react-refresh": "^0.4.4",
215-
"eslint-plugin-sonarjs": "^0.23.0",
216215
"eslint-plugin-tailwindcss": "^3.15.1",
217216
"googleapis": "^142.0.0",
218217
"html-entities": "^2.3.2",
219218
"husky": "^8.0.3",
220-
"identity-obj-proxy": "^3.0.0",
221219
"jsdom": "^22.1.0",
222220
"jsdom-worker": "^0.3.0",
223221
"lint-staged": "^15.0.2",
@@ -247,9 +245,11 @@
247245
"whatwg-fetch": "^3.6.19"
248246
},
249247
"dependencies": {
248+
"@stablelib/snappy": "^1.0.3",
250249
"@vscode/l10n": "^0.0.18",
251250
"@vscode/webview-ui-toolkit": "^1.4.0",
252251
"axios": "^1.5.1",
252+
"brotli-unicode": "^1.0.2",
253253
"buffer": "^6.0.3",
254254
"classnames": "^2.3.2",
255255
"connection-string": "^4.4.0",
@@ -259,6 +259,7 @@
259259
"dotenv": "^16.4.5",
260260
"file-saver": "^2.0.5",
261261
"formik": "^2.4.5",
262+
"fzstd": "^0.1.1",
262263
"history": "^5.3.0",
263264
"html-react-parser": "^5.0.6",
264265
"immer": "^9.0.21",
@@ -267,8 +268,10 @@
267268
"json-bigint": "^1.0.0",
268269
"jsonpath": "^1.1.1",
269270
"lodash": "^4.17.21",
271+
"lz4js": "^0.2.0",
270272
"monaco-editor": "^0.48.0",
271273
"msgpackr": "^1.10.1",
274+
"pako": "^2.1.0",
272275
"php-serialize": "^4.1.1",
273276
"pickleparser": "^0.2.1",
274277
"rawproto": "^0.7.15",

postcss.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ module.exports = {
55
'postcss-import': {},
66
'tailwindcss/nesting': {},
77
tailwindcss: {},
8-
autoprefixer: {},
98
},
109
}

src/Webview.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type WebviewOptions = {
1111
styleUri?: vscode.Uri
1212
nonce?: string
1313
message?: {
14+
action?: string
1415
data: object
1516
}
1617
column?: vscode.ViewColumn
@@ -113,6 +114,7 @@ abstract class Webview {
113114

114115
public abstract update(opts?: WebviewOptions): void
115116
public abstract setTitle(title: string): void
117+
public abstract postMessage(message: any): void
116118
}
117119

118120
export class WebviewPanel extends Webview implements vscode.Disposable {
@@ -211,6 +213,10 @@ export class WebviewPanel extends Webview implements vscode.Disposable {
211213
this.panel.title = title
212214
}
213215

216+
public postMessage(message: any) {
217+
this.panel.webview.postMessage(message)
218+
}
219+
214220
public dispose() {
215221
// Disposes of this instance
216222
// Next time getInstance() is called, it will construct a new instance

src/extension.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function activate(context: vscode.ExtensionContext) {
8484
viewId: ViewId.AddKey,
8585
handleMessage: (message) => handleMessage(message),
8686
message: args,
87-
})
87+
}).postMessage({ action: 'SetDatabase', data: { database: args.data?.database } })
8888
}),
8989

9090
vscode.commands.registerCommand('RedisForVSCode.addDatabase', (args) => {
@@ -159,22 +159,27 @@ export async function activate(context: vscode.ExtensionContext) {
159159

160160
vscode.commands.registerCommand('RedisForVSCode.addDatabaseClose', (args) => {
161161
WebviewPanel.getInstance({ viewId: ViewId.AddDatabase }).dispose()
162-
sidebarProvider.view?.webview.postMessage({ action: 'RefreshTree', data: args })
162+
sidebarProvider.view?.webview.postMessage({ action: 'AddDatabase', data: args })
163163
}),
164164

165165
vscode.commands.registerCommand('RedisForVSCode.editDatabaseClose', (args) => {
166166
WebviewPanel.getInstance({ viewId: ViewId.EditDatabase }).dispose()
167167
sidebarProvider.view?.webview.postMessage({ action: 'RefreshTree', data: args })
168+
169+
const keyDetailsWebview = WebviewPanel.instances[ViewId.Key]
170+
if (keyDetailsWebview) {
171+
keyDetailsWebview.postMessage({ action: 'SetDatabase', data: args })
172+
}
168173
}),
169174

170175
vscode.commands.registerCommand('RedisForVSCode.closeAddKeyAndRefresh', (args) => {
171176
WebviewPanel.getInstance({ viewId: ViewId.AddKey })?.dispose()
172-
sidebarProvider.view?.webview.postMessage({ action: 'RefreshTree', data: args })
177+
sidebarProvider.view?.webview.postMessage({ action: 'SetSelectedKeyAction', data: args })
173178
vscode.commands.executeCommand('RedisForVSCode.openKey', { action: 'SelectKey', data: args })
174179
}),
175180

176181
vscode.commands.registerCommand('RedisForVSCode.closeKeyAndRefresh', (args) => {
177-
sidebarProvider.view?.webview.postMessage({ action: 'RefreshTree', data: args })
182+
sidebarProvider.view?.webview.postMessage({ action: 'SetSelectedKeyAction', data: args })
178183
WebviewPanel.getInstance({ viewId: ViewId.Key })?.dispose()
179184
}),
180185

@@ -183,7 +188,7 @@ export async function activate(context: vscode.ExtensionContext) {
183188
}),
184189

185190
vscode.commands.registerCommand('RedisForVSCode.editKeyName', (args) => {
186-
sidebarProvider.view?.webview.postMessage({ action: 'RefreshTree', data: args })
191+
sidebarProvider.view?.webview.postMessage({ action: 'SetSelectedKeyAction', data: args })
187192
const title = getTitleForKey(args.keyInfo?.displayedKeyType, args.keyInfo?.newKeyString)
188193
WebviewPanel.getInstance({ viewId: ViewId.Key }).setTitle(title)
189194
}),

0 commit comments

Comments
 (0)