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 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-dadao-app

v0.6.0

Published

Bootstrap a project from the dadaowl GitLab template and set up 'upstream' for future updates.

Readme

create-dadao-app

从 Git 模板快速创建新项目,并设置 upstream 远程仓库,方便后续拉取模板更新。

快速开始

交互式创建(推荐)

npm create dadao-app@latest my-new-app

执行后会提示输入:

  • 模板仓库 URL(必填)
  • Origin 远程仓库 URL(可选,回车跳过)

使用命令行参数

npm create dadao-app@latest my-app \
  --template https://gitlab.dadaowl.cn/group/template.git \
  --origin https://gitlab.dadaowl.cn/your-group/my-app.git

命令行选项

| 选项 | 说明 | 默认值 | |------|------|--------| | --template <url> | 模板 Git 仓库 URL(必填,未提供时会提示输入) | - | | --origin <url> | Origin 远程仓库 URL(可选) | - | | --branch <name> | 模板分支名称 | main | | --no-push | 跳过首次推送到 origin | false | | -y, --yes | 跳过所有交互式提示 | false | | -h, --help | 显示帮助信息 | - |

示例

基础用法(交互式):

npm create dadao-app@latest my-shop

指定模板和 origin:

npm create dadao-app@latest my-shop \
  --template https://gitlab.dadaowl.cn/templates/shopify-framework.git \
  --origin https://gitlab.dadaowl.cn/mygroup/my-shop.git

仅克隆模板,稍后配置 origin:

npm create dadao-app@latest my-shop \
  --template https://gitlab.dadaowl.cn/templates/shopify-framework.git

使用特定分支并跳过推送:

npm create dadao-app@latest my-shop \
  --template https://gitlab.dadaowl.cn/templates/shopify-framework.git \
  --branch develop \
  --no-push

工作原理

  1. 克隆模板:将模板仓库克隆到新项目目录,并将远程命名为 upstream
  2. 禁用 upstream 推送:设置 upstream 为只读,防止意外推送到模板仓库
  3. 配置 origin(可选):如果提供了 origin URL,会添加 origin 远程仓库
  4. 首次推送(可选):如果配置了 origin 且未使用 --no-push,会自动推送当前分支
  5. 启用 rerere:开启 Git rerere 功能,记住冲突解决方案

稍后配置 origin

如果创建时未配置 origin,可以稍后手动添加:

cd my-new-app
git remote add origin https://gitlab.dadaowl.cn/your-group/my-app.git
git push -u origin main

同步模板更新

项目创建后,可以随时从 upstream 拉取模板更新:

# 拉取最新的模板代码
git fetch upstream

# 方式 A:合并(推荐,保留完整历史)
git merge upstream/main

# 方式 B:变基(线性历史,需要强制推送)
git rebase upstream/main

便捷脚本

您可以在项目的 package.json 中添加以下脚本:

{
  "scripts": {
    "sync:upstream": "git fetch upstream && git merge upstream/main",
    "sync:upstream:rebase": "git fetch upstream && git rebase upstream/main"
  }
}

然后使用:

npm run sync:upstream         # 合并策略
npm run sync:upstream:rebase  # 变基策略

环境变量

可以通过环境变量预设默认值:

| 环境变量 | 说明 | |----------|------| | TEMPLATE_GIT | 默认模板 URL | | ORIGIN_URL | 默认 origin URL | | TEMPLATE_BRANCH | 默认分支名称 |

示例:

export TEMPLATE_GIT=https://gitlab.dadaowl.cn/templates/shopify-framework.git
npm create dadao-app@latest my-shop

发布到 npm

如果您维护此工具,发布新版本:

npm login
npm version patch  # 或 minor, major
npm publish --access public

要求

  • Node.js >= 18
  • Git 已安装并配置

License

MIT