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

@guozhi-fe/oms-trade-workbench

v0.1.0-alpha.0

Published

Host-integrated React trade workbench modal for GuoZhi OMS applications.

Readme

@guozhi-fe/oms-trade-workbench

国智 OMS 应用共享的交易工作台 React 组件。当前 0.1.0-alpha.* 版本用于验证独立发包、 宿主请求适配、主题继承和受控全屏弹窗;其中的 Demo 数据契约不代表正式交易接口。

安装

npm install --save-exact @guozhi-fe/[email protected]

宿主需要提供兼容版本的 react、react-dom、antd 和 @chenhui996/gg-ui。具体范围以 包内 peerDependencies 为准。

接入

应用入口只引入一次组件样式,并在宿主现有主题 Provider 内注入请求 Transport:

import {
  TradeWorkbenchProvider,
  type TradeWorkbenchTransport,
} from '@guozhi-fe/oms-trade-workbench';
import '@guozhi-fe/oms-trade-workbench/style.css';

const transport: TradeWorkbenchTransport = {
  request: async (config) => {
    // 将 path、method、query、body、headers 和 signal 适配到宿主请求客户端。
    return hostRequest(config);
  },
};

function Root() {
  return (
    <HostThemeProvider>
      <TradeWorkbenchProvider transport={transport}>
        <App />
      </TradeWorkbenchProvider>
    </HostThemeProvider>
  );
}

页面通过受控属性打开弹窗:

import { TradeWorkbench } from '@guozhi-fe/oms-trade-workbench';

<TradeWorkbench
  open={open}
  entry={{ mode: 'edit', tradeId: 'DEMO-001' }}
  onRequestClose={() => setOpen(false)}
  onSubmitted={({ tradeId }) => {
    console.info('submitted', tradeId);
  }}
/>;

entry 支持创建、编辑和只读入口:

type TradeWorkbenchEntry =
  | { mode: 'create'; tradeId?: never }
  | { mode: 'edit' | 'view'; tradeId: string };

宿主边界

  • 包不创建根级主题 Provider,继承宿主的 Locale、组件前缀和 --gz-* Token。
  • 包不依赖宿主 Router、Store、Token 或请求库。
  • 宿主应在 Vite 中去重 react、react-dom、antd 和 @chenhui996/gg-ui。
  • 只能从包根入口和 @guozhi-fe/oms-trade-workbench/style.css 引用,不承诺 dist/ 深层路径。

开发验证

在 oms-web 仓库根目录执行:

npm run trade-workbench:verify
npm pack ./packages/trade-workbench --dry-run

License

MIT