Rush Stack商店部落格活動
跳到主要內容

Rush 檔案與資料夾

每個 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.json用於 Rush 與 JFrog Artifactory 服務整合的組態。
common/config/build-cache.json用於 Rush 的 建置快取的組態
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 全域安裝的符號連結,其版本在 rush.json 中指定。
common/temp/npm-tmp/...NPM 在安裝期間建立的暫存檔案。
common/temp/patches/...rush-pnpm patch 指令會在此暫存資料夾下建立修補程式檔案 (rush-pnpm commit-patch 會將其複製到 common/pnpm-patches)
common/temp/pnpm-local/...如果選取 PNPM 套件管理員,這是指向 Rush 全域安裝的符號連結,其版本在 rush.json 中指定。
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.json 中的 telemetryEnabled=true 時,儲存 Rush 所儲存的遙測輸出
common/temp/yarn-local/...如果選取 Yarn 套件管理員,這是指向 Rush 全域安裝的符號連結,其版本在 rush.json 中指定。
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」) 讀取。