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

zlooks.cn

v0.0.38

Published

Hile Http Next Example

Readme

Hile + Next.js

基于 Hile 与 Next.js 的全栈项目。API 路由(/- 前缀)与页面路由共享同一端口。

快速开始

pnpm install
pnpm run dev

浏览器打开 http://localhost:3000。示例 API:curl http://localhost:3000/-/post

全局 CLI zlooks(可选)

安装本包后可用 zlooks 命令;生产构建的 Next 产物固定在 ~/.zlooks/.next(由 zlooks compile 写入;与仓库内可选的 pnpm run build:next 写入包根 .next 不同)。

推荐顺序:

  1. zlooks setup — 初始化 ~/.zlooks:写入 .env,并创建或补齐 package.jsonname: zlooks-workspacedependencies / devDependencies 与根级 zlooks 插件清单占位,供后续 zlooks pluginsnext.config 读取)
  2. zlooks compile — 在包安装根执行 next build,产物写入 ~/.zlooks/.next
  3. zlooks start — 启动服务(若缺少 ~/.zlooks/.next/BUILD_ID 会提示先执行 compile

插件(实现后)zlooks plugins install <registry 包名>dependencieszlooks plugins install <本地文件夹路径> --dev → 仅开发嵌入,devDependenciesfile:),包名以该目录 package.json#name 为准。见 docs/superpowers/specs/2026-04-22-zlooks-plugins-protocol-design.md §5.1。

发布到 npm

  • package.jsonfiles: tarball 含 distsrcpublic/**/*显式排除 public/uploads/**,用户上传不落 npm 包)、Next/TS 根配置与 README.md不包含 next-env.d.ts(由本机 next dev / next build / zlooks compile 自动生成)、不包含 根目录 .next(安装后由 zlooks compile 写入 ~/.zlooks/.next)。
  • prepublishOnly:发布前自动执行 pnpm run build:base(生成 dist/,含 CLI 与 Hile 侧编译产物)。
  • 发布前自检(推荐):在仓库根执行 pnpm run release:verifytsc + build:base + build:next,确认整站可构建)。
  • 打包预览npm pack --dry-run 查看将打进包的文件列表(pnpm 的 pack--dry-run 时可用此命令)。

常用命令

| 命令 | 说明 | |------|------| | pnpm run dev | 构建 Next.js 并以开发模式启动 Hile 服务 | | pnpm run build | 仅编译 Hile 侧tscdist/,含 zlooks CLI);不包含 Next 生产构建 | | pnpm run build:next | 可选:在包根生成 .next(本地/CI 验证 Next 能否通过 next build) | | pnpm run release:verify | 发布前自检:tsc + build:base + build:next(整站可构建) | | pnpm run start | 生产模式启动:若走全局 zlooks start,需先 zlooks compile;若坚持仓库内 pnpm run start 且读包根 .next,需先 pnpm run build:next |

项目结构

src/
├── app/                 # Next.js App Router(禁止 loadService / defineModel)
├── controllers/         # *.controller.ts → 默认 GET /-/…(可 loadService / loadModel)
├── models/              # <领域>/*.model.ts:单文件 export default defineModel
└── services/            # *.boot.ts | *.service.ts(*.boot 由 CLI 自启动)
  • src/services/index.boot.tsHttpNextcwd(见 packages/http-next/SKILL.md)。
  • src/models/<领域>/*.model.ts:领域数据;src/app/page.tsx 示范 loadModel + export const dynamic = "force-dynamic"(凡 page.tsx 使用 loadModel 时强制)。
  • src/controllers/post.controller.ts:示范 loadModel(postModel, …)

loadService 仅可在 src/servicessrc/modelssrc/controllers 中使用,禁止src/app

详见 packages/http-next/SKILL.mdHile 文档