Rush Stack商店博客活动
跳到主要内容

仓储文件和文件夹

每个 Rush 单体仓库都具有由 rush init 创建并由 rush update 验证的标准文件夹结构。

配置文件

文件夹路径它做什么
rush.jsonRush 的主要配置文件
common/config/rush/.npmrc如果您需要为“npm install”自定义设置(例如 NPM 仓库映射),请将它们放在此文件中。Rush 将将此文件复制到 common/temp/ 文件夹中。
common/config/rush/.npmrc-publish用于发布操作,而不是 .npmrc
common/config/artifactory.jsonRush 与 JFrog Artifactory 服务集成的配置。
common/config/build-cache.jsonRush 的 构建缓存 的配置
common/config/rush/command-line.json用于定义 自定义命令
common/config/rush/common-versions.json用于指定影响仓库中所有项目的版本。
common/config/rush/deploy.json用于定义 rush deploy 命令的配置文件
common/config/rush/experiments.json启用 Rush 的实验性功能
common/config/rush/npm-shrinkwrap.json当您的包管理器是 NPM 时,它是 shrinkwrap 文件。这是应用于 Rush 仓库中所有项目的通用 shrinkwrap 文件。有关更多信息,请参阅 日常命令 部分中的 **“什么是这个 shrinkwrap 文件”**。
common/config/rush/rush-plugins.json指定要为单体仓库加载的 Rush 插件
common/config/rush/pnpm-lock.yaml当您的包管理器是 PNPM 时,它是 shrinkwrap 文件。
common/config/rush/yarn.lock当您的包管理器是 Yarn 时,它是 shrinkwrap 文件。
common/config/rush/browser-approved-packages.jsonrush.json 中的 approvedPackagesPolicy 设置使用
common/config/rush/nonbrowser-approved-packages.json由 rush.json 中的 approvedPackagesPolicy 设置使用
common/config/rush/pnpm-config.json特定于 PNPM 包管理器的配置
common/config/rush/version-policies.json定义 rush versionrush publish 工作流。

标准 Rush 文件夹

文件夹路径它做什么
common/autoinstallers/...在此文件夹下创建 自动安装程序项目
common/changes/...存储由 rush change 命令创建并由 rush version 命令使用的更改文件。
common/deploy/...rush init-deploy 在此文件夹下创建部署配置。
common/git-hooks/...Rush 的 git 钩子脚本 在这里定义
common/pnpm-patches/...rush-pnpm commit-patch 命令在此文件夹下存储包补丁文件
common/scripts/install-run-rush.js用于调用 rush 的 CI 引导脚本。rush update 会生成此文件,该文件应提交到 Git。有关详细信息,请参阅 启用 CI 构建
common/scripts/install-run-rush-pnpm.js用于调用 rush-pnpm 的 CI 引导脚本。
common/scripts/install-run-rushx.js用于调用 rushx 的 CI 引导脚本。
common/scripts/install-run.js用于调用任意 NPM 包的 CI 引导脚本。

Rush 创建的临时文件

文件夹路径它做什么
common/temp/build-cache/...Rush 的 构建缓存 的默认存储位置
common/temp/install-run/...install-run.jsinstall-run-rush.js 脚本的存储空间。请参阅 启用 CI 构建
common/temp/node_modules/...已安装的包。这是一个普通的 npm install 输出,此树中没有符号链接。
common/temp/npm-cache/...本地 NPM 缓存将在此处创建。Rush 不会使用全局 NPM 缓存,因为其并发问题。
common/temp/npm-local/...如果选择 NPM 包管理器,则它是指向 rush.json 中指定的版本的 Rush 全局安装的符号链接。
common/temp/npm-tmp/...NPM 在安装过程中创建的临时文件。
common/temp/patches/...rush-pnpm patch 命令在此临时文件夹下创建补丁文件(rush-pnpm commit-patch 将复制到 common/pnpm-patches
common/temp/pnpm-local/...如果选择 PNPM 包管理器,则它是指向 rush.json 中指定的版本的 Rush 全局安装的符号链接。
common/temp/pnpm-store/...如果选择 PNPM 包管理器,则它是 PNPM 存储的默认位置。(可以使用 RUSH_PNPM_STORE_PATH 环境变量重定向。)
common/temp/projects/...common/temp/package.json 引用的合成项目。
common/temp/rush-recycler/...用于加速递归删除。
common/temp/telemetry/...存储 rush.jsontelemetryEnabled=true 时 Rush 保存的遥测输出
common/temp/yarn-local/...如果选择 Yarn 包管理器,则它是指向 rush.json 中指定的版本的 Rush 全局安装的符号链接。
common/temp/last-install.flag不要担心这个文件。它跟踪上次成功的 rush install 的时间戳。
common/temp/package.json通用包定义。
common/temp/repo-state.jsonpnpm-config.json 中的 preventManualShrinkwrapChanges 设置生成
common/temp/rush-link.json不要担心这个文件。它在您运行 rush link 时创建,并由后面的命令(如“rush build”)读取。