chore: build
This commit is contained in:
+4
-6
@@ -17,8 +17,7 @@ const symbols_1 = require("./utils/symbols");
|
||||
*/
|
||||
class ExpoRunFormatter extends Formatter_1.Formatter {
|
||||
static create(projectRoot, { xcodeProject, isDebug, } = {}) {
|
||||
var _a;
|
||||
const appName = ((_a = xcodeProject === null || xcodeProject === void 0 ? void 0 : xcodeProject.name.match(/.*\/(.*)\.\w+/)) === null || _a === void 0 ? void 0 : _a[1]) || '';
|
||||
const appName = xcodeProject?.name.match(/.*\/(.*)\.\w+/)?.[1] || '';
|
||||
const formatter = new ExpoRunFormatter({
|
||||
projectRoot,
|
||||
appName,
|
||||
@@ -34,14 +33,13 @@ class ExpoRunFormatter extends Formatter_1.Formatter {
|
||||
return this._parser;
|
||||
}
|
||||
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 : {};
|
||||
podfile = (0, parsePodfileLock_1.parsePodfileLock)(podfileContents) ?? {};
|
||||
}
|
||||
catch { }
|
||||
this.podfileTracer = new PodfileTracer_1.PodfileTracer({
|
||||
@@ -74,7 +72,7 @@ class ExpoRunFormatter extends Formatter_1.Formatter {
|
||||
// Don't show warnings from cocoapods that come from non-root target pods.
|
||||
!collisions.some(({ filePath }) => {
|
||||
const nodeModule = this.podfileTracer.getNodeModuleNameForTarget(path_1.default.dirname(filePath));
|
||||
return !(nodeModule === null || nodeModule === void 0 ? void 0 : nodeModule.isRootTarget);
|
||||
return !nodeModule?.isRootTarget;
|
||||
}));
|
||||
}
|
||||
shouldShowWarningInTarget({ target }) {
|
||||
@@ -86,7 +84,7 @@ class ExpoRunFormatter extends Formatter_1.Formatter {
|
||||
}
|
||||
getNodeModuleName(filePath, target) {
|
||||
const results = this.podfileTracer.getNodeModuleName(filePath, target);
|
||||
return (results === null || results === void 0 ? void 0 : results.name) ? chalk_1.default.cyan(results.name) : null;
|
||||
return results?.name ? chalk_1.default.cyan(results.name) : null;
|
||||
}
|
||||
formatFileOperation(props) {
|
||||
const title = this.getFileOperationTitle(props.type);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+9
-10
@@ -106,6 +106,11 @@ function getAppRoot(filePath) {
|
||||
return isBuildFolder(appRoot) ? appRoot : '';
|
||||
}
|
||||
class Formatter {
|
||||
static { this.format = format; }
|
||||
static { this.formatBreadCrumb = formatBreadCrumb; }
|
||||
static { this.getAppRoot = getAppRoot; }
|
||||
static { this.highlightLastPathComponent = highlightLastPathComponent; }
|
||||
static { this.relativePath = relativePath; }
|
||||
get parser() {
|
||||
if (this._parser) {
|
||||
return this._parser;
|
||||
@@ -537,7 +542,7 @@ class Formatter {
|
||||
[
|
||||
Matchers_1.Matchers.Warnings.MISSING_ARCHITECTURE,
|
||||
([, $1, $2, $3]) => {
|
||||
return this.formatMissingArchitectureWarning($1, $2 === null || $2 === void 0 ? void 0 : $2.split(' ').map(value => value.trim()), $3 === null || $3 === void 0 ? void 0 : $3.split(' ').map(value => value.trim()));
|
||||
return this.formatMissingArchitectureWarning($1, $2?.split(' ').map(value => value.trim()), $3?.split(' ').map(value => value.trim()));
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -693,11 +698,6 @@ class Formatter {
|
||||
}
|
||||
}
|
||||
exports.Formatter = Formatter;
|
||||
Formatter.format = format;
|
||||
Formatter.formatBreadCrumb = formatBreadCrumb;
|
||||
Formatter.getAppRoot = getAppRoot;
|
||||
Formatter.highlightLastPathComponent = highlightLastPathComponent;
|
||||
Formatter.relativePath = relativePath;
|
||||
function findLastIndex(arr) {
|
||||
for (let i = arr.length - 1; i >= 0; i--) {
|
||||
if (arr[i].startsWith('Error:')) {
|
||||
@@ -737,7 +737,6 @@ function parseOptionalInt(text) {
|
||||
}
|
||||
}
|
||||
function formatWarningOrError({ projectRoot, filePath, reason, cursor, lineText, lineNumber, columnNumber, isError, maxWarningLineLength = 200, }) {
|
||||
var _a;
|
||||
const line = parseOptionalInt(lineNumber) || 0;
|
||||
const column = parseOptionalInt(columnNumber);
|
||||
const color = isError ? chalk_1.default.red : chalk_1.default.yellow;
|
||||
@@ -769,7 +768,7 @@ function formatWarningOrError({ projectRoot, filePath, reason, cursor, lineText,
|
||||
// `...transition:'fade'},k._updatePropsStack=function(){clearImmediate(k._updateImmediate),k._updateImmediate...`
|
||||
// If there is no text preview or column number, we can't do anything.
|
||||
if (lineText && column != null) {
|
||||
const rangeWindow = Math.round(Math.max((_a = displayFilePath === null || displayFilePath === void 0 ? void 0 : displayFilePath.length) !== null && _a !== void 0 ? _a : 0, 80) / 2);
|
||||
const rangeWindow = Math.round(Math.max(displayFilePath?.length ?? 0, 80) / 2);
|
||||
let minBounds = Math.max(0, column - rangeWindow);
|
||||
const maxBounds = Math.min(minBounds + rangeWindow * 2, lineText.length);
|
||||
previewLine = lineText.slice(minBounds, maxBounds);
|
||||
@@ -812,7 +811,7 @@ function formatWarningOrError({ projectRoot, filePath, reason, cursor, lineText,
|
||||
}
|
||||
}
|
||||
function fill(width) {
|
||||
return Array(width).join(' ');
|
||||
return width >= 0 ? Array(width).join(' ') : '';
|
||||
}
|
||||
// Dim values like `[-Wnullability-completeness]`
|
||||
function grayOutMatch(text, reg) {
|
||||
@@ -820,7 +819,7 @@ function grayOutMatch(text, reg) {
|
||||
}
|
||||
function replaceMatch(text, reg, callback) {
|
||||
const match = text.match(reg);
|
||||
if (match === null || match === void 0 ? void 0 : match.length) {
|
||||
if (match?.length) {
|
||||
return text.replace(reg, callback(match[0]));
|
||||
}
|
||||
return text;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+22
@@ -297,6 +297,17 @@ export declare const Matchers: {
|
||||
* `$2` target
|
||||
* `$3` project
|
||||
*/
|
||||
/**
|
||||
* Matches a Xcode project / workspace level warning like:
|
||||
* `/path/to/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 26.2.99. (in target 'SDWebImage-SDWebImage' from project 'Pods')`
|
||||
*
|
||||
* @regex Captured groups
|
||||
* `$1` = project file path
|
||||
* `$2` = warning reason (without the trailing "(in target ... from project ...)" suffix)
|
||||
* `$3` = native target
|
||||
* `$4` = native project
|
||||
*/
|
||||
XCODEPROJ_WARNING_MATCHER: RegExp;
|
||||
AMBIGUOUS_RUN_SCRIPT: RegExp;
|
||||
/**
|
||||
* @regex Captured groups
|
||||
@@ -335,6 +346,17 @@ export declare const Matchers: {
|
||||
* `$5` = native project
|
||||
*/
|
||||
UNSUPPORTED_ENTITLEMENT_MATCHER: RegExp;
|
||||
/**
|
||||
* Matches a Xcode project / workspace level error like:
|
||||
* `/path/to/MyApp.xcodeproj: error: Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the App Groups capability. (in target 'MyApp' from project 'MyApp')`
|
||||
*
|
||||
* @regex Captured groups
|
||||
* `$1` = project file path
|
||||
* `$2` = error reason (without the trailing "(in target ... from project ...)" suffix)
|
||||
* `$3` = native target
|
||||
* `$4` = native project
|
||||
*/
|
||||
XCODEPROJ_ERROR_MATCHER: RegExp;
|
||||
/**
|
||||
* @regex Captured groups
|
||||
* `$1` = whole error
|
||||
|
||||
+24
-2
@@ -300,7 +300,18 @@ exports.Matchers = {
|
||||
* `$2` target
|
||||
* `$3` project
|
||||
*/
|
||||
AMBIGUOUS_RUN_SCRIPT: /^Run script build phase '(.+)' will be run during every build because it does not specify any outputs\. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase\. \(in\s.*target '([^']*)'.*project '([^']*)'/m,
|
||||
/**
|
||||
* Matches a Xcode project / workspace level warning like:
|
||||
* `/path/to/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 26.2.99. (in target 'SDWebImage-SDWebImage' from project 'Pods')`
|
||||
*
|
||||
* @regex Captured groups
|
||||
* `$1` = project file path
|
||||
* `$2` = warning reason (without the trailing "(in target ... from project ...)" suffix)
|
||||
* `$3` = native target
|
||||
* `$4` = native project
|
||||
*/
|
||||
XCODEPROJ_WARNING_MATCHER: /^(\/.+\.(?:xcodeproj|xcworkspace)):\s*warning:\s*(.+)$/m,
|
||||
AMBIGUOUS_RUN_SCRIPT: /^Run script build phase '(.+)' will be run during every build because it does not specify any outputs\. To address this (?:warning|issue), either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase\. \(in\s.*target '([^']*)'.*project '([^']*)'/m,
|
||||
/**
|
||||
* @regex Captured groups
|
||||
* `$1` = whole warning
|
||||
@@ -337,7 +348,18 @@ exports.Matchers = {
|
||||
* `$4` = native target
|
||||
* `$5` = native project
|
||||
*/
|
||||
UNSUPPORTED_ENTITLEMENT_MATCHER: /^error: Provisioning profile (.*) doesn't (?:support|include) the (.*) (capability|entitlement)\.(?:\s\(in\s.*target '([^']*)'.*project '([^']*)'\)$)?/m,
|
||||
UNSUPPORTED_ENTITLEMENT_MATCHER: /^(?:error:\s)?Provisioning profile (.*) doesn't (?:support|include) the (.*) (capability|entitlement)\.(?:\s\(in\s.*target '([^']*)'.*project '([^']*)'\)$)?/m,
|
||||
/**
|
||||
* Matches a Xcode project / workspace level error like:
|
||||
* `/path/to/MyApp.xcodeproj: error: Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the App Groups capability. (in target 'MyApp' from project 'MyApp')`
|
||||
*
|
||||
* @regex Captured groups
|
||||
* `$1` = project file path
|
||||
* `$2` = error reason (without the trailing "(in target ... from project ...)" suffix)
|
||||
* `$3` = native target
|
||||
* `$4` = native project
|
||||
*/
|
||||
XCODEPROJ_ERROR_MATCHER: /^(\/.+\.(?:xcodeproj|xcworkspace)):\s*error:\s*(.+)$/m,
|
||||
/**
|
||||
* @regex Captured groups
|
||||
* `$1` = whole error
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+8
-10
@@ -123,6 +123,8 @@ class Parser {
|
||||
project: $4,
|
||||
}),
|
||||
],
|
||||
[Matchers_1.Matchers.Errors.XCODEPROJ_ERROR_MATCHER, ([, , $2]) => formatter.formatError($2)],
|
||||
[Matchers_1.Matchers.Warnings.XCODEPROJ_WARNING_MATCHER, ([, , $2]) => formatter.formatWarning($2)],
|
||||
[Matchers_1.Matchers.Errors.CHECK_DEPENDENCIES_ERRORS_MATCHER, ([, $1]) => formatter.formatError($1)],
|
||||
[
|
||||
Matchers_1.Matchers.Errors.PROVISIONING_PROFILE_REQUIRED_MATCHER,
|
||||
@@ -384,7 +386,7 @@ class Parser {
|
||||
Matchers_1.Matchers.Errors.COMPILE_ERROR_MATCHER,
|
||||
matches => {
|
||||
// Prevent matching a one-liner error.
|
||||
if (matches === null || matches === void 0 ? void 0 : matches[4]) {
|
||||
if (matches?.[4]) {
|
||||
return 'unmatched';
|
||||
}
|
||||
this.formattingError = true;
|
||||
@@ -396,7 +398,7 @@ class Parser {
|
||||
Matchers_1.Matchers.Warnings.COMPILE_WARNING_MATCHER,
|
||||
matches => {
|
||||
// Prevent matching a one-liner warning.
|
||||
if (matches === null || matches === void 0 ? void 0 : matches[4]) {
|
||||
if (matches?.[4]) {
|
||||
return 'unmatched';
|
||||
}
|
||||
this.formattingWarning = true;
|
||||
@@ -414,12 +416,11 @@ class Parser {
|
||||
[
|
||||
null,
|
||||
() => {
|
||||
var _a, _b;
|
||||
if (this.formattingError || this.formattingWarning) {
|
||||
// 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;
|
||||
this.currentIssue.line = text.match(/^(?:[\s]+\d+ \|\s)?(.*)/)?.[1] ?? text;
|
||||
}
|
||||
return 'unmatched';
|
||||
},
|
||||
@@ -484,16 +485,13 @@ class Parser {
|
||||
return this.formattingWarning && this.errorOrWarningIsPresent();
|
||||
}
|
||||
errorOrWarningIsPresent() {
|
||||
var _a, _b, _c;
|
||||
return !!((_a = this.currentIssue) === null || _a === void 0 ? void 0 : _a.reason) && !!((_b = this.currentIssue) === null || _b === void 0 ? void 0 : _b.cursor) && !!((_c = this.currentIssue) === null || _c === void 0 ? void 0 : _c.line);
|
||||
return !!this.currentIssue?.reason && !!this.currentIssue?.cursor && !!this.currentIssue?.line;
|
||||
}
|
||||
shouldFormatUndefinedSymbols() {
|
||||
var _a, _b, _c;
|
||||
return (((_a = this.linkerFailure) === null || _a === void 0 ? void 0 : _a.message) && ((_b = this.linkerFailure) === null || _b === void 0 ? void 0 : _b.symbol) && ((_c = this.linkerFailure) === null || _c === void 0 ? void 0 : _c.reference));
|
||||
return (this.linkerFailure?.message && this.linkerFailure?.symbol && this.linkerFailure?.reference);
|
||||
}
|
||||
shouldFormatDuplicateSymbols() {
|
||||
var _a, _b, _c;
|
||||
return ((_a = this.linkerFailure) === null || _a === void 0 ? void 0 : _a.message) && ((_c = (_b = this.linkerFailure) === null || _b === void 0 ? void 0 : _b.files) === null || _c === void 0 ? void 0 : _c.length) > 1;
|
||||
return this.linkerFailure?.message && this.linkerFailure?.files?.length > 1;
|
||||
}
|
||||
formatCompileError() {
|
||||
const error = { ...this.currentIssue };
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-6
@@ -15,14 +15,13 @@ const parsePodfileLock_1 = require("./parsePodfileLock");
|
||||
*/
|
||||
class PodfileTracer {
|
||||
static create(projectRoot, { xcodeProject } = {}) {
|
||||
var _a, _b;
|
||||
const podfileLock = path_1.default.join(projectRoot, 'ios', 'Podfile.lock');
|
||||
const podfileContents = fs_1.default.readFileSync(podfileLock, 'utf8');
|
||||
const rootTargetName = ((_a = xcodeProject === null || xcodeProject === void 0 ? void 0 : xcodeProject.name.match(/.*\/(.*)\.\w+/)) === null || _a === void 0 ? void 0 : _a[1]) || '';
|
||||
const rootTargetName = xcodeProject?.name.match(/.*\/(.*)\.\w+/)?.[1] || '';
|
||||
const formatter = new PodfileTracer({
|
||||
projectRoot,
|
||||
rootTargetName,
|
||||
podfile: (_b = (0, parsePodfileLock_1.parsePodfileLock)(podfileContents)) !== null && _b !== void 0 ? _b : {},
|
||||
podfile: (0, parsePodfileLock_1.parsePodfileLock)(podfileContents) ?? {},
|
||||
});
|
||||
return formatter;
|
||||
}
|
||||
@@ -63,7 +62,7 @@ class PodfileTracer {
|
||||
source = this.getExternalSourceForPod(parts[0]);
|
||||
}
|
||||
}
|
||||
if (source === null || source === void 0 ? void 0 : source.source) {
|
||||
if (source?.source) {
|
||||
// Finally attempt to trace the podspec file.
|
||||
const pkg = this.getPackageJsonAnyFilePathInModule({
|
||||
target: source.pod,
|
||||
@@ -90,13 +89,12 @@ class PodfileTracer {
|
||||
return this.getNodeModuleNameForTarget(target);
|
||||
}
|
||||
getExternalSourceForPodWithoutCache(pod) {
|
||||
var _a, _b;
|
||||
if (!pod) {
|
||||
return null;
|
||||
}
|
||||
const results = (0, getFirstExternalSourceForPod_1.getFirstExternalSourceForPod)(this.podfile, { name: pod });
|
||||
// Keep tracing until we get to a development pod with a local file reference.
|
||||
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;
|
||||
const filePath = results?.source[':podspec'] ?? results?.source[':path'] ?? null;
|
||||
if (results && filePath) {
|
||||
return { pod: results.pod, source: filePath };
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -12,7 +12,7 @@ function moduleNameFromPath(modulePath) {
|
||||
const [packageName] = modulePath.split('/');
|
||||
return packageName ? packageName : modulePath;
|
||||
}
|
||||
const NODE_MODULE_PATTERN = /node_modules(\/\.(pnpm|store)\/.*\/node_modules)?\//i;
|
||||
const NODE_MODULE_PATTERN = /node_modules(\/\.(bun|pnpm|store)\/.*\/node_modules)?\//i;
|
||||
function getNodeModuleName(filePath) {
|
||||
// '/<project>/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'
|
||||
// '/<project>/node_modules/.pnpm/react-native@0.73.1_@babel+core@7.20.2_react@18.2.0/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"getNodeModuleName.js","sourceRoot":"","sources":["../../src/utils/getNodeModuleName.ts"],"names":[],"mappings":";;AAcA,8CASC;AAvBD,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;AAChD,CAAC;AAED,MAAM,mBAAmB,GAAG,sDAAsD,CAAC;AAEnF,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,wGAAwG;IACxG,+KAA+K;IAC/K,uKAAuK;IACvK,MAAM,CAAC,EAAE,AAAD,EAAG,AAAD,EAAG,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC/D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["function moduleNameFromPath(modulePath: string) {\n if (modulePath.startsWith('@')) {\n const [org, packageName] = modulePath.split('/');\n if (org && packageName) {\n return [org, packageName].join('/');\n }\n return modulePath;\n }\n const [packageName] = modulePath.split('/');\n return packageName ? packageName : modulePath;\n}\n\nconst NODE_MODULE_PATTERN = /node_modules(\\/\\.(pnpm|store)\\/.*\\/node_modules)?\\//i;\n\nexport function getNodeModuleName(filePath: string): string | null {\n // '/<project>/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n // '/<project>/node_modules/.pnpm/react-native@0.73.1_@babel+core@7.20.2_react@18.2.0/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n // '/<project>/node_modules/.store/react-native@0.73.1-OKL2xQk6utgOIuOl3VvO_g/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n const [, , , modulePath] = filePath.split(NODE_MODULE_PATTERN);\n if (modulePath) {\n return moduleNameFromPath(modulePath);\n }\n return null;\n}\n"]}
|
||||
{"version":3,"file":"getNodeModuleName.js","sourceRoot":"","sources":["../../src/utils/getNodeModuleName.ts"],"names":[],"mappings":";;AAcA,8CASC;AAvBD,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;AAChD,CAAC;AAED,MAAM,mBAAmB,GAAG,0DAA0D,CAAC;AAEvF,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,wGAAwG;IACxG,+KAA+K;IAC/K,uKAAuK;IACvK,MAAM,CAAC,EAAE,AAAD,EAAG,AAAD,EAAG,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC/D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["function moduleNameFromPath(modulePath: string) {\n if (modulePath.startsWith('@')) {\n const [org, packageName] = modulePath.split('/');\n if (org && packageName) {\n return [org, packageName].join('/');\n }\n return modulePath;\n }\n const [packageName] = modulePath.split('/');\n return packageName ? packageName : modulePath;\n}\n\nconst NODE_MODULE_PATTERN = /node_modules(\\/\\.(bun|pnpm|store)\\/.*\\/node_modules)?\\//i;\n\nexport function getNodeModuleName(filePath: string): string | null {\n // '/<project>/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n // '/<project>/node_modules/.pnpm/react-native@0.73.1_@babel+core@7.20.2_react@18.2.0/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n // '/<project>/node_modules/.store/react-native@0.73.1-OKL2xQk6utgOIuOl3VvO_g/node_modules/react-native/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp'\n const [, , , modulePath] = filePath.split(NODE_MODULE_PATTERN);\n if (modulePath) {\n return moduleNameFromPath(modulePath);\n }\n return null;\n}\n"]}
|
||||
+6
-8
@@ -24,7 +24,7 @@ const parsePodDependency = (pod) => {
|
||||
// js-yaml fails to parse an array with a single item and instead formats it as a string divided by a `-` (hyphen).
|
||||
// Here we match if a hyphen comes after a space. We use fake-nested-Podfile to test this hack.
|
||||
const singleItemArrayBug = pod.match(/(.*)\s-\s(.*)/);
|
||||
if (singleItemArrayBug === null || singleItemArrayBug === void 0 ? void 0 : singleItemArrayBug[2]) {
|
||||
if (singleItemArrayBug?.[2]) {
|
||||
return (0, exports.parsePodDependency)({ [singleItemArrayBug[1]]: singleItemArrayBug[2] });
|
||||
}
|
||||
return [splitPodNameVersion(pod)];
|
||||
@@ -48,8 +48,8 @@ const parsePodDependency = (pod) => {
|
||||
};
|
||||
exports.parsePodDependency = parsePodDependency;
|
||||
function parsePodfileLock(fileContent) {
|
||||
var _a;
|
||||
const contents = (_a = loadPodfileLock(fileContent)) !== null && _a !== void 0 ? _a : loadPodfileLock(EXTERNAL_SOURCES_KEY + fileContent.split(EXTERNAL_SOURCES_KEY).slice(1));
|
||||
const contents = loadPodfileLock(fileContent) ??
|
||||
loadPodfileLock(EXTERNAL_SOURCES_KEY + fileContent.split(EXTERNAL_SOURCES_KEY).slice(1));
|
||||
if (!contents) {
|
||||
return null;
|
||||
}
|
||||
@@ -66,9 +66,8 @@ function parsePodfileLock(fileContent) {
|
||||
return parsed;
|
||||
}
|
||||
function splitPodNameVersion(pod) {
|
||||
var _a;
|
||||
const [name] = pod.split(' ');
|
||||
return { name, version: (_a = pod.match(/\((.*)\)/)) === null || _a === void 0 ? void 0 : _a[1] };
|
||||
return { name, version: pod.match(/\((.*)\)/)?.[1] };
|
||||
}
|
||||
function rubyCaseToKebab(str) {
|
||||
return str.toLowerCase().split(' ').join('-');
|
||||
@@ -77,8 +76,7 @@ function kebabCaseToCamelCase(str) {
|
||||
return str.replace(/-([a-z])/g, g => g[1].toUpperCase());
|
||||
}
|
||||
function getFilePathForExternalSource(podLock, pod) {
|
||||
var _a, _b, _c;
|
||||
const source = (_a = podLock.externalSources) === null || _a === void 0 ? void 0 : _a[pod];
|
||||
return (_c = (_b = source === null || source === void 0 ? void 0 : source[':podspec']) !== null && _b !== void 0 ? _b : source === null || source === void 0 ? void 0 : source[':path']) !== null && _c !== void 0 ? _c : null;
|
||||
const source = podLock.externalSources?.[pod];
|
||||
return source?.[':podspec'] ?? source?.[':path'] ?? null;
|
||||
}
|
||||
//# sourceMappingURL=parsePodfileLock.js.map
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@expo/xcpretty",
|
||||
"description": "Parse and format xcodebuild logs",
|
||||
"version": "4.4.0",
|
||||
"version": "4.4.3",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"author": "Evan Bacon <bacon@expo.io> (https://github.com/evanbacon)",
|
||||
@@ -17,7 +17,7 @@
|
||||
"scripts": {
|
||||
"watch": "tsc --watch",
|
||||
"build": "tsc",
|
||||
"prepare": "yarn run clean && yarn build",
|
||||
"prepare": "bun run clean && bun run build",
|
||||
"clean": "rimraf build ./tsconfig.tsbuildinfo",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"test": "jest"
|
||||
@@ -37,6 +37,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/babel__code-frame": "^7.27.0",
|
||||
"@types/js-yaml": "^4.0.1"
|
||||
"@types/js-yaml": "^4.0.1",
|
||||
"@types/node": "^20.16.13"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user