azu / monorepo-utils

A collection of utilities for monorepo/lerna. Tools for TypeScript project references etc..
164 stars 10 forks source link

fix: improve check for changes #51

Closed felschr closed 2 years ago

felschr commented 2 years ago

In one of our projects we're formatting all package.json files with prettier as part of a pre-commit hook (and after running workspaces-to-typescript-project-references). This causes the change check of workspaces-to-typescript-project-references to fail because the strings it compares are different even though the JSON objects have the same contents.

As a side effect this causes tsc -b to take significantly longer when running after workspaces-to-typescript-project-references without any other code changes.

This change parses & re-stringifies the tsconfig file to make sure it has the same formatting as the new contents JSON string.

azu commented 2 years ago

Thanks!

https://github.com/azu/monorepo-utils/releases/tag/v2.6.3 is released 🎉

felschr commented 2 years ago

Wow, that was fast! Thank you so much 🥳