@expo/cli 0.19.13 → 0.19.14

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.
Files changed (28) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/api/graphql/client.js +0 -1
  3. package/build/src/api/graphql/client.js.map +1 -1
  4. package/build/src/api/graphql/queries/AppQuery.js +6 -17
  5. package/build/src/api/graphql/queries/AppQuery.js.map +1 -1
  6. package/build/src/api/graphql/queries/UserQuery.js +4 -9
  7. package/build/src/api/graphql/queries/UserQuery.js.map +1 -1
  8. package/build/src/api/graphql/types/App.js +4 -9
  9. package/build/src/api/graphql/types/App.js.map +1 -1
  10. package/build/src/api/user/user.js +7 -12
  11. package/build/src/api/user/user.js.map +1 -1
  12. package/build/src/export/embed/exportEmbedAsync.js +4 -1
  13. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  14. package/build/src/start/server/metro/instantiateMetro.js +2 -2
  15. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  16. package/build/src/start/server/type-generation/routes.js +20 -5
  17. package/build/src/start/server/type-generation/routes.js.map +1 -1
  18. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +3 -1
  19. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
  20. package/build/src/utils/codesigning.js +8 -8
  21. package/build/src/utils/codesigning.js.map +1 -1
  22. package/build/src/utils/exit.js +59 -2
  23. package/build/src/utils/exit.js.map +1 -1
  24. package/build/src/utils/ip.js +89 -1
  25. package/build/src/utils/ip.js.map +1 -1
  26. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  27. package/build/src/utils/telemetry/utils/context.js +1 -1
  28. package/package.json +5 -6
@@ -13,13 +13,101 @@ function _internalIp() {
13
13
  };
14
14
  return data;
15
15
  }
