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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-cli-plugin-macula-auto-routing

v0.3.3

Published

Vue CLI plugin that provides auto routing feature

Readme

vue-cli-plugin-macula-auto-routing

Vue CLI plugin that provides auto routing feature for multi pages(forked from ktsn/vue-cli-plugin-auto-routing).

Overview

Ensure you are in a project generated by Vue CLI v3. You install this plugin by running the following command:

$ vue add macula-auto-routing

After adding the plugin, the file structure will be the below.

src/
├── modules/
├─────index(every multipage module)
├─────── views/
├────────── xxx.vue
├─────── layouts/
├─────── router/
├────────── index.js
└────────── routes.js(auto generate)

Pages

.vue files under the views/ directory will be automatically resolved to generate routing. Vue Router routes options will be configured with the file structure under the views/. The generated routing is same with Nuxt's routing.

Note that directories and files started and ended with __ (two underscores, e.g. __foo__.vue) will be ignored.

For example, when you have the following page components:

views/
├── __partial__.vue
├── index.vue
├── users.vue
└── users/
    └── _id.vue

It is resolved to the below routes. Note that _ prefixed components generate dynamic routing.

export default [
  {
    name: 'xxx-index',
    path: '/',
    component: () => import('src/modules/xxx/views/index.vue')
  },
  {
    name: 'xxx-users',
    path: '/users',
    component: () => import('src/modules/xxx/views/users.vue'),
    children: [
      {
        name: 'xxx-users-id',
        path: ':id?',
        component: () => import('src/modules/xxx/views/users/_id.vue')
      }
    ]
  }
]

If you want to make route param required, create a directory for the param and add index.vue in the directory. In the above example, if you replace users/_id.vue with users/_id/index.vue, :id param will be required.

<route-meta> custom block

If a page component has <route-meta> custom block, the content json will be used as route meta field.

For example, if index.vue has the following <route-meta> block:

<route-meta>
{
  "requiresAuth": true
}
</route-meta>

<template>
  <h1>Hello</h1>
</template>

The generated route config is like the following:

module.exports = [
  {
    name: 'index',
    path: '/',
    component: () => import('src/modules/xxx/views/index.vue'),
    meta: {
      requiresAuth: true
    }
  }
]

Layouts

Components under the layouts/ directory will be used as shared layout component in the application. You can choose a layout by specifying layout component option in a page component. The default value of layout is 'default'. That means when you omit layout options, layouts/default.vue will be choosed as the layout component. This is the same concept with Nuxt's layouts.

For example, when you have layouts/foo.vue and views/index.vue:

<!-- layouts/foo.vue -->
<template>
  <div>
    <h1>Foo Layout</h1>
    <router-view/>
  </div>
</template>
<!-- pages/index.vue -->
<template>
  <p>index.vue</p>
</template>

<script>
export default {
  // You can specify layout component name here (default value is 'default')
  layout: 'foo'
}
</script>

The following html will be rendered:

<div>
  <h1>Foo Layout</h1>
  <p>index.vue</p>
</div>

Related Projects

License

MIT