common-versions.json 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * This configuration file specifies NPM dependency version selections that affect all projects
  3. * in a Rush repo. More documentation is available on the Rush website: https://rushjs.io
  4. */
  5. {
  6. "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/common-versions.schema.json",
  7. /**
  8. * A table that specifies a "preferred version" for a given NPM package. This feature is typically used
  9. * to hold back an indirect dependency to a specific older version, or to reduce duplication of indirect dependencies.
  10. *
  11. * The "preferredVersions" value can be any SemVer range specifier (e.g. "~1.2.3"). Rush injects these values into
  12. * the "dependencies" field of the top-level common/temp/package.json, which influences how the package manager
  13. * will calculate versions. The specific effect depends on your package manager. Generally it will have no
  14. * effect on an incompatible or already constrained SemVer range. If you are using PNPM, similar effects can be
  15. * achieved using the pnpmfile.js hook. See the Rush documentation for more details.
  16. *
  17. * After modifying this field, it's recommended to run "rush update --full" so that the package manager
  18. * will recalculate all version selections.
  19. */
  20. "preferredVersions": {
  21. /**
  22. * When someone asks for "^1.0.0" make sure they get "1.2.3" when working in this repo,
  23. * instead of the latest version.
  24. */
  25. // "some-library": "1.2.3"
  26. },
  27. /**
  28. * When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions,
  29. * except in cases where different projects specify different version ranges for a given dependency. For older
  30. * package managers, this tended to reduce duplication of indirect dependencies. However, it can sometimes cause
  31. * trouble for indirect dependencies with incompatible peerDependencies ranges.
  32. *
  33. * The default value is true. If you're encountering installation errors related to peer dependencies,
  34. * it's recommended to set this to false.
  35. *
  36. * After modifying this field, it's recommended to run "rush update --full" so that the package manager
  37. * will recalculate all version selections.
  38. */
  39. // "implicitlyPreferredVersions": false,
  40. /**
  41. * If you would like the version specifiers for your dependencies to be consistent, then
  42. * uncomment this line. This is effectively similar to running "rush check" before any
  43. * of the following commands:
  44. *
  45. * rush install, rush update, rush link, rush version, rush publish
  46. *
  47. * In some cases you may want this turned on, but need to allow certain packages to use a different
  48. * version. In those cases, you will need to add an entry to the "allowedAlternativeVersions"
  49. * section of the common-versions.json.
  50. *
  51. * In the case that subspaces is enabled, this setting will take effect at a subspace level.
  52. */
  53. // "ensureConsistentVersions": true,
  54. /**
  55. * The "rush check" command can be used to enforce that every project in the repo must specify
  56. * the same SemVer range for a given dependency. However, sometimes exceptions are needed.
  57. * The allowedAlternativeVersions table allows you to list other SemVer ranges that will be
  58. * accepted by "rush check" for a given dependency.
  59. *
  60. * IMPORTANT: THIS TABLE IS FOR *ADDITIONAL* VERSION RANGES THAT ARE ALTERNATIVES TO THE
  61. * USUAL VERSION (WHICH IS INFERRED BY LOOKING AT ALL PROJECTS IN THE REPO).
  62. * This design avoids unnecessary churn in this file.
  63. */
  64. "allowedAlternativeVersions": {
  65. /**
  66. * For example, allow some projects to use an older TypeScript compiler
  67. * (in addition to whatever "usual" version is being used by other projects in the repo):
  68. */
  69. "react": ["^16.8.6"],
  70. "react-dom": ["^16.8.6"],
  71. "@types/react": ["^16.8.6"],
  72. "@types/react-dom": ["^16.8.6"],
  73. "typescript": ["5.0.4", "5.8.3"]
  74. }
  75. }