Skip to content

Commit 7744e1c

Browse files
DA-374 package size inconsistency (#382)
## Describe the problem this PR is solving ## Short description of the changes -
1 parent cd7afc1 commit 7744e1c

19 files changed

Lines changed: 81 additions & 52 deletions

.vscodeignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ vsc-extension-quickstart.md
1111
node_modules/
1212
.github/
1313
Makefile
14-
webpack.config.json
14+
webpack.config.json
15+
.git/**
16+
**/cmake*/
17+
**/cmake*
18+
**/cb-vscode-extension*/

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-couchbase",
33
"displayName": "Couchbase",
44
"description": "",
5-
"version": "2.0.1",
5+
"version": "2.0.2",
66
"engines": {
77
"vscode": "^1.63.1"
88
},
@@ -83,6 +83,7 @@
8383
"sass": "^1.72.0",
8484
"sass-loader": "^14.1.1",
8585
"style-loader": "^3.3.4",
86+
"terser-webpack-plugin": "^5.3.10",
8687
"ts-jest": "^29.1.2",
8788
"ts-loader": "^9.5.1",
8889
"typescript": "^5.4.3",

src/commands/collections/removeCollection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const removeCollection = async (node: CollectionNode) => {
3535
}
3636

3737
// Remove any document filter if set
38-
Memory.state.update(`filterDocuments-${node.connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`, '');
38+
Memory.state.update(`filterDocuments-${connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`, '');
3939

4040
const collectionManager = await connection.cluster
4141
?.bucket(node.bucketName)
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import CollectionNode from "../../model/CollectionNode";
2+
import { getActiveConnection } from "../../util/connections";
23
import { Memory } from "../../util/util";
34

45
export const clearDocumentFilter = async (node: CollectionNode) => {
6+
const connection = getActiveConnection();
7+
if(!connection){
8+
return;
9+
}
510
Memory.state.update(
6-
`filterDocuments-${node.connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`,
11+
`filterDocuments-${connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`,
712
""
813
);
914
};

src/commands/documents/filterDocuments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const filterDocuments = async (node: CollectionNode) => {
2525
}
2626

2727
const docFilter = Memory.state.get<IFilterDocuments>(
28-
`filterDocuments-${node.connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`
28+
`filterDocuments-${connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`
2929
);
3030
const filterStmt: string = docFilter ? docFilter.filter : "";
3131
let collectionName = node.collectionName;
@@ -78,7 +78,7 @@ export const filterDocuments = async (node: CollectionNode) => {
7878
filter: newDocFilterStmt.trim(),
7979
};
8080
Memory.state.update(
81-
`filterDocuments-${node.connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`,
81+
`filterDocuments-${connection.connectionIdentifier}-${node.bucketName}-${node.scopeName}-${node.collectionName}`,
8282
newDocFilter
8383
);
8484
};
Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import * as vscode from 'vscode';
2-
import { logger } from '../../logger/logger';
3-
import { Commands } from '../extensionCommands/commands';
1+
import * as vscode from "vscode";
2+
import { logger } from "../../logger/logger";
3+
import { Commands } from "../extensionCommands/commands";
4+
import { getActiveConnection } from "../../util/connections";
45

