Bartłomiej Rutkowski b6ffd462dd
perf: Cache package.json location between getNearestPackageJson invocations (#11580)
* perf: Cache package.json location between invocation

Cache package.json location to improve performance of migrations with a lot of files

Closes: #4136

* refactor: Use map. Move tests to appropriate files

Move tests and use Map instead of object as per review comments

* test: Check number of invocations in test

Change test to assert number of stat and readFile calls

* test: Change assert for CI

Added assertion to make both local and CI work

* Create package.json in test

* Create file only if not existed before

* test: Fix test assertion based on platform

* test: Change package.json type

* ci: Trigger tests

---------

Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app>
2025-08-18 21:16:55 +03:00
..