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

@wont/tools

v0.0.1-beta.5

Published

Tools to Build library for vue2、vue3、react<17、utils,using gulp、babel、rollup

Downloads

8

Readme

tools

Tools to Build library for vue2、vue3、react<17、utils,using gulp、babel、rollup

Usage

install

npm i @wont/tools -D

compile library

wont-tools compile <frame> [option]
wont-tools compile vue3 -d antd
wont-tools compile react16 -r

| frame | -d/--depends | antd | -e/--entry dirname | -r/--rollup | | --------- | :------------- | ------ | -------------------- | ------------- | | vue | ✅ | ✅ | ✅ | ✅ | | react16 | ✅ | ❌ | ✅ | ✅ | | utils | ❌ | ❌ | ✅ | ❌ |

frame 必填

frame 可选为 'vue2', 'vue3', 'react16', 'utils', 目前仅支持 vue3, react16

options 可选项

以下可选项-r-d antd不可组合使用,其他可以任意组合

-d/--depends antd

编译组件库依赖于某个组件库,目前vue3使用eslint-plugin-import集成了ant-design-vue

wont-tools compile vue3 -d antd
# or
wont-tools compile vue3 -depends antd

-e/--entry dirname

指定组件库文件名,默认为components

wont-tools compile vue3 -e src
# or
wont-tools compile vue3 -entry src

-r/--rollup

使用rollup编译javascript 注意 使用rollup编译的组件库,组件未引入样式文件,要使用babel-plugin-component引入,支持less变量定制主题

wont-tools compile vue3 -r
# or
wont-tools compile vue3 --rollup

Test case

@wont/react-ui @wont/utils

TODO

  • [X] vue3+tsx ui library
  • [ ] vue2 ui library, is it still necessary?
  • [X] react<17 ui library
  • [ ] rollup compile, less files output plugin
  • [X] utils ui library
  • [ ] npm version command
  • [ ] tag command
  • [ ] lint command
  • [ ] prettier command
  • [ ] create command
  • [ ] changelog command
  • [ ] docs command

目录示范与生成产物

utils

目录结构

  • 打包规则./${ENTRY_DIR_NAME}/!(_)*/!(_)*.ts
  • 根据以上规则生成index.ts作为入口文件
── src
│   ├── _common
│   │   ├── const.ts
│   ├── compose
│   │   ├── _compose.test.ts
│   │   └── compose.ts
│   ├── index.ts

执行指令

wont-tools compile utils -e src

生成产物

# esm
├── es
│   ├── compose
│   │   ├── compose.d.ts
│   │   └── index.js
│   ├── index.d.ts
│   ├── index.js
# commonjs
├── lib
│   ├── compose
│   │   ├── compose.d.ts
│   │   └── index.js
│   ├── index.d.ts
│   ├── index.js
# umd
├── dist
│   ├── umd.min.js

ui components

目录结构

  • 打包规则./${ENTRY_DIR_NAME}/**/index.tsx
  • 根据以上规则生成index.tsx作为入口文件
├── components
│   ├── button
│   │   ├── __tests__
│   │   │   ├── __snapshots__
│   │   │   └── button.test.tsx
│   │   ├── index.less
│   │   ├── index.stories.tsx
│   │   └── index.tsx
│   ├── index.tsx

执行指令

wont-tools compile react

生成产物

# esm
├── es
│   ├── button
│   │   ├── index.css
│   │   ├── index.d.ts
│   │   ├── index.js
│   │   └── index.less
│   ├── index.d.ts
│   ├── index.js

# commonjs
├── lib
│   ├── button
│   │   ├── index.css
│   │   ├── index.d.ts
│   │   ├── index.js
│   │   └── index.less
│   ├── index.d.ts
│   ├── index.js