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

tcwicons

v1.7.0

Published

A self-use SVG icon component

Downloads

1

Readme

Icons Components

目 录 结 构

docs // vitePress 文档配置目录
resources // svg资源目录
lib // 组件编译输出目录
scripts // 处理resources资源生成组件到packages的脚本和模板
types // 组件源码自动生成的定义文件
packages // 组件源码
  - index.ts //组件入口
  - svg // 处理过后的svg资源(resources中的svg去除宽高熟悉)
    -- index.d.ts 
    -- action // svg分类文件夹, 由代码生成
  - demo // 组件文档
  -components
    -- IconA.vue // 分类为common,名称为A的icon 组件, 由代码生成
    -- IconB.vue // 分类为other,名称为B的icon 组件, 由代码生成
    -- index.ts // components入口文件, 由代码生成
    -- index.less // icon的默认样式
    -- icons-categories.json // 组件的分类json, 由代码生成

使用

前置条件

文档说明

安装

yarn add tcwicons

全局引入

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import Icons from 'tcwicons';

const app = createApp(App);
app.use(Icons);
app.mount('#app');

// demo.vue
<template>
  <IconHome />
</template>

局部引入

<template>
  <IconHome />
</template>

<script setup lang="ts">
import {IconHome} from 'tcwicons';
</script>

构建 & 发布

将需要纳入组件库的icon svg文件放到resources对应的目录,确保svg的文件名在整个resources中是唯一的。添加commit并push到远程仓库,项目就会自动CI/CD。
在push到远程仓库之前可以本地yarn run build检查是否可以编译成功.
项目构建使用 semantic-release 自动发布,参考Publish npm packages to the GitHub Package Registry using semantic-release

发布过程为:

  • yarn 安装依赖包
  • yarn run build 执行构建(本项目通过配置 scripts: {"prepare": "npm run build"}实现)
  • yarn run release 版本更新并发布【注意:由于是通过github actions 发布到 npm,需要配置对应的NPM_TOKEN秘钥】

组件文档

yarn run docs:dev 打开控制台中的地址即可