Skip to content

Commit 75b82d0

Browse files
authored
chore: bump mongodb-query-parser dependency (#4632)
1 parent a9b88c2 commit 75b82d0

File tree

23 files changed

+78
-144
lines changed

23 files changed

+78
-144
lines changed

package-lock.json

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

packages/compass-aggregations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"mongodb": "^5.6.0",
8484
"mongodb-data-service": "^22.9.1",
8585
"mongodb-ns": "^2.4.0",
86-
"mongodb-query-parser": "^2.5.0",
86+
"mongodb-query-parser": "^3.1.3",
8787
"mongodb-schema": "^11.2.1",
8888
"nyc": "^15.1.0",
8989
"prettier": "^2.7.1",

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/match/match.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
22
import TypeChecker from 'hadron-type-checker';
3-
import queryParser from 'mongodb-query-parser';
3+
import { toJSString } from 'mongodb-query-parser';
44
import { css, spacing } from '@mongodb-js/compass-components';
55
import MatchGroupForm, { createGroup } from './match-group-form';
66

@@ -166,7 +166,7 @@ const MatchForm = ({ fields, onChange }: WizardComponentProps) => {
166166
setMatchGroup(changedGroup);
167167
try {
168168
const matchStage = mapMatchFormStateToMatchStage(changedGroup);
169-
onChange(queryParser.toJSString(matchStage), null);
169+
onChange(toJSString(matchStage) || '', null);
170170
} catch (error) {
171171
onChange('{}', error as Error);
172172
}

packages/compass-aggregations/src/modules/collation-string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CollationOptions } from 'mongodb';
2-
import queryParser from 'mongodb-query-parser';
2+
import { isCollationValid } from 'mongodb-query-parser';
33
import type { AnyAction } from 'redux';
44
import { ActionTypes as ConfirmNewPipelineActions } from './is-new-pipeline-confirm';
55
import { RESTORE_PIPELINE } from './saved-pipeline';
@@ -33,7 +33,7 @@ export const INITIAL_STATE: CollationStringState = {
3333
export function getCollationStateFromString(
3434
collationString: string
3535
): CollationStringState {
36-
const collation = queryParser.isCollationValid(collationString);
36+
const collation = isCollationValid(collationString);
3737
return {
3838
text: collationString,
3939
value: collation === false ? null : collation,

packages/compass-aggregations/src/typings.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
declare module 'react-sortable-hoc';
22
declare module '@mongodb-js/mongodb-redux-common/app-registry';
3-
declare module 'mongodb-query-parser' {
4-
import type { CollationOptions } from 'mongodb';
5-
const isCollationValid: (
6-
collationString: string
7-
) => false | null | CollationOptions;
8-
const toJSString: (input: unknown, pad?: string) => string;
9-
export { isCollationValid, toJSString };
10-
}
113
declare module '*.module.less' {
124
const styles = Record<string, string>;
135
export default styles;

packages/compass-import-export/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"mongodb": "^5.6.0",
106106
"mongodb-data-service": "^22.9.1",
107107
"mongodb-ns": "^2.4.0",
108-
"mongodb-query-parser": "^2.5.0",
108+
"mongodb-query-parser": "^3.1.3",
109109
"mongodb-schema": "^11.2.1",
110110
"nyc": "^15.1.0",
111111
"papaparse": "^5.3.2",

packages/compass-import-export/src/typings.d.ts

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

packages/compass-indexes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"mocha": "^10.2.0",
8484
"mongodb": "^5.6.0",
8585
"mongodb-data-service": "^22.9.1",
86-
"mongodb-query-parser": "^2.5.0",
86+
"mongodb-query-parser": "^3.1.3",
8787
"numeral": "^2.0.6",
8888
"nyc": "^15.1.0",
8989
"prop-types": "^15.7.2",

packages/compass-indexes/src/modules/create-index/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { EJSON, ObjectId } from 'bson';
22
import { combineReducers } from 'redux';
33
import type { Dispatch } from 'redux';
44
import { createLoggerAndTelemetry } from '@mongodb-js/compass-logging';
5-
import queryParser from 'mongodb-query-parser';
5+
import { isCollationValid } from 'mongodb-query-parser';
66
import type { CreateIndexesOptions, IndexSpecification } from 'mongodb';
77

88
import dataService from '../data-service';
@@ -135,8 +135,7 @@ export const createIndex = () => {
135135

136136
// Check for collaction errors.
137137
const collation =
138-
queryParser.isCollationValid(stateOptions.collation.value ?? '') ||
139-
undefined;
138+
isCollationValid(stateOptions.collation.value ?? '') || undefined;
140139

141140
if (stateOptions.collation.enabled && !collation) {
142141
dispatch(handleError('You must provide a valid collation object'));
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
declare module 'mongodb-query-parser' {
2-
import type { CollationOptions } from 'mongodb';
3-
const isCollationValid: (
4-
collationString: string
5-
) => false | null | CollationOptions;
6-
export { isCollationValid };
7-
}
8-
91
declare module '@mongodb-js/mongodb-redux-common/app-registry';

0 commit comments

Comments
 (0)