@expo/xcpretty
Advanced tools
Comparing version 4.3.1 to 4.3.2
@@ -10,3 +10,3 @@ #!/usr/bin/env node | ||
const projectRoot = path_1.default.resolve(process.argv[2] || '.'); | ||
Runner_1.formatXcodeBuildPipeProcessAsync(projectRoot); | ||
(0, Runner_1.formatXcodeBuildPipeProcessAsync)(projectRoot); | ||
//# sourceMappingURL=cli.js.map |
import { CopyFileProps, FileOperation, Formatter } from './Formatter'; | ||
import { MetroParser } from './MetroParser'; | ||
export declare type ExpoRunFormatterProps = { | ||
export type ExpoRunFormatterProps = { | ||
projectRoot: string; | ||
@@ -5,0 +5,0 @@ podfile?: Record<string, Record<string, string>>; |
@@ -19,18 +19,2 @@ "use strict"; | ||
class ExpoRunFormatter extends Formatter_1.Formatter { | ||
constructor(props) { | ||
var _a; | ||
super(props); | ||
this.props = props; | ||
let podfile = {}; | ||
const podfileLock = path_1.default.join(props.projectRoot, 'ios', 'Podfile.lock'); | ||
try { | ||
const podfileContents = fs_1.default.readFileSync(podfileLock, 'utf8'); | ||
podfile = (_a = parsePodfileLock_1.parsePodfileLock(podfileContents)) !== null && _a !== void 0 ? _a : {}; | ||
} | ||
catch { } | ||
this.podfileTracer = new PodfileTracer_1.PodfileTracer({ | ||
...props, | ||
podfile, | ||
}); | ||
} | ||
static create(projectRoot, { xcodeProject, isDebug, } = {}) { | ||
@@ -53,2 +37,18 @@ var _a; | ||
} | ||
constructor(props) { | ||
var _a; | ||
super(props); | ||
this.props = props; | ||
let podfile = {}; | ||
const podfileLock = path_1.default.join(props.projectRoot, 'ios', 'Podfile.lock'); | ||
try { | ||
const podfileContents = fs_1.default.readFileSync(podfileLock, 'utf8'); | ||
podfile = (_a = (0, parsePodfileLock_1.parsePodfileLock)(podfileContents)) !== null && _a !== void 0 ? _a : {}; | ||
} | ||
catch { } | ||
this.podfileTracer = new PodfileTracer_1.PodfileTracer({ | ||
...props, | ||
podfile, | ||
}); | ||
} | ||
formatMetroAssetCollectionError(errorContents) { | ||
@@ -55,0 +55,0 @@ const results = `\n${chalk_1.default.red(symbols_1.ERROR + |
@@ -7,3 +7,3 @@ import { Failure, Parser } from './Parser'; | ||
declare function getAppRoot(filePath: string): string; | ||
export declare type FileOperation = { | ||
export type FileOperation = { | ||
type: 'Analyze' | 'GenerateDSYMFile' | 'Ld' | 'Libtool' | 'ProcessPCH' | 'ProcessInfoPlistFile' | 'CodeSign' | 'Touch' | 'CompileC' | 'CompileSwift' | 'CompileXIB' | 'CompileStoryboard'; | ||
@@ -17,3 +17,3 @@ filePath: string; | ||
}; | ||
export declare type ConfigurationOperation = { | ||
export type ConfigurationOperation = { | ||
type: 'Analyze' | 'Aggregate' | 'Build' | 'Clean'; | ||
@@ -24,3 +24,3 @@ configuration: string; | ||
}; | ||
export declare type CopyFileProps = { | ||
export type CopyFileProps = { | ||
type: 'CpResource' | 'CopyStringsFile' | 'CopyPlistFile' | 'CpHeader'; | ||
@@ -27,0 +27,0 @@ from: string; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -106,7 +110,2 @@ if (k2 === undefined) k2 = k; | ||
class Formatter { | ||
constructor(props) { | ||
this.props = props; | ||
this.errors = []; | ||
this.warnings = []; | ||
} | ||
get parser() { | ||
@@ -119,2 +118,7 @@ if (this._parser) { | ||
} | ||
constructor(props) { | ||
this.props = props; | ||
this.errors = []; | ||
this.warnings = []; | ||
} | ||
pipe(data) { | ||
@@ -262,3 +266,3 @@ const lines = []; | ||
// Create the message. | ||
const results = chalk_1.default `${symbol} ${platform} ${reason.trim()}\n {gray └─${relativeAppFile}}`; | ||
const results = (0, chalk_1.default) `${symbol} ${platform} ${reason.trim()}\n {gray └─${relativeAppFile}}`; | ||
// Ensure we track the message | ||
@@ -326,3 +330,3 @@ if (type === 'warning') { | ||
formatError(message) { | ||
const results = switchRegex_1.switchRegex(message, [ | ||
const results = (0, switchRegex_1.switchRegex)(message, [ | ||
[ | ||
@@ -356,5 +360,5 @@ Matchers_1.Matchers.Errors.UNSUPPORTED_ENTITLEMENT_MATCHER, | ||
if (entitlementType === 'capability') { | ||
return chalk_1.default `${symbols_1.ERROR} ${platform} Provisioning Profile ${profileName} does not support the {red ${entitlementName}} capability.`; | ||
return (0, chalk_1.default) `${symbols_1.ERROR} ${platform} Provisioning Profile ${profileName} does not support the {red ${entitlementName}} capability.`; | ||
} | ||
return chalk_1.default `${symbols_1.ERROR} ${platform} Entitlements file defines the value {red "${entitlementName}"} which is not registered for profile ${profileName}.`; | ||
return (0, chalk_1.default) `${symbols_1.ERROR} ${platform} Entitlements file defines the value {red "${entitlementName}"} which is not registered for profile ${profileName}.`; | ||
} | ||
@@ -367,3 +371,3 @@ formatFileMissingError(reason, filePath) { | ||
formatLdWarning(reason) { | ||
const results = switchRegex_1.switchRegex(reason, [ | ||
const results = (0, switchRegex_1.switchRegex)(reason, [ | ||
[ | ||
@@ -539,3 +543,3 @@ Matchers_1.Matchers.Warnings.LINKER_METHOD_OVERRIDE, | ||
formatWarning(message) { | ||
const results = switchRegex_1.switchRegex(message, [ | ||
const results = (0, switchRegex_1.switchRegex)(message, [ | ||
[ | ||
@@ -801,3 +805,3 @@ Matchers_1.Matchers.Warnings.MISSING_ARCHITECTURE, | ||
const location = { start: { line, column } }; | ||
const framed = code_frame_1.codeFrameColumns(raw, location, { | ||
const framed = (0, code_frame_1.codeFrameColumns)(raw, location, { | ||
// TODO: Support iOS languages: C++, Objc, swift, Ruby, Bash | ||
@@ -804,0 +808,0 @@ // Maybe something like prism but for terminals? |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -355,3 +355,2 @@ export declare const Matchers: { | ||
COMPILE_ERROR_MATCHER: RegExp; | ||
COMPILE_ERROR_INLINE_MATCHER: RegExp; | ||
/** | ||
@@ -358,0 +357,0 @@ * @regex Captured groups |
@@ -358,3 +358,2 @@ "use strict"; | ||
COMPILE_ERROR_MATCHER: /^(\/.+\/(.*):.*:.*):\s(?:fatal\s)?error:\s(.+?(?=\(in)?)(?:\(in target '([^']*)' from project '([^']*)'\))?$/m, | ||
COMPILE_ERROR_INLINE_MATCHER: /^(\/.+\/(.*):.*:.*):\s(?:fatal\s)?error:\s(.+?(?=\(in)?)(?:\(in target '([^']*)' from project '([^']*)'\))$/m, | ||
/** | ||
@@ -364,3 +363,3 @@ * @regex Captured groups | ||
*/ | ||
CURSOR_MATCHER: /^([\s~]*\^[\s~]*)$/m, | ||
CURSOR_MATCHER: /^(?:\s+\|)?([\s~]*\^[\s~]*)$/m, | ||
/** | ||
@@ -367,0 +366,0 @@ * @regex Captured groups |
@@ -25,3 +25,3 @@ "use strict"; | ||
// In expo-updates, we wrap the bundler script and add regex around the error message so we can present it nicely to the user. | ||
return switchRegex_1.switchRegex(text, [ | ||
return (0, switchRegex_1.switchRegex)(text, [ | ||
[ | ||
@@ -28,0 +28,0 @@ /@build-script-error-begin/m, |
import { Formatter } from './Formatter'; | ||
export declare type Failure = { | ||
export type Failure = { | ||
filePath: string; | ||
@@ -4,0 +4,0 @@ testCase: string; |
@@ -43,3 +43,3 @@ "use strict"; | ||
const { formatter } = this; | ||
return switchRegex_1.switchRegex(text, [ | ||
return (0, switchRegex_1.switchRegex)(text, [ | ||
[ | ||
@@ -302,3 +302,3 @@ Matchers_1.Matchers.ANALYZE_MATCHER, | ||
// file name is undefined in newer projects | ||
fileName: $2 || path_1.basename($1 || ''), | ||
fileName: $2 || (0, path_1.basename)($1 || ''), | ||
target: $3, | ||
@@ -332,3 +332,3 @@ project: $4, | ||
updateTestState(text) { | ||
return switchRegex_1.switchRegex(text, [ | ||
return (0, switchRegex_1.switchRegex)(text, [ | ||
[ | ||
@@ -385,3 +385,3 @@ Matchers_1.Matchers.TEST_SUITE_STARTED_MATCHER, | ||
}; | ||
const results = switchRegex_1.switchRegex(text, [ | ||
const results = (0, switchRegex_1.switchRegex)(text, [ | ||
[ | ||
@@ -421,4 +421,8 @@ Matchers_1.Matchers.Errors.COMPILE_ERROR_MATCHER, | ||
() => { | ||
var _a, _b; | ||
if (this.formattingError || this.formattingWarning) { | ||
this.currentIssue.line = text; | ||
// Framework compile errors can have formatting like babel now: | ||
// ' 305 | std::__construct_at(__p, std::forward<_Args>(__args)...);' | ||
// So we need to strip the prefix (' 305 |') portion. | ||
this.currentIssue.line = (_b = (_a = text.match(/^(?:[\s]+\d+ \|\s)?(.*)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : text; | ||
} | ||
@@ -443,3 +447,3 @@ return 'unmatched'; | ||
}; | ||
switchRegex_1.switchRegex(text, [ | ||
(0, switchRegex_1.switchRegex)(text, [ | ||
[Matchers_1.Matchers.Errors.LINKER_UNDEFINED_SYMBOLS_MATCHER, handleLinkerFail], | ||
@@ -451,3 +455,3 @@ [Matchers_1.Matchers.Errors.LINKER_DUPLICATE_SYMBOLS_MATCHER, handleLinkerFail], | ||
} | ||
const results = switchRegex_1.switchRegex(text, [ | ||
const results = (0, switchRegex_1.switchRegex)(text, [ | ||
[ | ||
@@ -454,0 +458,0 @@ Matchers_1.Matchers.Errors.SYMBOL_REFERENCED_FROM_MATCHER, |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export declare function formatXcodeBuildPipeProcessAsync(projectRoot: string, { xcodeProjectName }?: { | ||
@@ -3,0 +2,0 @@ xcodeProjectName?: string; |
@@ -6,3 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getErrorLogFilePath = exports.writeBuildLogs = exports.createXcodeBuildHooks = exports.formatXcodeBuildPipeProcessAsync = void 0; | ||
exports.formatXcodeBuildPipeProcessAsync = formatXcodeBuildPipeProcessAsync; | ||
exports.createXcodeBuildHooks = createXcodeBuildHooks; | ||
exports.writeBuildLogs = writeBuildLogs; | ||
exports.getErrorLogFilePath = getErrorLogFilePath; | ||
const chalk_1 = __importDefault(require("chalk")); | ||
@@ -22,3 +25,2 @@ const fs_1 = __importDefault(require("fs")); | ||
} | ||
exports.formatXcodeBuildPipeProcessAsync = formatXcodeBuildPipeProcessAsync; | ||
function createXcodeBuildHooks(projectRoot, { xcodeProjectName, resolve, reject, }) { | ||
@@ -86,3 +88,2 @@ const formatter = ExpoRunFormatter_1.ExpoRunFormatter.create(projectRoot, { | ||
} | ||
exports.createXcodeBuildHooks = createXcodeBuildHooks; | ||
function writeBuildLogs(projectRoot, buildOutput, errorOutput) { | ||
@@ -94,3 +95,2 @@ const [logFilePath, errorFilePath] = getErrorLogFilePath(projectRoot); | ||
} | ||
exports.writeBuildLogs = writeBuildLogs; | ||
function getErrorLogFilePath(projectRoot) { | ||
@@ -101,3 +101,2 @@ const folder = path_1.default.join(projectRoot, '.expo'); | ||
} | ||
exports.getErrorLogFilePath = getErrorLogFilePath; | ||
function isTruthy(value) { | ||
@@ -104,0 +103,0 @@ const str = String(value).toLowerCase(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.switchRegex = void 0; | ||
exports.switchRegex = switchRegex; | ||
function switchRegex(text, cases, isAll = false) { | ||
@@ -19,3 +19,2 @@ for (const [reg, callback] of cases) { | ||
} | ||
exports.switchRegex = switchRegex; | ||
//# sourceMappingURL=switchRegex.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFirstExternalSourceForPod = exports.getDependentPods = void 0; | ||
exports.getDependentPods = getDependentPods; | ||
exports.getFirstExternalSourceForPod = getFirstExternalSourceForPod; | ||
function getDependentPods(podfileLock, { name, version }) { | ||
@@ -26,3 +27,2 @@ if (!podfileLock.pods) { | ||
} | ||
exports.getDependentPods = getDependentPods; | ||
/** | ||
@@ -66,3 +66,2 @@ * Find the first "external source" (local file path reference) for a given pod. | ||
} | ||
exports.getFirstExternalSourceForPod = getFirstExternalSourceForPod; | ||
//# sourceMappingURL=getFirstExternalSourceForPod.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getNodeModuleName = void 0; | ||
exports.getNodeModuleName = getNodeModuleName; | ||
function moduleNameFromPath(modulePath) { | ||
@@ -26,3 +26,2 @@ if (modulePath.startsWith('@')) { | ||
} | ||
exports.getNodeModuleName = getNodeModuleName; | ||
//# sourceMappingURL=getNodeModuleName.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPackageJsonForPath = void 0; | ||
exports.getPackageJsonForPath = getPackageJsonForPath; | ||
const find_up_1 = __importDefault(require("find-up")); | ||
@@ -16,3 +16,2 @@ function getPackageJsonForPath(filePath) { | ||
} | ||
exports.getPackageJsonForPath = getPackageJsonForPath; | ||
//# sourceMappingURL=getPackageJsonForPath.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFilePathForExternalSource = exports.parsePodfileLock = exports.parsePodDependency = exports.loadPodfileLock = void 0; | ||
exports.parsePodDependency = void 0; | ||
exports.loadPodfileLock = loadPodfileLock; | ||
exports.parsePodfileLock = parsePodfileLock; | ||
exports.getFilePathForExternalSource = getFilePathForExternalSource; | ||
const js_yaml_1 = require("js-yaml"); | ||
@@ -13,3 +16,3 @@ const EXTERNAL_SOURCES_KEY = 'EXTERNAL SOURCES'; | ||
function loadPodfileLock(str) { | ||
const contents = js_yaml_1.load(str); | ||
const contents = (0, js_yaml_1.load)(str); | ||
if (!contents || typeof contents !== 'object') { | ||
@@ -20,4 +23,3 @@ return null; | ||
} | ||
exports.loadPodfileLock = loadPodfileLock; | ||
exports.parsePodDependency = (pod) => { | ||
const parsePodDependency = (pod) => { | ||
if (typeof pod === 'string') { | ||
@@ -28,3 +30,3 @@ // js-yaml fails to parse an array with a single item and instead formats it as a string divided by a `-` (hyphen). | ||
if (singleItemArrayBug === null || singleItemArrayBug === void 0 ? void 0 : singleItemArrayBug[2]) { | ||
return exports.parsePodDependency({ [singleItemArrayBug[1]]: singleItemArrayBug[2] }); | ||
return (0, exports.parsePodDependency)({ [singleItemArrayBug[1]]: singleItemArrayBug[2] }); | ||
} | ||
@@ -38,3 +40,3 @@ return [splitPodNameVersion(pod)]; | ||
...results, | ||
dependencies: v.map(x => exports.parsePodDependency(x)).flat(), | ||
dependencies: v.map(x => (0, exports.parsePodDependency)(x)).flat(), | ||
}; | ||
@@ -45,3 +47,3 @@ } | ||
...results, | ||
dependencies: exports.parsePodDependency(v), | ||
dependencies: (0, exports.parsePodDependency)(v), | ||
}; | ||
@@ -52,2 +54,3 @@ } | ||
}; | ||
exports.parsePodDependency = parsePodDependency; | ||
function parsePodfileLock(fileContent) { | ||
@@ -71,3 +74,2 @@ var _a; | ||
} | ||
exports.parsePodfileLock = parsePodfileLock; | ||
function splitPodNameVersion(pod) { | ||
@@ -89,3 +91,2 @@ var _a; | ||
} | ||
exports.getFilePathForExternalSource = getFilePathForExternalSource; | ||
//# sourceMappingURL=parsePodfileLock.js.map |
@@ -17,9 +17,2 @@ "use strict"; | ||
class PodfileTracer { | ||
constructor(props) { | ||
this.props = props; | ||
// Wrap the expensive method in a cache | ||
this.getNodeModuleNameForTarget = memoize(this.getNodeModuleNameForTargetWithoutCache.bind(this)); | ||
this.getExternalSourceForPod = memoize(this.getExternalSourceForPodWithoutCache.bind(this)); | ||
this.memoizedGetPackageJsonAnyFilePathInModule = memoizeTrigger(this.getPackageJsonAnyFilePathInModuleWithoutCache.bind(this)); | ||
} | ||
static create(projectRoot, { xcodeProject } = {}) { | ||
@@ -33,3 +26,3 @@ var _a, _b; | ||
rootTargetName, | ||
podfile: (_b = parsePodfileLock_1.parsePodfileLock(podfileContents)) !== null && _b !== void 0 ? _b : {}, | ||
podfile: (_b = (0, parsePodfileLock_1.parsePodfileLock)(podfileContents)) !== null && _b !== void 0 ? _b : {}, | ||
}); | ||
@@ -41,2 +34,9 @@ return formatter; | ||
} | ||
constructor(props) { | ||
this.props = props; | ||
// Wrap the expensive method in a cache | ||
this.getNodeModuleNameForTarget = memoize(this.getNodeModuleNameForTargetWithoutCache.bind(this)); | ||
this.getExternalSourceForPod = memoize(this.getExternalSourceForPodWithoutCache.bind(this)); | ||
this.memoizedGetPackageJsonAnyFilePathInModule = memoizeTrigger(this.getPackageJsonAnyFilePathInModuleWithoutCache.bind(this)); | ||
} | ||
getNodeModuleNameForTargetWithoutCache(target) { | ||
@@ -86,3 +86,3 @@ if (!target) { | ||
getNodeModuleName(filePath, target) { | ||
const moduleName = getNodeModuleName_1.getNodeModuleName(filePath); | ||
const moduleName = (0, getNodeModuleName_1.getNodeModuleName)(filePath); | ||
if (moduleName) { | ||
@@ -101,3 +101,3 @@ return { name: moduleName, isRootTarget: false }; | ||
} | ||
const results = getFirstExternalSourceForPod_1.getFirstExternalSourceForPod(this.podfile, { name: pod }); | ||
const results = (0, getFirstExternalSourceForPod_1.getFirstExternalSourceForPod)(this.podfile, { name: pod }); | ||
// Keep tracing until we get to a development pod with a local file reference. | ||
@@ -128,3 +128,3 @@ const filePath = (_b = (_a = results === null || results === void 0 ? void 0 : results.source[':podspec']) !== null && _a !== void 0 ? _a : results === null || results === void 0 ? void 0 : results.source[':path']) !== null && _b !== void 0 ? _b : null; | ||
catch { | ||
return getPackageJsonForPath_1.getPackageJsonForPath(path_1.default.join(nativeProjectRoot, filePath)); | ||
return (0, getPackageJsonForPath_1.getPackageJsonForPath)(path_1.default.join(nativeProjectRoot, filePath)); | ||
} | ||
@@ -131,0 +131,0 @@ } |
{ | ||
"name": "@expo/xcpretty", | ||
"description": "Parse and format xcodebuild logs", | ||
"version": "4.3.1", | ||
"version": "4.3.2", | ||
"main": "build/index.js", | ||
@@ -6,0 +6,0 @@ "types": "build/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
308676
3393