In 1987, Col. Chang Hsien-yi, an American spy in Taiwan, gave evidence to the CIA revealing that Taiwan was only a couple of years away from developing a nuclear device. America told Taiwan to end their secret weapons program and the country complied, preventing the PRC from finding out and growing antsy over the fact their greatest rival possessed a nuclear weapon.
Let's say, however, that the United States did not succeed in their investigation. Chang Hsien-yi either never becomes a spy or is not promoted high enough to know about the nuclear program. They never find out about Taiwan's secret program and the country develops nuclear capability in 1989. How would China and the United States react? Could this lead to war? How does Taiwan develop with their own nukes?
It all depends on how this becomes public knowledge, I think. If China finds out that Taiwan is developing nuclear weapons before the first sweapon is built, then I think China will attack. In 1989, I think it most likely that this results in a Chinese defeat, but the US had helped to defend Taiwan, ending "strategic ambiguity" . The US may well try to strong-arm Taiwan into giving up this capability, which did just help lead to war. If Taiwan gives up the weapons, then in effect, Taiwan just traded nuclear weapons for a less implicit US defense guarantee. I expect the US still won't formally ally with Taiwan, but any future Chinese leader considering attacking Taiwan again will have to rekon with the fact that the US has helped to defend Taiwan before. In terms of society and politics, I expect this to speed up democratization, and to accelerate the trend of publicly identifying proudly as Taiwanese. Probably a lot of people in Taiwan will blame their own government and military for helping spark the war (or at least not doing a better job hiding the program). Winning the war may embolden pan-Green politicians. They may think they can go farther in localization and the like, as China won't be as likely to attack having lost once before. On the other hand, even a victorious war is costly, so I expect you would also see increased numbers of people who want to avoid strongly antagonizing China again. Perhaps, then, you would see a split between the more cautious and and less cautious supporters of independence.
Outside of Taiwan, I expect neighboring countries to be somewhat less friendly than before, though. For example, anti-nuclear-weapons sentiment in Japan is quite high, so I expect the general public view of Taiwan in Japan will suffer.
I won't pretend to have any great knowledge of what China is like in this period, but 1989 will have turned out to be a rough year for China. Launching and then losing a "war to reunite the motherland" will not improve the average persons opinion of the ruling elite. If something like Tiananmen still happens, then perhaps we will see the government grow more repressive in terms of public expression, with more encouragement to say the right things about the government, not to merely avoid saying the wrong things. But I really don't know. I expect this would have a strong negative effect on Chinese economic growth. Taiwanese investment in and outsourcing to China had an outsized impact on Chinese growth in these early days, but I expect we'll see less of it in this TL. Even if neither government tries to restrain it, public sentiment on both sides will make it more difficult. American FDI will probably also be less than in OTL. This is just before the period in which China starts to transform it's Cold War mass army to a more modern force. I expect that trend to accelerate, although if China is generally poorer, it may be a slower process. I also expect even more attention will be paid to creating a modern Navy, or at least to may it very costly indeed for the US to sail too close to China. In this case, there is unfortunately a fairly high chance of another war decades down the road, when China thinks herself strong enough, assuming no drastic changes in the Chinese system of government or in Chinese public opinion.
On to the other scenario, then. Let's say that Taiwan pulls it off. One day in 1989, an old fishing trawler, safely evacuated, explodes in atomic fire in some desolate spot in the Pacific. The Taiwanese government then tells the world: "Yep, that was us, and we have
insert plausible delivery system here, too" .China, the US, and other nations demand that Taiwan decommission all her nuclear weapons, and Taiwan refuses. Ultimately, I think China will back down. They would "win" a nuclear exchange, provided no one else joins the party, but who wants that? In that case, I think Taiwan has plausibly ensured its continued independence into the indefinite future, but at a high price. Relations with China will be very bad, and the US will not be at all pleased, either. Taiwan won't be quite a piriah state, but I expect relations to be very strained for some time. In effect here, Taiwan has traded an implicit agreement that the US would help defend it if attacked by China for an independent guarantee, but poor relations with much of the world. The world will probably get over it in time, as it did with India and Pakistan, but I doubt you would ever see the US-Taiwan relationship return to prior levels of warmth.
Domestically, I think having these weapons will be controversial at home, though after angering much of the world by developing them, I don't see a safe way to live without them. I suppose a future Taiwanese administration could try to public give them up, and allow international inspectors to verify this, in return for an explicit security guarantee from the US. But that is only a fair trade if the Taiwanese public firmly believes in the US commitment, and also believes the US will continue to be stronger than China militarily into the indefinite future. And, of course, the US would have to agree. Giving up the weapons, particarily if it is framed as the new democratic government rectifying the mistakes of the autocratic, would likely earn Taiwan some good will abroad. It wouldn't please China, though.