@expo/cli 0.19.14 → 0.20.0
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.
- package/build/bin/cli +1 -1
- package/build/src/export/createMetadataJson.js +14 -10
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +34 -94
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +3 -3
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/exportApp.js +32 -1
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportDomComponents.js +156 -0
- package/build/src/export/exportDomComponents.js.map +1 -0
- package/build/src/export/exportHermes.js +49 -1
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/install/installExpoPackage.js +15 -15
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +2 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +21 -5
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/utils/filePath.js +28 -0
- package/build/src/utils/filePath.js.map +1 -0
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/clients/RudderDetachedClient.js +13 -13
- package/build/src/utils/telemetry/clients/RudderDetachedClient.js.map +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +2 -2
- package/build/src/export/embed/guessHermes.js +0 -69
- package/build/src/export/embed/guessHermes.js.map +0 -1
|
@@ -47,19 +47,19 @@ class RudderDetachedClient {
|
|
|
47
47
|
})));
|
|
48
48
|
}
|
|
49
49
|
async flush() {
|
|
50
|
-
if (!this.records.length) {
|
|
51
|
-
return debug("No records to flush, skipping...");
|
|
52
|
-
}
|
|
53
|
-
const file = (0, _createTempPath.createTempFilePath)("expo-telemetry.json");
|
|
54
|
-
const data = JSON.stringify({
|
|
55
|
-
records: this.records
|
|
56
|
-
});
|
|
57
|
-
this.records = [];
|
|
58
|
-
await _nodeFs().default.promises.mkdir(_nodePath().default.dirname(file), {
|
|
59
|
-
recursive: true
|
|
60
|
-
});
|
|
61
|
-
await _nodeFs().default.promises.writeFile(file, data);
|
|
62
50
|
try {
|
|
51
|
+
if (!this.records.length) {
|
|
52
|
+
return debug("No records to flush, skipping...");
|
|
53
|
+
}
|
|
54
|
+
const file = (0, _createTempPath.createTempFilePath)("expo-telemetry.json");
|
|
55
|
+
const data = JSON.stringify({
|
|
56
|
+
records: this.records
|
|
57
|
+
});
|
|
58
|
+
this.records = [];
|
|
59
|
+
await _nodeFs().default.promises.mkdir(_nodePath().default.dirname(file), {
|
|
60
|
+
recursive: true
|
|
61
|
+
});
|
|
62
|
+
await _nodeFs().default.promises.writeFile(file, data);
|
|
63
63
|
const child = (0, _nodeChildProcess().spawn)(process.execPath, [
|
|
64
64
|
require.resolve("./flushRudderDetached"),
|
|
65
65
|
file
|
|
@@ -71,7 +71,7 @@ class RudderDetachedClient {
|
|
|
71
71
|
});
|
|
72
72
|
child.unref();
|
|
73
73
|
} catch (error) {
|
|
74
|
-
// This could fail if
|
|
74
|
+
// This could fail if any direct or indirect imports change during an upgrade to the `expo` dependency via `npx expo install --fix`,
|
|
75
75
|
// since this file may no longer be present after the upgrade, but before the process under the old Expo CLI version is terminated.
|
|
76
76
|
debug("Exception while initiating detached flush:", error);
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/utils/telemetry/clients/RudderDetachedClient.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { createTempFilePath } from '../../createTempPath';\nimport type { TelemetryClient, TelemetryClientStrategy, TelemetryRecordInternal } from '../types';\n\nconst debug = require('debug')('expo:telemetry:client:detached') as typeof console.log;\n\nexport class RudderDetachedClient implements TelemetryClient {\n /** This client should be used for short-lived commands */\n readonly strategy: TelemetryClientStrategy = 'detached';\n /** All recorded telemetry events */\n private records: TelemetryRecordInternal[] = [];\n\n abort() {\n return this.records;\n }\n\n record(record: TelemetryRecordInternal[]) {\n this.records.push(\n ...record.map((record) => ({\n ...record,\n originalTimestamp: record.sentAt,\n }))\n );\n }\n\n async flush() {\n if (!this.records.length) {\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/utils/telemetry/clients/RudderDetachedClient.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { createTempFilePath } from '../../createTempPath';\nimport type { TelemetryClient, TelemetryClientStrategy, TelemetryRecordInternal } from '../types';\n\nconst debug = require('debug')('expo:telemetry:client:detached') as typeof console.log;\n\nexport class RudderDetachedClient implements TelemetryClient {\n /** This client should be used for short-lived commands */\n readonly strategy: TelemetryClientStrategy = 'detached';\n /** All recorded telemetry events */\n private records: TelemetryRecordInternal[] = [];\n\n abort() {\n return this.records;\n }\n\n record(record: TelemetryRecordInternal[]) {\n this.records.push(\n ...record.map((record) => ({\n ...record,\n originalTimestamp: record.sentAt,\n }))\n );\n }\n\n async flush() {\n try {\n if (!this.records.length) {\n return debug('No records to flush, skipping...');\n }\n\n const file = createTempFilePath('expo-telemetry.json');\n const data = JSON.stringify({ records: this.records });\n\n this.records = [];\n\n await fs.promises.mkdir(path.dirname(file), { recursive: true });\n await fs.promises.writeFile(file, data);\n\n const child = spawn(process.execPath, [require.resolve('./flushRudderDetached'), file], {\n detached: true,\n windowsHide: true,\n shell: false,\n stdio: 'ignore',\n });\n\n child.unref();\n } catch (error) {\n // This could fail if any direct or indirect imports change during an upgrade to the `expo` dependency via `npx expo install --fix`,\n // since this file may no longer be present after the upgrade, but before the process under the old Expo CLI version is terminated.\n debug('Exception while initiating detached flush:', error);\n }\n\n debug('Detached flush started');\n }\n}\n"],"names":["RudderDetachedClient","debug","require","strategy","records","abort","record","push","map","originalTimestamp","sentAt","flush","length","file","createTempFilePath","data","JSON","stringify","fs","promises","mkdir","path","dirname","recursive","writeFile","child","spawn","process","execPath","resolve","detached","windowsHide","shell","stdio","unref","error"],"mappings":"AAAA;;;;+BASaA,sBAAoB;;aAApBA,oBAAoB;;;yBATX,oBAAoB;;;;;;;8DAC3B,SAAS;;;;;;;8DACP,WAAW;;;;;;gCAEO,sBAAsB;;;;;;AAGzD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,gCAAgC,CAAC,AAAsB,AAAC;AAEhF,MAAMF,oBAAoB;IAC/B,wDAAwD,GACxD,AAASG,QAAQ,GAA4B,UAAU,CAAC;IACxD,kCAAkC,GAClC,AAAQC,OAAO,GAA8B,EAAE,CAAC;IAEhDC,KAAK,GAAG;QACN,OAAO,IAAI,CAACD,OAAO,CAAC;IACtB;IAEAE,MAAM,CAACA,MAAiC,EAAE;QACxC,IAAI,CAACF,OAAO,CAACG,IAAI,IACZD,MAAM,CAACE,GAAG,CAAC,CAACF,MAAM,GAAK,CAAC;gBACzB,GAAGA,MAAM;gBACTG,iBAAiB,EAAEH,MAAM,CAACI,MAAM;aACjC,CAAC,CAAC,CACJ,CAAC;IACJ;UAEMC,KAAK,GAAG;QACZ,IAAI;YACF,IAAI,CAAC,IAAI,CAACP,OAAO,CAACQ,MAAM,EAAE;gBACxB,OAAOX,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACnD,CAAC;YAED,MAAMY,IAAI,GAAGC,IAAAA,eAAkB,mBAAA,EAAC,qBAAqB,CAAC,AAAC;YACvD,MAAMC,IAAI,GAAGC,IAAI,CAACC,SAAS,CAAC;gBAAEb,OAAO,EAAE,IAAI,CAACA,OAAO;aAAE,CAAC,AAAC;YAEvD,IAAI,CAACA,OAAO,GAAG,EAAE,CAAC;YAElB,MAAMc,OAAE,EAAA,QAAA,CAACC,QAAQ,CAACC,KAAK,CAACC,SAAI,EAAA,QAAA,CAACC,OAAO,CAACT,IAAI,CAAC,EAAE;gBAAEU,SAAS,EAAE,IAAI;aAAE,CAAC,CAAC;YACjE,MAAML,OAAE,EAAA,QAAA,CAACC,QAAQ,CAACK,SAAS,CAACX,IAAI,EAAEE,IAAI,CAAC,CAAC;YAExC,MAAMU,KAAK,GAAGC,IAAAA,iBAAK,EAAA,MAAA,EAACC,OAAO,CAACC,QAAQ,EAAE;gBAAC1B,OAAO,CAAC2B,OAAO,CAAC,uBAAuB,CAAC;gBAAEhB,IAAI;aAAC,EAAE;gBACtFiB,QAAQ,EAAE,IAAI;gBACdC,WAAW,EAAE,IAAI;gBACjBC,KAAK,EAAE,KAAK;gBACZC,KAAK,EAAE,QAAQ;aAChB,CAAC,AAAC;YAEHR,KAAK,CAACS,KAAK,EAAE,CAAC;QAChB,EAAE,OAAOC,KAAK,EAAE;YACd,oIAAoI;YACpI,mIAAmI;YACnIlC,KAAK,CAAC,4CAA4C,EAAEkC,KAAK,CAAC,CAAC;QAC7D,CAAC;QAEDlC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"tree-kill": "^1.2.2",
|
|
168
168
|
"tsd": "^0.28.1"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "a64603dce90981bf7688657f87dfa4be3e24f58b"
|
|
171
171
|
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
isAndroidUsingHermes: ()=>isAndroidUsingHermes,
|
|
13
|
-
isIosUsingHermes: ()=>isIosUsingHermes
|
|
14
|
-
});
|
|
15
|
-
function _fs() {
|
|
16
|
-
const data = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
17
|
-
_fs = function() {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
function _path() {
|
|
23
|
-
const data = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
24
|
-
_path = function() {
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
function _interopRequireDefault(obj) {
|
|
30
|
-
return obj && obj.__esModule ? obj : {
|
|
31
|
-
default: obj
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const ASSUME_HERMES_IS_USED_BY_DEFAULT = true;
|
|
35
|
-
function parseGradleProperties(content) {
|
|
36
|
-
const result = {};
|
|
37
|
-
for (let line of content.split("\n")){
|
|
38
|
-
line = line.trim();
|
|
39
|
-
if (!line || line.startsWith("#")) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
const sepIndex = line.indexOf("=");
|
|
43
|
-
const key = line.substr(0, sepIndex);
|
|
44
|
-
const value = line.substr(sepIndex + 1);
|
|
45
|
-
result[key] = value;
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
function isAndroidUsingHermes(projectRoot) {
|
|
50
|
-
// Check gradle.properties from prebuild template
|
|
51
|
-
const gradlePropertiesPath = _path().default.join(projectRoot, "android", "gradle.properties");
|
|
52
|
-
if (_fs().default.existsSync(gradlePropertiesPath)) {
|
|
53
|
-
const props = parseGradleProperties(_fs().default.readFileSync(gradlePropertiesPath, "utf8"));
|
|
54
|
-
return props["hermesEnabled"] === "true";
|
|
55
|
-
}
|
|
56
|
-
return ASSUME_HERMES_IS_USED_BY_DEFAULT;
|
|
57
|
-
}
|
|
58
|
-
function isIosUsingHermes(projectRoot) {
|
|
59
|
-
// Trying best to check ios native project if by chance to be consistent between app config
|
|
60
|
-
// Check ios/Podfile for ":hermes_enabled => true"
|
|
61
|
-
const podfilePath = _path().default.join(projectRoot, "ios", "Podfile");
|
|
62
|
-
if (_fs().default.existsSync(podfilePath)) {
|
|
63
|
-
const content = _fs().default.readFileSync(podfilePath, "utf8");
|
|
64
|
-
return content.search(/^\s*:hermes_enabled\s*=>\s*true,?\s+/m) >= 0;
|
|
65
|
-
}
|
|
66
|
-
return ASSUME_HERMES_IS_USED_BY_DEFAULT;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=guessHermes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/guessHermes.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nconst ASSUME_HERMES_IS_USED_BY_DEFAULT = true;\n\nfunction parseGradleProperties(content: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (let line of content.split('\\n')) {\n line = line.trim();\n if (!line || line.startsWith('#')) {\n continue;\n }\n\n const sepIndex = line.indexOf('=');\n const key = line.substr(0, sepIndex);\n const value = line.substr(sepIndex + 1);\n result[key] = value;\n }\n return result;\n}\n\nexport function isAndroidUsingHermes(projectRoot: string) {\n // Check gradle.properties from prebuild template\n const gradlePropertiesPath = path.join(projectRoot, 'android', 'gradle.properties');\n if (fs.existsSync(gradlePropertiesPath)) {\n const props = parseGradleProperties(fs.readFileSync(gradlePropertiesPath, 'utf8'));\n return props['hermesEnabled'] === 'true';\n }\n\n return ASSUME_HERMES_IS_USED_BY_DEFAULT;\n}\n\nexport function isIosUsingHermes(projectRoot: string) {\n // Trying best to check ios native project if by chance to be consistent between app config\n\n // Check ios/Podfile for \":hermes_enabled => true\"\n const podfilePath = path.join(projectRoot, 'ios', 'Podfile');\n if (fs.existsSync(podfilePath)) {\n const content = fs.readFileSync(podfilePath, 'utf8');\n return content.search(/^\\s*:hermes_enabled\\s*=>\\s*true,?\\s+/m) >= 0;\n }\n\n return ASSUME_HERMES_IS_USED_BY_DEFAULT;\n}\n"],"names":["isAndroidUsingHermes","isIosUsingHermes","ASSUME_HERMES_IS_USED_BY_DEFAULT","parseGradleProperties","content","result","line","split","trim","startsWith","sepIndex","indexOf","key","substr","value","projectRoot","gradlePropertiesPath","path","join","fs","existsSync","props","readFileSync","podfilePath","search"],"mappings":"AAAA;;;;;;;;;;;IAqBgBA,oBAAoB,MAApBA,oBAAoB;IAWpBC,gBAAgB,MAAhBA,gBAAgB;;;8DAhCjB,IAAI;;;;;;;8DACF,MAAM;;;;;;;;;;;AAEvB,MAAMC,gCAAgC,GAAG,IAAI,AAAC;AAE9C,SAASC,qBAAqB,CAACC,OAAe,EAA0B;IACtE,MAAMC,MAAM,GAA2B,EAAE,AAAC;IAC1C,KAAK,IAAIC,IAAI,IAAIF,OAAO,CAACG,KAAK,CAAC,IAAI,CAAC,CAAE;QACpCD,IAAI,GAAGA,IAAI,CAACE,IAAI,EAAE,CAAC;QACnB,IAAI,CAACF,IAAI,IAAIA,IAAI,CAACG,UAAU,CAAC,GAAG,CAAC,EAAE;YACjC,SAAS;QACX,CAAC;QAED,MAAMC,QAAQ,GAAGJ,IAAI,CAACK,OAAO,CAAC,GAAG,CAAC,AAAC;QACnC,MAAMC,GAAG,GAAGN,IAAI,CAACO,MAAM,CAAC,CAAC,EAAEH,QAAQ,CAAC,AAAC;QACrC,MAAMI,KAAK,GAAGR,IAAI,CAACO,MAAM,CAACH,QAAQ,GAAG,CAAC,CAAC,AAAC;QACxCL,MAAM,CAACO,GAAG,CAAC,GAAGE,KAAK,CAAC;IACtB,CAAC;IACD,OAAOT,MAAM,CAAC;AAChB,CAAC;AAEM,SAASL,oBAAoB,CAACe,WAAmB,EAAE;IACxD,iDAAiD;IACjD,MAAMC,oBAAoB,GAAGC,KAAI,EAAA,QAAA,CAACC,IAAI,CAACH,WAAW,EAAE,SAAS,EAAE,mBAAmB,CAAC,AAAC;IACpF,IAAII,GAAE,EAAA,QAAA,CAACC,UAAU,CAACJ,oBAAoB,CAAC,EAAE;QACvC,MAAMK,KAAK,GAAGlB,qBAAqB,CAACgB,GAAE,EAAA,QAAA,CAACG,YAAY,CAACN,oBAAoB,EAAE,MAAM,CAAC,CAAC,AAAC;QACnF,OAAOK,KAAK,CAAC,eAAe,CAAC,KAAK,MAAM,CAAC;IAC3C,CAAC;IAED,OAAOnB,gCAAgC,CAAC;AAC1C,CAAC;AAEM,SAASD,gBAAgB,CAACc,WAAmB,EAAE;IACpD,2FAA2F;IAE3F,kDAAkD;IAClD,MAAMQ,WAAW,GAAGN,KAAI,EAAA,QAAA,CAACC,IAAI,CAACH,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,AAAC;IAC7D,IAAII,GAAE,EAAA,QAAA,CAACC,UAAU,CAACG,WAAW,CAAC,EAAE;QAC9B,MAAMnB,OAAO,GAAGe,GAAE,EAAA,QAAA,CAACG,YAAY,CAACC,WAAW,EAAE,MAAM,CAAC,AAAC;QACrD,OAAOnB,OAAO,CAACoB,MAAM,yCAAyC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,OAAOtB,gCAAgC,CAAC;AAC1C,CAAC"}
|