This commit is contained in:
crusader 2017-12-23 04:45:55 +09:00
parent 69601984c2
commit 1fb44fdb5f
15 changed files with 89 additions and 58 deletions

View File

@ -20,7 +20,6 @@
"stats": "set NODE_ENV=production && webpack --progress --config ./config/webpack/webpack.config.stats.js --profile --json > ./config/webpack/stats/stats.json" "stats": "set NODE_ENV=production && webpack --progress --config ./config/webpack/webpack.config.stats.js --profile --json > ./config/webpack/stats/stats.json"
}, },
"devDependencies": { "devDependencies": {
"@types/auth0-lock": "^10.16.2",
"@types/history": "^4.6.2", "@types/history": "^4.6.2",
"@types/jest": "^21.1.8", "@types/jest": "^21.1.8",
"@types/lodash": "^4.14.91", "@types/lodash": "^4.14.91",
@ -74,7 +73,6 @@
"webpack-visualizer-plugin": "^0.1.11" "webpack-visualizer-plugin": "^0.1.11"
}, },
"dependencies": { "dependencies": {
"auth0-lock": "^10.24.1",
"history": "^4.7.2", "history": "^4.7.2",
"immutable": "^3.8.2", "immutable": "^3.8.2",
"inversify": "^4.9.0", "inversify": "^4.9.0",

View File

@ -3,10 +3,8 @@ import {
TypeUtil, TypeUtil,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {AnnotatedElement} from './annotated_element';
AnnotatedElement, import {Annotation} from './annotation';
Annotation,
} from '@overflow/commons/core/reflect';
export abstract class AccessibleObject implements AnnotatedElement { export abstract class AccessibleObject implements AnnotatedElement {
private _annotations: Map<ClassType, Annotation>; private _annotations: Map<ClassType, Annotation>;

View File

@ -2,9 +2,7 @@ import {
ClassType, ClassType,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {Annotation} from './annotation';
Annotation,
} from '@overflow/commons/core/reflect';
export interface AnnotatedElement { export interface AnnotatedElement {
_addAnnotation<AnnotationType extends Annotation>(annotation: AnnotationType): void; _addAnnotation<AnnotationType extends Annotation>(annotation: AnnotationType): void;

View File

@ -4,11 +4,10 @@ import {
Metadata, Metadata,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {AccessibleObject} from './accessible_object';
AccessibleObject, import {Constructor} from './constructor';
Field, import {Field} from './field';
Method, import {Method} from './method';
} from '@overflow/commons/core/reflect';
export class Class extends AccessibleObject { export class Class extends AccessibleObject {
private _clazzType: ClassType; private _clazzType: ClassType;

View File

@ -1,19 +0,0 @@
// import {
// PropertyKeyType,
// } from '@overflow/commons/core/type';
// import {
// Class,
// Executable,
// } from '@overflow/commons/core/reflect';
// export class Constructor extends Executable {
// public constructor(declaringClazz: Class, parameterTypes: any[]) {
// super(declaringClazz, parameterTypes);
// }
// public getName(): PropertyKeyType {
// return '';
// }
// }

View File

@ -0,0 +1,17 @@
import {
PropertyKeyType,
} from '@overflow/commons/core/type';
import {Class} from './class';
import {Executable} from './executable';
export class Constructor extends Executable {
public constructor(declaringClazz: Class, parameterTypes: any[]) {
super(declaringClazz, parameterTypes);
}
public getName(): PropertyKeyType {
return '';
}
}

View File

@ -2,12 +2,10 @@ import {
PropertyKeyType, PropertyKeyType,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {AccessibleObject} from './accessible_object';
AccessibleObject, import {Class} from './class';
Class, import {Member} from './member';
Member, import {Parameter} from './parameter';
Parameter,
} from '@overflow/commons/core/reflect';
export abstract class Executable extends AccessibleObject implements Member { export abstract class Executable extends AccessibleObject implements Member {
private _clazz: Class; private _clazz: Class;

View File

@ -2,11 +2,9 @@ import {
PropertyKeyType, PropertyKeyType,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {AccessibleObject} from './accessible_object';
AccessibleObject, import {Class} from './class';
Class, import {Member} from './member';
Member,
} from '@overflow/commons/core/reflect';
export class Field extends AccessibleObject implements Member { export class Field extends AccessibleObject implements Member {
private _clazz: Class; private _clazz: Class;

View File

@ -1,7 +1,7 @@
export * from './accessible_object'; export * from './accessible_object';
export * from './annotated_element'; export * from './annotated_element';
export * from './annotation'; export * from './annotation';
export * from './class_constructor'; export * from './constructor';
export * from './class'; export * from './class';
export * from './executable'; export * from './executable';
export * from './field'; export * from './field';

View File

@ -1,11 +1,9 @@
import {
Class,
} from '@overflow/commons/core/reflect';
import { import {
PropertyKeyType, PropertyKeyType,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import {Class} from './class';
export interface Member { export interface Member {
getDeclaringClass(): Class; getDeclaringClass(): Class;
getName(): PropertyKeyType; getName(): PropertyKeyType;

View File

@ -2,10 +2,8 @@ import {
PropertyKeyType, PropertyKeyType,
} from '@overflow/commons/core/type'; } from '@overflow/commons/core/type';
import { import {Class} from './class';
Class, import {Executable} from './executable';
Executable,
} from '@overflow/commons/core/reflect';
export class Method extends Executable { export class Method extends Executable {
private _name: PropertyKeyType; private _name: PropertyKeyType;

View File

@ -1,7 +1,5 @@
import { import {AccessibleObject} from './accessible_object';
AccessibleObject, import {Executable} from './executable';
Executable,
} from '@overflow/commons/core/reflect';
export class Parameter extends AccessibleObject { export class Parameter extends AccessibleObject {
private _executable: Executable; private _executable: Executable;

View File

@ -1,4 +1,5 @@
export * from './action_mapping'; export * from './action_mapping';
export * from './parameter';
export * from './reducer'; export * from './reducer';
export * from './rest_api'; export * from './rest_api';
export * from './rpc_api'; export * from './rpc_api';

View File

@ -0,0 +1,43 @@
import {
Annotation,
} from '@overflow/commons/core/reflect';
import {
PropertyKeyType,
TypeUtil,
} from '@overflow/commons/core/type';
import {
Decorator,
} from '@overflow/commons/decorator';
export interface ParameterAnnotationAttributes {
name?: string;
}
export class ParameterAnnotation implements Annotation {
public readonly attributes: ParameterAnnotationAttributes;
public constructor(name: string | ParameterAnnotationAttributes) {
if (undefined === name) {
this.attributes = {
name: '',
};
return;
}
if (TypeUtil.isString(name)) {
this.attributes = {
name: <string>name,
};
} else {
this.attributes = <ParameterAnnotationAttributes>name;
}
}
public parameterDecorator?(target: Object, propertyKey: PropertyKeyType, parameterIndex: number): void {
console.log('Parameter');
}
}
export const Parameter = Decorator.create(ParameterAnnotation);

View File

@ -1,5 +1,6 @@
import { import {
ActionMapping, ActionMapping,
Parameter,
Reducer, Reducer,
RestAPI, RestAPI,
} from '@overflow/commons/redux/decorators'; } from '@overflow/commons/redux/decorators';
@ -7,12 +8,17 @@ import {
@Reducer() @Reducer()
@ActionMapping('@overflow/modules/member/MemberReducer') @ActionMapping('@overflow/modules/member/MemberReducer')
export default class MemberReducer { export default class MemberReducer {
private name: string;
public constructor(@Parameter() name: string) {
this.name = name;
}
/** /**
* signin * signin
*/ */
@RestAPI('/account/signin') @RestAPI('/account/signin')
@ActionMapping('/signin') @ActionMapping('/signin')
public signin(state: any, result: any, error: any): any { public signin(state: any, @Parameter() result: any, error: any): any {
return state; return state;
} }