Snark first: weapons[1] to defeat rockets and free-falling bombs have been operational for quite a while now. Next gen (laser) is being made operational; both shipboard versions and air versions for the CAP. Next next gen (railgun) is on the horizon, but still uncertain.
Serious reply: a carrier is a highly mobile, flexible airport. Like any other major fleet element, it's a threat in being, and best used that way. Might even be best used by always being held beyond radar horizon, to keep the opposing forces spread thin and deployed overtime, preventing any transports from resupplying the enemy troops deployed to Taiwan.
A carrier is also by its nature an anchor point for a whole battle group, with flexible capabilities of long range detection, jamming, attack, and defense, including major ASW threat. It can also make a 300 mile dash at 30kn to deliver several dozen F35 to an island. An overnight miracle.
[1] anti-rockets and CIWS