aws-pdk icon indicating copy to clipboard operation
aws-pdk copied to clipboard

[BUG] MonorepoTsProject uses incorrect version of projen during "upgrade-deps"

Open memorsolutions opened this issue 1 year ago • 0 comments

Describe the bug

This seems to occur when the latest published version of projen is a higher than the one hard coded in projen-version.ts .This can result (and actually does so for projen 0.88.0 vs 0.82.8) in changes to the tree from a transient use of the newer projen version, but then immediately reverting projen to the hard coded version, preventing the ability to adjust options to account for the changes.

Expected Behavior

I expect that upgrade-deps does not make changes to the source tree that result from a transient use of a newer version of projen.

Current Behavior

Running upgrade-deps results in side effects when it executes the npm-check-updates step.

Reproduction Steps

  1. Create a new monorepo (or us an existing one) using 0.23.54
  2. Notice that out-of-the box, .gitatributes does not contain the default text=auto eol=lf introduced in projen 0.88.0
  3. Run the upgrade-deps task
  4. Notice that side effects of projen 0.88.0 appear in the .gitatributes files.

Possible Solution

Consider adding -x projen to the command line for npm-check-updates.

Additional Information/Context

The task for upgrade-deps includes a step running npm-check-updates on the entire monorep. This results in the projen version in the top/monorepo level package.json getting updated to the latest release.

A later step runs pnpm i (in the case of using pnpm), which installs the latest projen. The final step runs pnpm exec projen which:

  • Executes the new version of projen, resulting in changes introduced by the new version of projen
  • However, as projen runs, it eventually executes the MonorepoTsProject which forces reverting the projen version back to the one hard coded in projen-version.ts.
  • Because the projen version was reverted, the projen base classes used by MonorepoTsProject do not support new options for TypeScriptProject (or its super classes) needed to control/counter the side effects.

PDK version used

0.23.54 (possibly as early as 0.23.1)

What languages are you seeing this issue on?

Typescript

Environment details (OS name and version, etc.)

Ubuntu 22.04

memorsolutions avatar Oct 04 '24 15:10 memorsolutions