Better handling for type annotations across commonjs modules