node-esm
接口
MoveVercelOutputToRootOptions
定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:7
属性
| 属性 | 类型 | 描述 | 定义于 |
|---|---|---|---|
cwd? | string | 运行目录。 默认值为 process.cwd()。 | node-esm/scripts/move-vercel-output-to-root/index.ts:12 |
dryRun? | boolean | 仅打印解析结果,不实际复制文件。 默认值 false | node-esm/scripts/move-vercel-output-to-root/index.ts:48 |
rootDir? | string | monorepo 根目录。 不传时会从 cwd 开始,向上查找 pnpm-workspace.yaml。 | node-esm/scripts/move-vercel-output-to-root/index.ts:18 |
skipClean? | boolean | 是否跳过目标目录清理。 默认值 false | node-esm/scripts/move-vercel-output-to-root/index.ts:41 |
sourceDir? | string | 子包内构建产物目录。 相对路径基于 cwd 解析。 默认值 ".vercel/output" | node-esm/scripts/move-vercel-output-to-root/index.ts:26 |
targetDir? | string | monorepo 根目录内的目标输出目录。 相对路径基于 monorepo 根目录解析。 默认值 ".vercel/output" | node-esm/scripts/move-vercel-output-to-root/index.ts:34 |
MoveVercelOutputToRootResult
定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:60
继承
属性
PackageInfo
定义于: node-esm/ruan-cat-pkg-info.ts:4
包的信息
属性
| 属性 | 类型 | 描述 | 定义于 |
|---|---|---|---|
description | string | 包的描述 | node-esm/ruan-cat-pkg-info.ts:8 |
name | string | 包名 | node-esm/ruan-cat-pkg-info.ts:6 |
url | `https://npm.im/${string}` | 带有包名的官方镜像源地址 | node-esm/ruan-cat-pkg-info.ts:10 |
ResolvedMoveVercelOutputToRootOptions
定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:51
继承于
属性
| 属性 | 类型 | 定义于 |
|---|---|---|
cwd | string | node-esm/scripts/move-vercel-output-to-root/index.ts:52 |
dryRun | boolean | node-esm/scripts/move-vercel-output-to-root/index.ts:57 |
monorepoRoot | string | node-esm/scripts/move-vercel-output-to-root/index.ts:53 |
skipClean | boolean | node-esm/scripts/move-vercel-output-to-root/index.ts:56 |
sourceDir | string | node-esm/scripts/move-vercel-output-to-root/index.ts:54 |
targetDir | string | node-esm/scripts/move-vercel-output-to-root/index.ts:55 |
WriteYaml2mdParams
类型参数
| 类型参数 | 默认类型 |
|---|---|
T | Record<string, any> |
属性
| 属性 | 类型 | 描述 | 定义于 |
|---|---|---|---|
data | T | 被插入到md头部的数据 | node-esm/yaml-to-md.ts:12 |
mdPath | string | 目标md文件地址 | node-esm/yaml-to-md.ts:9 |
变量
defaultCleanTargets
const defaultCleanTargets: readonly ["node_modules", "yarn.lock", "pnpm-lock.yaml", "package-lock.json", "dist", ".turbo", ".vercel", ".cache", ".temp"];定义于: node-esm/scripts/clean.ts:5
函数
clean()
function clean(targets?): Promise<void>;定义于: node-esm/scripts/clean.ts:28
删除node项目的依赖项便于重新安装依赖,也包括常见的各种垃圾文件。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
targets? | string[] | 被清除的目标文件夹 也包括文件 |
返回
Promise<void>
Description
getMoveVercelOutputToRootHelpText()
function getMoveVercelOutputToRootHelpText(): string;定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:240
CLI 帮助信息。
返回
string
getRuanCatPkgInfo()
function getRuanCatPkgInfo(): Promise<PackageInfo[]>;定义于: node-esm/ruan-cat-pkg-info.ts:23
获得阮喵喵全部的包信息
返回
Promise<PackageInfo[]>
Description
这是一个node环境下的函数,用于获取阮喵喵的所有包的信息。
使用的是node的child_process模块,调用pnpm命令获取包信息。
- 默认仅考虑pnpm包
- 在node环境下运行
moveVercelOutputToRoot()
function moveVercelOutputToRoot(options?): MoveVercelOutputToRootResult;定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:145
将当前子包内的 .vercel/output 移动到 monorepo 根目录。
参数
| 参数 | 类型 |
|---|---|
options | MoveVercelOutputToRootOptions |
返回
Description
该函数服务于 Vercel 在 monorepo 场景下的部署:
- 构建仍在子包目录内执行
- 产物默认出现在子包的
.vercel/output - Vercel 却要求在 monorepo 根目录下读取
.vercel/output
parseMoveVercelOutputToRootCliArgs()
function parseMoveVercelOutputToRootCliArgs(args): MoveVercelOutputToRootOptions & {
help?: boolean;
};定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:192
解析命令行参数。
参数
| 参数 | 类型 |
|---|---|
args | string[] |
返回
MoveVercelOutputToRootOptions & {help?: boolean;
}
resolveMoveVercelOutputToRootOptions()
function resolveMoveVercelOutputToRootOptions(options?): ResolvedMoveVercelOutputToRootOptions;定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:99
解析脚本所需的全部路径。
参数
| 参数 | 类型 |
|---|---|
options | MoveVercelOutputToRootOptions |
返回
ResolvedMoveVercelOutputToRootOptions
runMoveVercelOutputToRootCli()
function runMoveVercelOutputToRootCli(args?): void;定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:257
执行 CLI。
参数
| 参数 | 类型 |
|---|---|
args | string[] |
返回
void
writeYaml2md()
function writeYaml2md<T>(params): void;定义于: node-esm/yaml-to-md.ts:20
将YAML数据写入到MD文件内
类型参数
| 类型参数 |
|---|
T |
参数
| 参数 | 类型 |
|---|---|
params | WriteYaml2mdParams<T> |
返回
void
已被弃用
请使用 gray-matter 库来实现相关的更改,不使用 writeYaml2md 函数了。
参考
findMonorepoRoot
重新导出 findMonorepoRoot
isMonorepoProject
重新导出 isMonorepoProject