npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@foolishchow/vuex

v0.1.1

Published

enable vuex class declaration in typescript

Downloads

7

Readme

vuex class wrapper for vue

install

yarn add @foolishchow/vuex
yarn add @foolishchow/vue-cli-plugin-vuex-gen

background gen process

  • configs

| name | description | required | type | default | | -------- | :-------------------------------- | :------: | :------: | :------------------: | | glob | glob config for vuex files | true | string[] | undefined | | file | genereated vuex file | true | string | undefined | | store | store name | false | string | Store | | Module | Decorate Name of FVuex.Module | false | string[] | ["FVuex.Module"] | | Action | Decorate Name of FVuex.Action | false | string[] | ["FVuex.Action"] | | Mutation | Decorate Name of FVuex.Mutation | false | string[] | ["FVuex.Mutation"] |

  • config for @vue/cli demo

// file $projectRoot/vue.config.js
// if pluginOptions.vuexGen is not configed , background gen process will not start
module.exports = {
  pluginOptions: {
    vuexGen: {
      glob: ["src/store/**/*.ts"],
      file: "src/vuex.ts",
      store: "VuexStore"
    }
  }
}
//or
module.exports = {
  pluginOptions: {
    vuexgen: {
      glob: ["src/store/**/*.ts"],
      file: "src/vuex.ts",
      store: "VuexStore"
    }
  }
}
  • api for node

import Api from "@foolishchow/vue-cli-plugin-vuex-gen";
let config = {
  glob: ["src/store/**/*.ts"],
  file: "src/vuex.ts",
  store: "FireWeedAdminVuexStore"
};
let cwd = process.cwd();
let alias = {
  '@': cwd + '/src',
  'vue$': 'vue/dist/vue.runtime.esm.js',
};
Api(config, alias)

use

  • if you code the module like this
import { FVuex } from "@foolishchow/vuex";

@FVuex.Module
export class UserModule {

  userInfo: { name: string } = { name: "" };

  get goodsClassCascder() {
    return "";
  }

  @FVuex.Mutation
  UpdateUserName(userName: string) {
    this.state.userInfo.name = userName;
  }


  @FVuex.Action
  InitUserInfo() {
    return Promise.resolve({} as { name: string })
  }
}

the output main Store file will gen


/**
 * this file is auto generated
 * don't modify by hand
 */
import Vue from "vue";
import Vuex from "vuex";
import { FVuex } from "@foolishchow/vuex";
import { UserModule as UserModule_1 } from "./store/user";
const StoreModules: any = {}
FVuex.addModule(StoreModules, "UserModule", UserModule_1)
Vue.use(Vuex)
export interface Store extends FVuex.Store<StoreNS.RootState, StoreNS.RootGetter, StoreNS.RootCommit, StoreNS.RootDispatch> {
}
export const Store: Store = new Vuex.Store(StoreModules);
export module StoreNS {
    export interface RootGetter {
        UserModule: StoreNS.UserModule.Getters;
    }
    export interface RootState {
        UserModule: StoreNS.UserModule.State;
    }
    export interface RootCommit {
        (type: "UserModule/UpdateUserName", userName: string, option?: FVuex.CommitOption): void;
        (payload: CommitPayload.UserModule_UpdateUserName, option?: FVuex.CommitOption): void;
    }
    export namespace CommitPayload {
        export type UserModule_UpdateUserName = {
            type: "UserModule/UpdateUserName";
            payload: string;
        };
    }
    export interface RootDispatch {
        (type: "UserModule/InitUserInfo", payload?: undefined, option?: FVuex.DispatchOption): Promise<{
            name: string;
        }>;
        (payload: DispatchPayload.UserModule_InitUserInfo, option?: FVuex.DispatchOption): Promise<{
            name: string;
        }>;
    }
    export namespace DispatchPayload {
        export type UserModule_InitUserInfo = {
            type: "UserModule/InitUserInfo";
        };
    }
}
export module StoreNS {
    export module UserModule {
        export interface State {
            userInfo: {
                name: string;
            };
        }
        export interface Getters {
            goodsClassCascder: string;
        }
        export interface Dispatch {
            (type: "InitUserInfo", payload?: undefined, option?: FVuex.ScopedDispatchOption): Promise<{
                name: string;
            }>;
            (payload: DispatchPayload.InitUserInfo, option?: FVuex.ScopedDispatchOption): Promise<{
                name: string;
            }>;
        }
        export namespace DispatchPayload {
            export type InitUserInfo = {
                type: "InitUserInfo";
            };
        }
        export interface Commit {
            (type: "UpdateUserName", userName: string, option?: FVuex.ScopedCommitOption): void;
            (payload: CommitPayload.UpdateUserName, option?: FVuex.ScopedCommitOption): void;
        }
        export namespace CommitPayload {
            export type UpdateUserName = {
                type: "UpdateUserName";
                payload: string;
            };
        }
    }
}
declare module "./store/user" {
    export interface UserModule {
        state: StoreNS.UserModule.State;
        rootState: StoreNS.RootState;
        getters: StoreNS.UserModule.Getters;
        rootGetters: StoreNS.RootGetter;
        commit: StoreNS.RootCommit & StoreNS.UserModule.Commit;
        dispatch: StoreNS.RootDispatch & StoreNS.UserModule.Dispatch;
        $store: Store;
    }
}