Skip to content

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仅打印解析结果,不实际复制文件。 默认值 falsenode-esm/scripts/move-vercel-output-to-root/index.ts:48
rootDir?stringmonorepo 根目录。 不传时会从 cwd 开始,向上查找 pnpm-workspace.yamlnode-esm/scripts/move-vercel-output-to-root/index.ts:18
skipClean?boolean是否跳过目标目录清理。 默认值 falsenode-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?stringmonorepo 根目录内的目标输出目录。 相对路径基于 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

继承

属性

属性类型继承自定义于
copiedboolean-node-esm/scripts/move-vercel-output-to-root/index.ts:61
cwdstringResolvedMoveVercelOutputToRootOptions.cwdnode-esm/scripts/move-vercel-output-to-root/index.ts:52
dryRunbooleanResolvedMoveVercelOutputToRootOptions.dryRunnode-esm/scripts/move-vercel-output-to-root/index.ts:57
monorepoRootstringResolvedMoveVercelOutputToRootOptions.monorepoRootnode-esm/scripts/move-vercel-output-to-root/index.ts:53
skipCleanbooleanResolvedMoveVercelOutputToRootOptions.skipCleannode-esm/scripts/move-vercel-output-to-root/index.ts:56
sourceDirstringResolvedMoveVercelOutputToRootOptions.sourceDirnode-esm/scripts/move-vercel-output-to-root/index.ts:54
targetDirstringResolvedMoveVercelOutputToRootOptions.targetDirnode-esm/scripts/move-vercel-output-to-root/index.ts:55

PackageInfo

定义于: node-esm/ruan-cat-pkg-info.ts:4

包的信息

属性

属性类型描述定义于
descriptionstring包的描述node-esm/ruan-cat-pkg-info.ts:8
namestring包名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

继承于

属性

属性类型定义于
cwdstringnode-esm/scripts/move-vercel-output-to-root/index.ts:52
dryRunbooleannode-esm/scripts/move-vercel-output-to-root/index.ts:57
monorepoRootstringnode-esm/scripts/move-vercel-output-to-root/index.ts:53
skipCleanbooleannode-esm/scripts/move-vercel-output-to-root/index.ts:56
sourceDirstringnode-esm/scripts/move-vercel-output-to-root/index.ts:54
targetDirstringnode-esm/scripts/move-vercel-output-to-root/index.ts:55

WriteYaml2mdParams

定义于: node-esm/yaml-to-md.ts:7

类型参数

类型参数默认类型
TRecord<string, any>

属性

属性类型描述定义于
dataT被插入到md头部的数据node-esm/yaml-to-md.ts:12
mdPathstring目标md文件地址node-esm/yaml-to-md.ts:9

类型别名

WorkspacePackageInfo

ts
type WorkspacePackageInfo = Required<Pick<PackageJson, "name" | "version">>;

定义于: node-esm/scripts/relizy-runner/index.ts:13

发版基线 tag 校验所需的最小字段,由 PackageJson 派生。

变量

defaultCleanTargets

ts
const defaultCleanTargets: readonly ["node_modules", "yarn.lock", "pnpm-lock.yaml", "package-lock.json", "dist", ".turbo", ".vercel", ".cache", ".temp"];

定义于: node-esm/scripts/clean.ts:5

函数

buildBootstrapInstructions()

ts
function buildBootstrapInstructions(missingPackages): string;

定义于: node-esm/scripts/relizy-runner/index.ts:191

根据缺少基线 tag 的包列表,生成包含补打 tag 命令的提示文本。

参数

参数类型
missingPackagesRequired<Pick<PackageJson, "name" | "version">>[]

返回

string


clean()

ts
function clean(targets?): Promise<void>;

定义于: node-esm/scripts/clean.ts:28

删除node项目的依赖项便于重新安装依赖,也包括常见的各种垃圾文件。

参数

参数类型描述
targets?string[]被清除的目标文件夹 也包括文件

返回

Promise<void>

Description


ensureRelizyShellEnv()

ts
function ensureRelizyShellEnv(): 
  | {
  PATH: string;
}
  | {
[key: string]: string | undefined;
};

定义于: node-esm/scripts/relizy-runner/index.ts:126

确保 relizy 所需的 GNU 工具(grep / head / sed)在 PATH 中可用。
Windows 下会自动补齐 Git for Windows 的 usr\bin 路径。

返回

| {
PATH: string;
}
| {
[key: string]: string | undefined;
}


getMoveVercelOutputToRootHelpText()

ts
function getMoveVercelOutputToRootHelpText(): string;

定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:240

CLI 帮助信息。

返回

string


getRelizyRunnerHelpText()

ts
function getRelizyRunnerHelpText(): string;

定义于: node-esm/scripts/relizy-runner/index.ts:214

获取 relizy-runner CLI 的帮助文本。

返回

string


getRuanCatPkgInfo()

