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

@vrx/cp

v0.4.3

Published

为 使用.tsx,.ts,.vue 方案的 vue3 组件库进行打包

Downloads

178

Readme

@vrx/cp

为 使用.tsx,.ts,.vue 方案的 vue3 组件库进行打包

该包处于实验阶段,API 不稳定

特性

  • 生成.d.ts 文件
  • 生成 components.d.ts
  • 生成 web-types.json

简单使用

pnpm exec vrx-cp build

组件信息配置文件

用于覆盖自动组件信息解析时遗漏或解析错误的配置

  • gendoc.{ts,js,mts,mjs}
  • gendoc.{toml,yaml,yml,jsonc,json5,json}

例:

gendoc.ts

import { defineGenDoc } from '@vrx/cp'

export default defineGenDoc([
  {
  name: 'Progress',
  props: {
    percent: {
      type: 'number',
      desc: '百分比 0.1 形式',
    },
    title: {
      type: 'string',
      desc: '标题',
    },
  },
  events: {
    click: {
      desc: '点击事件',
    },
  },
  slots: {
    label: {
      name: 'label',
      desc: '标题',
    },
  },
}
])

gendoc.toml

[[docs]]
name = 'Progress'

[docs.props.percent]
type = 'number'
desc = '百分比 0.1 形式'

[docs.props.title]
type = 'string'
desc = '标题'

[docs.events.click]
desc = '点击事件'

[docs.slots.label]
name = 'label'
desc = '标题'

配置文件

  • vrx-cp.config.{ts,js,mts,mjs}
  • vrx-cp.{toml,yaml,yml,jsonc,json5,json}
  • package.json#vrx-cp

⚠️ 由于vite5.0废弃了cjs module的原因,配置文件在使用 js/ts编写时只能使用esm格式

import { defineConfig } from '@vrx/cp'

export default defineConfig({
  // 入口文件 默认 src/index.ts
  entry: 'src/index.ts',
})

autoprefixer 样式

可以 根据 .browserslistrc 文件自动添加浏览器前缀

# Browsers that we support

last 1 version
> 1%
not dead # no browsers without security updates

试验性功能

watch mode

监听 源码目录,当文件发生改变时,重新执行打包操作

pnpm exec vrx-cp build --watch
# or
pnpm exec vrx-cp watch

vue-macros + volar

配置文件参考

vrx-cp.config.ts

import { defineConfig } from '@vrx/cp'
import VueMacros from 'unplugin-vue-macros/vite'

export default defineConfig({
  type: ({ vue, vueJsx }) =>
    VueMacros({
      plugins: {
        vue: vue(),
        vueJsx: vueJsx(),
      },
    }),
})

tsconfig.json

{
  "compilerOptions": {
    "types": ["unplugin-vue-macros/macros-global"]
  },
  "vueCompilerOptions": {
    "plugins": [
      "@vue-macros/volar/define-options",
      "@vue-macros/volar/define-models",
      "@vue-macros/volar/define-props",
      "@vue-macros/volar/define-props-refs",
      "@vue-macros/volar/short-vmodel",
      "@vue-macros/volar/define-slots",
      "@vue-macros/volar/jsx-directive"
    ]
  }
}