Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/compass-aggregations/.depcheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ignores: [
"mongodb-extended-json",
"storage-mixin",
"@hot-loader/react-dom",
"@babel/cli",
Expand Down
1 change: 0 additions & 1 deletion packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
"lodash.debounce": "^4.0.8",
"lodash.isempty": "^4.4.0",
"lodash.isstring": "^4.0.1",
"mongodb-extended-json": "^1.11.1",
"mongodb-ns": "^2.3.0",
"re-resizable": "^6.9.0",
"react-bootstrap": "^0.32.4",
Expand Down
2 changes: 0 additions & 2 deletions packages/compass-crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@
"fast-json-parse": "^1.0.3",
"hadron-document": "^7.7.0",
"hadron-type-checker": "^6.6.0",
"js-beautify": "^1.10.2",
"lodash": "^4.17.15",
"moment": "^2.27.0",
"moment-timezone": "^0.5.21",
"mongodb-ace-theme": "^1.5.0",
"mongodb-extended-json": "^1.11.1",
"react-click-outside": "^3.0.1",
"react-tooltip": "^3.11.1"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/compass-crud/src/components/editable-json.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EJSON } from 'bson';
import React from 'react';
import PropTypes from 'prop-types';
import EJSON from 'mongodb-extended-json';
import jsBeautify from 'js-beautify';
import jsonParse from 'fast-json-parse';
import { TextButton } from 'hadron-react-buttons';
import DocumentActions from './document-actions';
Expand Down Expand Up @@ -313,7 +312,7 @@ class JsonEditor extends React.Component {

const value = this.state.json
? this.state.json
: jsBeautify(EJSON.stringify(this.props.doc.generateObject()));
: EJSON.stringify(this.props.doc.generateObject(), null, 2);

return (
<div className="json-ace-editor">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import classnames from 'classnames';
import jsBeautify from 'js-beautify';
import PropTypes from 'prop-types';

import 'ace-builds';
Expand Down Expand Up @@ -36,7 +35,7 @@ const OPTIONS = {
class InsertJsonDocument extends Component {
componentDidMount() {
if (this.props.jsonDoc !== '') {
let value = jsBeautify(this.props.jsonDoc);
let value = this.props.jsonDoc;

if (this.props.isCommentNeeded) {
value = `${EDITOR_COMMENT}${value}`;
Expand Down
7 changes: 3 additions & 4 deletions packages/compass-crud/src/components/json-editor.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EJSON } from 'bson';
import React from 'react';
import PropTypes from 'prop-types';
import EJSON from 'mongodb-extended-json';
import jsBeautify from 'js-beautify';
import jsonParse from 'fast-json-parse';
import { TextButton } from 'hadron-react-buttons';
import DocumentActions from './document-actions';
Expand Down Expand Up @@ -130,7 +129,7 @@ class EditableJson extends React.Component {
deleting: false,
mode: VIEWING,
message: EMPTY,
json: jsBeautify(EJSON.stringify(this.props.doc.generateObject()))
json: EJSON.stringify(this.props.doc.generateObject(), null, 2)
});

this.props.clearUpdateStatus();
Expand Down Expand Up @@ -313,7 +312,7 @@ class EditableJson extends React.Component {

const value = this.state.json
? this.state.json
: jsBeautify(EJSON.stringify(this.props.doc.generateObject()));
: EJSON.stringify(this.props.doc.generateObject(), null, 2);

return (
<div className="json-ace-editor">
Expand Down
8 changes: 4 additions & 4 deletions packages/compass-crud/src/stores/crud-store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EJSON } from 'bson';
import Reflux from 'reflux';
import toNS from 'mongodb-ns';
import EJSON from 'mongodb-extended-json';
import { findIndex, isEmpty } from 'lodash';
import StateMixin from 'reflux-state-mixin';
import HadronDocument from 'hadron-document';
Expand Down Expand Up @@ -362,7 +362,7 @@ const configureStore = (options = {}) => {
*/
copyToClipboard(doc) {
track('Document Copied', { mode: this.modeForTelemetry() });
const documentJSON = EJSON.stringify(doc.generateObject());
const documentJSON = EJSON.stringify(doc.generateObject(), null, 2);
let input = document.createElement(INPUT);
input.type = TYPE;
input.setAttribute(STYLES, DISPLAY);
Expand Down Expand Up @@ -678,7 +678,7 @@ const configureStore = (options = {}) => {
}
}

const jsonDoc = EJSON.stringify(hadronDoc.generateObject());
const jsonDoc = EJSON.stringify(hadronDoc.generateObject(), null, 2);

this.setState({
insert: {
Expand Down Expand Up @@ -718,7 +718,7 @@ const configureStore = (options = {}) => {
*/
toggleInsertDocument(view) {
if (view === 'JSON') {
const jsonDoc = EJSON.stringify(this.state.insert.doc.generateObject());
const jsonDoc = EJSON.stringify(this.state.insert.doc.generateObject(), null, 2);

this.setState({
insert: {
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-crud/src/stores/crud-store.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EJSON } from 'bson';
import util from 'util';
import Connection from 'mongodb-connection-model';
import { connect, convertConnectionModelToInfo } from 'mongodb-data-service';
import AppRegistry from 'hadron-app-registry';
import HadronDocument, { Element } from 'hadron-document';
import configureStore from './crud-store';
import configureActions from '../actions';
import EJSON from 'mongodb-extended-json';

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
Expand Down
3 changes: 2 additions & 1 deletion packages/compass-indexes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@hot-loader/react-dom": "^16.9.0",
"@mongodb-js/compass-components": "^0.10.0",
"@mongodb-js/compass-deployment-awareness": "^11.18.0",
"bson": "^4.4.1",
"debug": "4.3.0",
"hadron-react-buttons": "^5.6.0",
"hadron-react-components": "^5.10.0",
Expand Down Expand Up @@ -59,6 +60,7 @@
"@mongodb-js/compass-field-store": "^7.18.0",
"autoprefixer": "^9.4.6",
"babel-loader": "^8.2.2",
"bson": "^4.4.1",
"chai": "^4.2.0",
"chai-enzyme": "1.0.0-beta.1",
"classnames": "^2.2.6",
Expand Down Expand Up @@ -100,7 +102,6 @@
"mocha-webpack": "^2.0.0-beta.0",
"mongodb-connection-model": "^21.12.0",
"mongodb-data-service": "^21.16.0",
"mongodb-extended-json": "^1.11.1",
"mongodb-index-model": "^3.8.0",
"mongodb-reflux-store": "^0.0.1",
"node-loader": "^0.6.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EJSON } from 'bson';
import { combineReducers } from 'redux';
const EJSON = require('mongodb-extended-json');
import { createLoggerAndTelemetry } from '@mongodb-js/compass-logging';

import dataService from '../data-service';
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-query-history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"ampersand-rest-collection": "^6.0.0",
"autoprefixer": "^9.4.6",
"babel-loader": "^8.2.2",
"bson": "^4.4.1",
"chai": "^4.1.2",
"chai-enzyme": "1.0.0-beta.1",
"cheerio": "^1.0.0-rc.2",
Expand Down Expand Up @@ -119,7 +120,6 @@
"mocha": "^5.0.0",
"mocha-webpack": "^2.0.0-beta.0",
"mongodb-connection-model": "^21.12.0",
"mongodb-extended-json": "^1.11.1",
"mongodb-js-metrics": "^7.7.0",
"mongodb-ns": "^2.3.0",
"mongodb-query-parser": "^2.4.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/compass-query-history/src/models/query.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Model from 'ampersand-model';
import { EJSON } from 'bson';
import uuid from 'uuid';
import EJSON from 'mongodb-extended-json';

/**
* A model that represents a MongoDB query.
Expand Down Expand Up @@ -51,7 +51,7 @@ const Query = Model.extend({
_ns: 'string'
},
parse: function(attrs) {
return EJSON.deserialize(attrs);
return attrs ? EJSON.deserialize(attrs) : undefined;
},
serialize: function() {
return EJSON.serialize(this.getAttributes({ props: true }));
Expand Down
2 changes: 0 additions & 2 deletions packages/compass-schema-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"mongodb-ace-autocompleter": "*",
"mongodb-ace-mode": "^1.5.0",
"mongodb-ace-theme": "^1.5.0",
"mongodb-extended-json": "*",
"mongodb-query-parser": "^2.4.3",
"prop-types": "^15.7.2",
"react": "^16.14.0",
Expand Down Expand Up @@ -102,7 +101,6 @@
"mongodb-ace-theme": "^1.5.0",
"mongodb-connection-model": "^21.12.0",
"mongodb-data-service": "^21.16.0",
"mongodb-extended-json": "^1.11.1",
"mongodb-ns": "^2.3.0",
"mongodb-query-parser": "^2.4.3",
"mongodb-reflux-store": "^0.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EJSON from 'mongodb-extended-json';
import { EJSON } from 'bson';
import queryParser from 'mongodb-query-parser';
import { stringify as javascriptStringify } from 'javascript-stringify';
import { createLoggerAndTelemetry } from '@mongodb-js/compass-logging';
Expand Down