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

@oetsky/pm-ui

v0.0.3

Published

[View the Storybook app](https://chec-ui.netlify.app/)

Downloads

1

Readme

Vue.js component UI library using Tailwindcss by Chec

View the Storybook app

Installation & Usage

You can use either yarn or npm to install the ui-library and it's dependencies from this Github repo.

with yarn

yarn add github:chec/ui-library

with npm

npm install github:chec/ui-library

Setting up Tailwindcss

  1. Create a tailwind.preview.js file at the root of the app exporting the ui-library's custom tailwind.preview.js from it.
module.exports = require('@chec/ui-library/tailwind.config');
  1. Inject the ui-library's compiled css and Tailwind.css file which includes the @tailwind directives to include the ui-library configured Tailwindcss styles/utilities.
/*
ui-library.css compiled css
*/
@import '~@chec/ui-library/dist/ui-library.css';

/*
tailwind.css, uses the @tailwind directive to inject Tailwind's base, components, and utilities styles into your CSS: 
*/  
@import '~@chec/ui-library/src/assets/tailwind.css';

Utilizing Sass mixins

You can import helpful sass mixins such as aspect-ratio.

/* mixins.scss */

@import '~@chec/ui-library/src/assets/mixins.scss';

Mixins

  • aspect-ratio

    use-case:

    <div class="image-container">
    
      <img src="chec.io/image.jpg" />
    
      <div v-else>
        <h6>
          No Image
        </h6>
      </div>
    
    </div>
    .image-container {
    
      /* tailwind @apply directive */
      @apply w-1/2 max-w-sm; 
    
      /* apply aspect-ratio mixin */
      @include aspect-ratio(16, 9); 
    
      /* style fall-back element */
      div {
        @apply bg-gray-300;
      }
    }

Translating

We use the vue-i18n library for this. See lang/*.js for the dictionaries. See the dashboard repo's lang/README.md for a detailed guide for using the library. TL;DRs:

  • <p>{{ $t('paginate.goToFirst') }}</p> renders "Go to the first page"
  • this.$t(...) from component instance methods

Project setup

git clone https://github.com/chec/ui-library.git
cd ui-library
yarn install

Start Storybook app on port 6006:

yarn storybook:serve

Run the frontend app proper on port 8080:

yarn run serve

Compiles and minifies for production (This is done continously)

yarn build-lib

Lints and fixes files

yarn lint:Fix

Customize configuration

See Configuration Reference.

配置流水线

npm config set registry=https://packages.aliyun.com/61f3948c74c3f3b550740ebe/npm/npm-registry/

组件库使用

由于pm-ui 发布在私有仓库中,需要配置nrm nrm add yf http://10.33.22.19:8081/repository/npm-group/ nrm use yf pnpm install pm-ui --save

// 可能无效 或者配置.npmrc文件,单独指定源地址

pm-ui:registry=http://10.33.22.19:8081/repository/npm-hosted/

发布

nrm add yf http://10.33.22.19:8081/repository/npm-hosted/ nrm use yf

npm login

输入账户/密码

npm publish

组件本地开发

  1. 运行 yarn storybook:serve 启动 storybook
  2. yarn yalc-watch2 监听组件的更新并进行构建打包

业务项目中

  1. pnpm install yalc -g
  2. pnpm install pm-ui -S
  3. yalc add pm-ui 添加依赖
  4. yalc update pm-ui 安装组件
  5. update 后,vue-cli-server 无法自动重启,加载组件
  6. 组件使用完后需要使用正式发布的组件 则yalc remove –all进行清除