Addresses the deprecation part of #689

### TODO
- [ ] Write some unit tests for current behavior
- [ ] Write unit tests for deprecation warning
- [ ] Emit deprecation warning if requiring non-Cordova modules (see #689)

### Things to consider
- It might be beneficial to `require` using module names instead of the current 
relative path juggling.
- I see no reason why this method should be allowed to be called with a 
`modulePath` that starts with `/`, `./` or `../`. Making this assumption should 
make the checks for allowed modules easier.
- Path should be normalized using `path.posix.normalize(modulePath)` after 
filtering out "real" paths in the step outlined above
- It would be great to give some useful hints with the deprecation message:
  - Which package used the method in a deprecated way. Maybe there is some nice 
existing package that analyzes the call stack to do that
  - When we actually drop support, we should tell the user how to work around 
the issue (`npm install <REQUIRED_PACKAGE>`)

[ Full content available at: https://github.com/apache/cordova-lib/pull/707 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to