@expo/build-tools 20.0.0 → 20.2.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.
Files changed (44) hide show
  1. package/dist/builders/android.js +6 -0
  2. package/dist/builders/custom.js +23 -0
  3. package/dist/builders/ios.js +6 -0
  4. package/dist/common/installDependencies.d.ts +10 -1
  5. package/dist/common/installDependencies.js +95 -1
  6. package/dist/common/prebuild.js +2 -3
  7. package/dist/{ios → common}/xcpretty.d.ts +1 -0
  8. package/dist/{ios → common}/xcpretty.js +18 -3
  9. package/dist/datadog.d.ts +8 -1
  10. package/dist/datadog.js +23 -13
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/ios/fastlane.js +1 -1
  14. package/dist/ios/pod.js +1 -1
  15. package/dist/runtimeSettings.d.ts +12 -0
  16. package/dist/runtimeSettings.js +120 -0
  17. package/dist/steps/easFunctions.js +1 -1
  18. package/dist/steps/functions/downloadBuild.d.ts +5 -3
  19. package/dist/steps/functions/downloadBuild.js +34 -4
  20. package/dist/steps/functions/findAndUploadBuildArtifacts.js +2 -2
  21. package/dist/steps/functions/installMaestro.js +13 -2
  22. package/dist/steps/functions/maestroResultParser.d.ts +18 -0
  23. package/dist/steps/functions/maestroResultParser.js +132 -3
  24. package/dist/steps/functions/maestroTests.js +26 -13
  25. package/dist/steps/functions/repack.d.ts +3 -1
  26. package/dist/steps/functions/repack.js +15 -1
  27. package/dist/steps/functions/reportMaestroTestResults.js +39 -20
  28. package/dist/steps/functions/restoreBuildCache.js +9 -6
  29. package/dist/steps/functions/startAgentDeviceRemoteSession.d.ts +1 -1
  30. package/dist/steps/functions/startAgentDeviceRemoteSession.js +101 -22
  31. package/dist/steps/functions/startArgentRemoteSession.js +1 -1
  32. package/dist/steps/functions/startIosSimulator.js +12 -0
  33. package/dist/steps/functions/startServeSimRemoteSession.js +1 -1
  34. package/dist/steps/functions/uploadArtifact.js +1 -1
  35. package/dist/steps/utils/ios/fastlane.js +1 -1
  36. package/dist/steps/utils/remoteDeviceRunSession.d.ts +29 -1
  37. package/dist/steps/utils/remoteDeviceRunSession.js +76 -2
  38. package/dist/utils/IosSimulatorUtils.d.ts +4 -0
  39. package/dist/utils/IosSimulatorUtils.js +5 -0
  40. package/dist/utils/expoUpdatesEmbedded.d.ts +3 -0
  41. package/dist/utils/expoUpdatesEmbedded.js +109 -0
  42. package/package.json +5 -5
  43. package/dist/steps/utils/ios/xcpretty.d.ts +0 -15
  44. package/dist/steps/utils/ios/xcpretty.js +0 -92
@@ -1,92 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.XcodeBuildLogger = void 0;
7
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
8
- const xcpretty_1 = require("@expo/xcpretty");
9
- const assert_1 = __importDefault(require("assert"));
10
- const fast_glob_1 = __importDefault(require("fast-glob"));
11
- const fs_extra_1 = __importDefault(require("fs-extra"));
12
- const path_1 = __importDefault(require("path"));
13
- const CHECK_FILE_INTERVAL_MS = 1000;
14
- class XcodeBuildLogger {
15
- logger;
16
- projectRoot;
17
- loggerError;
18
- flushing = false;
19
- logReaderPromise;
20
- logsPath;
21
- constructor(logger, projectRoot) {
22
- this.logger = logger;
23
- this.projectRoot = projectRoot;
24
- }
25
- async watchLogFiles(logsDirectory) {
26
- while (!this.flushing) {
27
- const logsFilename = await this.getBuildLogFilename(logsDirectory);
28
- if (logsFilename) {
29
- this.logsPath = path_1.default.join(logsDirectory, logsFilename);
30
- void this.startBuildLogger(this.logsPath);
31
- return;
32
- }
33
- await new Promise(res => setTimeout(res, CHECK_FILE_INTERVAL_MS));
34
- }
35
- }
36
- async flush() {
37
- this.flushing = true;
38
- if (this.loggerError) {
39
- throw this.loggerError;
40
- }
41
- if (this.logReaderPromise) {
42
- this.logReaderPromise.child.kill('SIGINT');
43
- try {
44
- await this.logReaderPromise;
45
- }
46
- catch { }
47
- }
48
- if (this.logsPath) {
49
- await this.findBundlerErrors(this.logsPath);
50
- }
51
- }
52
- async getBuildLogFilename(logsDirectory) {
53
- const paths = await (0, fast_glob_1.default)('*.log', { cwd: logsDirectory });
54
- return paths.length >= 1 ? paths[0] : undefined;
55
- }
56
- async startBuildLogger(logsPath) {
57
- try {
58
- const formatter = xcpretty_1.ExpoRunFormatter.create(this.projectRoot, {
59
- // TODO: Can provide xcode project name for better parsing
60
- isDebug: false,
61
- });
62
- this.logReaderPromise = (0, spawn_async_1.default)('tail', ['-n', '+0', '-f', logsPath], { stdio: 'pipe' });
63
- (0, assert_1.default)(this.logReaderPromise.child.stdout, 'stdout is not available');
64
- this.logReaderPromise.child.stdout.on('data', (data) => {
65
- const lines = formatter.pipe(data.toString());
66
- for (const line of lines) {
67
- this.logger.info(line);
68
- }
69
- });
70
- await this.logReaderPromise;
71
- this.logger.info(formatter.getBuildSummary());
72
- }
73
- catch (err) {
74
- if (!this.flushing) {
75
- this.loggerError = err;
76
- }
77
- }
78
- }
79
- async findBundlerErrors(logsPath) {
80
- try {
81
- const logFile = await fs_extra_1.default.readFile(logsPath, 'utf-8');
82
- const match = logFile.match(/Welcome to Metro!\s* Fast - Scalable - Integrated\s*([\s\S]*)Run CLI with --verbose flag for more details.\nCommand PhaseScriptExecution failed with a nonzero exit code/);
83
- if (match) {
84
- this.logger.info(match[1]);
85
- }
86
- }
87
- catch (err) {
88
- this.logger.error({ err }, 'Failed to read Xcode logs');
89
- }
90
- }
91
- }
92
- exports.XcodeBuildLogger = XcodeBuildLogger;