16
+ function _nodeChildProcess() {
17
+ const data = require("node:child_process");
18
+ _nodeChildProcess = function() {
19
+ return data;
20
+ };
21
+ return data;
22
+ }
23
+ function _nodeNet() {
24
+ const data = require("node:net");
25
+ _nodeNet = function() {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function _nodeOs() {
31
+ const data = require("node:os");
32
+ _nodeOs = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
16
37
  function _interopRequireDefault(obj) {
17
38
  return obj && obj.__esModule ? obj : {
18
39
  default: obj
19
40
  };
20
41
  }
42
+ /** Gets a route address by opening a UDP socket to a publicly routed address.
43
+ * @privateRemarks
44
+ * This is wrapped in `spawnSync` since the original `getIpAddress` utility exported
45
+ * in this module is used synchronosly. An appropriate timeout has been set and UDP
46
+ * ports don't send a message when opened.
47
+ * @throws if `spawnSync` fails
48
+ */ function getRouteAddress() {
49
+ const { error , status , stdout } = (0, _nodeChildProcess().spawnSync)(process.execPath, [
50
+ "-"
51
+ ], {
52
+ // This should be the cheapest method to determine the default route
53
+ // By opening a socket to a publicly routed IP address, we let the default
54
+ // gateway handle this socket, which means the socket's address will be
55
+ // the prioritised route for public IP addresses.
56
+ // It might fall back to `"0.0.0.0"` when no network connection is established
57
+ input: `
58
+ var socket = require('dgram').createSocket({ type: 'udp4', reuseAddr: true });
59
+ socket.unref();
60
+ socket.connect(53, '1.1.1.1', function() {
61
+ var address = socket.address();
62
+ socket.close();
63
+ if (address && 'address' in address) {
64
+ process.stdout.write(address.address);
65
+ process.exit(0);
66
+ } else {
67
+ process.exit(1);
68
+ }
69
+ });
70
+ `,
71
+ shell: false,
72
+ timeout: 500,
73
+ encoding: "utf8",
74
+ windowsVerbatimArguments: false,
75
+ windowsHide: true
76
+ });
77
+ // We only use the stdout as an IP, if it validates as an IP and we got a zero exit code
78
+ if (status || error) {
79
+ return null;
80
+ } else if (!status && typeof stdout === "string" && (0, _nodeNet().isIPv4)(stdout.trim())) {
81
+ return stdout.trim();
82
+ } else {
83
+ return null;
84
+ }
85
+ }
86
+ /** Determines the internal IP address by opening a socket, then checking the socket address against non-internal network interface assignments
87
+ * @throws If no address can be determined.
88
+ */ function getRouteIPAddress() {
89
+ // We check the IP address we get against the available network interfaces
90
+ // It's only an internal IP address if we have a matching address on an interface's IP assignment
91
+ let routeAddress = null;
92
+ try {
93
+ routeAddress = getRouteAddress();
94
+ } catch {}
95
+ if (!routeAddress) {
96
+ return null;
97
+ }
98
+ const ifaces = (0, _nodeOs().networkInterfaces)();
99
+ for(const iface in ifaces){
100
+ const assignments = ifaces[iface];
101
+ for(let i = 0; assignments && i < assignments.length; i++){
102
+ const assignment = assignments[i];
103
+ // Only use IPv4 assigments that aren't internal
104
+ if (assignment.family === "IPv4" && !assignment.internal && assignment.address === routeAddress) return routeAddress;
105
+ }
106
+ }
107
+ return null;
108
+ }
21
109
  function getIpAddress() {
22
- return _internalIp().default.v4.sync() || "127.0.0.1";
110
+ return _internalIp().default.v4.sync() || getRouteIPAddress() || "127.0.0.1";
23
111
  }
24
112
 
25
113
  //# sourceMappingURL=ip.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/ip.ts"],"sourcesContent":["import internalIp from 'internal-ip';\n\nexport function getIpAddress(): string {\n return internalIp.v4.sync() || '127.0.0.1';\n}\n"],"names":["getIpAddress","internalIp","v4","sync"],"mappings":"AAAA;;;;+BAEgBA,cAAY;;aAAZA,YAAY;;;8DAFL,aAAa;;;;;;;;;;;AAE7B,SAASA,YAAY,GAAW;IACrC,OAAOC,WAAU,EAAA,QAAA,CAACC,EAAE,CAACC,IAAI,EAAE,IAAI,WAAW,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"sources":["../../../src/utils/ip.ts"],"sourcesContent":["import internalIp from 'internal-ip';\nimport { spawnSync } from 'node:child_process';\nimport { isIPv4 } from 'node:net';\nimport { networkInterfaces } from 'node:os';\n\n/** Gets a route address by opening a UDP socket to a publicly routed address.\n * @privateRemarks\n * This is wrapped in `spawnSync` since the original `getIpAddress` utility exported\n * in this module is used synchronosly. An appropriate timeout has been set and UDP\n * ports don't send a message when opened.\n * @throws if `spawnSync` fails\n */\nfunction getRouteAddress(): string | null {\n const { error, status, stdout } = spawnSync(process.execPath, ['-'], {\n // This should be the cheapest method to determine the default route\n // By opening a socket to a publicly routed IP address, we let the default\n // gateway handle this socket, which means the socket's address will be\n // the prioritised route for public IP addresses.\n // It might fall back to `\"0.0.0.0\"` when no network connection is established\n input: `\n var socket = require('dgram').createSocket({ type: 'udp4', reuseAddr: true });\n socket.unref();\n socket.connect(53, '1.1.1.1', function() {\n var address = socket.address();\n socket.close();\n if (address && 'address' in address) {\n process.stdout.write(address.address);\n process.exit(0);\n } else {\n process.exit(1);\n }\n });\n `,\n shell: false,\n timeout: 500,\n encoding: 'utf8',\n windowsVerbatimArguments: false,\n windowsHide: true,\n });\n // We only use the stdout as an IP, if it validates as an IP and we got a zero exit code\n if (status || error) {\n return null;\n } else if (!status && typeof stdout === 'string' && isIPv4(stdout.trim())) {\n return stdout.trim();\n } else {\n return null;\n }\n}\n\n/** Determines the internal IP address by opening a socket, then checking the socket address against non-internal network interface assignments\n * @throws If no address can be determined.\n */\nfunction getRouteIPAddress(): string | null {\n // We check the IP address we get against the available network interfaces\n // It's only an internal IP address if we have a matching address on an interface's IP assignment\n let routeAddress: string | null = null;\n try {\n routeAddress = getRouteAddress();\n } catch {}\n if (!routeAddress) {\n return null;\n }\n const ifaces = networkInterfaces();\n for (const iface in ifaces) {\n const assignments = ifaces[iface];\n for (let i = 0; assignments && i < assignments.length; i++) {\n const assignment = assignments[i];\n // Only use IPv4 assigments that aren't internal\n if (\n assignment.family === 'IPv4' &&\n !assignment.internal &&\n assignment.address === routeAddress\n )\n return routeAddress;\n }\n }\n return null;\n}\n\nexport function getIpAddress(): string {\n return internalIp.v4.sync() || getRouteIPAddress() || '127.0.0.1';\n}\n"],"names":["getIpAddress","getRouteAddress","error","status","stdout","spawnSync","process","execPath","input","shell","timeout","encoding","windowsVerbatimArguments","windowsHide","isIPv4","trim","getRouteIPAddress","routeAddress","ifaces","networkInterfaces","iface","assignments","i","length","assignment","family","internal","address","internalIp","v4","sync"],"mappings":"AAAA;;;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IACnC,IAAK,MAAMC,KAAK,IAAIF,MAAM,CAAE;QAC1B,MAAMG,WAAW,GAAGH,MAAM,CAACE,KAAK,CAAC,AAAC;QAClC,IAAK,IAAIE,CAAC,GAAG,CAAC,EAAED,WAAW,IAAIC,CAAC,GAAGD,WAAW,CAACE,MAAM,EAAED,CAAC,EAAE,CAAE;YAC1D,MAAME,UAAU,GAAGH,WAAW,CAACC,CAAC,CAAC,AAAC;YAClC,gDAAgD;YAChD,IACEE,UAAU,CAACC,MAAM,KAAK,MAAM,IAC5B,CAACD,UAAU,CAACE,QAAQ,IACpBF,UAAU,CAACG,OAAO,KAAKV,YAAY,EAEnC,OAAOA,YAAY,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,SAASjB,YAAY,GAAW;IACrC,OAAO4B,WAAU,EAAA,QAAA,CAACC,EAAE,CAACC,IAAI,EAAE,IAAId,iBAAiB,EAAE,IAAI,WAAW,CAAC;AACpE,CAAC"}
@@ -31,7 +31,7 @@ class FetchClient {
31
31
  this.headers = {
32
32
  accept: "application/json",
33
33
  "content-type": "application/json",
34
- "user-agent": `expo-cli/${"0.19.13"}`,
34
+ "user-agent": `expo-cli/${"0.19.14"}`,
35
35
  authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
36
36
  };
37
37
  }
@@ -79,7 +79,7 @@ function createContext() {
79
79
  cpu: summarizeCpuInfo(),
80
80
  app: {
81
81
  name: "expo/cli",
82
- version: "0.19.13"
82
+ version: "0.19.14"
83
83
  },
84
84
  ci: _ciInfo().isCI ? {
85
85
  name: _ciInfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.19.13",
3
+ "version": "0.19.14",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/expo/expo/tree/main/packages/@expo/cli",
41
41
  "dependencies": {
42
+ "@0no-co/graphql.web": "^1.0.8",
42
43
  "@babel/runtime": "^7.20.0",
43
44
  "@expo/code-signing-certificates": "^0.0.5",
44
45
  "@expo/config": "~10.0.2",
@@ -56,8 +57,8 @@
56
57
  "@expo/spawn-async": "^1.7.2",
57
58
  "@expo/xcpretty": "^4.3.0",
58
59
  "@react-native/dev-middleware": "0.76.1",
59
- "@urql/core": "^2.3.6",
60
- "@urql/exchange-retry": "0.3.0",
60
+ "@urql/core": "^5.0.6",
61
+ "@urql/exchange-retry": "^1.3.0",
61
62
  "accepts": "^1.3.8",
62
63
  "arg": "^5.0.2",
63
64
  "better-opn": "~3.0.2",
@@ -76,8 +77,6 @@
76
77
  "fs-extra": "~8.1.0",
77
78
  "getenv": "^1.0.0",
78
79
  "glob": "^10.4.2",
79
- "graphql": "^15.8.0",
80
- "graphql-tag": "^2.10.1",
81
80
  "internal-ip": "^4.3.0",
82
81
  "is-docker": "^2.0.0",
83
82
  "is-wsl": "^2.1.1",
@@ -168,5 +167,5 @@
168
167
  "tree-kill": "^1.2.2",
169
168
  "tsd": "^0.28.1"
170
169
  },
171
- "gitHead": "8f821c2fa246a5206d25b00ca83fd4cfe639e784"
170
+ "gitHead": "d97ae0839fa465cee14e13ca38f3c6c84c124d82"
172
171
  }