rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] Design note: Subspace configuration improvements

Open octogonz opened this issue 1 month ago • 4 comments

Today @william2958 and I chatted about some remaining design questions for the Subspace config files, related to his PR https://github.com/microsoft/rushstack/pull/4715:

subspaces.md image

Here's a summary of the proposed changes:

  • The rush init template for .npmrc needs a # comment clearly explaining how the subspace .npmrc gets merged with common/config/rush/.npmrc

  • The subspaces/<name>/.pnpmfile-subspace.cjs file (inherited from split workspaces) should get renamed to .pnpmfile.cjs, since we forbid comnmon/config/rush/.pnpmfile.cjs when the feature is enabled

  • common/config/rush/pnpm-config.json should be treated as an all-or-nothing fallback in the case where subspaces/<name>/pnpm-config.json is absent.

    @octogonz will double-check with the maintainers whether this is intuitive enough or needs some clarification (such as subnspaces/_fallback/pnpm-config.json or common/config/rush/pnpm-config-fallback.json)

  • ensureConsistentVersions always applies within a subspace; there is no mode where it applies across all projects in the monorepo

  • The ensureConsistentVersions setting should be moved from rush.json to common-versions.json so it is alongside allowedAlternativeVersions

  • --subspace is mandatory for rush check when the feature is enabled

  • rush version, rush install, etc always need to invoke rush check in a loop for each subspace with ensureConsistentVersions=true (or if we are optimizing, for the subset of subspaces affected by that operation).

  • rush version should NOT support the --subspace parameter` since its operation isn't associated with any particular subspace

@iclanton @chengcyber

octogonz avatar May 17 '24 02:05 octogonz