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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zhangjie6/x-taro

v0.0.3

Published

基于 Taro 的可复用组件库

Downloads

45

Readme

@zhangjie6/x-taro

@zhangjie6/x-taro 是一个面向 Taro 项目的可复用组件库,用来承接从业务项目中抽离出来的公共组件。

安装

pnpm add @zhangjie6/x-taro

以下依赖需要由使用方项目自行安装:

npm install react @tarojs/components @tarojs/taro taro-ui

全局配置

组件库支持通过 setupXTaro 注入项目级公共能力,例如资源前缀、接口前缀和请求方法。

import { setupXTaro } from "@zhangjie6/x-taro";

setupXTaro({
  ossUrl: "https://example.com/assets",
  apiOldUrl: "https://example.com",
  request,
});

如果某个组件有更特殊的需求,也可以通过组件 props 单独覆盖对应能力。

如果项目需要复用路径组件的默认业务逻辑,也可以把相关能力一起挂到全局配置里:

import { setupXTaro } from "@zhangjie6/x-taro";

setupXTaro({
  ossUrl: "https://example.com/assets",
  apiOldUrl: "https://example.com",
  request,
  route: {
    addressSelectPage: "/pages/address/select/index",
    pickAddress: async ({ index, current }) => {
      return {
        idx: index,
        location: current,
      };
    },
    createTraceByPosition: async (list) => list,
    createTraces: async (list) => list,
  },
});

使用示例

import {
  FormRow,
  FormItemContentBox,
  CommonInputFormItem,
  CommonSelectFormItem,
  CommonRouteFormItem,
} from "@zhangjie6/x-taro";

路径组件的接入方式

CommonRouteFormItem 支持两层能力来源:

  1. 组件 props 显式传入
  2. setupXTaro 全局配置

如果项目想保留当前业务逻辑,可以在 setupXTaro 中注入地址选择和轨迹计算能力;如果不传,则组件会优先使用默认地址页跳转逻辑,轨迹计算则回退为原数据透传。