data
data copied to clipboard
`npx warp-drive retrofit types@canary` doesn't remove DT packages
Reproduction
- Create a new TS project on Stackblitz: https://stackblitz.com/fork/github/ember-cli/editor-output/tree/stackblitz-app-output-typescript?title=Ember%20TypeScript%20Starter
- Run the command there
Description
I just tried out the npx warp-drive retrofit types@canary as documented here and I noticed that the DT packages weren't actually being removed.
I did some debugging and it seems there are multiple problems:
- This line is incorrect.
DefinitelyTypedis an array of strings, so the array destructuring isn't needed there. https://github.com/emberjs/data/blob/16c9ad97a4a0fdff7d5b2688d0dd7f94540c93f1/packages/-warp-drive/src/-private/warp-drive/commands/retrofit.ts#L324 - It seems that the pkg.dependencies and pkg.devDependencies are being replaced with new (sorted) versions. This also means that the deps and devDeps references no longer point to the same object, so the deletes don't affect the version that is written back to disk afterwards.