diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ec2deb3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.DS_Store": true, + "temp": true + } +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8225e67 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,43 @@ +# Contributing to Inversify + +## Setup + +1 - Clone your fork of the repository: +``` +$ git clone https://github.com/YOUR_USERNAME/inversify-devtools.git +``` + +2 - Install typings: +``` +$ npm install -g typings +``` + +3 - Install type definitions: +``` +$ typings install +``` + +4 - Install npm dependencies: +``` +$ npm install +``` + +5 - Run build process +``` +$ gulp +``` + +## Guidelines + +- Please try to [combine multiple commits before pushing](http://stackoverflow.com/questions/6934752/combining-multiple-commits-before-pushing-in-git) + +- Please use `TDD` when fixing bugs. This means that you should write a unit test that fails because it reproduces the issue, +then fix the issue finally run the test to ensure that the issue has been resolved. This helps us to prevent fixed bugs from +happening again in the future. + +- Please keep the test coverage at 100%. Write additional unit test if necessary + +- Please create an issue before sending a PR ff your it is going to change the public interface of InversifyJS or it +includes significant architecture changes. + +- Feel free to ask for help from other members of the InversifyJS team via the chat / mailing list or github issues. \ No newline at end of file diff --git a/package.json b/package.json index 77be41b..b597fd4 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "dependencies": { "bootstrap": "^3.3.6", "font-awesome": "^4.6.1", - "inversify-dts": "^1.0.5", - "inversify-logger-middleware": "^1.0.0-beta.5", + "inversify-dts": "^1.0.7", + "inversify-logger-middleware": "^1.0.0-beta.6", "react": "^15.0.1", "react-dom": "^15.0.1", "react-json-tree": "^0.7.4", @@ -45,13 +45,13 @@ "gulp": "^3.9.1", "gulp-tslint": "^5.0.0", "gulp-typescript": "^2.13.0", - "inversify": "^2.0.0-beta.8", - "reflect-metadata": "^0.1.3", + "inversify": "^2.0.0-beta.10", "publish-please": "^2.1.4", "redux-devtools": "^3.2.0", "redux-devtools-dock-monitor": "^1.1.1", "redux-devtools-log-monitor": "^1.0.11", "redux-logger": "^2.6.1", + "reflect-metadata": "^0.1.3", "run-sequence": "^1.1.5", "tslint": "^3.8.1", "vinyl-buffer": "^1.0.0", diff --git a/src/actions/app_actions.ts b/src/actions/app_actions.ts index 59c87c2..3003475 100644 --- a/src/actions/app_actions.ts +++ b/src/actions/app_actions.ts @@ -6,12 +6,13 @@ import SelectableKernel from "../core/selectable_kernel"; let resize = makeActionCreator(ACTION_TYPES.RESIZE, "width", "height"); let appInitSuccess = makeActionCreator(ACTION_TYPES.APP_INIT_SUCCESS, "kernel"); +let initSettings = makeActionCreator(ACTION_TYPES.APP_SETTINGS_SUCCESS, "settings"); function appInitAsync() { return function(dispatch: Redux.Dispatch) { - let attachLogger = function(kernel: inversify.IKernel) { - let logger = getLogger(loggerActions.addLogEntry, dispatch); + let attachLogger = function(kernel: inversify.interfaces.Kernel) { + let logger = getLogger(loggerActions.addLogEntry, initSettings, dispatch); kernel.applyMiddleware(logger); let selectableKernel = new SelectableKernel(kernel); dispatch(appInitSuccess(selectableKernel)); diff --git a/src/actions/logger_actions.ts b/src/actions/logger_actions.ts index 72931f0..c746031 100644 --- a/src/actions/logger_actions.ts +++ b/src/actions/logger_actions.ts @@ -3,10 +3,14 @@ import ACTION_TYPES from "../constants/action_types"; let addLogEntry = makeActionCreator(ACTION_TYPES.ADD_LOG_ENTRY, "entry"); let selectRequest = makeActionCreator(ACTION_TYPES.SELECT_LOG_ENTRY, "entry"); +let filterRequests = makeActionCreator(ACTION_TYPES.FILTER_LOG_ENTRIES, "filterBy"); +let clearRequests = makeActionCreator(ACTION_TYPES.CLEAR_LOG); let loggerActions = { addLogEntry, - selectRequest + selectRequest, + filterRequests, + clearRequests }; export default loggerActions; diff --git a/src/actions/settings_actions.ts b/src/actions/settings_actions.ts new file mode 100644 index 0000000..243c900 --- /dev/null +++ b/src/actions/settings_actions.ts @@ -0,0 +1,21 @@ +import { makeActionCreator } from "../utils/utils"; +import ACTION_TYPES from "../constants/action_types"; +import interfaces from "../interfaces/interfaces"; + +let saveSettingsSuccess = makeActionCreator(ACTION_TYPES.SAVE_SETTINGS_SUCCESS); +let saveSettingsError = makeActionCreator(ACTION_TYPES.SAVE_SETTINGS_ERROR, "exception"); + +let saveSettingsAsync = function (settings: interfaces.UserSettings) { + try { + window.localStorage.setItem("inversify_settings", JSON.stringify(settings)); + return saveSettingsSuccess(); + } catch (e) { + return saveSettingsError(e); + } +}; + +let settingsActions = { + saveSettingsAsync +}; + +export default settingsActions; diff --git a/src/components/binding_explorer.tsx b/src/components/binding_explorer.tsx index c1d7b10..eca5b47 100644 --- a/src/components/binding_explorer.tsx +++ b/src/components/binding_explorer.tsx @@ -43,11 +43,11 @@ class BindingExplorer extends React.Component { public render() { return ( - +
Services with more than one implementation are displayed in yellow. - Remember to add some metadata and constrints to avoid ambiguous match exceptions! + Remember to add some metadata and constraints to avoid ambiguous match exceptions!
{this._renderBindings(this.props.dictionary)}
diff --git a/src/components/binding_props_explorer.tsx b/src/components/binding_props_explorer.tsx index 10e4e01..e5e2972 100644 --- a/src/components/binding_props_explorer.tsx +++ b/src/components/binding_props_explorer.tsx @@ -12,7 +12,7 @@ class BindingPropsExplorer extends React.Component { public render() { return ( - +
diff --git a/src/components/kernel_explorer.tsx b/src/components/kernel_explorer.tsx index 7b45902..d9a1a97 100644 --- a/src/components/kernel_explorer.tsx +++ b/src/components/kernel_explorer.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import { Link } from "react-router"; import Panel from "./panel"; +import interfaces from "../interfaces/interfaces"; const dir = { close: "▹", @@ -21,16 +22,16 @@ class KernelExplorer extends React.Component { ); } - private _handleClick(kernel: ISelectableKernel) { + private _handleClick(kernel: interfaces.SelectableKernel) { this.props.selectKernel(kernel); } - private _renderKernels(kernels: ISelectableKernel[]) { - return kernels.map((kernel: ISelectableKernel, id: number) => { + private _renderKernels(kernels: interfaces.SelectableKernel[]) { + return kernels.map((kernel: interfaces.SelectableKernel, id: number) => { return (
{ this._handleClick(kernel); }}>
-
GUID: {kernel.guid}
+
GUID: {kernel.details.guid}

Kernel

diff --git a/src/components/log_details.tsx b/src/components/log_details.tsx index ab60924..0fa4152 100644 --- a/src/components/log_details.tsx +++ b/src/components/log_details.tsx @@ -2,6 +2,7 @@ import * as React from "react"; import Panel from "./panel"; import JSONTree from "react-json-tree"; import theme from "../constants/json_tree_theme"; +import interfaces from "../interfaces/interfaces"; class LogDetails extends React.Component { @@ -26,7 +27,7 @@ class LogDetails extends React.Component { ); } - private _renderEntry(entry: ISelectableLogEntry) { + private _renderEntry(entry: interfaces.SelectableLogEntry) { if (entry.details.error) { diff --git a/src/components/menu.tsx b/src/components/menu.tsx index 823c18e..2185b39 100644 --- a/src/components/menu.tsx +++ b/src/components/menu.tsx @@ -2,16 +2,16 @@ import * as React from "react"; import { Link } from "react-router"; class Menu extends React.Component { - + public constructor(props: any) { super(props); } - + public render() { return (
    -
  • +