├── .gitignore ├── src ├── index.ts ├── mutation.ts ├── action.ts └── module.ts ├── tsconfig.json ├── package.json ├── README.md ├── test └── index.ts └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import moduleDecorator from './module'; 2 | import mutationDecorator from './mutation'; 3 | import actionDecorator from './action'; 4 | 5 | export const module = moduleDecorator; 6 | export const mutation = mutationDecorator; 7 | export const action = actionDecorator; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "sourceMap": true, 5 | "inlineSourceMap": true, 6 | "target": "es5", 7 | "noImplicitAny": true, 8 | "lib": [ 9 | "es5", 10 | "es2015.promise", 11 | "dom" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/mutation.ts: -------------------------------------------------------------------------------- 1 | import {queueDecorator} from './module'; 2 | 3 | function factory(target: any, name: string, method: Function): any { 4 | queueDecorator((store: any) => { 5 | store.mutations = store.mutations || {}; 6 | store.mutations[name] = (state: any, ...args: any[]) => { 7 | method.apply(store.state, args); 8 | } 9 | }); 10 | } 11 | 12 | export default function mutation(...opts: any[]) { 13 | if (typeof opts[0] === 'object') { 14 | return factory(opts[0], opts[1], opts[0][opts[1]]); 15 | } else { 16 | return (target: any, propKey: string) => { 17 | return factory(target, opts[0], target[propKey]); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/action.ts: -------------------------------------------------------------------------------- 1 | import {queueDecorator} from './module'; 2 | 3 | function factory(target: any, name: string, method: Function): any { 4 | queueDecorator((store: any) => { 5 | store.actions = store.actions || {}; 6 | store.actions[name] = (context: any, ...args: any[]) => { 7 | const scope = { 8 | commit: (...args: any[]) => context.commit(...args), 9 | dispatch: (...args: any[]) => context.dispatch(...args), 10 | rootState: context.rootState, 11 | rootGetters: context.rootGetters, 12 | ...context.state, 13 | ...context.getters, 14 | }; 15 | return method.apply(scope, args); 16 | } 17 | }); 18 | } 19 | 20 | export default function action(...opts: any[]) { 21 | if (typeof opts[0] === 'object') { 22 | return factory(opts[0], opts[1], opts[0][opts[1]]); 23 | } else { 24 | return (target: any, propKey: string) => { 25 | return factory(target, opts[0], target[propKey]); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuex-ts-decorators", 3 | "version": "0.0.7", 4 | "description": "TypeScript decorators for working with Vuex", 5 | "typings": "src/index.ts", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "preversion": "npm test", 9 | "postversion": "git push --tags && npm publish", 10 | "test": "mocha -r source-map-support/register -r ts-node/register -r es6-promise/auto test/**/*.ts", 11 | "start": "npm run test -- -w --watch-extensions ts" 12 | }, 13 | "repository": "snaptopixel/vuex-ts-decorators", 14 | "author": "Casey Corcoran (http://snaptopixel.com)", 15 | "license": "ISC", 16 | "devDependencies": { 17 | "@types/chai": "3.4.35", 18 | "@types/mocha": "2.2.39", 19 | "@types/sinon": "1.16.35", 20 | "chai": "3.5.0", 21 | "es6-promise": "4.0.5", 22 | "mocha": "3.2.0", 23 | "sinon": "1.17.7", 24 | "source-map-support": "0.4.11", 25 | "ts-node": "2.1.0", 26 | "typescript": "2.2.1", 27 | "vue": "2.2.1", 28 | "vuex": "2.2.1" 29 | }, 30 | "engines": { 31 | "node": ">=6.0.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/module.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import * as Vuex from 'vuex'; 3 | 4 | Vue.use(Vuex); 5 | 6 | const storeInstance = new Vuex.Store({}); 7 | 8 | function mapProperties(target: any, store: any) { 9 | const instance = new target(); 10 | const keys = Object.getOwnPropertyNames(instance).filter(key => !(key in storeInstance)); 11 | keys.forEach(key => { store.state[key] = instance[key] }); 12 | } 13 | 14 | function mapGetters(target: any, store: any) { 15 | const keys = Object.getOwnPropertyNames(target.prototype).filter(key => !(key in Vuex.Store.prototype)); 16 | keys.forEach(key => { 17 | const desc = Object.getOwnPropertyDescriptor(target.prototype, key); 18 | if(desc.get) { 19 | store.getters = store.getters || {}; 20 | store.getters[key] = (state: any, getters: any, rootState: any, rootGetters: any) => { 21 | const scope = { 22 | ...store.getters, 23 | ...store.state, 24 | rootState, 25 | rootGetters, 26 | }; 27 | return desc.get.apply(scope); 28 | } 29 | } 30 | }); 31 | } 32 | 33 | let decoratorQueue: Function[] = []; 34 | 35 | export function factory(target: Function, config?: any): any { 36 | const store: any = { 37 | state: {} 38 | }; 39 | if (config.modules) { store.modules = config.modules; } 40 | if (config.namespaced) { store.namespaced = true; } 41 | mapProperties(target, store); 42 | mapGetters(target, store); 43 | config.decorators.forEach((callback: Function) => callback(store)); 44 | if (config.store) { 45 | return new Vuex.Store(store); 46 | } else { 47 | return store; 48 | } 49 | } 50 | 51 | export function queueDecorator(callback: Function) { 52 | decoratorQueue.push(callback); 53 | } 54 | 55 | type ModuleConfig = { 56 | store?: boolean; 57 | modules?: Object; 58 | namespaced?: boolean; 59 | } 60 | 61 | function Module(opts:ModuleConfig|Function) { 62 | const decorators = decoratorQueue; 63 | decoratorQueue = []; 64 | if (typeof opts === 'function') { 65 | return factory.bind(null, opts, {decorators}); 66 | } else { 67 | return (target: any) => { 68 | return factory.bind(null, target, {...opts, decorators}); 69 | } 70 | } 71 | } 72 | 73 | export default Module; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ⚠️ **This project is currently undergoing refactoring and is NOT production ready** ⚠️ 2 | 3 | # TypeScript Decorators for Vuex [![Build Status](https://img.shields.io/circleci/project/snaptopixel/vuex-ts-decorators/master.svg)](https://circleci.com/gh/snaptopixel/vuex-ts-decorators) [![npm package](https://img.shields.io/npm/v/vuex-ts-decorators.svg)](https://www.npmjs.com/package/vuex-ts-decorators) 4 | 5 | > Write Vuex stores and modules with type-safety and code completion 6 | 7 | - [Quick primer](#quick-primer) 8 | - [Inspiration](#inspiration) 9 | - [Basic example](#basic-example) 10 | - [Conventions for type-safety](#conventions-for-type-safety) 11 | - [Example store with typed `dispatch` and `commit`](#example-store-with-typed-dispatch-and-commit) 12 | - [Example usage and code structure](#example-usage-and-code-structure) 13 | 14 | ## Quick primer 15 | 16 | Decorators can seem quite magical so it helps to have a basic understanding of what they do (and don't do). In this implementation the main job of decorators is to transform a `class` _definition_ into a “shape” which Vuex supports. 17 | 18 | So, you write a nice class with comfortable syntax and the decorators do the legwork of mapping, transforming and replacing your class with something else. They also normalize the scope in which your actions, mutations and getters operate so instead of using function params you end up just using `this` to access things in a straightforward (and type-safe) way. 19 | 20 | ## Inspiration 21 | 22 | This solution is heavily inspired by the excellent work on [vue-class-component](https://github.com/vuejs/vue-class-component) which makes writing components in TypeScript very ergonomic and fun. The goal of this project is to apply similar patterns to Vuex while also providing (and [allowing for](#conventions-for-type-safety)) TypeScript niceties like code-completion and type-safety all the way down. 23 | 24 | ## Basic example 25 | The following snippet shows a standard Vuex declaration followed by an example using decorators. 26 | 27 | ```ts 28 | // Without decorators 29 | const MyStore = new Vuex.Store({ 30 | state: { 31 | prop: 'value' 32 | }, 33 | getters: { 34 | myGetter(state, getters) { 35 | return state.prop + ' gotten'; 36 | }, 37 | myOtherGetter(state, getters) { 38 | return getters.myGetter + ' again'; 39 | } 40 | }, 41 | actions: { 42 | myAction({commit, getters}, payload) { 43 | commit('myMutation', getters.myOtherGetter + payload.prop); 44 | } 45 | }, 46 | mutations: { 47 | myMutation(state, payload) { 48 | state.prop = payload; 49 | } 50 | } 51 | }) 52 | 53 | // With decorators 54 | @module({ 55 | store: true 56 | }) 57 | class MyStore { 58 | prop = 'value'; 59 | get myGetter(): string { 60 | return this.prop + ' gotten'; 61 | } 62 | get myOtherGetter(): string { 63 | return this.myGetter + ' again'; 64 | } 65 | @action 66 | myAction(payload) { 67 | this.commit('myMutation', this.myOtherGetter + payload.prop); 68 | } 69 | @mutation 70 | myMutation(payload) { 71 | this.prop = payload; 72 | } 73 | } 74 | ``` 75 | 76 | ## Conventions for type-safety 77 | You may have noticed a problem with the second example above. Inside `myAction` we're making a call to `this.commit()` which is not defined on the class and will throw an error at compile time. 78 | 79 | It's important to note that by themselves, these decorators do not provide full type-safety for Vuex. Instead they allow you to write your stores and modules in a way that allows you to _achieve_ type-safety via normal TypeScript conventions. 80 | 81 | ### Example store with typed `dispatch` and `commit` 82 | 83 | ```ts 84 | type actions = { 85 | myAction: {prop: string} 86 | } 87 | 88 | type mutations = { 89 | myMutation: string 90 | } 91 | 92 | type TypedDispatch = (type: T, value?: actions[T] ) => Promise; 93 | type TypedCommit = (type: T, value?: mutations[T] ) => void; 94 | 95 | @module({ 96 | store: true 97 | }) 98 | class MyStore { 99 | dispatch: TypedDispatch; 100 | commit: TypedCommit; 101 | prop = 'value'; 102 | get myGetter(): string { 103 | return this.prop + ' gotten'; 104 | } 105 | get myOtherGetter(): string { 106 | return this.myGetter + ' again'; 107 | } 108 | @action 109 | myAction(payload: actions['myAction']) { 110 | this.commit('myMutation', this.myOtherGetter + payload.prop); 111 | } 112 | @mutation 113 | myMutation(payload: mutations['myMutation']) { 114 | this.prop = payload; 115 | } 116 | } 117 | ``` 118 | 119 | ## Example usage and code structure 120 | 121 | For futher answers and information, please check out the companion [vuex-ts-example](https://github.com/snaptopixel/vuex-ts-example) project. You'll be able to see the decorators in action as well as some guidance on how you can structure your code for the best results. 122 | -------------------------------------------------------------------------------- /test/index.ts: -------------------------------------------------------------------------------- 1 | import {Store, StoreOptions} from 'vuex'; 2 | import {action, module, mutation} from '../src'; 3 | import {expect} from 'chai'; 4 | 5 | /////////////////////////////////////// 6 | // Boilerplate for type-checking etc // 7 | /////////////////////////////////////// 8 | 9 | // Keys are action names, declared type is expected when calling dispatch() 10 | type actions = { 11 | getFoo: string; 12 | moreFoo: null; 13 | testRoot: null; 14 | } 15 | 16 | // Keys are mutation names, declared type is expected when calling commit() 17 | type mutations = { 18 | setFoo: string; 19 | } 20 | 21 | // Enforce/enable type checking of commit and dispatch calls at compile time 22 | type TypedDispatch = (type: T, value?: actions[T] ) => Promise; 23 | type TypedCommit = (type: T, value?: mutations[T] ) => void; 24 | 25 | // All modules should extend TypedStore for complile time type checking 26 | // this class is never used at runtime, it's just a shim for typing 27 | class TypedStore extends Store { 28 | constructor() { 29 | super({}); // Make Vuex.Store happy 30 | } 31 | commit: TypedCommit; 32 | dispatch: TypedDispatch; 33 | } 34 | 35 | ////////////// 36 | // Examples // 37 | ////////////// 38 | 39 | @module 40 | class SubModule extends TypedStore { 41 | public actions: actions; 42 | public mutations: mutations; 43 | private rootState: any; 44 | private rootGetters: any; 45 | private foo: String = 'foo'; 46 | private get foobar(): String { 47 | return `${this.foo} bar`; 48 | } 49 | @action 50 | getFoo(value: string = 'fu') { 51 | this.commit('setFoo', value); 52 | return Promise.resolve('hi'); 53 | } 54 | @action 55 | moreFoo() { 56 | this.dispatch('getFoo', 'fee'); 57 | } 58 | @action 59 | testRoot() { 60 | return Promise.resolve({ 61 | rootGetters: this.rootGetters, 62 | rootState: this.rootState 63 | }); 64 | } 65 | @mutation 66 | setFoo(foo:String) { 67 | this.foo = foo; 68 | } 69 | } 70 | 71 | @module({ 72 | store: true, 73 | modules: { 74 | submodule: new SubModule() 75 | } 76 | }) 77 | class TestStore extends TypedStore { 78 | submodule: SubModule; 79 | private message = 'Hello'; 80 | private get fullMessage(): string { 81 | return this.message + ' World'; 82 | } 83 | } 84 | 85 | describe('@module decorator', () => { 86 | it('returns a constructor', () => { 87 | expect(SubModule).to.be.a('function'); 88 | }); 89 | describe('when store == true', () => { 90 | it('creates a Vuex.Store instance', () => { 91 | expect(new TestStore()).to.be.an.instanceof(Store); 92 | }); 93 | it('does not extend TypedStore at runtime (used only for type inference)', () => { 94 | expect(new TestStore()).to.not.be.an.instanceof(TypedStore); 95 | }); 96 | }); 97 | describe('when store != true', () => { 98 | it('creates a module (StoreOptions compliant object)', () => { 99 | let sub = new SubModule(); 100 | expect(sub.actions).to.not.be.undefined; 101 | expect(sub.getters).to.not.be.undefined; 102 | expect(sub.state).to.not.be.undefined; 103 | expect(sub.mutations).to.not.be.undefined; 104 | }); 105 | it('does not extend TypedStore at runtime (used only for type inference)', () => { 106 | expect(new SubModule()).to.not.be.an.instanceof(TypedStore); 107 | }); 108 | }); 109 | describe('transforms class', () => { 110 | it('sets state', () => { 111 | const store = new TestStore(); 112 | expect(store.state.message).to.eq('Hello'); 113 | expect(store.state.submodule.foo).to.eq('foo'); 114 | }); 115 | it('maps getters', () => { 116 | const store = new TestStore(); 117 | const desc = Object.getOwnPropertyDescriptor(store.getters, 'foobar'); 118 | expect(desc.get).to.be.a('function'); 119 | expect(store.getters.foobar).to.equal('foo bar'); 120 | }); 121 | }); 122 | }); 123 | 124 | describe('@action decorator', () => { 125 | let store: TestStore; 126 | let module: SubModule; 127 | it('adds methods to “actions” object', () => { 128 | module = new SubModule(); 129 | expect(module.actions.getFoo).to.be.a('function'); 130 | }); 131 | it('can call other actions', () => { 132 | store = new TestStore(); 133 | store.dispatch('getFoo'); 134 | expect(store.state.submodule.foo).to.eq('fu'); 135 | store.dispatch('moreFoo'); 136 | expect(store.state.submodule.foo).to.eq('fee'); 137 | }); 138 | it('can commit mutations', () => { 139 | store = new TestStore(); 140 | expect(store.state.submodule.foo).to.not.eq('fu'); 141 | const p = store.dispatch('getFoo'); 142 | expect(store.state.submodule.foo).to.eq('fu'); 143 | }); 144 | it('can return a promise', (done) => { 145 | store = new TestStore(); 146 | const p = store.dispatch('getFoo'); 147 | expect(p).to.be.an.instanceOf(Promise); 148 | p.then(msg => { 149 | expect(msg).to.eq('hi'); 150 | done(); 151 | }).catch(done); 152 | }); 153 | it('can access rootState and rootGetters', (done) => { 154 | store = new TestStore(); 155 | store.dispatch('testRoot').then((props: any) => { 156 | const {rootGetters, rootState} = props; 157 | expect(rootGetters.fullMessage).to.eq('Hello World'); 158 | expect(rootState.message).to.eq('Hello'); 159 | expect(rootState.submodule.foo).to.eq('fu'); 160 | done(); 161 | }).catch(done); 162 | }); 163 | 164 | // TODO: Write tests for mutation decorator 165 | }); -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/chai@3.4.35": 6 | version "3.4.35" 7 | resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.4.35.tgz#e8d65f83492d2944f816fc620741821c28a8c900" 8 | 9 | "@types/mocha@2.2.39": 10 | version "2.2.39" 11 | resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.39.tgz#f68d63db8b69c38e9558b4073525cf96c4f7a829" 12 | 13 | "@types/sinon@1.16.35": 14 | version "1.16.35" 15 | resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-1.16.35.tgz#ee687cc42d1a79448256f1c012a33a0840e85c5c" 16 | 17 | ansi-regex@^2.0.0: 18 | version "2.1.1" 19 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 20 | 21 | ansi-styles@^2.2.1: 22 | version "2.2.1" 23 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" 24 | 25 | any-promise@^1.3.0: 26 | version "1.3.0" 27 | resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" 28 | 29 | arrify@^1.0.0: 30 | version "1.0.1" 31 | resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" 32 | 33 | assertion-error@^1.0.1: 34 | version "1.0.2" 35 | resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" 36 | 37 | balanced-match@^0.4.1: 38 | version "0.4.2" 39 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" 40 | 41 | brace-expansion@^1.0.0: 42 | version "1.1.6" 43 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" 44 | dependencies: 45 | balanced-match "^0.4.1" 46 | concat-map "0.0.1" 47 | 48 | browser-stdout@1.3.0: 49 | version "1.3.0" 50 | resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" 51 | 52 | chai@3.5.0: 53 | version "3.5.0" 54 | resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" 55 | dependencies: 56 | assertion-error "^1.0.1" 57 | deep-eql "^0.1.3" 58 | type-detect "^1.0.0" 59 | 60 | chalk@^1.1.1: 61 | version "1.1.3" 62 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" 63 | dependencies: 64 | ansi-styles "^2.2.1" 65 | escape-string-regexp "^1.0.2" 66 | has-ansi "^2.0.0" 67 | strip-ansi "^3.0.0" 68 | supports-color "^2.0.0" 69 | 70 | commander@2.9.0: 71 | version "2.9.0" 72 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" 73 | dependencies: 74 | graceful-readlink ">= 1.0.0" 75 | 76 | concat-map@0.0.1: 77 | version "0.0.1" 78 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 79 | 80 | debug@2.2.0: 81 | version "2.2.0" 82 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" 83 | dependencies: 84 | ms "0.7.1" 85 | 86 | deep-eql@^0.1.3: 87 | version "0.1.3" 88 | resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" 89 | dependencies: 90 | type-detect "0.1.1" 91 | 92 | diff@1.4.0: 93 | version "1.4.0" 94 | resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" 95 | 96 | diff@^3.1.0: 97 | version "3.2.0" 98 | resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" 99 | 100 | error-ex@^1.2.0: 101 | version "1.3.0" 102 | resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" 103 | dependencies: 104 | is-arrayish "^0.2.1" 105 | 106 | es6-promise@4.0.5: 107 | version "4.0.5" 108 | resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.0.5.tgz#7882f30adde5b240ccfa7f7d78c548330951ae42" 109 | 110 | escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: 111 | version "1.0.5" 112 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 113 | 114 | formatio@1.1.1: 115 | version "1.1.1" 116 | resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.1.1.tgz#5ed3ccd636551097383465d996199100e86161e9" 117 | dependencies: 118 | samsam "~1.1" 119 | 120 | fs.realpath@^1.0.0: 121 | version "1.0.0" 122 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 123 | 124 | glob@7.0.5: 125 | version "7.0.5" 126 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95" 127 | dependencies: 128 | fs.realpath "^1.0.0" 129 | inflight "^1.0.4" 130 | inherits "2" 131 | minimatch "^3.0.2" 132 | once "^1.3.0" 133 | path-is-absolute "^1.0.0" 134 | 135 | "graceful-readlink@>= 1.0.0": 136 | version "1.0.1" 137 | resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" 138 | 139 | growl@1.9.2: 140 | version "1.9.2" 141 | resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" 142 | 143 | has-ansi@^2.0.0: 144 | version "2.0.0" 145 | resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" 146 | dependencies: 147 | ansi-regex "^2.0.0" 148 | 149 | has-flag@^1.0.0: 150 | version "1.0.0" 151 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" 152 | 153 | inflight@^1.0.4: 154 | version "1.0.6" 155 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 156 | dependencies: 157 | once "^1.3.0" 158 | wrappy "1" 159 | 160 | inherits@2: 161 | version "2.0.3" 162 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 163 | 164 | inherits@2.0.1: 165 | version "2.0.1" 166 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" 167 | 168 | is-arrayish@^0.2.1: 169 | version "0.2.1" 170 | resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" 171 | 172 | is-utf8@^0.2.0: 173 | version "0.2.1" 174 | resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" 175 | 176 | json3@3.3.2: 177 | version "3.3.2" 178 | resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" 179 | 180 | lodash._baseassign@^3.0.0: 181 | version "3.2.0" 182 | resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" 183 | dependencies: 184 | lodash._basecopy "^3.0.0" 185 | lodash.keys "^3.0.0" 186 | 187 | lodash._basecopy@^3.0.0: 188 | version "3.0.1" 189 | resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" 190 | 191 | lodash._basecreate@^3.0.0: 192 | version "3.0.3" 193 | resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" 194 | 195 | lodash._getnative@^3.0.0: 196 | version "3.9.1" 197 | resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" 198 | 199 | lodash._isiterateecall@^3.0.0: 200 | version "3.0.9" 201 | resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" 202 | 203 | lodash.create@3.1.1: 204 | version "3.1.1" 205 | resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" 206 | dependencies: 207 | lodash._baseassign "^3.0.0" 208 | lodash._basecreate "^3.0.0" 209 | lodash._isiterateecall "^3.0.0" 210 | 211 | lodash.isarguments@^3.0.0: 212 | version "3.1.0" 213 | resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" 214 | 215 | lodash.isarray@^3.0.0: 216 | version "3.0.4" 217 | resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" 218 | 219 | lodash.keys@^3.0.0: 220 | version "3.1.2" 221 | resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" 222 | dependencies: 223 | lodash._getnative "^3.0.0" 224 | lodash.isarguments "^3.0.0" 225 | lodash.isarray "^3.0.0" 226 | 227 | lolex@1.3.2: 228 | version "1.3.2" 229 | resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31" 230 | 231 | make-error@^1.1.1: 232 | version "1.2.1" 233 | resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.2.1.tgz#9a6dfb4844423b9f145806728d05c6e935670e75" 234 | 235 | minimatch@^3.0.2: 236 | version "3.0.3" 237 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" 238 | dependencies: 239 | brace-expansion "^1.0.0" 240 | 241 | minimist@0.0.8: 242 | version "0.0.8" 243 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 244 | 245 | minimist@^1.2.0: 246 | version "1.2.0" 247 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 248 | 249 | mkdirp@0.5.1, mkdirp@^0.5.1: 250 | version "0.5.1" 251 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 252 | dependencies: 253 | minimist "0.0.8" 254 | 255 | mocha@3.2.0: 256 | version "3.2.0" 257 | resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3" 258 | dependencies: 259 | browser-stdout "1.3.0" 260 | commander "2.9.0" 261 | debug "2.2.0" 262 | diff "1.4.0" 263 | escape-string-regexp "1.0.5" 264 | glob "7.0.5" 265 | growl "1.9.2" 266 | json3 "3.3.2" 267 | lodash.create "3.1.1" 268 | mkdirp "0.5.1" 269 | supports-color "3.1.2" 270 | 271 | ms@0.7.1: 272 | version "0.7.1" 273 | resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" 274 | 275 | once@^1.3.0: 276 | version "1.4.0" 277 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 278 | dependencies: 279 | wrappy "1" 280 | 281 | parse-json@^2.2.0: 282 | version "2.2.0" 283 | resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" 284 | dependencies: 285 | error-ex "^1.2.0" 286 | 287 | path-is-absolute@^1.0.0: 288 | version "1.0.1" 289 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 290 | 291 | pinkie@^2.0.4: 292 | version "2.0.4" 293 | resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" 294 | 295 | samsam@1.1.2, samsam@~1.1: 296 | version "1.1.2" 297 | resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567" 298 | 299 | sinon@1.17.7: 300 | version "1.17.7" 301 | resolved "https://registry.yarnpkg.com/sinon/-/sinon-1.17.7.tgz#4542a4f49ba0c45c05eb2e9dd9d203e2b8efe0bf" 302 | dependencies: 303 | formatio "1.1.1" 304 | lolex "1.3.2" 305 | samsam "1.1.2" 306 | util ">=0.10.3 <1" 307 | 308 | source-map-support@0.4.11, source-map-support@^0.4.0: 309 | version "0.4.11" 310 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" 311 | dependencies: 312 | source-map "^0.5.3" 313 | 314 | source-map@^0.5.3: 315 | version "0.5.6" 316 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" 317 | 318 | strip-ansi@^3.0.0: 319 | version "3.0.1" 320 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 321 | dependencies: 322 | ansi-regex "^2.0.0" 323 | 324 | strip-bom@^2.0.0: 325 | version "2.0.0" 326 | resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" 327 | dependencies: 328 | is-utf8 "^0.2.0" 329 | 330 | strip-json-comments@^2.0.0: 331 | version "2.0.1" 332 | resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" 333 | 334 | supports-color@3.1.2: 335 | version "3.1.2" 336 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" 337 | dependencies: 338 | has-flag "^1.0.0" 339 | 340 | supports-color@^2.0.0: 341 | version "2.0.0" 342 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" 343 | 344 | ts-node@2.1.0: 345 | version "2.1.0" 346 | resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-2.1.0.tgz#aa2bf4b2e25c5fb6a7c54701edc3666d3a9db25d" 347 | dependencies: 348 | arrify "^1.0.0" 349 | chalk "^1.1.1" 350 | diff "^3.1.0" 351 | make-error "^1.1.1" 352 | minimist "^1.2.0" 353 | mkdirp "^0.5.1" 354 | pinkie "^2.0.4" 355 | source-map-support "^0.4.0" 356 | tsconfig "^5.0.2" 357 | v8flags "^2.0.11" 358 | xtend "^4.0.0" 359 | yn "^1.2.0" 360 | 361 | tsconfig@^5.0.2: 362 | version "5.0.3" 363 | resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-5.0.3.tgz#5f4278e701800967a8fc383fd19648878f2a6e3a" 364 | dependencies: 365 | any-promise "^1.3.0" 366 | parse-json "^2.2.0" 367 | strip-bom "^2.0.0" 368 | strip-json-comments "^2.0.0" 369 | 370 | type-detect@0.1.1: 371 | version "0.1.1" 372 | resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" 373 | 374 | type-detect@^1.0.0: 375 | version "1.0.0" 376 | resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" 377 | 378 | typescript@2.2.1: 379 | version "2.2.1" 380 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.1.tgz#4862b662b988a4c8ff691cc7969622d24db76ae9" 381 | 382 | user-home@^1.1.1: 383 | version "1.1.1" 384 | resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" 385 | 386 | "util@>=0.10.3 <1": 387 | version "0.10.3" 388 | resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" 389 | dependencies: 390 | inherits "2.0.1" 391 | 392 | v8flags@^2.0.11: 393 | version "2.0.11" 394 | resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881" 395 | dependencies: 396 | user-home "^1.1.1" 397 | 398 | vue@2.1.10: 399 | version "2.1.10" 400 | resolved "https://registry.yarnpkg.com/vue/-/vue-2.1.10.tgz#c9235ca48c7925137be5807832ac4e3ac180427b" 401 | 402 | vuex@2.1.2: 403 | version "2.1.2" 404 | resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.1.2.tgz#15d2da62dd6ff59c071f0a91cd4f434eacf6ca6c" 405 | 406 | wrappy@1: 407 | version "1.0.2" 408 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 409 | 410 | xtend@^4.0.0: 411 | version "4.0.1" 412 | resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" 413 | 414 | yn@^1.2.0: 415 | version "1.2.0" 416 | resolved "https://registry.yarnpkg.com/yn/-/yn-1.2.0.tgz#d237a4c533f279b2b89d3acac2db4b8c795e4a63" 417 | --------------------------------------------------------------------------------