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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hillyee_vue_cli

v1.0.5

Published

```shell npm install hillyee_vue_cli -g ```

Downloads

7

Readme

说明文档

一个帮助你快速搭建和开发前端项目的CLI

如何安装脚手架?

npm install hillyee_vue_cli -g

创建项目

yee create projectname

项目使用 vue3 + ts + vite 的模板

github仓库:https://github.com/Hillyee/yee_vue3_temp.git

查看所有选项

yee --help

项目开发

1. 创建组件

yee addcpn ComponentName # 默认存放到src/components目录下

# 也可以指定存放目录 (-d 后加上指定目录)
yee addcpn ComponentName -d src/pages/ComponentName

例如:yee addcpn home,会在 src/components/home.vue 创建:

<script lang="ts" setup>
const props = defineProps({
  
})
const emit = defineEmits([])

const message = 'home'

defineExpose({
  
})
</script>

<template>
  <div class="home">
    <h1>{{ message }}</h1>
  </div>
</template>

<style scoped lang="less">
.home {

}
</style>

2. 创建Vue页面,并配置路由

yee addpage PageName 
# 例如yee addpage home
# 页面page默认会放到src/pages/home/home.vue中
# 路由router默认会放到src/router/home/home.ts中

# 也可以指定文件夹, page和router中间用 '-' 隔开
# 例如
yee addpage home -d src/views-src/homeRouter
# 页面会放到src/views/home/home.vue中
# 路由会放到src/homeRouter/home/home.ts中

结构如下:

// home.vue
<script lang="ts" setup>
const props = defineProps({
  
})
const emit = defineEmits([])

const message = 'home'

defineExpose({
  
})
</script>

<template>
  <div class="home">
    <h1>{{ message }}</h1>
  </div>
</template>

<style scoped lang="less">
.home {

}
</style>
// home.ts
// 普通加载路由
// import home from './home.vue'
// 懒加载路由
const home = () => import('./home.vue')
export default {
  path: '/home',
  name: 'home',
  component: home,
  children: [
  ]
}

3. 创建Vuex子模块

yee addstore YourVuexModuleName 
# 例如
yee addstore home
# 默认在src/store/home目录创建home.ts和types.ts

# 也可以指定文件夹
yee addstore home -d src/vuex
# 会在src/vuex/home目录创建home.ts和types.ts

结构如下:

// home.ts
import { Module } from 'vuex'
import { IRootState } from '../types'
import { IHomeState } from './types'

const homeModule: Module<IHomeState, IRootState> = {
  namespaced: true,
  state() {
    return {

    }
  },
  mutations: {

  },
  actions: {
   
  },
  getters: {
    
  }
}

export default homeModule
// types.ts
export interface IHomeState {
  
}

报错处理

  1. 如果 create 项目的时候报错:'git clone' failed with status 128,可自行 clone 模板并下载依赖
git clone https://github.com/Hillyee/yee_vue3_temp.git YourProjectName # 克隆模板
cd YourProjectName
npm install # 下载依赖
npm run dev # 启动项目
  1. 如果 create 项目的时候报错: 'git checkout' failed with status 1,模板已 clone下来
cd YourProjectName
npm install # 下载依赖
npm run dev # 启动项目