Skip to content

Commit

Permalink
fix: support linking of BaseReactPackage subclasses (#2563)
Browse files Browse the repository at this point in the history
* fix: support linking of BaseReactPackage subclasses

* Update packages/cli-config-android/src/config/__tests__/findPackageClassName.test.ts

Co-authored-by: Michał Pierzchała <[email protected]>

---------

Co-authored-by: Michał Pierzchała <[email protected]>
  • Loading branch information
vonovak and thymikee authored Dec 12, 2024
1 parent 1d30fea commit d3b1080
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/cli-config-android/src/config/__fixtures__/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export const findPackagesClassNameKotlinValid = [
`
class SomeExampleKotlinPackage : TurboReactPackage {
}`,
`
class SomeExampleKotlinPackage : BaseReactPackage {
}`,
];

Expand Down Expand Up @@ -265,6 +269,13 @@ export const findPackagesClassNameJavaValid = [
extends
TurboReactPackage {
}
`,
`
class SomeExampleKotlinPackage
extends
BaseReactPackage {
}
`,
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function matchClassName(file: string) {
return nativeModuleMatch;
} else {
return file.match(
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*TurboReactPackage/,
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*(Turbo|Base)ReactPackage/,
);
}
}

0 comments on commit d3b1080

Please sign in to comment.