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

@lark-apaas/coding-templates

v0.1.3

Published

OpenClaw project templates for mclaw CLI

Readme

@lark-apaas/coding-templates

OpenClaw 项目模板包,供 mclaw CLI 使用。

模板列表

| 模板 | 目录 | 说明 | |---|---|---| | html | template-html/ | 纯 HTML,零依赖,原型验证 | | nextjs-static | template-nextjs-static/ | Next.js Pages Router,静态导出,纯前端 | | nextjs-fullstack | template-nextjs-fullstack/ | Next.js App Router + Drizzle + PostgreSQL,全栈 |

包结构

template/
├── package.json                  # npm 包定义(@lark-apaas/coding-templates)
├── meta.json                     # 模板元数据(业务侧生成,名称/描述/特性标签)
├── template-html/
│   ├── _gitignore
│   ├── package.json              # mclaw.type: "html"
│   └── index.html
├── template-nextjs-static/
│   ├── _gitignore                # CLI 复制时重命名为 .gitignore
│   ├── package.json              # mclaw.type: "nextjs-static",name 为 {{projectName}}
│   ├── tailwind.config.ts
│   ├── eslint.config.js
│   ├── postcss.config.js
│   ├── components.json
│   └── src/
│       ├── pages/                # Pages Router 路由
│       ├── components/ui/        # shadcn/ui 58 个组件
│       ├── hooks/
│       ├── lib/
│       └── styles/globals.css
└── template-nextjs-fullstack/
    ├── _gitignore
    ├── _env.local.example        # CLI 复制时重命名为 .env.local.example
    ├── package.json              # mclaw.type: "nextjs-fullstack",name 为 {{projectName}}
    ├── drizzle.config.ts
    ├── tailwind.config.ts
    ├── eslint.config.js
    ├── postcss.config.js
    ├── components.json
    └── src/
        ├── app/                  # App Router 路由 + Server Actions
        ├── components/ui/        # shadcn/ui 58 个组件
        ├── db/                   # Drizzle ORM schema + 连接
        ├── hooks/
        └── lib/

特殊文件命名

npm publish 会忽略 .gitignore.env*,因此模板中使用 _ 前缀:

| 模板中的文件名 | CLI 复制后的文件名 | |---|---| | _gitignore | .gitignore | | _env.local.example | .env.local.example |

模板类型标识

每个模板的 package.json 包含 mclaw.type 字段,标识模板类型:

{
  "mclaw": {
    "type": "nextjs-static"
  }
}

meta.json 由业务侧生成和维护。若 meta.json 丢失,CLI 可扫描各模板目录的 package.json 中的 mclaw.type 恢复。

mclaw CLI 集成方式

const path = require('path');
const fs = require('fs-extra');

// 1. 读取模板元数据
const meta = require('@lark-apaas/coding-templates/meta.json');

// 2. 定位模板目录
const templateDir = path.dirname(require.resolve('@lark-apaas/coding-templates/meta.json'));
const srcDir = path.join(templateDir, selectedTemplate.dir);

// 3. 复制到目标目录
await fs.copy(srcDir, targetDir);

// 4. 重命名特殊文件
const renames = { '_gitignore': '.gitignore', '_env.local.example': '.env.local.example' };
for (const [from, to] of Object.entries(renames)) {
  const filePath = path.join(targetDir, from);
  if (fs.existsSync(filePath)) {
    await fs.rename(filePath, path.join(targetDir, to));
  }
}

// 5. 替换 package.json 中的占位符
const pkgPath = path.join(targetDir, 'package.json');
if (fs.existsSync(pkgPath)) {
  let content = await fs.readFile(pkgPath, 'utf-8');
  content = content.replace('{{projectName}}', projectName);
  await fs.writeFile(pkgPath, content);
}

技术栈

两个 Next.js 模板共享相同的技术选型:

  • Next.js 16 + React 19 + TypeScript 5
  • Tailwind CSS 4@tailwindcss/postcss,CSS-first 配置)
  • shadcn/ui(base-nova 风格,lucide 图标,58 个组件预装)
  • ESLint 9 flat config(@eslint/js + typescript-eslint,无 eslint-config-next
  • next-themes(暗色模式)

fullstack 模板额外包含:Drizzle ORM + PostgreSQL + Zod

发版

cd template
npm version patch
npm publish