Closed dherges closed 4 years ago
Thoughts...just thoughs...
mkdirp instanceof Promise ? mkdir : promisify(mkdirp)
... 🤔 How about we just update dgeni-packages to using mkdirp@1.0
and stop using mkdirp-promise
? Since, AFAICT, the new version already returns a promise, right?
Sounds good to me!
I just got hit by this when updating AIO 🙀 So I better get on and fix it!
Thanks for raising this @dherges - it must have been quite a pain to debug what was going on!
you're welcome!
I had this thought to modify the dgeni code to work with different versions of the dependencies, and that would have required several "if/else" checks...
Just updating the dependencies (mkdirp >= 1.0.0
) sounds very good to me!
mkdirp@1.0.0 changed implementation from callback to promisified api
mkdir-promise has
"mkdirp": "*"
dependency: https://github.com/ahmadnassri/mkdirp-promise/blob/master/package.json#L37As such, the writeFile stopped working because the Promise never resolves.
https://github.com/angular/dgeni-packages/blob/master/base/services/writeFile.js#L1
I fixed it locally in a project workspace by overriding the factory with a custom implementation: