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

@cowave-front/create

v1.0.1

Published

`@cowave-front/create` 是项目生成核心包,负责把内置模板复制到目标目录,并根据用户选择注入主题、可选能力、依赖和运行时变量。

Downloads

35

Readme

@cowave-front/create

@cowave-front/create 是项目生成核心包,负责把内置模板复制到目标目录,并根据用户选择注入主题、可选能力、依赖和运行时变量。

普通业务开发者一般不需要直接使用本包,推荐使用 @cowave-front/cli 提供的 cowave-front create 命令。

当前能力

  • 复制 Vue + Vite 基础模板。
  • 注入 UI 风格模板:orcadeep-blue-techgreen-tech
  • 注入可选能力:i18nx6openlayers
  • 替换模板变量:项目名、包名、代理地址、主题信息、国际化入口。
  • 按用户选择执行依赖安装。
  • 默认使用 npm 安装生成项目依赖,避免用户本地没有 pnpm 导致安装失败。
  • 显式选择 pnpm 时,会追加 --ignore-workspace,避免生成项目被父级 workspace 接管。

安装

npm install @cowave-front/create

使用示例

import { createProject } from '@cowave-front/create'

await createProject({
  projectName: 'demo-front',
  templateDir: 'D:/project/cowave-front-cli/templates/vue-vite',
  optionalTemplateDirs: [
    'D:/project/cowave-front-cli/templates/styles/orca'
  ],
  stylePreset: 'orca',
  optionalFeatures: ['i18n'],
  apiProxyTarget: 'http://localhost:8080',
  install: false
})

主要 API

createProject(options)

创建项目。

常用参数:

  • projectName:目标项目目录名。
  • templateDir:基础模板目录。
  • cwd:创建项目的工作目录,默认当前进程目录。
  • force:目标目录非空时是否继续写入。
  • install:创建完成后是否立即安装依赖。
  • packageManager:安装依赖使用的包管理器,支持 npmpnpmyarn,默认 npm
  • optionalFeatures:可选能力列表。
  • optionalTemplateDirs:附加模板目录,例如主题模板、OpenLayers 模板、i18n 模板。
  • stylePreset:UI 风格,支持 orcadeep-blue-techgreen-tech
  • apiProxyTarget:生成项目中 /api 代理目标地址。

返回值:

  • root:生成项目绝对路径。
  • packageName:规范化后的 package name。
  • optionalFeatures:实际注入的可选能力。
  • stylePreset:实际使用的 UI 风格。
  • apiProxyTarget:实际写入的代理地址。
  • installed:是否已执行依赖安装。

optionalFeatureDefinitions

脚手架支持的可选能力定义。

import { optionalFeatureDefinitions } from '@cowave-front/create'

当前包括:

  • i18n:国际化能力。
  • x6:图编辑能力。
  • openlayers:地图能力。

uiStylePresetDefinitions

脚手架支持的 UI 风格定义。

import { uiStylePresetDefinitions } from '@cowave-front/create'

当前包括:

  • orca:虎鲸风格,默认风格。
  • deep-blue-tech:深蓝科技风。
  • green-tech:绿色科技风。

开发命令

corepack pnpm --filter @cowave-front/create build
corepack pnpm --filter @cowave-front/create test
corepack pnpm --filter @cowave-front/create typecheck