From 6cb832565311fe7ae3ef59b39c61dfdc6f9ff01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Thu, 9 Jun 2016 22:39:25 -0700 Subject: [PATCH 1/6] add support for Angular 1.5 components --- example/dist/decorator/sample-component.js | 31 + example/dist/naming_rule/sample-component.js | 19 + example/src/decorator/decorators.ts | 4 + example/src/decorator/sample-component.ts | 22 + example/src/naming_rule/sample-component.ts | 20 + example/typings/angularjs/angular.d.ts | 930 +++++++++++++------ index.js | 15 +- index.ts | 18 +- 8 files changed, 756 insertions(+), 303 deletions(-) create mode 100644 example/dist/decorator/sample-component.js create mode 100644 example/dist/naming_rule/sample-component.js create mode 100644 example/src/decorator/sample-component.ts create mode 100644 example/src/naming_rule/sample-component.ts diff --git a/example/dist/decorator/sample-component.js b/example/dist/decorator/sample-component.js new file mode 100644 index 0000000..7a5f23a --- /dev/null +++ b/example/dist/decorator/sample-component.js @@ -0,0 +1,31 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var sample; +(function (sample) { + var SampleComponentController = (function () { + function SampleComponentController($compile) { + this.$compile = $compile; + }/**/SampleComponentController.$inject = ['$compile']; SampleComponentController.$componentName = 'SampleComponentController'/**/ + SampleComponentController = __decorate([ + sample.Controller + ], SampleComponentController); + return SampleComponentController; + }()); + var SampleComponent = (function () { + function SampleComponent() { + this.templateUrl = '/sample.html'; + this.bindings = { + text: '<' + }; + this.controller = SampleComponentController; + }/**/SampleComponent.$inject = []; SampleComponent.$componentName = 'sample'/**/ + SampleComponent = __decorate([ + sample.Component + ], SampleComponent); + return SampleComponent; + }()); +})(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-component.js b/example/dist/naming_rule/sample-component.js new file mode 100644 index 0000000..15904c1 --- /dev/null +++ b/example/dist/naming_rule/sample-component.js @@ -0,0 +1,19 @@ +var sample; +(function (sample) { + var SampleComponentController = (function () { + function SampleComponentController($compile) { + this.$compile = $compile; + }/**/SampleComponentController.$inject = ['$compile']; SampleComponentController.$componentName = 'SampleComponentController'/**/ + return SampleComponentController; + }());/**/angular.module('sample').controller('SampleComponentController',SampleComponentController);/**/ + var SampleComponent = (function () { + function SampleComponent() { + this.templateUrl = '/sample.html'; + this.bindings = { + text: '<' + }; + this.controller = SampleComponentController; + }/**/SampleComponent.$inject = []; SampleComponent.$componentName = 'sample'/**/ + return SampleComponent; + }());/**/angular.module('sample').component('sample',new SampleComponent());/**/ +})(sample || (sample = {})); diff --git a/example/src/decorator/decorators.ts b/example/src/decorator/decorators.ts index 25e0b75..72fd9c9 100644 --- a/example/src/decorator/decorators.ts +++ b/example/src/decorator/decorators.ts @@ -19,4 +19,8 @@ module sample { angularModule.directive(clazz.$componentName, args); } + export function Component(clazz: any) { + angularModule.component(clazz.$componentName, new clazz()); + } + } diff --git a/example/src/decorator/sample-component.ts b/example/src/decorator/sample-component.ts new file mode 100644 index 0000000..f400690 --- /dev/null +++ b/example/src/decorator/sample-component.ts @@ -0,0 +1,22 @@ +module sample { + + @sample.Controller + class SampleComponentController { + constructor(public $compile:angular.ICompileService){ + } + } + + @sample.Component + class SampleComponent implements angular.IComponentOptions { + + templateUrl = '/sample.html' + + bindings: {[id:string]:string} = { + text: '<' + } + + controller = SampleComponentController + + } + +} diff --git a/example/src/naming_rule/sample-component.ts b/example/src/naming_rule/sample-component.ts new file mode 100644 index 0000000..85d6046 --- /dev/null +++ b/example/src/naming_rule/sample-component.ts @@ -0,0 +1,20 @@ +module sample { + + class SampleComponentController { + constructor(public $compile:angular.ICompileService){ + } + } + + class SampleComponent implements angular.IComponentOptions { + + templateUrl = '/sample.html' + + bindings: {[id:string]:string} = { + text: '<' + } + + controller = SampleComponentController + + } + +} diff --git a/example/typings/angularjs/angular.d.ts b/example/typings/angularjs/angular.d.ts index 191aa76..82c39b0 100644 --- a/example/typings/angularjs/angular.d.ts +++ b/example/typings/angularjs/angular.d.ts @@ -1,11 +1,5 @@ -// Type definitions for Angular JS 1.3+ -// Project: http://angularjs.org -// Definitions by: Diego Vilar -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/angularjs/angular.d.ts declare var angular: angular.IAngularStatic; // Support for painless dependency injection @@ -23,7 +17,7 @@ declare module 'angular' { /////////////////////////////////////////////////////////////////////////////// // ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// -declare module angular { +declare namespace angular { // not directly implemented, but ensures that constructed class implements $get interface IServiceProviderClass { @@ -41,6 +35,7 @@ declare module angular { interface IAngularBootstrapConfig { strictDi?: boolean; + debugInfoEnabled?: boolean; } /////////////////////////////////////////////////////////////////////////// @@ -56,132 +51,11 @@ declare module angular { * @param element DOM element which is the root of angular application. * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. + * function that will be invoked by the injector as a config block. * @param config an object for defining configuration options for the application. The following keys are supported: * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + bootstrap(element: string|Element|JQuery|Document, modules?: (string|Function|any[])[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -237,8 +111,8 @@ declare module angular { forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any; fromJson(json: string): any; - identity(arg?: any): any; - injector(modules?: any[]): auto.IInjectorService; + identity(arg?: T): T; + injector(modules?: any[], strictDi?: boolean): auto.IInjectorService; isArray(value: any): boolean; isDate(value: any): boolean; isDefined(value: any): boolean; @@ -250,6 +124,16 @@ declare module angular { isUndefined(value: any): boolean; lowercase(str: string): string; + /** + * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects. If you want to preserve original objects, you can do so by passing an empty object as the target: var object = angular.merge({}, object1, object2). + * + * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy. + * + * @param dst Destination object. + * @param src Source object(s). + */ + merge(dst: any, ...src: any[]): any; + /** * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. * @@ -275,6 +159,12 @@ declare module angular { dot: number; codeName: string; }; + + /** + * If window.name contains prefix NG_DEFER_BOOTSTRAP! when angular.bootstrap is called, the bootstrap process will be paused until angular.resumeBootstrap() is called. + * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with. + */ + resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService; } /////////////////////////////////////////////////////////////////////////// @@ -282,9 +172,13 @@ declare module angular { // see http://docs.angularjs.org/api/angular.Module /////////////////////////////////////////////////////////////////////////// interface IModule { - animation(name: string, animationFactory: Function): IModule; - animation(name: string, inlineAnnotatedFunction: any[]): IModule; - animation(object: Object): IModule; + /** + * Use this method to register a component. + * + * @param name The name of the component. + * @param options A definition object passed into the component. + */ + component(name: string, options: IComponentOptions): IModule; /** * Use this method to register work which needs to be performed on module loading. * @@ -297,13 +191,14 @@ declare module angular { * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. */ config(inlineAnnotatedFunction: any[]): IModule; + config(object: Object): IModule; /** * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. * * @param name The name of the constant. * @param value The constant value. */ - constant(name: string, value: any): IModule; + constant(name: string, value: T): IModule; constant(object: Object): IModule; /** * The $controller service is used by Angular to create new controllers. @@ -370,7 +265,19 @@ declare module angular { * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. */ run(inlineAnnotatedFunction: any[]): IModule; + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param serviceConstructor An injectable class (constructor function) that will be instantiated. + */ service(name: string, serviceConstructor: Function): IModule; + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param inlineAnnotatedConstructor An injectable class (constructor function) that will be instantiated. + */ service(name: string, inlineAnnotatedConstructor: any[]): IModule; service(object: Object): IModule; /** @@ -381,9 +288,17 @@ declare module angular { * @param name The name of the instance. * @param value The value. */ - value(name: string, value: any): IModule; + value(name: string, value: T): IModule; value(object: Object): IModule; + /** + * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. + * @param name The name of the service to decorate + * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. + */ + decorator(name:string, decoratorConstructor: Function): IModule; + decorator(name:string, inlineAnnotatedConstructor: any[]): IModule; + // Properties name: string; requires: string[]; @@ -401,6 +316,15 @@ declare module angular { */ [name: string]: any; + /** + * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form. + * + * Also there is special case for Moz prefix starting with upper case letter. + * + * For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives + */ + $normalize(name: string): string; + /** * Adds the CSS class value specified by the classVal parameter to the * element. If animations are enabled then an animation will be triggered @@ -415,6 +339,12 @@ declare module angular { */ $removeClass(classVal: string): void; + /** + * Adds and removes the appropriate CSS class values to the element based on the difference between + * the new and old CSS class values (specified as newClasses and oldClasses). + */ + $updateClass(newClasses: string, oldClasses: string): void; + /** * Set DOM element attribute value. */ @@ -426,7 +356,7 @@ declare module angular { * following compilation. The observer is then invoked whenever the * interpolated value changes. */ - $observe(name: string, fn: (value?: any) => any): Function; + $observe(name: string, fn: (value?: T) => any): Function; /** * A map of DOM element attribute names to the normalized name. This is needed @@ -452,9 +382,10 @@ declare module angular { $invalid: boolean; $submitted: boolean; $error: any; - $addControl(control: INgModelController): void; - $removeControl(control: INgModelController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; + $pending: any; + $addControl(control: INgModelController | IFormController): void; + $removeControl(control: INgModelController | IFormController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; $setDirty(): void; $setPristine(): void; $commitViewValue(): void; @@ -474,6 +405,7 @@ declare module angular { // types do work and it's common to use them. $setViewValue(value: any, trigger?: string): void; $setPristine(): void; + $setDirty(): void; $validate(): void; $setTouched(): void; $setUntouched(): void; @@ -504,12 +436,25 @@ declare module angular { $invalid: boolean; } + //Allows tuning how model updates are done. + //https://docs.angularjs.org/api/ng/directive/ngModelOptions + interface INgModelOptions { + updateOn?: string; + debounce?: any; + allowInvalid?: boolean; + getterSetter?: boolean; + timezone?: string; + } + interface IModelValidators { - [index: string]: (...args: any[]) => boolean; + /** + * viewValue is any because it can be an object that is called in the view like $viewValue.name:$viewValue.subName + */ + [index: string]: (modelValue: any, viewValue: any) => boolean; } interface IAsyncModelValidators { - [index: string]: (...args: any[]) => IPromise; + [index: string]: (modelValue: any, viewValue: any) => IPromise; } interface IModelParser { @@ -539,9 +484,29 @@ declare module angular { $applyAsync(exp: string): any; $applyAsync(exp: (scope: IScope) => any): any; + /** + * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners. + * + * The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled. + * + * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. + * + * @param name Event name to broadcast. + * @param args Optional one or more arguments which will be passed onto the event listeners. + */ $broadcast(name: string, ...args: any[]): IAngularEvent; $destroy(): void; $digest(): void; + /** + * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners. + * + * The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it. + * + * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. + * + * @param name Event name to emit. + * @param args Optional one or more arguments which will be passed onto the event listeners. + */ $emit(name: string, ...args: any[]): IAngularEvent; $eval(): any; @@ -563,18 +528,18 @@ declare module angular { * @param name Event name to listen on. * @param listener Function to call when the event is emitted. */ - $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function; + $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): () => void; - $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function; - $watch(watchExpression: string, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function; - $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function; - $watch(watchExpression: (scope: IScope) => any, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function; + $watch(watchExpression: string, listener?: string, objectEquality?: boolean): () => void; + $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; + $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): () => void; + $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - $watchCollection(watchExpression: string, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; - $watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; + $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; - $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; + $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; $parent: IScope; $root: IRootScopeService; @@ -623,7 +588,7 @@ declare module angular { */ $odd: boolean; - } + } interface IAngularEvent { /** @@ -660,21 +625,14 @@ declare module angular { [key: string]: any; } - /////////////////////////////////////////////////////////////////////////// - // BrowserService - // TODO undocumented, so we need to get it from the source code - /////////////////////////////////////////////////////////////////////////// - interface IBrowserService { - [key: string]: any; - } - /////////////////////////////////////////////////////////////////////////// // TimeoutService // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function, delay?: number, invokeApply?: boolean): IPromise; - cancel(promise: IPromise): boolean; + (delay?: number, invokeApply?: boolean): IPromise; + (fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): IPromise; + cancel(promise?: IPromise): boolean; } /////////////////////////////////////////////////////////////////////////// @@ -682,50 +640,153 @@ declare module angular { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): IPromise; cancel(promise: IPromise): boolean; } - /////////////////////////////////////////////////////////////////////////// - // AngularProvider - // see http://docs.angularjs.org/api/ng/provider/$animateProvider - /////////////////////////////////////////////////////////////////////////// - interface IAnimateProvider { - /** - * Registers a new injectable animation factory function. + /** + * $filter - $filterProvider - service in module ng + * + * Filters are used for formatting data displayed to the user. + * + * see https://docs.angularjs.org/api/ng/service/$filter + */ + interface IFilterService { + (name: 'filter'): IFilterFilter; + (name: 'currency'): IFilterCurrency; + (name: 'number'): IFilterNumber; + (name: 'date'): IFilterDate; + (name: 'json'): IFilterJson; + (name: 'lowercase'): IFilterLowercase; + (name: 'uppercase'): IFilterUppercase; + (name: 'limitTo'): IFilterLimitTo; + (name: 'orderBy'): IFilterOrderBy; + /** + * Usage: + * $filter(name); * - * @param name The name of the animation. - * @param factory The factory function that will be executed to return the animation object. + * @param name Name of the filter function to retrieve */ - register(name: string, factory: () => IAnimateCallbackObject): void; + (name: string): T; + } + interface IFilterFilter { + (array: T[], expression: string | IFilterFilterPatternObject | IFilterFilterPredicateFunc, comparator?: IFilterFilterComparatorFunc|boolean): T[]; + } + + interface IFilterFilterPatternObject { + [name: string]: any; + } + + interface IFilterFilterPredicateFunc { + (value: T, index: number, array: T[]): boolean; + } + + interface IFilterFilterComparatorFunc { + (actual: T, expected: T): boolean; + } + + interface IFilterCurrency { + /** + * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. + * @param amount Input to filter. + * @param symbol Currency symbol or identifier to be displayed. + * @param fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale + * @return Formatted number + */ + (amount: number, symbol?: string, fractionSize?: number): string; + } + + interface IFilterNumber { + /** + * Formats a number as text. + * @param number Number to format. + * @param fractionSize Number of decimal places to round the number to. If this is not provided then the fraction size is computed from the current locale's number formatting pattern. In the case of the default locale, it will be 3. + * @return Number rounded to decimalPlaces and places a “,” after each third digit. + */ + (value: number|string, fractionSize?: number|string): string; + } + + interface IFilterDate { /** - * Gets and/or sets the CSS class expression that is checked when performing an animation. + * Formats date to a string based on the requested format. * - * @param expression The className expression which will be checked against all animations. - * @returns The current CSS className expression value. If null then there is no expression value. + * @param date Date to format either as Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is specified in the string input, the time is considered to be in the local timezone. + * @param format Formatting rules (see Description). If not specified, mediumDate is used. + * @param timezone Timezone to be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset, for example, '+0430' (4 hours, 30 minutes east of the Greenwich meridian) If not specified, the timezone of the browser will be used. + * @return Formatted string or the input if input is not recognized as date/millis. */ - classNameFilter(expression?: RegExp): RegExp; + (date: Date | number | string, format?: string, timezone?: string): string; } - /** - * The animation object which contains callback functions for each event that is expected to be animated. - */ - interface IAnimateCallbackObject { - eventFn(element: Node, doneFn: () => void): Function; + interface IFilterJson { + /** + * Allows you to convert a JavaScript object into JSON string. + * @param object Any JavaScript object (including arrays and primitive types) to filter. + * @param spacing The number of spaces to use per indentation, defaults to 2. + * @return JSON string. + */ + (object: any, spacing?: number): string; } - /////////////////////////////////////////////////////////////////////////// - // FilterService - // see http://docs.angularjs.org/api/ng.$filter - // see http://docs.angularjs.org/api/ng.$filterProvider - /////////////////////////////////////////////////////////////////////////// - interface IFilterService { - (name: string): Function; + interface IFilterLowercase { + /** + * Converts string to lowercase. + */ + (value: string): string; + } + + interface IFilterUppercase { + /** + * Converts string to uppercase. + */ + (value: string): string; + } + + interface IFilterLimitTo { + /** + * Creates a new array containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string or number, as specified by the value and sign (positive or negative) of limit. + * @param input Source array to be limited. + * @param limit The length of the returned array. If the limit number is positive, limit number of items from the beginning of the source array/string are copied. If the number is negative, limit number of items from the end of the source array are copied. The limit will be trimmed if it exceeds array.length. If limit is undefined, the input will be returned unchanged. + * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. + * @return A new sub-array of length limit or less if input array had less than limit elements. + */ + (input: T[], limit: string|number, begin?: string|number): T[]; + /** + * Creates a new string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source string or number, as specified by the value and sign (positive or negative) of limit. If a number is used as input, it is converted to a string. + * @param input Source string or number to be limited. + * @param limit The length of the returned string. If the limit number is positive, limit number of items from the beginning of the source string are copied. If the number is negative, limit number of items from the end of the source string are copied. The limit will be trimmed if it exceeds input.length. If limit is undefined, the input will be returned unchanged. + * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. + * @return A new substring of length limit or less if input had less than limit elements. + */ + (input: string|number, limit: string|number, begin?: string|number): string; + } + + interface IFilterOrderBy { + /** + * Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers. Note: if you notice numbers are not being sorted as expected, make sure they are actually being saved as numbers and not strings. + * @param array The array to sort. + * @param expression A predicate to be used by the comparator to determine the order of elements. + * @param reverse Reverse the order of the array. + * @return Reverse the order of the array. + */ + (array: T[], expression: string|((value: T) => any)|(((value: T) => any)|string)[], reverse?: boolean): T[]; } + /** + * $filterProvider - $filter - provider in module ng + * + * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function. + * + * see https://docs.angularjs.org/api/ng/provider/$filterProvider + */ interface IFilterProvider extends IServiceProvider { - register(name: string, filterFactory: Function): IServiceProvider; + /** + * register(name); + * + * @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx). + */ + register(name: string | {}): IServiceProvider; } /////////////////////////////////////////////////////////////////////////// @@ -790,7 +851,7 @@ declare module angular { warn: ILogCall; } - interface ILogProvider { + interface ILogProvider extends IServiceProvider { debugEnabled(): boolean; debugEnabled(enabled: boolean): ILogProvider; } @@ -816,11 +877,32 @@ declare module angular { unwrapPromises(): boolean; unwrapPromises(value: boolean): IParseProvider; + + /** + * Configure $parse service to add literal values that will be present as literal at expressions. + * + * @param literalName Token for the literal value. The literal name value must be a valid literal name. + * @param literalValue Value for this literal. All literal values must be primitives or `undefined`. + **/ + addLiteral(literalName: string, literalValue: any): void; + + /** + * Allows defining the set of characters that are allowed in Angular expressions. The function identifierStart will get called to know if a given character is a valid character to be the first character for an identifier. The function identifierContinue will get called to know if a given character is a valid character to be a follow-up identifier character. The functions identifierStart and identifierContinue will receive as arguments the single character to be identifier and the character code point. These arguments will be string and numeric. Keep in mind that the string parameter can be two characters long depending on the character representation. It is expected for the function to return true or false, whether that character is allowed or not. + * Since this function will be called extensivelly, keep the implementation of these functions fast, as the performance of these functions have a direct impact on the expressions parsing speed. + * + * @param identifierStart The function that will decide whether the given character is a valid identifier start character. + * @param identifierContinue The function that will decide whether the given character is a valid identifier continue character. + **/ + setIdentifierFns(identifierStart?: (character: string, codePoint: number) => boolean, + identifierContinue?: (character: string, codePoint: number) => boolean): void; } interface ICompiledExpression { (context: any, locals?: any): any; + literal: boolean; + constant: boolean; + // If value is not provided, undefined is gonna be used since the implementation // does not check the parameter. Let's force a value for consistency. If consumer // whants to undefine it, pass the undefined value explicitly. @@ -924,9 +1006,10 @@ declare module angular { * See http://docs.angularjs.org/api/ng/service/$q */ interface IQService { - new (resolver: (resolve: IQResolveReject) => any): IPromise; - new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject) => any): IPromise; new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + (resolver: (resolve: IQResolveReject) => any): IPromise; + (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. @@ -935,7 +1018,16 @@ declare module angular { * * @param promises An array of promises. */ - all(promises: IPromise[]): IPromise; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise]): IPromise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; + all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; + all(promises: IPromise[]): IPromise; /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * @@ -944,6 +1036,7 @@ declare module angular { * @param promises A hash of promises. */ all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>; + all(promises: { [id: string]: IPromise; }): IPromise; /** * Creates a Deferred object which represents a task which will finish in the future. */ @@ -961,38 +1054,46 @@ declare module angular { * * @param value Value or a promise */ - when(value: IPromise|T): IPromise; + resolve(value: IPromise|T): IPromise; + /** + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. + */ + resolve(): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. * * @param value Value or a promise */ + when(value: IPromise|T): IPromise; + /** + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. + */ when(): IPromise; } interface IPromise { /** * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. - * + * The successCallBack may return IPromise for when a $q.reject() needs to be returned * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. */ - then(successCallback: (promiseValue: T) => IHttpPromise|IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; + then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; /** * Shorthand for promise.then(null, errorCallback) */ - catch(onRejected: (reason: any) => IHttpPromise|IPromise|TResult): IPromise; + catch(onRejected: (reason: any) => IPromise|TResult): IPromise; /** * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. * * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. */ - finally(finallyCallback: () => any): IPromise; + finally(finallyCallback: () => any): IPromise; } interface IDeferred { - resolve(value?: T): void; + resolve(value?: T|IPromise): void; reject(reason?: any): void; notify(state?: any): void; promise: IPromise; @@ -1004,6 +1105,7 @@ declare module angular { /////////////////////////////////////////////////////////////////////////// interface IAnchorScrollService { (): void; + (hash: string): void; yOffset: any; } @@ -1011,34 +1113,95 @@ declare module angular { disableAutoScrolling(): void; } - /////////////////////////////////////////////////////////////////////////// - // CacheFactoryService - // see http://docs.angularjs.org/api/ng.$cacheFactory - /////////////////////////////////////////////////////////////////////////// + /** + * $cacheFactory - service in module ng + * + * Factory that constructs Cache objects and gives access to them. + * + * see https://docs.angularjs.org/api/ng/service/$cacheFactory + */ interface ICacheFactoryService { - // Lets not foce the optionsMap to have the capacity member. Even though - // it's the ONLY option considered by the implementation today, a consumer - // might find it useful to associate some other options to the cache object. - //(cacheId: string, optionsMap?: { capacity: number; }): CacheObject; - (cacheId: string, optionsMap?: { capacity: number; }): ICacheObject; + /** + * Factory that constructs Cache objects and gives access to them. + * + * @param cacheId Name or id of the newly created cache. + * @param optionsMap Options object that specifies the cache behavior. Properties: + * + * capacity — turns the cache into LRU cache. + */ + (cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject; - // Methods bellow are not documented + /** + * Get information about all the caches that have been created. + * @returns key-value map of cacheId to the result of calling cache#info + */ info(): any; + + /** + * Get access to a cache object by the cacheId used when it was created. + * + * @param cacheId Name or id of a cache to access. + */ get(cacheId: string): ICacheObject; } + /** + * $cacheFactory.Cache - type in module ng + * + * A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data. + * + * see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache + */ interface ICacheObject { + /** + * Retrieve information regarding a particular Cache. + */ info(): { + /** + * the id of the cache instance + */ id: string; + + /** + * the number of entries kept in the cache instance + */ size: number; - // Not garanteed to have, since it's a non-mandatory option - //capacity: number; + //...: any additional properties from the options object when creating the cache. }; + + /** + * Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set. + * + * It will not insert undefined values into the cache. + * + * @param key the key under which the cached data is stored. + * @param value the value to store alongside the key. If it is undefined, the key will not be stored. + */ put(key: string, value?: T): T; - get(key: string): any; + + /** + * Retrieves named data stored in the Cache object. + * + * @param key the key of the data to be retrieved + */ + get(key: string): T; + + /** + * Removes an entry from the Cache object. + * + * @param key the key of the entry to be removed + */ remove(key: string): void; + + /** + * Clears the cache object of any entries. + */ removeAll(): void; + + /** + * Destroys the Cache object entirely, removing it from the $cacheFactory set. + */ destroy(): void; } @@ -1055,10 +1218,15 @@ declare module angular { interface ICompileProvider extends IServiceProvider { directive(name: string, directiveFactory: Function): ICompileProvider; + directive(directivesMap: Object, directiveFactory: Function): ICompileProvider; + directive(name: string, inlineAnnotatedFunction: any[]): ICompileProvider; + directive(directivesMap: Object, inlineAnnotatedFunction: any[]): ICompileProvider; // Undocumented, but it is there... directive(directivesMap: any): ICompileProvider; + component(name: string, options: IComponentOptions): ICompileProvider; + aHrefSanitizationWhitelist(): RegExp; aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; @@ -1093,8 +1261,9 @@ declare module angular { /////////////////////////////////////////////////////////////////////////// interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: Function, locals?: any): any; - (controllerName: string, locals?: any): any; + (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; + (controllerName: string, locals?: any, later?: boolean, ident?: string): T; } interface IControllerProvider extends IServiceProvider { @@ -1103,6 +1272,15 @@ declare module angular { allowGlobals(): void; } + /** + * xhrFactory + * Replace or decorate this service to create your own custom XMLHttpRequest objects. + * see https://docs.angularjs.org/api/ng/service/$xhrFactory + */ + interface IXhrFactory { + (method: string, url: string): T; + } + /** * HttpService * see http://docs.angularjs.org/api/ng/service/$http @@ -1175,51 +1353,25 @@ declare module angular { /** * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations. */ - defaults: IRequestConfig; + defaults: IHttpProviderDefaults; /** * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes. */ - pendingRequests: any[]; + pendingRequests: IRequestConfig[]; } /** * Object describing the request to be made and how it should be processed. * see http://docs.angularjs.org/api/ng/service/$http#usage */ - interface IRequestShortcutConfig { + interface IRequestShortcutConfig extends IHttpProviderDefaults { /** * {Object.} * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified. */ params?: any; - /** - * Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. - */ - headers?: any; - - /** - * Name of HTTP header to populate with the XSRF token. - */ - xsrfHeaderName?: string; - - /** - * Name of cookie containing the XSRF token. - */ - xsrfCookieName?: string; - - /** - * {boolean|Cache} - * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. - */ - cache?: any; - - /** - * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information. - */ - withCredentials?: boolean; - /** * {string|Object} * Data to be sent as the request message data. @@ -1227,25 +1379,12 @@ declare module angular { data?: any; /** - * {function(data, headersGetter)|Array.} - * Transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version. - */ - transformRequest?: any; - - /** - * {function(data, headersGetter)|Array.} - * Transform function or an array of such functions. The transform function takes the http response body and headers and returns its transformed (typically deserialized) version. - */ - transformResponse?: any; - - /** - * {number|Promise} * Timeout in milliseconds, or promise that should abort the request when resolved. */ - timeout?: any; + timeout?: number|IPromise; /** - * See requestType. + * See [XMLHttpRequest.responseType]https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype */ responseType?: string; } @@ -1277,38 +1416,130 @@ declare module angular { interface IHttpPromiseCallbackArg { data?: T; status?: number; - headers?: (headerName: string) => string; + headers?: IHttpHeadersGetter; config?: IRequestConfig; statusText?: string; } interface IHttpPromise extends IPromise> { - success(callback: IHttpPromiseCallback): IHttpPromise; - error(callback: IHttpPromiseCallback): IHttpPromise; - then(successCallback: (response: IHttpPromiseCallbackArg) => IPromise|TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise; + /** + * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. + * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. + * @deprecated + */ + success?(callback: IHttpPromiseCallback): IHttpPromise; + /** + * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. + * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. + * @deprecated + */ + error?(callback: IHttpPromiseCallback): IHttpPromise; + } + + // See the jsdoc for transformData() at https://github.com/angular/angular.js/blob/master/src/ng/http.js#L228 + interface IHttpRequestTransformer { + (data: any, headersGetter: IHttpHeadersGetter): any; + } + + // The definition of fields are the same as IHttpPromiseCallbackArg + interface IHttpResponseTransformer { + (data: any, headersGetter: IHttpHeadersGetter, status: number): any; + } + + type HttpHeaderType = {[requestType: string]:string|((config:IRequestConfig) => string)}; + + interface IHttpRequestConfigHeaders { + [requestType: string]: any; + common?: any; + get?: any; + post?: any; + put?: any; + patch?: any; } /** - * Object that controls the defaults for $http provider + * Object that controls the defaults for $http provider. Not all fields of IRequestShortcutConfig can be configured + * via defaults and the docs do not say which. The following is based on the inspection of the source code. * https://docs.angularjs.org/api/ng/service/$http#defaults + * https://docs.angularjs.org/api/ng/service/$http#usage + * https://docs.angularjs.org/api/ng/provider/$httpProvider The properties section */ interface IHttpProviderDefaults { - xsrfCookieName?: string; + /** + * {boolean|Cache} + * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. + */ + cache?: any; + + /** + * Transform function or an array of such functions. The transform function takes the http request body and + * headers and returns its transformed (typically serialized) version. + * @see {@link https://docs.angularjs.org/api/ng/service/$http#transforming-requests-and-responses} + */ + transformRequest?: IHttpRequestTransformer |IHttpRequestTransformer[]; + + /** + * Transform function or an array of such functions. The transform function takes the http response body and + * headers and returns its transformed (typically deserialized) version. + */ + transformResponse?: IHttpResponseTransformer | IHttpResponseTransformer[]; + + /** + * Map of strings or functions which return strings representing HTTP headers to send to the server. If the + * return value of a function is null, the header will not be sent. + * The key of the map is the request verb in lower case. The "common" key applies to all requests. + * @see {@link https://docs.angularjs.org/api/ng/service/$http#setting-http-headers} + */ + headers?: IHttpRequestConfigHeaders; + + /** Name of HTTP header to populate with the XSRF token. */ xsrfHeaderName?: string; + + /** Name of cookie containing the XSRF token. */ + xsrfCookieName?: string; + + /** + * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information. + */ withCredentials?: boolean; - headers?: { - common?: any; - post?: any; - put?: any; - patch?: any; - } + + /** + * A function used to the prepare string representation of request parameters (specified as an object). If + * specified as string, it is interpreted as a function registered with the $injector. Defaults to + * $httpParamSerializer. + */ + paramSerializer?: string | ((obj: any) => string); + } + + interface IHttpInterceptor { + request?: (config: IRequestConfig) => IRequestConfig|IPromise; + requestError?: (rejection: any) => any; + response?: (response: IHttpPromiseCallbackArg) => IPromise>|IHttpPromiseCallbackArg; + responseError?: (rejection: any) => any; + } + + interface IHttpInterceptorFactory { + (...args: any[]): IHttpInterceptor; } interface IHttpProvider extends IServiceProvider { defaults: IHttpProviderDefaults; - interceptors: any[]; + + /** + * Register service factories (names or implementations) for interceptors which are called before and after + * each request. + */ + interceptors: (string|IHttpInterceptorFactory|(string|IHttpInterceptorFactory)[])[]; useApplyAsync(): boolean; useApplyAsync(value: boolean): IHttpProvider; + + /** + * + * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. + * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * otherwise, returns the current configured value. + */ + useLegacyPromiseExtensions(value:boolean) : boolean | IHttpProvider; } /////////////////////////////////////////////////////////////////////////// @@ -1400,6 +1631,8 @@ declare module angular { interface ISCEDelegateProvider extends IServiceProvider { resourceUrlBlacklist(blacklist: any[]): void; resourceUrlWhitelist(whitelist: any[]): void; + resourceUrlBlacklist(): any[]; + resourceUrlWhitelist(): any[]; } /** @@ -1430,6 +1663,60 @@ declare module angular { totalPendingRequests: number; } + /////////////////////////////////////////////////////////////////////////// + // Component + // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html + // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ + /////////////////////////////////////////////////////////////////////////// + /** + * Component definition object (a simplified directive definition object) + */ + interface IComponentOptions { + /** + * Controller constructor function that should be associated with newly created scope or the name of a registered + * controller if passed as a string. Empty function by default. + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + controller?: string | Function | (string | Function)[]; + /** + * An identifier name for a reference to the controller. If present, the controller will be published to scope under + * the controllerAs name. If not present, this will default to be the same as the component name. + * @default "$ctrl" + */ + controllerAs?: string; + /** + * html template as a string or a function that returns an html template as a string which should be used as the + * contents of this component. Empty string by default. + * If template is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + template?: string | Function | (string | Function)[]; + /** + * path or function that returns a path to an html template that should be used as the contents of this component. + * If templateUrl is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + templateUrl?: string | Function | (string | Function)[]; + /** + * Define DOM attribute binding to component properties. Component properties are always bound to the component + * controller and not to the scope. + */ + bindings?: {[binding: string]: string}; + /** + * Whether transclusion is enabled. Enabled by default. + */ + transclude?: boolean | string | {[slot: string]: string}; + require?: string | string[] | {[controller: string]: string}; + } + + interface IComponentTemplateFn { + ( $element?: IAugmentedJQuery, $attrs?: IAttributes ): string; + } + /////////////////////////////////////////////////////////////////////////// // Directive // see http://docs.angularjs.org/api/ng.$compileProvider#directive @@ -1445,7 +1732,7 @@ declare module angular { scope: IScope, instanceElement: IAugmentedJQuery, instanceAttributes: IAttributes, - controller: any, + controller: {}, transclude: ITranscludeFunction ): void; } @@ -1459,6 +1746,12 @@ declare module angular { ( templateElement: IAugmentedJQuery, templateAttributes: IAttributes, + /** + * @deprecated + * Note: The transclude function that is passed to the compile function is deprecated, + * as it e.g. does not know about the right outer scope. Please use the transclude function + * that is passed to the link function instead. + */ transclude: ITranscludeFunction ): IDirectivePrePost; } @@ -1467,18 +1760,29 @@ declare module angular { compile?: IDirectiveCompileFn; controller?: any; controllerAs?: string; - bindToController?: boolean; + /** + * @deprecated + * Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before + * the controller constructor is called, this use is now deprecated. Please place initialization code that + * relies upon bindings inside a $onInit method on the controller, instead. + */ + bindToController?: boolean | Object; link?: IDirectiveLinkFn | IDirectivePrePost; + multiElement?: boolean; name?: string; priority?: number; + /** + * @deprecated + */ replace?: boolean; - require?: any; + require?: string | string[] | {[controller: string]: string}; restrict?: string; - scope?: any; - template?: any; - templateUrl?: any; + scope?: boolean | Object; + template?: string | Function; + templateNamespace?: string; + templateUrl?: string | Function; terminal?: boolean; - transclude?: any; + transclude?: boolean | string | {[slot: string]: string}; } /** @@ -1509,6 +1813,11 @@ declare module angular { controller(name: string): any; injector(): any; scope(): IScope; + + /** + * Overload for custom scope interfaces + */ + scope(): T; isolateScope(): IScope; inheritedData(key: string, value: any): JQuery; @@ -1516,18 +1825,6 @@ declare module angular { inheritedData(key?: string): any; } - /////////////////////////////////////////////////////////////////////// - // AnimateService - // see http://docs.angularjs.org/api/ng.$animate - /////////////////////////////////////////////////////////////////////// - interface IAnimateService { - addClass(element: JQuery, className: string, done?: Function): IPromise; - enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; - leave(element: JQuery, done?: Function): void; - move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; - removeClass(element: JQuery, className: string, done?: Function): void; - } - /////////////////////////////////////////////////////////////////////////// // AUTO module (angular.js) /////////////////////////////////////////////////////////////////////////// @@ -1538,13 +1835,41 @@ declare module angular { // see http://docs.angularjs.org/api/AUTO.$injector /////////////////////////////////////////////////////////////////////// interface IInjectorService { - annotate(fn: Function): string[]; + annotate(fn: Function, strictDi?: boolean): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; - get(name: string): any; + get(name: string, caller?: string): T; + get(name: '$anchorScroll'): IAnchorScrollService + get(name: '$cacheFactory'): ICacheFactoryService + get(name: '$compile'): ICompileService + get(name: '$controller'): IControllerService + get(name: '$document'): IDocumentService + get(name: '$exceptionHandler'): IExceptionHandlerService + get(name: '$filter'): IFilterService + get(name: '$http'): IHttpService + get(name: '$httpBackend'): IHttpBackendService + get(name: '$httpParamSerializer'): IHttpParamSerializer + get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer + get(name: '$interpolate'): IInterpolateService + get(name: '$interval'): IIntervalService + get(name: '$locale'): ILocaleService + get(name: '$location'): ILocationService + get(name: '$log'): ILogService + get(name: '$parse'): IParseService + get(name: '$q'): IQService + get(name: '$rootElement'): IRootElementService + get(name: '$rootScope'): IRootScopeService + get(name: '$sce'): ISCEService + get(name: '$sceDelegate'): ISCEDelegateService + get(name: '$templateCache'): ITemplateCacheService + get(name: '$templateRequest'): ITemplateRequestService + get(name: '$timeout'): ITimeoutService + get(name: '$window'): IWindowService + get(name: '$xhrFactory'): IXhrFactory has(name: string): boolean; - instantiate(typeConstructor: Function, locals?: any): any; + instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; invoke(func: Function, context?: any, locals?: any): any; + strictDi: boolean; } /////////////////////////////////////////////////////////////////////// @@ -1586,8 +1911,17 @@ declare module angular { provider(name: string, provider: IServiceProvider): IServiceProvider; provider(name: string, serviceProviderConstructor: Function): IServiceProvider; service(name: string, constructor: Function): IServiceProvider; + service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; value(name: string, value: any): IServiceProvider; } } -} + + /** + * $http params serializer that converts objects to strings + * see https://docs.angularjs.org/api/ng/service/$httpParamSerializer + */ + interface IHttpParamSerializer { + (obj: Object): string; + } +} \ No newline at end of file diff --git a/index.js b/index.js index a6273da..d2c7d6a 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,8 @@ function setDefaultValue(opts) { { pattern: /Manager$/, type: 'service' }, { pattern: /ServiceDelegate$/, type: 'service' }, { pattern: /Provider$/, type: 'provider', removePattern: true }, - { pattern: /Directive$/, type: 'directive', removePattern: true, firstLowerCase: true } + { pattern: /Directive$/, type: 'directive', removePattern: true, firstLowerCase: true }, + { pattern: /Component$/, type: 'component', removePattern: true, firstLowerCase: true } ]; } if (typeof opts.decoratorPatterns === 'undefined') { @@ -28,7 +29,8 @@ function setDefaultValue(opts) { { pattern: /Controller$/, func: 'Controller', firstLowerCase: false }, { pattern: /Service$/, func: 'Service' }, { pattern: /Provider$/, func: 'Provider', removePattern: true }, - { pattern: /Directive$/, func: 'Directive', removePattern: true, firstLowerCase: true } + { pattern: /Directive$/, func: 'Directive', removePattern: true, firstLowerCase: true }, + { pattern: /Component$/, func: 'Component', removePattern: true, firstLowerCase: true } ]; } } @@ -129,6 +131,9 @@ function addAngularModule(node, decl, opts, ptn) { if (type === 'directive') { source += createModule(); } + else if (type === 'component') { + source += createComponent(); + } else if (type === 'value') { source += createModule(); } @@ -140,6 +145,12 @@ function addAngularModule(node, decl, opts, ptn) { } source += '/**/'; node.update(node.source() + source); + function createComponent() { + var source = ''; + source += "angular.module('" + moduleName + "')"; + source += "." + type + "('" + conponentName + "',new " + className + "());"; + return source; + } function functionModule() { var source = ''; source += "angular.module('" + moduleName + "')"; diff --git a/index.ts b/index.ts index 19e2f04..ece83d0 100644 --- a/index.ts +++ b/index.ts @@ -45,7 +45,8 @@ function setDefaultValue(opts: Options) { { pattern: /Manager$/, type: 'service' }, { pattern: /ServiceDelegate$/, type: 'service' }, { pattern: /Provider$/, type: 'provider', removePattern: true }, - { pattern: /Directive$/, type: 'directive', removePattern: true, firstLowerCase: true } + { pattern: /Directive$/, type: 'directive', removePattern: true, firstLowerCase: true }, + { pattern: /Component$/, type: 'component', removePattern: true, firstLowerCase: true } ]; } @@ -54,7 +55,8 @@ function setDefaultValue(opts: Options) { { pattern: /Controller$/, func: 'Controller', firstLowerCase: false }, { pattern: /Service$/, func: 'Service' }, { pattern: /Provider$/, func: 'Provider', removePattern: true }, - { pattern: /Directive$/, func: 'Directive', removePattern: true, firstLowerCase: true } + { pattern: /Directive$/, func: 'Directive', removePattern: true, firstLowerCase: true }, + { pattern: /Component$/, func: 'Component', removePattern: true, firstLowerCase: true } ]; } @@ -215,6 +217,9 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern if (type === 'directive') { source += createModule(); } + else if (type === 'component') { + source += createComponent(); + } else if (type === 'value') { source += createModule(); } @@ -227,6 +232,13 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern source += '/**/'; node.update(node.source() + source); + function createComponent() { + var source = ''; + source += `angular.module('${moduleName}')`; + source += `.${type}('${conponentName}',new ${className}());`; + return source; + } + function functionModule() { var source = ''; source += `angular.module('${moduleName}')`; @@ -235,7 +247,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern } function createModule() { - constructorParams.push(`function(){return new (Function.prototype.bind.apply(${className},[null].concat(Array.prototype.slice.call(arguments))));}`); + constructorParams.push(`function(){return new (Function.prototype.bind.apply(${className},[null].concat(Array.prototype.slice.call(arguments))));}`); var source = ''; source += `angular.module('${moduleName}')`; source += `.${type}('${conponentName}',[${constructorParams.join('\,')}]);`; From 909987579ca68fb07eff597f865ea2702324775e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Jul 2016 12:05:39 -0700 Subject: [PATCH 2/6] bump falafel version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9573bba..738b937 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/takeshi/gulp-typescript-angular", "dependencies": { - "falafel": "^1.0.1", + "falafel": "^1.2.0", "gulp": "^3.8.11", "gulp-typescript": "^2.5.0", "through2": "^0.6.3" From 83711593bdbfe829ae86d9c8e526c30348713327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Jul 2016 16:31:51 -0700 Subject: [PATCH 3/6] update to work with ES6/ES2015 proper classes --- example/dist/decorator/decorators.js | 4 ++ example/dist/decorator/sample-controller.js | 12 ++--- example/dist/decorator/sample-directive.js | 12 ++--- .../dist/decorator/sample-manager-provider.js | 14 +++--- example/dist/decorator/sample-service.js | 12 ++--- example/dist/naming_rule/sample-component.js | 6 +-- example/dist/naming_rule/sample-controller.js | 4 +- example/dist/naming_rule/sample-ctrl.js | 4 +- example/dist/naming_rule/sample-directive.js | 8 ++-- .../naming_rule/sample-manager-provider.js | 6 +-- example/dist/naming_rule/sample-service.js | 4 +- index.js | 20 +++----- index.ts | 48 ++++++++----------- npm-shrinkwrap.json | 14 ++++++ 14 files changed, 83 insertions(+), 85 deletions(-) create mode 100644 npm-shrinkwrap.json diff --git a/example/dist/decorator/decorators.js b/example/dist/decorator/decorators.js index ab6d401..a6f35ad 100644 --- a/example/dist/decorator/decorators.js +++ b/example/dist/decorator/decorators.js @@ -20,4 +20,8 @@ var sample; angularModule.directive(clazz.$componentName, args); } sample.Directive = Directive; + function Component(clazz) { + angularModule.component(clazz.$componentName, new clazz()); + } + sample.Component = Component; })(sample || (sample = {})); diff --git a/example/dist/decorator/sample-controller.js b/example/dist/decorator/sample-controller.js index e479783..f67752b 100644 --- a/example/dist/decorator/sample-controller.js +++ b/example/dist/decorator/sample-controller.js @@ -1,10 +1,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); - switch (arguments.length) { - case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); - case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); - case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); - } + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; }; var sample; (function (sample) { @@ -16,5 +14,5 @@ var sample; sample.Controller ], SampleController); return SampleController; - })(); + }()); })(sample || (sample = {})); diff --git a/example/dist/decorator/sample-directive.js b/example/dist/decorator/sample-directive.js index 8e436f4..8851d1d 100644 --- a/example/dist/decorator/sample-directive.js +++ b/example/dist/decorator/sample-directive.js @@ -1,10 +1,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); - switch (arguments.length) { - case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); - case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); - case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); - } + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; }; var sample; (function (sample) { @@ -23,5 +21,5 @@ var sample; sample.Directive ], SampleDirective); return SampleDirective; - })(); + }()); })(sample || (sample = {})); diff --git a/example/dist/decorator/sample-manager-provider.js b/example/dist/decorator/sample-manager-provider.js index fb56fb5..4d1f9e9 100644 --- a/example/dist/decorator/sample-manager-provider.js +++ b/example/dist/decorator/sample-manager-provider.js @@ -1,10 +1,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); - switch (arguments.length) { - case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); - case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); - case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); - } + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; }; var sample; (function (sample) { @@ -18,11 +16,11 @@ var sample; sample.Provider ], SampleManagerProvider); return SampleManagerProvider; - })(); + }()); var $SampleManager = (function () { function $SampleManager(provider) { this.provider = provider; } return $SampleManager; - })(); + }()); })(sample || (sample = {})); diff --git a/example/dist/decorator/sample-service.js b/example/dist/decorator/sample-service.js index 3feab58..9c10548 100644 --- a/example/dist/decorator/sample-service.js +++ b/example/dist/decorator/sample-service.js @@ -1,10 +1,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); - switch (arguments.length) { - case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); - case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); - case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); - } + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; }; var sample; (function (sample) { @@ -16,5 +14,5 @@ var sample; sample.Service ], SampleService); return SampleService; - })(); + }()); })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-component.js b/example/dist/naming_rule/sample-component.js index 15904c1..100b93c 100644 --- a/example/dist/naming_rule/sample-component.js +++ b/example/dist/naming_rule/sample-component.js @@ -3,9 +3,9 @@ var sample; var SampleComponentController = (function () { function SampleComponentController($compile) { this.$compile = $compile; - }/**/SampleComponentController.$inject = ['$compile']; SampleComponentController.$componentName = 'SampleComponentController'/**/ + } return SampleComponentController; - }());/**/angular.module('sample').controller('SampleComponentController',SampleComponentController);/**/ + }());/**/angular.module('sample').controller('SampleComponentController',['$compile',function(){return new (Function.prototype.bind.apply(SampleComponentController,[null].concat(arguments)));}]);/**/ var SampleComponent = (function () { function SampleComponent() { this.templateUrl = '/sample.html'; @@ -13,7 +13,7 @@ var sample; text: '<' }; this.controller = SampleComponentController; - }/**/SampleComponent.$inject = []; SampleComponent.$componentName = 'sample'/**/ + } return SampleComponent; }());/**/angular.module('sample').component('sample',new SampleComponent());/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-controller.js b/example/dist/naming_rule/sample-controller.js index ce6ac1d..11b51c3 100644 --- a/example/dist/naming_rule/sample-controller.js +++ b/example/dist/naming_rule/sample-controller.js @@ -3,7 +3,7 @@ var sample; var SampleController = (function () { function SampleController($scope) { this.$scope = $scope; - }/**/SampleController.$inject = ['$scope']; SampleController.$componentName = 'SampleController'/**/ + } return SampleController; - })();/**/angular.module('sample').controller('SampleController',SampleController);/**/ + }());/**/angular.module('sample').controller('SampleController',['$scope',function(){return new (Function.prototype.bind.apply(SampleController,[null].concat(arguments)));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-ctrl.js b/example/dist/naming_rule/sample-ctrl.js index c211587..ea25204 100644 --- a/example/dist/naming_rule/sample-ctrl.js +++ b/example/dist/naming_rule/sample-ctrl.js @@ -3,7 +3,7 @@ var sample; var SampleCtrl = (function () { function SampleCtrl($scope) { this.$scope = $scope; - }/**/SampleCtrl.$inject = ['$scope']; SampleCtrl.$componentName = 'SampleCtrl'/**/ + } return SampleCtrl; - })();/**/angular.module('sample').controller('SampleCtrl',SampleCtrl);/**/ + }());/**/angular.module('sample').controller('SampleCtrl',['$scope',function(){return new (Function.prototype.bind.apply(SampleCtrl,[null].concat(arguments)));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-directive.js b/example/dist/naming_rule/sample-directive.js index a9cdedc..34a8f9e 100644 --- a/example/dist/naming_rule/sample-directive.js +++ b/example/dist/naming_rule/sample-directive.js @@ -7,9 +7,9 @@ var sample; (function (sample) { var AbstractDirective = (function () { function AbstractDirective() { - }/**/AbstractDirective.$inject = []; AbstractDirective.$componentName = 'abstract'/**/ + } return AbstractDirective; - })();/**/angular.module('sample').directive('abstract',[function(){return new (Function.prototype.bind.apply(AbstractDirective,[null].concat(Array.prototype.slice.call(arguments))));}]);/**/ + }());/**/angular.module('sample').directive('abstract',new AbstractDirective());/**/ var SampleDirective = (function (_super) { __extends(SampleDirective, _super); function SampleDirective($compile) { @@ -20,9 +20,9 @@ var sample; this.scope = { text: '=' }; - }/**/SampleDirective.$inject = ['$compile']; SampleDirective.$componentName = 'sample'/**/ + } SampleDirective.prototype.link = function (scope, element, attr) { }; return SampleDirective; - })(AbstractDirective);/**/angular.module('sample').directive('sample',['$compile',function(){return new (Function.prototype.bind.apply(SampleDirective,[null].concat(Array.prototype.slice.call(arguments))));}]);/**/ + }(AbstractDirective));/**/angular.module('sample').directive('sample',new SampleDirective());/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-manager-provider.js b/example/dist/naming_rule/sample-manager-provider.js index 51c0fa7..656529a 100644 --- a/example/dist/naming_rule/sample-manager-provider.js +++ b/example/dist/naming_rule/sample-manager-provider.js @@ -2,16 +2,16 @@ var sample; (function (sample) { var SampleManagerProvider = (function () { function SampleManagerProvider($q) { - }/**/SampleManagerProvider.$inject = ['$q']; SampleManagerProvider.$componentName = 'sampleManager'/**/ + } SampleManagerProvider.prototype.$get = function () { return new $SampleManager(this); }; return SampleManagerProvider; - })();/**/angular.module('sample').provider('sampleManager',SampleManagerProvider);/**/ + }());/**/angular.module('sample').provider('sampleManager',['$q',function(){return new (Function.prototype.bind.apply(SampleManagerProvider,[null].concat(arguments)));}]);/**/ var $SampleManager = (function () { function $SampleManager(provider) { this.provider = provider; } return $SampleManager; - })(); + }()); })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-service.js b/example/dist/naming_rule/sample-service.js index 6e27d08..09b3443 100644 --- a/example/dist/naming_rule/sample-service.js +++ b/example/dist/naming_rule/sample-service.js @@ -3,7 +3,7 @@ var sample; var SampleService = (function () { function SampleService($q) { this.$q = $q; - }/**/SampleService.$inject = ['$q']; SampleService.$componentName = 'sampleService'/**/ + } return SampleService; - })();/**/angular.module('sample').service('sampleService',SampleService);/**/ + }());/**/angular.module('sample').service('sampleService',['$q',function(){return new (Function.prototype.bind.apply(SampleService,[null].concat(arguments)));}]);/**/ })(sample || (sample = {})); diff --git a/index.js b/index.js index d2c7d6a..dc2a8d4 100644 --- a/index.js +++ b/index.js @@ -59,9 +59,9 @@ function transform(contents, opts) { } function findClassDeclaration(node, opts) { var decls, decl; - if (node.type === 'VariableDeclaration' && + if ((node.type === 'ClassDeclaration' && (decl = node)) || (node.type === 'VariableDeclaration' && (decls = node.declarations) && decls.length === 1 && - (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression') { + (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression')) { if (opts.ignore && decl.id.name.match(opts.ignore)) { return; } @@ -101,7 +101,7 @@ function addAngularModule(node, decl, opts, ptn) { if (typeof firstLowerCase === 'undefined') { firstLowerCase = opts.firstLowerCase; } - var constructor = decl.init.callee.body.body[0].type === 'FunctionDeclaration' ? decl.init.callee.body.body[0] : decl.init.callee.body.body[1]; + var constructor = (decl.body && decl.body.body) ? (decl.body.body[0].kind === 'constructor' ? decl.body.body[0].value : { params: [] }) : (decl.init.callee.body.body[0].type === 'FunctionDeclaration' ? decl.init.callee.body.body[0] : decl.init.callee.body.body[1]); var constructorParams = constructor.params.map(function (param) { return '\'' + param.name + '\''; }); @@ -113,7 +113,6 @@ function addAngularModule(node, decl, opts, ptn) { if (firstLowerCase) { conponentName = conponentName.toLowerCase()[0] + conponentName.substring(1); } - add$inject(decl.init.callee.body, className, conponentName, constructor, constructorParams); function add$inject(body, className, componentName, constructor, constructorParams) { if (!constructorParams) { return; @@ -125,6 +124,7 @@ function addAngularModule(node, decl, opts, ptn) { constructor.update(constructor.source() + source); } if (opts.decoratorModuleName) { + add$inject(decl.init.callee.body, className, conponentName, constructor, constructorParams); return; } var source = '/**/'; @@ -132,7 +132,7 @@ function addAngularModule(node, decl, opts, ptn) { source += createModule(); } else if (type === 'component') { - source += createComponent(); + source += createModule(); } else if (type === 'value') { source += createModule(); @@ -145,20 +145,14 @@ function addAngularModule(node, decl, opts, ptn) { } source += '/**/'; node.update(node.source() + source); - function createComponent() { + function createModule() { var source = ''; source += "angular.module('" + moduleName + "')"; source += "." + type + "('" + conponentName + "',new " + className + "());"; return source; } function functionModule() { - var source = ''; - source += "angular.module('" + moduleName + "')"; - source += "." + type + "('" + conponentName + "'," + className + ");"; - return source; - } - function createModule() { - constructorParams.push("function(){return new (Function.prototype.bind.apply(" + className + ",[null].concat(Array.prototype.slice.call(arguments))));}"); + constructorParams.push("function(){return new (Function.prototype.bind.apply(" + className + ",[null].concat(Array.prototype.slice.apply(arguments))));}"); var source = ''; source += "angular.module('" + moduleName + "')"; source += "." + type + "('" + conponentName + "',[" + constructorParams.join('\,') + "]);"; diff --git a/index.ts b/index.ts index ece83d0..0cff58f 100644 --- a/index.ts +++ b/index.ts @@ -88,6 +88,9 @@ module.exports = function angularify(opts: Options) { }; interface Node { + id: { + name: string + } type: string; declarations: Declaration[]; update(source:string); @@ -98,18 +101,20 @@ interface Declaration { id: { name: string } - init: { + body?: { + body: { + kind: string, + value: Function + } + } + init?: { type: string, callee: { - body: Body + body: { body: DecoratorBlock[] } } } } -interface Body { - body: DecoratorBlock[]; -} - interface DecoratorBlock{ expression:{ right:any, @@ -129,9 +134,9 @@ function transform(contents: string, opts: Options): string { function findClassDeclaration(node: Node, opts: Options) { var decls: Declaration[], decl: Declaration; - if (node.type === 'VariableDeclaration' && + if ((node.type === 'ClassDeclaration' && (decl = node)) || (node.type === 'VariableDeclaration' && (decls = node.declarations) && decls.length === 1 && - (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression') { + (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression')) { if (opts.ignore && decl.id.name.match(opts.ignore)) { return; } @@ -178,9 +183,9 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern firstLowerCase = opts.firstLowerCase; } - var constructor = decl.init.callee.body.body[0].type === 'FunctionDeclaration' ? decl.init.callee.body.body[0] : decl.init.callee.body.body[1]; - var constructorParams = constructor.params.map(function(param) { - return '\'' + param.name + '\''; + var constructor = (decl.body && decl.body.body) ? (decl.body.body[0].kind === 'constructor' ? decl.body.body[0].value : {params:[]}) : (decl.init.callee.body.body[0].type === 'FunctionDeclaration' ? decl.init.callee.body.body[0] : decl.init.callee.body.body[1]); + var constructorParams = constructor.params.map(function (param) { + return '\'' + param.name + '\''; }); @@ -194,22 +199,18 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern if (firstLowerCase) { conponentName = conponentName.toLowerCase()[0] + conponentName.substring(1); } - - add$inject(decl.init.callee.body, className, conponentName, constructor, constructorParams); - function add$inject(body, className, componentName, constructor, constructorParams) { if (!constructorParams) { - return; + return; } var source = '/**/'; source += `${className}.$inject = [${constructorParams.join('\,')}]; `; source += `${className}.$componentName = '${componentName}'`; source += '/**/'; - constructor.update(constructor.source() + source); } - if (opts.decoratorModuleName) { + add$inject(decl.init.callee.body, className, conponentName, constructor, constructorParams); return; } @@ -218,7 +219,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern source += createModule(); } else if (type === 'component') { - source += createComponent(); + source += createModule(); } else if (type === 'value') { source += createModule(); @@ -232,7 +233,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern source += '/**/'; node.update(node.source() + source); - function createComponent() { + function createModule() { var source = ''; source += `angular.module('${moduleName}')`; source += `.${type}('${conponentName}',new ${className}());`; @@ -240,14 +241,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern } function functionModule() { - var source = ''; - source += `angular.module('${moduleName}')`; - source += `.${type}('${conponentName}',${className});`; - return source; - } - - function createModule() { - constructorParams.push(`function(){return new (Function.prototype.bind.apply(${className},[null].concat(Array.prototype.slice.call(arguments))));}`); + constructorParams.push(`function(){return new (Function.prototype.bind.apply(${className},[null].concat(Array.prototype.slice.apply(arguments))));}`); var source = ''; source += `angular.module('${moduleName}')`; source += `.${type}('${conponentName}',[${constructorParams.join('\,')}]);`; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json new file mode 100644 index 0000000..8c29091 --- /dev/null +++ b/npm-shrinkwrap.json @@ -0,0 +1,14 @@ +{ + "dependencies": { + "falafel": { + "version": "1.2.0", + "from": "falafel@>=1.2.0 <2.0.0", + "dependencies": { + "acorn": { + "version": "3.0.0", + "from": "acorn@>=1.0.3 <2.0.0" + } + } + } + } +} From fafd1ffb51091f9b6af0ff4a068d1c49e6ab3ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Jul 2016 19:20:53 -0700 Subject: [PATCH 4/6] bugfix --- index.js | 5 +---- index.ts | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index dc2a8d4..d5d1a09 100644 --- a/index.js +++ b/index.js @@ -61,13 +61,10 @@ function findClassDeclaration(node, opts) { var decls, decl; if ((node.type === 'ClassDeclaration' && (decl = node)) || (node.type === 'VariableDeclaration' && (decls = node.declarations) && decls.length === 1 && - (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression')) { + (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression' && decl.init.callee.body)) { if (opts.ignore && decl.id.name.match(opts.ignore)) { return; } - if (!decl.init.callee.body) { - return; - } if (opts.decorator) { var decorators = findDecorator(decl); decorators.forEach(function (decorator) { diff --git a/index.ts b/index.ts index 0cff58f..128608d 100644 --- a/index.ts +++ b/index.ts @@ -136,13 +136,10 @@ function findClassDeclaration(node: Node, opts: Options) { var decls: Declaration[], decl: Declaration; if ((node.type === 'ClassDeclaration' && (decl = node)) || (node.type === 'VariableDeclaration' && (decls = node.declarations) && decls.length === 1 && - (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression')) { + (decl = decls[0]) && decl.init && decl.init.type === 'CallExpression' && decl.init.callee.body)) { if (opts.ignore && decl.id.name.match(opts.ignore)) { return; } - if (!decl.init.callee.body) { - return; - } if (opts.decorator) { var decorators = findDecorator(decl); decorators.forEach(function(decorator) { From 67bd69ba95b47bab98ab9a1fe8b8c48b34aa4e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Mon, 7 Nov 2016 12:15:30 +0200 Subject: [PATCH 5/6] fix directives --- example/dist/naming_rule/sample-component.js | 4 +- example/dist/naming_rule/sample-controller.js | 2 +- example/dist/naming_rule/sample-ctrl.js | 2 +- example/dist/naming_rule/sample-directive.js | 4 +- .../naming_rule/sample-manager-provider.js | 2 +- example/dist/naming_rule/sample-service.js | 2 +- index.js | 8 +- index.ts | 8 +- yarn.lock | 1466 +++++++++++++++++ 9 files changed, 1482 insertions(+), 16 deletions(-) create mode 100644 yarn.lock diff --git a/example/dist/naming_rule/sample-component.js b/example/dist/naming_rule/sample-component.js index 100b93c..2735422 100644 --- a/example/dist/naming_rule/sample-component.js +++ b/example/dist/naming_rule/sample-component.js @@ -5,7 +5,7 @@ var sample; this.$compile = $compile; } return SampleComponentController; - }());/**/angular.module('sample').controller('SampleComponentController',['$compile',function(){return new (Function.prototype.bind.apply(SampleComponentController,[null].concat(arguments)));}]);/**/ + }());/**/angular.module('sample').controller('SampleComponentController',['$compile',function(){return new (Function.prototype.bind.apply(SampleComponentController,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ var SampleComponent = (function () { function SampleComponent() { this.templateUrl = '/sample.html'; @@ -15,5 +15,5 @@ var sample; this.controller = SampleComponentController; } return SampleComponent; - }());/**/angular.module('sample').component('sample',new SampleComponent());/**/ + }());/**/angular.module('sample').component('sample',[function(){return new (Function.prototype.bind.apply(SampleComponent,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-controller.js b/example/dist/naming_rule/sample-controller.js index 11b51c3..01ed83d 100644 --- a/example/dist/naming_rule/sample-controller.js +++ b/example/dist/naming_rule/sample-controller.js @@ -5,5 +5,5 @@ var sample; this.$scope = $scope; } return SampleController; - }());/**/angular.module('sample').controller('SampleController',['$scope',function(){return new (Function.prototype.bind.apply(SampleController,[null].concat(arguments)));}]);/**/ + }());/**/angular.module('sample').controller('SampleController',['$scope',function(){return new (Function.prototype.bind.apply(SampleController,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-ctrl.js b/example/dist/naming_rule/sample-ctrl.js index ea25204..3cd888c 100644 --- a/example/dist/naming_rule/sample-ctrl.js +++ b/example/dist/naming_rule/sample-ctrl.js @@ -5,5 +5,5 @@ var sample; this.$scope = $scope; } return SampleCtrl; - }());/**/angular.module('sample').controller('SampleCtrl',['$scope',function(){return new (Function.prototype.bind.apply(SampleCtrl,[null].concat(arguments)));}]);/**/ + }());/**/angular.module('sample').controller('SampleCtrl',['$scope',function(){return new (Function.prototype.bind.apply(SampleCtrl,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-directive.js b/example/dist/naming_rule/sample-directive.js index 34a8f9e..73b3d3a 100644 --- a/example/dist/naming_rule/sample-directive.js +++ b/example/dist/naming_rule/sample-directive.js @@ -9,7 +9,7 @@ var sample; function AbstractDirective() { } return AbstractDirective; - }());/**/angular.module('sample').directive('abstract',new AbstractDirective());/**/ + }());/**/angular.module('sample').directive('abstract',[function(){return new (Function.prototype.bind.apply(AbstractDirective,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ var SampleDirective = (function (_super) { __extends(SampleDirective, _super); function SampleDirective($compile) { @@ -24,5 +24,5 @@ var sample; SampleDirective.prototype.link = function (scope, element, attr) { }; return SampleDirective; - }(AbstractDirective));/**/angular.module('sample').directive('sample',new SampleDirective());/**/ + }(AbstractDirective));/**/angular.module('sample').directive('sample',['$compile',function(){return new (Function.prototype.bind.apply(SampleDirective,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ })(sample || (sample = {})); diff --git a/example/dist/naming_rule/sample-manager-provider.js b/example/dist/naming_rule/sample-manager-provider.js index 656529a..c70107c 100644 --- a/example/dist/naming_rule/sample-manager-provider.js +++ b/example/dist/naming_rule/sample-manager-provider.js @@ -7,7 +7,7 @@ var sample; return new $SampleManager(this); }; return SampleManagerProvider; - }());/**/angular.module('sample').provider('sampleManager',['$q',function(){return new (Function.prototype.bind.apply(SampleManagerProvider,[null].concat(arguments)));}]);/**/ + }());/**/angular.module('sample').provider('sampleManager',['$q',function(){return new (Function.prototype.bind.apply(SampleManagerProvider,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ var $SampleManager = (function () { function $SampleManager(provider) { this.provider = provider; diff --git a/example/dist/naming_rule/sample-service.js b/example/dist/naming_rule/sample-service.js index 09b3443..60f13fe 100644 --- a/example/dist/naming_rule/sample-service.js +++ b/example/dist/naming_rule/sample-service.js @@ -5,5 +5,5 @@ var sample; this.$q = $q; } return SampleService; - }());/**/angular.module('sample').service('sampleService',['$q',function(){return new (Function.prototype.bind.apply(SampleService,[null].concat(arguments)));}]);/**/ + }());/**/angular.module('sample').service('sampleService',['$q',function(){return new (Function.prototype.bind.apply(SampleService,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ })(sample || (sample = {})); diff --git a/index.js b/index.js index d5d1a09..2ba9db2 100644 --- a/index.js +++ b/index.js @@ -126,16 +126,16 @@ function addAngularModule(node, decl, opts, ptn) { } var source = '/**/'; if (type === 'directive') { - source += createModule(); + source += functionModule(); } else if (type === 'component') { - source += createModule(); + source += functionModule(); } else if (type === 'value') { - source += createModule(); + source += functionModule(); } else if (type === 'constant') { - source += createModule(); + source += functionModule(); } else { source += functionModule(); diff --git a/index.ts b/index.ts index 128608d..9792cd1 100644 --- a/index.ts +++ b/index.ts @@ -213,16 +213,16 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern var source = '/**/'; if (type === 'directive') { - source += createModule(); + source += functionModule(); } else if (type === 'component') { - source += createModule(); + source += functionModule(); } else if (type === 'value') { - source += createModule(); + source += functionModule(); } else if (type === 'constant') { - source += createModule(); + source += functionModule(); } else { source += functionModule() diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..525a69a --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1466 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 +acorn@^1.0.3: + version "1.2.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" + +ansi-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" + +array-differ@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-uniq@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +beeper@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.0.tgz#9ee6fc1ce7f54feaace7ce73588b056037866a2c" + +brace-expansion@^1.0.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +chalk@^1.0.0, chalk@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +clone-stats@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + +clone@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" + +clone@^1.0.0, clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +convert-source-map@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +dateformat@^1.0.11: + version "1.0.12" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" + dependencies: + get-stdin "^4.0.1" + meow "^3.3.0" + +decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +defaults@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + +deprecated@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/deprecated/-/deprecated-0.0.1.tgz#f9c9af5464afa1e7a971458a8bdef2aa94d5bb19" + +detect-file@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63" + dependencies: + fs-exists-sync "^0.1.0" + +duplexer2@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" + +duplexify@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" + dependencies: + end-of-stream "1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +end-of-stream@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" + dependencies: + once "~1.3.0" + +end-of-stream@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" + dependencies: + once "~1.3.0" + +error-ex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expand-tilde@^1.2.1, expand-tilde@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" + dependencies: + os-homedir "^1.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +falafel@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/falafel/-/falafel-1.2.0.tgz#c18d24ef5091174a497f318cd24b026a25cddab4" + dependencies: + acorn "^1.0.3" + foreach "^2.0.5" + isarray "0.0.1" + object-keys "^1.0.6" + +fancy-log@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.2.0.tgz#d5a51b53e9ab22ca07d558f2b67ae55fdb5fcbd8" + dependencies: + chalk "^1.1.1" + time-stamp "^1.0.0" + +filename-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-index@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +findup-sync@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" + dependencies: + detect-file "^0.1.0" + is-glob "^2.0.1" + micromatch "^2.3.7" + resolve-dir "^0.1.0" + +fined@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fined/-/fined-1.0.2.tgz#5b28424b760d7598960b7ef8480dff8ad3660e97" + dependencies: + expand-tilde "^1.2.1" + lodash.assignwith "^4.0.7" + lodash.isempty "^4.2.1" + lodash.isplainobject "^4.0.4" + lodash.isstring "^4.0.1" + lodash.pick "^4.2.1" + parse-filepath "^1.0.1" + +first-chunk-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" + +flagged-respawn@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-0.3.2.tgz#ff191eddcd7088a675b2610fffc976be9b8074b5" + +for-in@^0.1.5: + version "0.1.6" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" + +for-own@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + dependencies: + for-in "^0.1.5" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + +gaze@^0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" + dependencies: + globule "~0.1.0" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob-parent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.0.1.tgz#60021327cc963ddc3b5f085764f500479ecd82ff" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-stream@^3.1.5: + version "3.1.18" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-3.1.18.tgz#9170a5f12b790306fdfe598f313f8f7954fd143b" + dependencies: + glob "^4.3.1" + glob2base "^0.0.12" + minimatch "^2.0.1" + ordered-read-streams "^0.1.0" + through2 "^0.6.1" + unique-stream "^1.0.0" + +glob-stream@^5.3.2: + version "5.3.5" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22" + dependencies: + extend "^3.0.0" + glob "^5.0.3" + glob-parent "^3.0.0" + micromatch "^2.3.7" + ordered-read-streams "^0.3.0" + through2 "^0.6.0" + to-absolute-glob "^0.1.1" + unique-stream "^2.0.2" + +glob-watcher@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-0.0.6.tgz#b95b4a8df74b39c83298b0c05c978b4d9a3b710b" + dependencies: + gaze "^0.5.1" + +glob@^4.3.1: + version "4.5.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "^2.0.1" + once "^1.3.0" + +glob@^5.0.3: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" + minimatch "~0.2.11" + +glob2base@^0.0.12: + version "0.0.12" + resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56" + dependencies: + find-index "^0.1.1" + +global-modules@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" + dependencies: + global-prefix "^0.1.4" + is-windows "^0.2.0" + +global-prefix@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.4.tgz#05158db1cde2dd491b455e290eb3ab8bfc45c6e1" + dependencies: + ini "^1.3.4" + is-windows "^0.2.0" + osenv "^0.1.3" + which "^1.2.10" + +globule@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" + dependencies: + glob "~3.1.21" + lodash "~1.0.1" + minimatch "~0.2.11" + +glogg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" + dependencies: + sparkles "^1.0.0" + +graceful-fs@^3.0.0: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + +graceful-fs@^4.0.0, graceful-fs@^4.1.2: + version "4.1.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131" + +graceful-fs@~1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" + +gulp-sourcemaps@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" + dependencies: + convert-source-map "^1.1.1" + graceful-fs "^4.1.2" + strip-bom "^2.0.0" + through2 "^2.0.0" + vinyl "^1.0.0" + +gulp-typescript@^2.5.0: + version "2.14.1" + resolved "https://registry.yarnpkg.com/gulp-typescript/-/gulp-typescript-2.14.1.tgz#bc00edf2ee71f09bda53fd1d0b873b571371d4de" + dependencies: + gulp-util "~3.0.7" + source-map "~0.5.3" + through2 "~2.0.1" + typescript "1.8.10" + vinyl-fs "~2.4.3" + +gulp-util@^3.0.0, gulp-util@~3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" + dependencies: + array-differ "^1.0.0" + array-uniq "^1.0.2" + beeper "^1.0.0" + chalk "^1.0.0" + dateformat "^1.0.11" + fancy-log "^1.1.0" + gulplog "^1.0.0" + has-gulplog "^0.1.0" + lodash._reescape "^3.0.0" + lodash._reevaluate "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.template "^3.0.0" + minimist "^1.1.0" + multipipe "^0.1.2" + object-assign "^3.0.0" + replace-ext "0.0.1" + through2 "^2.0.0" + vinyl "^0.5.0" + +gulp@^3.8.11: + version "3.9.1" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-3.9.1.tgz#571ce45928dd40af6514fc4011866016c13845b4" + dependencies: + archy "^1.0.0" + chalk "^1.0.0" + deprecated "^0.0.1" + gulp-util "^3.0.0" + interpret "^1.0.0" + liftoff "^2.1.0" + minimist "^1.1.0" + orchestrator "^0.3.0" + pretty-hrtime "^1.0.0" + semver "^4.1.0" + tildify "^1.0.0" + v8flags "^2.0.2" + vinyl-fs "^0.3.0" + +gulplog@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + dependencies: + glogg "^1.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-gulplog@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" + dependencies: + sparkles "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@^2.0.1, inherits@~2.0.1, inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" + +ini@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +interpret@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + +is-absolute@^0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" + dependencies: + is-relative "^0.2.1" + is-windows "^0.2.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.0.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.0.tgz#33411a482b046bf95e6b0cb27ee2711af4cf15ad" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-relative@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-0.2.1.tgz#d27f4c7d516d175fb610db84bbeef23c3bc97aa5" + dependencies: + is-unc-path "^0.1.1" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-unc-path@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-0.1.1.tgz#ab2533d77ad733561124c3dc0f5cd8b90054c86b" + dependencies: + unc-path-regex "^0.1.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-valid-glob@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" + +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + +isarray@~1.0.0, isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isexe@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +json-stable-stringify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +kind-of@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.0.4.tgz#7b8ecf18a4e17f8269d73b501c9f232c96887a74" + dependencies: + is-buffer "^1.0.2" + +lazystream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" + dependencies: + readable-stream "^2.0.5" + +liftoff@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.3.0.tgz#a98f2ff67183d8ba7cfaca10548bd7ff0550b385" + dependencies: + extend "^3.0.0" + findup-sync "^0.4.2" + fined "^1.0.1" + flagged-respawn "^0.3.2" + lodash.isplainobject "^4.0.4" + lodash.isstring "^4.0.1" + lodash.mapvalues "^4.4.0" + rechoir "^0.6.2" + resolve "^1.1.7" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basetostring@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" + +lodash._basevalues@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash._reescape@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" + +lodash._reevaluate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" + +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + +lodash._root@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + +lodash.assignwith@^4.0.7: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz#127a97f02adc41751a954d24b0de17e100e038eb" + +lodash.escape@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" + dependencies: + lodash._root "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.isempty@^4.2.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" + +lodash.isequal@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.4.0.tgz#6295768e98e14dc15ce8d362ef6340db82852031" + +lodash.isplainobject@^4.0.4: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.mapvalues@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + +lodash.pick@^4.2.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + +lodash.restparam@^3.0.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" + +lodash.template@^3.0.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" + dependencies: + lodash._basecopy "^3.0.0" + lodash._basetostring "^3.0.0" + lodash._basevalues "^3.0.0" + lodash._isiterateecall "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + lodash.keys "^3.0.0" + lodash.restparam "^3.0.0" + lodash.templatesettings "^3.0.0" + +lodash.templatesettings@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + +lodash@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +map-cache@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +meow@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +merge-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.0.tgz#9cfd156fef35421e2b5403ce11dc6eb1962b026e" + dependencies: + readable-stream "^2.0.1" + +micromatch@^2.3.7: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +minimatch@^2.0.1: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" + dependencies: + brace-expansion "^1.0.0" + +minimatch@~0.2.11: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +"minimatch@2 || 3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@^1.1.0, minimist@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +multipipe@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" + dependencies: + duplexer2 "0.0.2" + +natives@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" + +object-assign@^4.0.0, object-assign@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + +object-keys@^1.0.6: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +orchestrator@^0.3.0: + version "0.3.8" + resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" + dependencies: + end-of-stream "~0.1.5" + sequencify "~0.0.7" + stream-consume "~0.1.0" + +ordered-read-streams@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz#fd565a9af8eb4473ba69b6ed8a34352cb552f126" + +ordered-read-streams@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" + dependencies: + is-stream "^1.0.1" + readable-stream "^2.0.1" + +os-homedir@^1.0.0, os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.3.tgz#83cf05c6d6458fc4d5ac6362ea325d92f2754217" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +parse-filepath@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.1.tgz#159d6155d43904d16c10ef698911da1e91969b73" + dependencies: + is-absolute "^0.2.3" + map-cache "^0.2.0" + path-root "^0.1.1" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + dependencies: + path-root-regex "^0.1.0" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-hrtime@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +randomatic@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.5.tgz#5e9ef5f2d573c67bd2b8124ae90b5156e457840b" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.4, readable-stream@^2.0.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +"readable-stream@>=1.0.33-1 <1.1.0-0": + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +replace-ext@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + +resolve-dir@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" + dependencies: + expand-tilde "^1.2.2" + global-modules "^0.2.3" + +resolve@^1.1.6, resolve@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +semver@^4.1.0: + version "4.3.6" + resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" + +"semver@2 || 3 || 4 || 5": + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +sequencify@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +signal-exit@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" + +source-map@~0.5.3: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +sparkles@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +stream-consume@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" + dependencies: + first-chunk-stream "^1.0.0" + strip-bom "^2.0.0" + +strip-bom@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" + dependencies: + first-chunk-stream "^1.0.0" + is-utf8 "^0.2.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +through2-filter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" + dependencies: + through2 "~2.0.0" + xtend "~4.0.0" + +through2@^0.6.0, through2@^0.6.1, through2@^0.6.3: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through2@^2.0.0, through2@~2.0.0, through2@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9" + dependencies: + readable-stream "~2.0.0" + xtend "~4.0.0" + +tildify@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" + dependencies: + os-homedir "^1.0.0" + +time-stamp@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" + +to-absolute-glob@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" + dependencies: + extend-shallow "^2.0.1" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +typescript@1.8.10: + version "1.8.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-1.8.10.tgz#b475d6e0dff0bf50f296e5ca6ef9fbb5c7320f1e" + +unc-path-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + +unique-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" + +unique-stream@^2.0.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" + dependencies: + json-stable-stringify "^1.0.0" + through2-filter "^2.0.0" + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +v8flags@^2.0.2: + version "2.0.11" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881" + dependencies: + user-home "^1.1.1" + +vali-date@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +vinyl-fs@^0.3.0: + version "0.3.14" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" + dependencies: + defaults "^1.0.0" + glob-stream "^3.1.5" + glob-watcher "^0.0.6" + graceful-fs "^3.0.0" + mkdirp "^0.5.0" + strip-bom "^1.0.0" + through2 "^0.6.1" + vinyl "^0.4.0" + +vinyl-fs@~2.4.3: + version "2.4.4" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239" + dependencies: + duplexify "^3.2.0" + glob-stream "^5.3.2" + graceful-fs "^4.0.0" + gulp-sourcemaps "1.6.0" + is-valid-glob "^0.3.0" + lazystream "^1.0.0" + lodash.isequal "^4.0.0" + merge-stream "^1.0.0" + mkdirp "^0.5.0" + object-assign "^4.0.0" + readable-stream "^2.0.4" + strip-bom "^2.0.0" + strip-bom-stream "^1.0.0" + through2 "^2.0.0" + through2-filter "^2.0.0" + vali-date "^1.0.0" + vinyl "^1.0.0" + +vinyl@^0.4.0: + version "0.4.6" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" + dependencies: + clone "^0.2.0" + clone-stats "^0.0.1" + +vinyl@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +vinyl@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +which@^1.2.10: + version "1.2.11" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.11.tgz#c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b" + dependencies: + isexe "^1.1.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +"xtend@>=4.0.0 <4.1.0-0", xtend@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + From 0c9877607607e4c24958bd1f49304a09b5f0d2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eetu=20M=C3=A4kel=C3=A4?= Date: Tue, 15 Nov 2016 22:26:13 +0200 Subject: [PATCH 6/6] fix components --- example/dist/naming_rule/sample-component.js | 2 +- index.js | 2 +- index.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/dist/naming_rule/sample-component.js b/example/dist/naming_rule/sample-component.js index 2735422..85751fc 100644 --- a/example/dist/naming_rule/sample-component.js +++ b/example/dist/naming_rule/sample-component.js @@ -15,5 +15,5 @@ var sample; this.controller = SampleComponentController; } return SampleComponent; - }());/**/angular.module('sample').component('sample',[function(){return new (Function.prototype.bind.apply(SampleComponent,[null].concat(Array.prototype.slice.apply(arguments))));}]);/**/ + }());/**/angular.module('sample').component('sample',new SampleComponent());/**/ })(sample || (sample = {})); diff --git a/index.js b/index.js index 2ba9db2..9126365 100644 --- a/index.js +++ b/index.js @@ -129,7 +129,7 @@ function addAngularModule(node, decl, opts, ptn) { source += functionModule(); } else if (type === 'component') { - source += functionModule(); + source += createModule(); } else if (type === 'value') { source += functionModule(); diff --git a/index.ts b/index.ts index 9792cd1..5f8244d 100644 --- a/index.ts +++ b/index.ts @@ -216,7 +216,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern source += functionModule(); } else if (type === 'component') { - source += functionModule(); + source += createModule(); } else if (type === 'value') { source += functionModule(); @@ -225,7 +225,7 @@ function addAngularModule(node:Node, decl:Declaration, opts:Options, ptn:Pattern source += functionModule(); } else { - source += functionModule() + source += functionModule(); } source += '/**/'; node.update(node.source() + source);