fix(app): regenerate iOS Markdown inline code props

This commit is contained in:
Mohamed Boudra
2026-10-27 14:46:31 +01:00
parent 4495bda146
commit b3ca2327a8
2 changed files with 89 additions and 0 deletions
@@ -3770,3 +3770,60 @@ index eaa3279..05a02eb 100644
private:
int forceHeightRecalculationCounter_{0};
std::shared_ptr<MarkdownTextMeasurementManager> measurementsManager_;
diff --git a/node_modules/react-native-enriched-markdown/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h b/node_modules/react-native-enriched-markdown/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h
--- a/node_modules/react-native-enriched-markdown/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h
+++ b/node_modules/react-native-enriched-markdown/ios/generated/ReactCodegen/EnrichedMarkdownTextSpec/Props.h
@@ -1639,6 +1639,7 @@
struct EnrichedMarkdownMarkdownStyleCodeStruct {
std::string fontFamily{};
Float fontSize{0.0};
+ Float fontScale{0.0};
SharedColor color{};
SharedColor backgroundColor{};
SharedColor borderColor{};
@@ -1651,6 +1652,7 @@
folly::dynamic result = folly::dynamic::object();
result["fontFamily"] = fontFamily;
result["fontSize"] = fontSize;
+ result["fontScale"] = fontScale;
result["color"] = ::facebook::react::toDynamic(color);
result["backgroundColor"] = ::facebook::react::toDynamic(backgroundColor);
result["borderColor"] = ::facebook::react::toDynamic(borderColor);
@@ -1670,6 +1672,10 @@
if (tmp_fontSize != map.end()) {
fromRawValue(context, tmp_fontSize->second, result.fontSize);
}
+ auto tmp_fontScale = map.find("fontScale");
+ if (tmp_fontScale != map.end()) {
+ fromRawValue(context, tmp_fontScale->second, result.fontScale);
+ }
auto tmp_color = map.find("color");
if (tmp_color != map.end()) {
fromRawValue(context, tmp_color->second, result.color);
@@ -6185,6 +6191,7 @@
struct EnrichedMarkdownTextMarkdownStyleCodeStruct {
std::string fontFamily{};
Float fontSize{0.0};
+ Float fontScale{0.0};
SharedColor color{};
SharedColor backgroundColor{};
SharedColor borderColor{};
@@ -6197,6 +6204,7 @@
folly::dynamic result = folly::dynamic::object();
result["fontFamily"] = fontFamily;
result["fontSize"] = fontSize;
+ result["fontScale"] = fontScale;
result["color"] = ::facebook::react::toDynamic(color);
result["backgroundColor"] = ::facebook::react::toDynamic(backgroundColor);
result["borderColor"] = ::facebook::react::toDynamic(borderColor);
@@ -6216,6 +6224,10 @@
if (tmp_fontSize != map.end()) {
fromRawValue(context, tmp_fontSize->second, result.fontSize);
}
+ auto tmp_fontScale = map.find("fontScale");
+ if (tmp_fontScale != map.end()) {
+ fromRawValue(context, tmp_fontScale->second, result.fontScale);
+ }
auto tmp_color = map.find("color");
if (tmp_color != map.end()) {
fromRawValue(context, tmp_color->second, result.color);
+32
View File
@@ -10,6 +10,38 @@ const bin = path.resolve("node_modules", ".bin");
const packageName = "react-native-draggable-flatlist";
const patchFile = `${packageName}+4.0.3.patch`;
test("patched Markdown ships iOS props generated from its native specs", () => {
const packageDir = path.resolve("packages/app/node_modules/react-native-enriched-markdown");
const output = mkdtempSync(path.join(tmpdir(), "markdown-ios-codegen-"));
try {
// includesGeneratedCode makes CocoaPods use the shipped headers instead of
// regenerating them after patch-package changes the TypeScript specs.
const result = spawnSync(
process.execPath,
[
path.resolve("node_modules/react-native/scripts/generate-codegen-artifacts.js"),
"-p",
packageDir,
"-t",
"ios",
"-o",
output,
"-s",
"library",
],
{ encoding: "utf8" },
);
assert.equal(result.status, 0, result.stdout + result.stderr);
const header = "ReactCodegen/EnrichedMarkdownTextSpec/Props.h";
assert.equal(
readFileSync(path.join(packageDir, "ios/generated", header), "utf8"),
readFileSync(path.join(output, header), "utf8"),
);
} finally {
rmSync(output, { recursive: true, force: true });
}
});
function createCheckout() {
const root = mkdtempSync(path.join(tmpdir(), "postinstall-patches-"));
writeFileSync(path.join(root, "package.json"), JSON.stringify({ name: "checkout" }));