Repository: facebook/react
Pull request: use-sync-external-store: Add `exports` field to `package.json`

Closes https://github.com/facebook/react/issues/24590
Closes https://github.com/facebook/react/pull/26230

## Summary

Adds `exports` fields for the following entrypoints:
```
import { useSyncExternalStore } from "use-sync-external-store";
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector";
import { useSyncExternalStore } from "use-sync-external-store/shim";
import { useSyncExternalStore } from "use-sync-external-store/shim/index.native";
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
import packageManifest from "use-sync-external-store/package.json" assert { type: "json" };

// "legacy" entrypoints
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector.js";
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
import { useSyncExternalStore } from "use-sync-external-store/shim/index.native.js";
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector.js";
```

There's an argument to be made that this should be a SemVer MAJOR e.g. `use-sync-external-store/cjs/*` no longer works. I wouldn't consider these part of the public interface though. If we make it SemVer major we can remove all the legacy entrypoints. Feels a bit too disruptive for this feature. With support for legacy entrypoints this should be non-breaking. So a SemVer MAJOR punishes the libraries using public entrypoints just to safeguard the ones using internals.

## How did you test this change?

- [x] CI
- [x] Testing all entrypoints https://github.com/eps1lon/react-pr-25231-uses-exports-field-test
    ```js
    import A from "use-sync-external-store";
    import B from "use-sync-external-store/with-selector";
    import legacy_B from "use-sync-external-store/with-selector.js";
    import C from "use-sync-external-store/shim";
    import legacy_C from "use-sync-external-store/shim/index.js";
    import D from "use-sync-external-store/shim/index.native";
    import legacy_D from "use-sync-external-store/shim/index.native.js";
    import E from "use-sync-external-store/shim/with-selector";
    import legacy_E from "use-sync-external-store/shim/with-selector.js";
    import F from "use-sync-external-store/package.json" assert { type: "json" };

    ```

Changed files:
filename: packages/use-sync-external-store/package.json
patch: @@ -2,6 +2,22 @@
   "name": "use-sync-external-store",
   "description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.",
   "version": "1.5.0",
+  "exports": {
+    ".": "./index.js",
+    "./with-selector": "./with-selector.js",
+    "./with-selector.js": "./with-selector.js",
+    "./shim": {
+      "react-native": "./shim/index.native.js",
+      "default": "./shim/index.js"
+    },
+    "./shim/index.js": "./shim/index.js",
+    "./shim/index.native": "./shim/index.native.js",
+    "./shim/index.native.js": "./shim/index.native.js",
+    "./shim/with-selector": "./shim/with-selector.js",
+    "./shim/with-selector.js": "./shim/with-selector.js",
+    "./package.json": "./package.json",
+    "./src/*": "./src/*.js"
+  },
   "repository": {
     "type": "git",
     "url": "https://github.com/facebook/react.git",