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

@dt-company/create-dt-app

v0.1.3

Published

从模板生成已接入 @dt-company/design-system 的 Vite + React 应用

Downloads

545

Readme

@dt-company/create-dt-app

生成已接入 @dt-company/design-system 的 Vite + React 模板(顶栏路由、表格 + Dialog 示例、AGENTS.md 等)。


两种用法不要混用

| 场景 | 用的到底是什么 | 命令 | |------|------------------|------| | 在本仓库(company-design-system)里 新建 apps/xxx | 根目录 本地脚本不是从 npm 装 CLI | 见下文「A」 | | 任意目录(已安装 Node/pnpm,设计系统已从 npm 发布) | npm 上的包 @dt-company/create-dt-app | 见下文「B」 |

根目录的 pnpm create-app 来自仓库根 package.json"create-app": "node packages/create-dt-app/bin/create-dt-app.mjs",pnpm 只是执行这个脚本,不会去 registry 解析 @dt-company/create-dt-app


A. 在本 monorepo 里新建应用

本仓库根目录

pnpm create-app apps/<应用目录名>
pnpm install
pnpm --filter <生成出的 package.json 里的 name> dev

示例:

pnpm create-app apps/portal
pnpm install
pnpm --filter portal dev

此时若检测到 packages/design-system,脚本会自动改为 workspace:* 并写入 Vite/tsconfig 源码 alias(与 apps/demo 一致)。


B. 使用已发布的 npm 包(新建独立项目)

前置:已安装 Node ≥ 20,且 npm 上已存在 @dt-company/design-system(本脚手架模板依赖它)。

你想创建项目的父目录执行(将 my-dt-app 换成你的文件夹名;该目录尚不存在或为空):

pnpm dlx @dt-company/create-dt-app my-dt-app

或使用 npm:

npx @dt-company/create-dt-app my-dt-app

说明:包内 bin 名为 create-dt-appdlx / npx 安装该包后会直接执行这个命令第一个参数就是目标路径(传给脚本的 process.argv[2]),中间不要再写一遍 create-dt-app。需要固定版本时可写 @dt-company/[email protected]

然后进入目录、安装依赖、启动:

cd my-dt-app
pnpm install   # 或 npm install / yarn
pnpm dev

生成内容使用 npm 版模板@dt-company/design-system^0.1.0(从 registry 安装), monorepo 专用 Vite alias。


约束

  • 目标目录若已存在且非空,脚本会报错退出。
  • 在 monorepo 内时,路径写成 apps/<name> 可与现有 ../../packages/design-system 对齐;独立项目可任意目录名。

模板内容

template/package.jsonvite.config.tstsconfig.jsonindex.htmlsrc/*AGENTS.md 等。

  • src/App.tsxQueryClientProvider、路由、ThemeProviderTooltipProvider
  • src/i18n/:react-i18next + locales/zh.json · en.jsonmain.tsximport "./i18n/i18n"
  • src/lib/query-client.tsQueryClient 默认选项
  • src/layouts/app-layout.tsx:顶栏、NavLinkLanguageSwitcher、主题切换
  • src/pages/home-page.tsxuseQuery 示例
  • src/pages/list-page.tsx:Table + Dialog + useMutation(删除行),结构对齐 voice-page

npm 发布说明(维护者)

  • @dt-company/design-system,再发本包。
  • 模板内 "@dt-company/design-system": "^0.1.0" 与设计系统主版本保持同步(升级大版本时改 template/package.json)。
  • 本仓库根执行 pnpm create-app 时脚本会检测 monorepo 并切换为 workspace:* + 源码 alias;npm 用户走上一节「B」。