Client should ask, but ideally this will be written into the contract beforehand. I don't mind sharing source code but not for re-use in other projects.
Yeah this is no different than receiving a binary rather than the source, bundled code is close enough for this comparison (though it would be probably easier to unbundle code rather than decompile a binary, it’s still a fair amount of work)