56
export const checkAndCreatePrimaryIndex = async (elementData: any) => {
67
const answer = await vscode.window.showWarningMessage(
@@ -10,16 +11,27 @@ export const checkAndCreatePrimaryIndex = async (elementData: any) => {
1011
"No"
1112
);
1213
if (answer === "Yes") {
13-
try{
14+
try {
15+
const connection = getActiveConnection();
16+
if (!connection) {
17+
return;
18+
}
1419
vscode.window.showInformationMessage("Creating primary index");
15-
await elementData.connection.cluster?.query(
20+
await connection.cluster?.query(
1621
`CREATE PRIMARY INDEX ON \`${elementData.bucketName}\`.\`${elementData.scopeName}\`.\`${elementData.collectionName}\` USING GSI`
1722
);
18-
logger.info(`Created Primay Index on ${elementData.bucketName} ${elementData.scopeName} ${elementData.collectionName} USING GSI`);
19-
vscode.commands.executeCommand(Commands.refreshCollection, elementData.parentNode);
20-
} catch(e){
21-
vscode.window.showErrorMessage("Error while creating primary index "+e);
22-
logger.error("Error while creating primary index "+ e);
23+
logger.info(
24+
`Created Primay Index on ${elementData.bucketName} ${elementData.scopeName} ${elementData.collectionName} USING GSI`
25+
);
26+
vscode.commands.executeCommand(
27+
Commands.refreshCollection,
28+
elementData.parentNode
29+
);
30+
} catch (e) {
31+
vscode.window.showErrorMessage(
32+
"Error while creating primary index " + e
33+
);
34+
logger.error("Error while creating primary index " + e);
2335
}
2436
}
25-
};
37+
};

src/commands/iq/iqLoginhandler.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ const getSessionsJwt = async (formData: IFormData): Promise<string> => {
3232

3333
export const iqLoginHandler = async (formData: IFormData) => {
3434
try {
35-
// Check for remember me
36-
if (formData.rememberMe === true) {
37-
Global.state.update(Constants.IQ_USER_ID, formData.username);
38-
const secretService = SecretService.getInstance();
39-
await secretService.store(`${Constants.IQ_PASSWORD}-${formData.username}`, formData.password);
40-
}
41-
4235
// Return organization select page data
4336
const jwtToken = await getSessionsJwt(formData);
4437
Memory.state.update("vscode-couchbase.iq.jwtToken", jwtToken);
4538
const organizations = await iqRestApiService.loadOrganizations(
4639
jwtToken
4740
);
41+
42+
// Check for remember me
43+
if (formData.rememberMe === true) {
44+
Global.state.update(Constants.IQ_USER_ID, formData.username);
45+
const secretService = SecretService.getInstance();
46+
await secretService.store(`${Constants.IQ_PASSWORD}-${formData.username}`, formData.password);
47+
}
4848
return organizations;
4949
} catch (error: any) {
5050
throw new Error(error.message.toString());

src/handlers/handleCLIDownloader.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class DependenciesDownloader {
9292
map.set(
9393
this.TOOL_IMPORT_EXPORT,
9494
this.getToolSpec(
95-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-macos_x86_64.zip",
95+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-macos_x86_64.zip",
9696
this.TOOL_IMPORT_EXPORT,
9797
OSUtil.MACOS_64
9898
)
@@ -125,7 +125,7 @@ class DependenciesDownloader {
125125
map.set(
126126
this.TOOL_IMPORT_EXPORT,
127127
this.getToolSpec(
128-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-macos_arm64.zip",
128+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-macos_arm64.zip",
129129
this.TOOL_IMPORT_EXPORT,
130130
OSUtil.MACOS_ARM
131131
)
@@ -158,7 +158,7 @@ class DependenciesDownloader {
158158
map.set(
159159
this.TOOL_IMPORT_EXPORT,
160160
this.getToolSpec(
161-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-windows_amd64.zip",
161+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-windows_amd64.zip",
162162
this.TOOL_IMPORT_EXPORT,
163163
OSUtil.WINDOWS_64
164164
)
@@ -191,7 +191,7 @@ class DependenciesDownloader {
191191
map.set(
192192
this.TOOL_IMPORT_EXPORT,
193193
this.getToolSpec(
194-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-windows_amd64.zip",
194+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-windows_amd64.zip",
195195
this.TOOL_IMPORT_EXPORT,
196196
OSUtil.WINDOWS_ARM
197197
)
@@ -224,7 +224,7 @@ class DependenciesDownloader {
224224
map.set(
225225
this.TOOL_IMPORT_EXPORT,
226226
this.getToolSpec(
227-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-linux_x86_64.tar.gz",
227+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-linux_x86_64.tar.gz",
228228
this.TOOL_IMPORT_EXPORT,
229229
OSUtil.LINUX_64
230230
)
@@ -257,7 +257,7 @@ class DependenciesDownloader {
257257
map.set(
258258
this.TOOL_IMPORT_EXPORT,
259259
this.getToolSpec(
260-
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-linux_aarch64.tar.gz",
260+
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-linux_aarch64.tar.gz",
261261
this.TOOL_IMPORT_EXPORT,
262262
OSUtil.LINUX_ARM
263263
)

src/handlers/versionConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export const config = {
77
TOOLS_VERSION: "7.2",
88
CBMIGRATE_VERSION: "1",
99
SHELL_VERSION: "1",
10-
CBIMPORT_EXPORT_VERSION: "7.2",
10+
CBIMPORT_EXPORT_VERSION: "7.6",
1111
};

0 commit comments

Comments
 (0)