ts
function getRuanCatPkgInfo(): Promise<PackageInfo[]>;

定义于: node-esm/ruan-cat-pkg-info.ts:23

获得阮喵喵全部的包信息

返回

Promise<PackageInfo[]>

Description

这是一个node环境下的函数,用于获取阮喵喵的所有包的信息。

使用的是node的child_process模块,调用pnpm命令获取包信息。

  • 默认仅考虑pnpm包
  • 在node环境下运行

getWorkspacePackages()

ts
function getWorkspacePackages(workspaceRoot?): Required<Pick<PackageJson, "name" | "version">>[];

定义于: node-esm/scripts/relizy-runner/index.ts:24

解析根目录 pnpm-workspace.yaml 并展开 glob 模式,
收集所有含 package.json 的子包目录,返回其 name 与 version。

使用 pnpm-workspace-yaml
解析工作区清单,再用 pkg-typesPackageJson 约束子包字段。

参数

参数类型
workspaceRoot?string

返回

Required<Pick<PackageJson, "name" | "version">>[]


moveVercelOutputToRoot()

ts
function moveVercelOutputToRoot(options?): MoveVercelOutputToRootResult;

定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:145

将当前子包内的 .vercel/output 移动到 monorepo 根目录。

参数

参数类型
optionsMoveVercelOutputToRootOptions

返回

MoveVercelOutputToRootResult

Description

该函数服务于 Vercel 在 monorepo 场景下的部署:

  1. 构建仍在子包目录内执行
  2. 产物默认出现在子包的 .vercel/output
  3. Vercel 却要求在 monorepo 根目录下读取 .vercel/output

parseMoveVercelOutputToRootCliArgs()

ts
function parseMoveVercelOutputToRootCliArgs(args): MoveVercelOutputToRootOptions & {
  help?: boolean;
};

定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:192

解析命令行参数。

参数

参数类型
argsstring[]

返回

MoveVercelOutputToRootOptions & {
help?: boolean;
}


parseRelizyRunnerCliArgs()

ts
function parseRelizyRunnerCliArgs(args): {
  help: boolean;
  relizyArgs: string[];
};

定义于: node-esm/scripts/relizy-runner/index.ts:318

解析 relizy-runner CLI 参数。
如果首个参数是 --help-h,返回 { help: true }
否则将所有参数透传给 relizy。

参数

参数类型
argsstring[]

返回

ts
{
  help: boolean;
  relizyArgs: string[];
}
名称类型定义于
helpbooleannode-esm/scripts/relizy-runner/index.ts:318
relizyArgsstring[]node-esm/scripts/relizy-runner/index.ts:318

resolveMoveVercelOutputToRootOptions()

ts
function resolveMoveVercelOutputToRootOptions(options?): ResolvedMoveVercelOutputToRootOptions;

定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:99

解析脚本所需的全部路径。

参数

参数类型
optionsMoveVercelOutputToRootOptions

返回

ResolvedMoveVercelOutputToRootOptions


runMoveVercelOutputToRootCli()

ts
function runMoveVercelOutputToRootCli(args?): void;

定义于: node-esm/scripts/move-vercel-output-to-root/index.ts:257

执行 CLI。

参数

参数类型
argsstring[]

返回

void


runRelizyRunner()

ts
function runRelizyRunner(relizyArgs): number;

定义于: node-esm/scripts/relizy-runner/index.ts:266

执行 relizy-runner。

参数

参数类型描述
relizyArgsstring[]透传给 relizy 的子命令与参数

返回

number

退出码

Description

在 relizy 执行前做两件事:

  1. Windows 下自动补齐 Git for Windows 的 usr\bin 路径,避免 relizy 内部调用 grep/head/sed 失败。
  2. release/bump 前校验 independent 基线 tag,缺失时打印补打命令并终止。

runRelizyRunnerCli()

ts
function runRelizyRunnerCli(args?): void;

定义于: node-esm/scripts/relizy-runner/index.ts:329

执行 relizy-runner CLI。

参数

参数类型
argsstring[]

返回

void


shouldCheckIndependentBootstrap()

ts
function shouldCheckIndependentBootstrap(relizyArgs): boolean;

定义于: node-esm/scripts/relizy-runner/index.ts:178

判断当前 relizy 子命令是否需要检查 independent 基线 tag。
releasebump 需要。

参数

参数类型
relizyArgsstring[]

返回

boolean


writeYaml2md()

ts
function writeYaml2md<T>(params): void;

定义于: node-esm/yaml-to-md.ts:20

将YAML数据写入到MD文件内

类型参数

类型参数
T

参数

参数类型
paramsWriteYaml2mdParams<T>

返回

void

已被弃用

请使用 gray-matter 库来实现相关的更改,不使用 writeYaml2md 函数了。

参考

findMonorepoRoot

重新导出 findMonorepoRoot


isMonorepoProject

重新导出 isMonorepoProject

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史
最近更新