fix: CJS companion namespace access for resource types at all depths (#2765)