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
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"name": "mongodb-compass",
"productName": "MongoDB Compass",
"plugins-directory": ".mongodb/compass/plugins",
"packages": [
"plugins": [
"node_modules/@mongodb-js/compass-serverstats",
"node_modules/@mongodb-js/compass-document-validation",
"node_modules/@mongodb-js/compass-deployment-awareness",
Expand All @@ -48,13 +48,11 @@
"index"
]
},
"compass-enterprise": {
"name": "mongodb-compass-enterprise",
"productName": "MongoDB Compass Enterprise",
"plugins-directory": ".mongodb/compass-enterprise/plugins",
"packages": [
"node_modules/@mongodb-js/compass-serverstats",
"node_modules/@mongodb-js/compass-document-validation",
"compass-community": {
"name": "mongodb-compass-community",
"productName": "MongoDB Compass Community",
"plugins-directory": ".mongodb/compass-community/plugins",
"plugins": [
"node_modules/@mongodb-js/compass-deployment-awareness",
"node_modules/@mongodb-js/compass-charts",
"node_modules/@mongodb-js/compass-crud",
Expand Down Expand Up @@ -173,7 +171,7 @@
"hadron-compile-cache": "^1.0.1",
"hadron-ipc": "^0.0.7",
"hadron-module-cache": "^0.0.3",
"hadron-package-manager": "^4.0.0",
"hadron-plugin-manager": "^5.0.0",
"hadron-react-bson": "^1.4.0",
"hadron-react-buttons": "^1.5.0",
"hadron-react-components": "^1.8.0",
Expand Down
6 changes: 3 additions & 3 deletions src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ marky.stop('Migrations');
var React = require('react');
var ReactDOM = require('react-dom');
var AutoUpdate = require('../auto-update');
var { Action } = require('hadron-package-manager');
var { Action } = require('hadron-plugin-manager');


ipc.once('app:launched', function() {
Expand Down Expand Up @@ -401,8 +401,8 @@ app.extend({
if (err) {
throw err;
}
require('./setup-package-manager');
Action.packageActivationCompleted.listen(() => {
require('./setup-plugin-manager');
Action.pluginActivationCompleted.listen(() => {
global.hadronApp.appRegistry.onActivated();

// signal to main process that app is ready
Expand Down
28 changes: 14 additions & 14 deletions src/app/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@

@import "../../node_modules/mapbox-gl/dist/mapbox-gl.css";

// Packages
// Internal Plugins
// @todo don't hard-code these, style manager needs to handle package styles
@import "../internal-packages/app/styles/index.less";
@import "../internal-packages/collection/styles/index.less";
@import "../internal-packages/collection-stats/styles/index.less";
@import "../internal-packages/database-ddl/styles/index.less";
@import "../internal-packages/home/styles/index.less";
@import "../internal-packages/query/styles/index.less";
@import "../internal-packages/schema/styles/index.less";
@import "../internal-packages/indexes/styles/index.less";
@import "../internal-packages/explain/styles/index.less";
@import "../internal-packages/sidebar/styles/index.less";
@import "../internal-packages/database/styles/index.less";
@import "../internal-packages/instance-header/styles/index.less";
@import "../internal-packages/ssh-tunnel-status/styles/index.less";
@import "../internal-plugins/app/styles/index.less";
@import "../internal-plugins/collection/styles/index.less";
@import "../internal-plugins/collection-stats/styles/index.less";
@import "../internal-plugins/database-ddl/styles/index.less";
@import "../internal-plugins/home/styles/index.less";
@import "../internal-plugins/query/styles/index.less";
@import "../internal-plugins/schema/styles/index.less";
@import "../internal-plugins/indexes/styles/index.less";
@import "../internal-plugins/explain/styles/index.less";
@import "../internal-plugins/sidebar/styles/index.less";
@import "../internal-plugins/database/styles/index.less";
@import "../internal-plugins/instance-header/styles/index.less";
@import "../internal-plugins/ssh-tunnel-status/styles/index.less";
6 changes: 3 additions & 3 deletions src/app/reflux-listen-to-external-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const app = require('hadron-app');
const Reflux = require('reflux');
const packageActivationCompleted = require('hadron-package-manager/lib/action').packageActivationCompleted;
const pluginActivationCompleted = require('hadron-plugin-manager/lib/action').pluginActivationCompleted;

/**
* defers attaching a store listener to a store until all packages have
Expand All @@ -15,9 +15,9 @@ const packageActivationCompleted = require('hadron-package-manager/lib/action').
* @param {Function} callback Callback to attach
*/
Reflux.StoreMethods.listenToExternalStore = function(storeKey, callback) {
this.listenTo(packageActivationCompleted, () => {
this.listenTo(pluginActivationCompleted, () => {
const store = app.appRegistry.getStore(storeKey);
this.listenTo(store, callback);
this.stopListeningTo(packageActivationCompleted);
this.stopListeningTo(pluginActivationCompleted);
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ const pkg = require('../../package.json');
const path = require('path');
const os = require('os');
const AppRegistry = require('hadron-app-registry');
const { PackageManager } = require('hadron-package-manager');
const debug = require('debug')('mongodb-compass:setup-package-manager');
const PluginManager = require('hadron-plugin-manager');
const debug = require('debug')('mongodb-compass:setup-plugin-manager');

app.appRegistry = new AppRegistry();

/**
* Location of the internal packages.
* Location of the internal plugins.
*/
const INTERNAL_PACKAGES = path.join(__dirname, '..', 'internal-packages');
const INTERNAL_PLUGINS = path.join(__dirname, '..', 'internal-plugins');

/**
* The root dir.
Expand All @@ -29,21 +29,21 @@ const DISTRIBUTION = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBU
const PLUGINS_DIR = 'plugins-directory';

/**
* Location of the dev packages.
* Location of the dev plugins.
*/
const DEV_PACKAGES = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);
const DEV_PLUGINS = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);

/**
* @note: The 2nd and 3rd arguments are the root directory and an array
* of packages for the distribution and their relative paths from the
* root directory.
*/
app.packageManager = new PackageManager(
[ INTERNAL_PACKAGES, DEV_PACKAGES ],
app.pluginManager = new PluginManager(
[ INTERNAL_PLUGINS, DEV_PLUGINS ],
ROOT,
DISTRIBUTION.packages
DISTRIBUTION.plugins
);

app.packageManager.activate(app.appRegistry);
app.pluginManager.activate(app.appRegistry);

debug(`Package manager activated with distribution ${process.env.HADRON_DISTRIBUTION}.`);
debug(`Plugin manager activated with distribution ${process.env.HADRON_DISTRIBUTION}.`);
14 changes: 7 additions & 7 deletions src/app/setup-style-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const DISTRIBUTION = pkg.config.hadron.distributions[process.env.HADRON_DISTRIBU
const PLUGINS_DIR = 'plugins-directory';

/**
* Location of the dev packages.
* Location of the dev plugins.
*/
const DEV_PACKAGES = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);
const DEV_PLUGINS = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);

/**
* The style tag constant.
Expand All @@ -42,21 +42,21 @@ const setup = (stylesheet, done) => {
manager.use(document, path.join(__dirname, stylesheet));

/**
* @note: This loads all the styles from all the packages in the current
* distribution. The styles must be in package-root/styles/index.less
* @note: This loads all the styles from all the plugins in the current
* distribution. The styles must be in plugin-root/styles/index.less
* This is for dev only, note that we will need to address pre-building
* and loading the prebuilt styles for the Compass artifacts for better
* performance.
*/
manager.load(document, path.join(__dirname, '..', '..'), DISTRIBUTION.packages);
manager.load(document, path.join(__dirname, '..', '..'), DISTRIBUTION.plugins);
}


/**
* For production we need to also look in the configured directory for local
* developer plugins.
*/
fs.readdir(DEV_PACKAGES, (error, files) => {
fs.readdir(DEV_PLUGINS, (error, files) => {
if (error) {
done();
} else {
Expand All @@ -66,7 +66,7 @@ const setup = (stylesheet, done) => {
*/
try {
const styles = document.createElement(STYLE);
const loc = path.join(DEV_PACKAGES, file, 'lib', 'styles', 'index.css');
const loc = path.join(DEV_PLUGINS, file, 'lib', 'styles', 'index.css');
styles.textContent = fs.readFileSync(loc, { encoding: 'utf8' });
document.head.appendChild(styles);
} catch (e) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Compass Internal Packages
# Compass Internal Plugins

## Developer Notes

When registering resources in the app registry, please use the `PackageName.ResourceName`
When registering resources in the app registry, please use the `PluginName.ResourceName`
convention for keys.

### Examples:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Collection Stats Package
# Compass Collection Stats Plugin

Provides functionality shown in the stats header area in the collection view.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Collection Stats Package
# Compass Collection Stats Plugin

Provides functionality shown in the stats header area in the collection view.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Explain Plan Package
# Compass Explain Plan Plugin

Provides functionality shown in the "Explain Plan" tab in the collection view.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Home Package
# Compass Home Plugin

Home layout for Compass view that switches between different views based on the current namespace:

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Indexes Package
# Compass Indexes Plugin

Provides functionality shown in the "Indexes" tab in the collection view.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Instance Package
# Compass Instance Plugin

Instance Level View Layout that contains Instance level tabs.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Query Package
# Compass Query Plugin

Provides functionality shown in the query bar in the collection view.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compass Schema Package
# Compass Schema Plugin

Provides functionality shown in the "Schema" tab in the collection view.

Expand Down
2 changes: 1 addition & 1 deletion test/enzyme/collection-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sinon = require('sinon');
const shallow = require('enzyme').shallow;
const AppRegistry = require('hadron-app-registry');
const { TabNavBar } = require('hadron-react-components');
const Collection = require('../../src/internal-packages/collection/lib/components/index');
const Collection = require('../../src/internal-plugins/collection/lib/components/index');

// const debug = require('debug')('compass:collection:test');

Expand Down
6 changes: 3 additions & 3 deletions test/enzyme/home.component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const sinon = require('sinon');
const { shallow } = require('enzyme');
const AppRegistry = require('hadron-app-registry');
const { StatusRow } = require('hadron-react-components');
const { UI_STATES } = require('../../src/internal-packages/home/lib/constants');
const InstanceComponent = require('../../src/internal-packages/instance/lib/component');
const { UI_STATES } = require('../../src/internal-plugins/home/lib/constants');
const InstanceComponent = require('../../src/internal-plugins/instance/lib/component');

describe('<Home />', () => {
const appRegistry = app.appRegistry;
Expand Down Expand Up @@ -37,7 +37,7 @@ describe('<Home />', () => {
app.appRegistry.registerComponent('Database.CreateCollectionDialog', sinon.spy());
app.appRegistry.registerComponent('Database.DropCollectionDialog', sinon.spy());

this.Home = require('../../src/internal-packages/home/lib/component/home');
this.Home = require('../../src/internal-plugins/home/lib/component/home');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
6 changes: 3 additions & 3 deletions test/enzyme/indexes.column.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const expect = chai.expect;
const React = require('react');
const {mount, shallow} = require('enzyme');

const SizeColumn = require('../../src/internal-packages/indexes/lib/component/size-column');
const UsageColumn = require('../../src/internal-packages/indexes/lib/component/usage-column');
const SizeColumn = require('../../src/internal-plugins/indexes/lib/component/size-column');
const UsageColumn = require('../../src/internal-plugins/indexes/lib/component/usage-column');

chai.use(chaiEnzyme());

Expand All @@ -36,7 +36,7 @@ describe('<Indexes />', () => {
app.appRegistry = new AppRegistry();
app.instance = {build: {version: '3.2.0'}};

this.CreateIndexButton = require('../../src/internal-packages/indexes/lib/component/create-index-button');
this.CreateIndexButton = require('../../src/internal-plugins/indexes/lib/component/create-index-button');
});
afterEach(function() {
// Restore properties on the global app object,
Expand Down
2 changes: 1 addition & 1 deletion test/enzyme/instance-header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const InstanceHeader = require('../../src/internal-packages/instance-header/lib/components/instance-header');
const InstanceHeader = require('../../src/internal-plugins/instance-header/lib/components/instance-header');

chai.use(chaiEnzyme());

Expand Down
6 changes: 3 additions & 3 deletions test/enzyme/querybar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const _ = require('lodash');
const shallow = require('enzyme').shallow;
const mount = require('enzyme').mount;

const QueryBar = require('../../src/internal-packages/query/lib/component/query-bar');
const QueryOption = require('../../src/internal-packages/query/lib/component/query-option');
const OptionsToggle = require('../../src/internal-packages/query/lib/component/options-toggle');
const QueryBar = require('../../src/internal-plugins/query/lib/component/query-bar');
const QueryOption = require('../../src/internal-plugins/query/lib/component/query-option');
const OptionsToggle = require('../../src/internal-plugins/query/lib/component/options-toggle');
const debug = require('debug')('mongodb-compass:test:validation');

chai.use(chaiEnzyme());
Expand Down
2 changes: 1 addition & 1 deletion test/enzyme/sidebar-collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const SidebarCollection = require('../../src/internal-packages/sidebar/lib/components/sidebar-collection');
const SidebarCollection = require('../../src/internal-plugins/sidebar/lib/components/sidebar-collection');

chai.use(chaiEnzyme());

Expand Down
2 changes: 1 addition & 1 deletion test/enzyme/sidebar-database.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const SidebarDatabase = require('../../src/internal-packages/sidebar/lib/components/sidebar-database');
const SidebarDatabase = require('../../src/internal-plugins/sidebar/lib/components/sidebar-database');

chai.use(chaiEnzyme());

Expand Down
4 changes: 2 additions & 2 deletions test/enzyme/sidebar-instance-properties.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const SidebarInstanceProperties = require('../../src/internal-packages/sidebar/lib/components/sidebar-instance-properties');
const { LOADING_STATE } = require('../../src/internal-packages/sidebar/lib/constants');
const SidebarInstanceProperties = require('../../src/internal-plugins/sidebar/lib/components/sidebar-instance-properties');
const { LOADING_STATE } = require('../../src/internal-plugins/sidebar/lib/constants');

chai.use(chaiEnzyme());

Expand Down
4 changes: 2 additions & 2 deletions test/enzyme/sidebar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const Sidebar = require('../../src/internal-packages/sidebar/lib/components/sidebar');
const InstanceStore = require('../../src/internal-packages/app/lib/stores/instance-store');
const Sidebar = require('../../src/internal-plugins/sidebar/lib/components/sidebar');
const InstanceStore = require('../../src/internal-plugins/app/lib/stores/instance-store');

chai.use(chaiEnzyme());

Expand Down
4 changes: 2 additions & 2 deletions test/enzyme/ssh-tunnel-status.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const React = require('react');
const sinon = require('sinon');
const AppRegistry = require('hadron-app-registry');
const { shallow } = require('enzyme');
const SSHTunnelStatus = require('../../src/internal-packages/ssh-tunnel-status/lib/components/ssh-tunnel-status');
const Actions = require('../../src/internal-packages/ssh-tunnel-status/lib/actions');
const SSHTunnelStatus = require('../../src/internal-plugins/ssh-tunnel-status/lib/components/ssh-tunnel-status');
const Actions = require('../../src/internal-plugins/ssh-tunnel-status/lib/actions');
chai.use(chaiEnzyme());

const appRegistry = app.appRegistry;
Expand Down
Loading