@expo/build-tools 0.1.184 → 0.1.185

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.
@@ -51,8 +51,8 @@ class XcodeBuildLogger {
51
51
  async startBuildLogger(logsPath) {
52
52
  try {
53
53
  const formatter = xcpretty_1.ExpoRunFormatter.create(this.projectRoot, {
54
- isDebug: false,
55
54
  // TODO: Can provide xcode project name for better parsing
55
+ isDebug: false,
56
56
  });
57
57
  this.logReaderPromise = (0, spawn_async_1.default)('tail', ['-n', '+0', '-f', logsPath], { stdio: 'pipe' });
58
58
  (0, assert_1.default)(this.logReaderPromise.child.stdout, 'stdout is not available');
@@ -1 +1 @@
1
- {"version":3,"file":"xcpretty.js","sourceRoot":"","sources":["../../src/ios/xcpretty.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,gDAAwB;AAExB,wDAA0B;AAE1B,6CAAkD;AAClD,oEAA0E;AAC1E,0DAA2B;AAE3B,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAa,gBAAgB;IAM3B,YAA6B,MAAc,EAAmB,WAAmB;QAApD,WAAM,GAAN,MAAM,CAAQ;QAAmB,gBAAW,GAAX,WAAW,CAAQ;QAJzE,aAAQ,GAAY,KAAK,CAAC;IAIkD,CAAC;IAE9E,KAAK,CAAC,aAAa,CAAC,aAAqB;QAC9C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;YACrB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;YACnE,IAAI,YAAY,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;gBACvD,KAAK,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1C,OAAO;aACR;YACD,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,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AAyB,CAAC,CAAC;YACtE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC7D,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;oBACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACxB;YACH,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,gBAAgB,CAAC;YAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC;SAC/C;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;aACxB;SACF;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAAgB;QAC9C,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CACzB,0KAA0K,CAC3K,CAAC;YACF,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5B;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,2BAA2B,CAAC,CAAC;SACzD;IACH,CAAC;CACF;AA7ED,4CA6EC","sourcesContent":["import assert from 'assert';\nimport path from 'path';\n\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\nimport { ExpoRunFormatter } from '@expo/xcpretty';\nimport spawnAsync, { SpawnPromise, SpawnResult } from '@expo/spawn-async';\nimport fg from 'fast-glob';\n\nconst CHECK_FILE_INTERVAL_MS = 1000;\n\nexport class XcodeBuildLogger {\n private loggerError?: Error;\n private flushing: boolean = false;\n private logReaderPromise?: SpawnPromise<SpawnResult>;\n private logsPath?: string;\n\n constructor(private readonly logger: bunyan, private readonly projectRoot: string) {}\n\n public async watchLogFiles(logsDirectory: string): Promise<void> {\n while (!this.flushing) {\n const logsFilename = await this.getBuildLogFilename(logsDirectory);\n if (logsFilename) {\n this.logsPath = path.join(logsDirectory, logsFilename);\n void this.startBuildLogger(this.logsPath);\n return;\n }\n await new Promise((res) => setTimeout(res, CHECK_FILE_INTERVAL_MS));\n }\n }\n\n public async flush(): Promise<void> {\n this.flushing = true;\n if (this.loggerError) {\n throw this.loggerError;\n }\n if (this.logReaderPromise) {\n this.logReaderPromise.child.kill('SIGINT');\n try {\n await this.logReaderPromise;\n } catch {}\n }\n if (this.logsPath) {\n await this.findBundlerErrors(this.logsPath);\n }\n }\n private async getBuildLogFilename(logsDirectory: string): Promise<string | undefined> {\n const paths = await fg('*.log', { cwd: logsDirectory });\n return paths.length >= 1 ? paths[0] : undefined;\n }\n\n private async startBuildLogger(logsPath: string): Promise<void> {\n try {\n const formatter = ExpoRunFormatter.create(this.projectRoot, {\n isDebug: false,\n // TODO: Can provide xcode project name for better parsing\n });\n this.logReaderPromise = spawnAsync('tail', ['-n', '+0', '-f', logsPath], { stdio: 'pipe' });\n assert(this.logReaderPromise.child.stdout, 'stdout is not available');\n this.logReaderPromise.child.stdout.on('data', (data: string) => {\n const lines = formatter.pipe(data.toString());\n for (const line of lines) {\n this.logger.info(line);\n }\n });\n await this.logReaderPromise;\n\n this.logger.info(formatter.getBuildSummary());\n } catch (err: any) {\n if (!this.flushing) {\n this.loggerError = err;\n }\n }\n }\n\n private async findBundlerErrors(logsPath: string): Promise<void> {\n try {\n const logFile = await fs.readFile(logsPath, 'utf-8');\n const match = logFile.match(\n /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/\n );\n if (match) {\n this.logger.info(match[1]);\n }\n } catch (err) {\n this.logger.error({ err }, 'Failed to read Xcode logs');\n }\n }\n}\n"]}
1
+ {"version":3,"file":"xcpretty.js","sourceRoot":"","sources":["../../src/ios/xcpretty.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,gDAAwB;AAExB,wDAA0B;AAE1B,6CAAkD;AAClD,oEAA0E;AAC1E,0DAA2B;AAE3B,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAa,gBAAgB;IAM3B,YAA6B,MAAc,EAAmB,WAAmB;QAApD,WAAM,GAAN,MAAM,CAAQ;QAAmB,gBAAW,GAAX,WAAW,CAAQ;QAJzE,aAAQ,GAAY,KAAK,CAAC;IAIkD,CAAC;IAE9E,KAAK,CAAC,aAAa,CAAC,aAAqB;QAC9C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;YACrB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;YACnE,IAAI,YAAY,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;gBACvD,KAAK,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1C,OAAO;aACR;YACD,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC,CAAC;SACrE;IACH,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,IAAI,CAAC,WAAW,CAAC;SACxB;QACD,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,CAAC,gBAAgB,CAAC,KA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,IAAI,CAAC,IAAI,CAAC,CAAC;iBACxB;YACH,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,gBAAgB,CAAC;YAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC;SAC/C;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;aACxB;SACF;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAAgB;QAC9C,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CACzB,0KAA0K,CAC3K,CAAC;YACF,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5B;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,2BAA2B,CAAC,CAAC;SACzD;IACH,CAAC;CACF;AA7ED,4CA6EC","sourcesContent":["import assert from 'assert';\nimport path from 'path';\n\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\nimport { ExpoRunFormatter } from '@expo/xcpretty';\nimport spawnAsync, { SpawnPromise, SpawnResult } from '@expo/spawn-async';\nimport fg from 'fast-glob';\n\nconst CHECK_FILE_INTERVAL_MS = 1000;\n\nexport class XcodeBuildLogger {\n private loggerError?: Error;\n private flushing: boolean = false;\n private logReaderPromise?: SpawnPromise<SpawnResult>;\n private logsPath?: string;\n\n constructor(private readonly logger: bunyan, private readonly projectRoot: string) {}\n\n public async watchLogFiles(logsDirectory: string): Promise<void> {\n while (!this.flushing) {\n const logsFilename = await this.getBuildLogFilename(logsDirectory);\n if (logsFilename) {\n this.logsPath = path.join(logsDirectory, logsFilename);\n void this.startBuildLogger(this.logsPath);\n return;\n }\n await new Promise((res) => setTimeout(res, CHECK_FILE_INTERVAL_MS));\n }\n }\n\n public async flush(): Promise<void> {\n this.flushing = true;\n if (this.loggerError) {\n throw this.loggerError;\n }\n if (this.logReaderPromise) {\n this.logReaderPromise.child.kill('SIGINT');\n try {\n await this.logReaderPromise;\n } catch {}\n }\n if (this.logsPath) {\n await this.findBundlerErrors(this.logsPath);\n }\n }\n private async getBuildLogFilename(logsDirectory: string): Promise<string | undefined> {\n const paths = await fg('*.log', { cwd: logsDirectory });\n return paths.length >= 1 ? paths[0] : undefined;\n }\n\n private async startBuildLogger(logsPath: string): Promise<void> {\n try {\n const formatter = ExpoRunFormatter.create(this.projectRoot, {\n // TODO: Can provide xcode project name for better parsing\n isDebug: false,\n });\n this.logReaderPromise = spawnAsync('tail', ['-n', '+0', '-f', logsPath], { stdio: 'pipe' });\n assert(this.logReaderPromise.child.stdout, 'stdout is not available');\n this.logReaderPromise.child.stdout.on('data', (data: string) => {\n const lines = formatter.pipe(data.toString());\n for (const line of lines) {\n this.logger.info(line);\n }\n });\n await this.logReaderPromise;\n\n this.logger.info(formatter.getBuildSummary());\n } catch (err: any) {\n if (!this.flushing) {\n this.loggerError = err;\n }\n }\n }\n\n private async findBundlerErrors(logsPath: string): Promise<void> {\n try {\n const logFile = await fs.readFile(logsPath, 'utf-8');\n const match = logFile.match(\n /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/\n );\n if (match) {\n this.logger.info(match[1]);\n }\n } catch (err) {\n this.logger.error({ err }, 'Failed to read Xcode logs');\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "0.1.184",
3
+ "version": "0.1.185",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [