
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@ifanrx/scaffolder
Advanced tools
@ifanrx/scaffolder
脚手架工具有以下核心功能:
@ifanrx/*
系列依赖包至指定版本。Usage: @ifanrx/scaffolder [command] [options]
Scaffolding CLI for generating projects or update project dependencies
Options:
-v, --version 查看版本信息
-h, --help 查看帮助信息
Commands:
init [options] [template] 快速创建项目
pull [options] [template] 拉取模板代码到现有项目中
update-package [packageName] 一键升级 @ifanrx/* 系列依赖包至指定版本
help [command] display help for command
tips: 可通过 [command] -h 查看每个命令的使用方法
:::warning 必须先确保已安装 hgflow 插件,可通过以下命令验证:
hg flow --help
hg flow {<stream> [<action> [<arg>]] | <command>} [<option>...]
...
:::
使用 init
命令可快速创建一个新项目,常规操作流程是:先创建代码仓库,拉取代码仓库到本地,然后在项目根目录运行:
pnpm dlx @ifanrx/scaffolder init
根据提示填写项目配置信息,即可基于最新模板快速构建一个全新项目。
Usage: @ifanrx/scaffolder init [options] [template]
快速创建项目
Arguments:
template 模板类型 (choices: "app", "miniapp", "dashboard", "faas")
Options:
--name 英文项目名称(默认创建在当前目录)
--description 中文项目名称
--appid appid
--clientId, --client_id 知晓云 client id
--clientSecret, --client_secret 知晓云 client secret
--envId, --env_id 知晓云 env id
--qaClientId, --qa_client_id 知晓云 QA client id
--projectType, --project_type 项目类型 (choices: "yghact", "business")
--useZAA 是否接入 0AA
--initHgFlow 是否初始化 hg flow
--autoCommit 是否自动 commit
-h, --help display help for command
:::tip
init
命令有以下几种使用方式:
# 不指定模板类型,会询问模板类型,其中 app 包含所有模板
pnpm dlx @ifanrx/scaffolder init
# 只需要创建某个模板
pnpm dlx @ifanrx/scaffolder init dashboard
# 直接设置参数值
pnpm dlx @ifanrx/scaffolder init --name=test --description=示例项目 ...
:::
使用 pull
命令可快速将最新的模板代码迭代更新到现有项目中,方便后续添加统一公用代码。
适用于以下场景:
该命令在活动集等类型项目中尤为实用,因为这些项目的运营后台结构基本一致,后续都将采用这种方式统一管理和迭代升级项目的基础通用代码模块。
常规操作流程是:当模板代码有更新且需要将其合并到现有项目时,只需在项目根目录下运行:
pnpm dlx @ifanrx/scaffolder pull [template] # 目前仅支持 dashboard 模板
执行命令后,如遇到冲突文件,会得到提示,根据情况选择合并策略:
conflict package.json
? Overwrite package.json? (ynarxdeiH)
合并策略如下:
使用 update-package
命令可一键将 @ifanrx/* 系列依赖包升级至指定版本。
由于 @ifanrx/* 包内的依赖与项目内依赖存在部分重叠,在依赖版本冲突时,有概率出现灵异现象,如:样式丢失、打包失败等。故在更新 @ifanrx/* 依赖时,需要同步共同依赖版本号。
以下 npm 包更新时需要同步依赖版本号:
因此,@ifanrx/* 依赖都必须使用以下命令进行更新:
pnpm dlx @ifanrx/scaffolder update-package # 手动选择依赖以及版本号
pnpm dlx @ifanrx/scaffolder update-package @ifanrx/uni-mp # 指定依赖,手动选择版本号
pnpm dlx @ifanrx/scaffolder update-package @ifanrx/uni-mp@1.1.0 # 指定依赖以及版本号
pnpm dlx @ifanrx/scaffolder update-package @ifanrx/uni-mp@latest # 更新至最新版本
FAQs
Scaffolding CLI for generating projects or update project dependencies
We found that @ifanrx/scaffolder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.