I think the best way is that you contribute to github.com/packageA/xxx and use the new version of github.com/packageA/xxx in your code. In this way, we lower the maintenance effort, for example, someday you may want to pick some features from A to B.
If this is not working, just use replace or modify the import code line manually. If you find it too boilerplate to do it, use some AI tools like vscode cline, it can do it very well!