react-cosmos-native 6.2.1-canary.4278ab2.0 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
- import * as ReactNative from 'react-native';
2
- const { NativeModules } = ReactNative;
1
+ import { TurboModuleRegistry } from 'react-native';
3
2
  export function getSocketUrl(playgroundUrl) {
4
3
  // The URL module isn't implemented fully in React Native and I don't want to
5
4
  // bring in another dependency just for this.
6
- const scriptURL = NativeModules.SourceCode.scriptURL;
5
+ const sourceCode = TurboModuleRegistry.getEnforcing('SourceCode');
6
+ const constants = sourceCode.getConstants?.();
7
+ const scriptURL = constants.scriptURL;
7
8
  // https://stackoverflow.com/a/27755/1332513
8
9
  const urlRegex = /^(.*:)\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/;
9
10
  const [, _protocol, host] = scriptURL.match(urlRegex) || [];
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "react-cosmos-native",
3
- "version": "6.2.1-canary.4278ab2.0+4278ab2",
3
+ "version": "6.2.2",
4
4
  "description": "React Cosmos Native",
5
5
  "repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-native",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "./dist/index.js",
9
9
  "dependencies": {
10
- "react-cosmos-core": "6.2.1-canary.4278ab2.0+4278ab2",
11
- "react-cosmos-renderer": "6.2.1-canary.4278ab2.0+4278ab2"
10
+ "react-cosmos-core": "^6.2.0",
11
+ "react-cosmos-renderer": "^6.2.0"
12
12
  },
13
- "gitHead": "4278ab2501658d27f6b61ad9f36bc5334d23fbc9"
13
+ "gitHead": "8026efa62623e9ecbdb299dc906bc79bd01f101a"
14
14
  }