expo-modules-autolinking
Advanced tools
Comparing version 2.0.5 to 2.0.6-canary-20250114-804e26d
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import type { RNConfigDependencyAndroid, RNConfigReactNativePlatformsConfigAndroid } from './reactNativeConfig.types'; | ||
@@ -8,7 +9,8 @@ export declare function resolveDependencyConfigImplAndroidAsync(packageRoot: string, reactNativeConfig: RNConfigReactNativePlatformsConfigAndroid | null | undefined): Promise<RNConfigDependencyAndroid | null>; | ||
/** | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `TurboReactPackage`. | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `(Base|Turbo)ReactPackage`. | ||
*/ | ||
export declare function parseNativePackageClassNameAsync(packageRoot: string, androidDir: string): Promise<string | null>; | ||
export declare function matchNativePackageClassName(filePath: string, contents: Buffer): string | null; | ||
export declare function parseLibraryNameAsync(androidDir: string, packageJson: any): Promise<string | null>; | ||
export declare function parseComponentDescriptorsAsync(packageRoot: string, pacakgeJson: any): Promise<string[]>; | ||
export declare function parseComponentDescriptorsAsync(packageRoot: string, packageJson: any): Promise<string[]>; | ||
export declare function findGradleAndManifestAsync({ androidDir, isLibrary, }: { | ||
@@ -15,0 +17,0 @@ androidDir: string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findGradleAndManifestAsync = exports.parseComponentDescriptorsAsync = exports.parseLibraryNameAsync = exports.parseNativePackageClassNameAsync = exports.parsePackageNameAsync = exports.resolveDependencyConfigImplAndroidAsync = void 0; | ||
exports.findGradleAndManifestAsync = exports.parseComponentDescriptorsAsync = exports.parseLibraryNameAsync = exports.matchNativePackageClassName = exports.parseNativePackageClassNameAsync = exports.parsePackageNameAsync = exports.resolveDependencyConfigImplAndroidAsync = void 0; | ||
const fast_glob_1 = __importDefault(require("fast-glob")); | ||
@@ -97,3 +97,3 @@ const promises_1 = __importDefault(require("fs/promises")); | ||
/** | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `TurboReactPackage`. | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `(Base|Turbo)ReactPackage`. | ||
*/ | ||
@@ -127,6 +127,6 @@ async function parseNativePackageClassNameAsync(packageRoot, androidDir) { | ||
} | ||
// [1] Match TurboReactPackage | ||
// [1] Match (Base|Turbo)ReactPackage | ||
if (!lazyTurboReactPackageRegex) { | ||
lazyTurboReactPackageRegex = | ||
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*TurboReactPackage/; | ||
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*(Base|Turbo)ReactPackage/; | ||
} | ||
@@ -139,2 +139,3 @@ const matchTurboReactPackage = fileContents.match(lazyTurboReactPackageRegex); | ||
} | ||
exports.matchNativePackageClassName = matchNativePackageClassName; | ||
async function parseLibraryNameAsync(androidDir, packageJson) { | ||
@@ -167,5 +168,5 @@ // [0] `codegenConfig.name` from package.json | ||
exports.parseLibraryNameAsync = parseLibraryNameAsync; | ||
async function parseComponentDescriptorsAsync(packageRoot, pacakgeJson) { | ||
const jsRoot = pacakgeJson?.codegenConfig?.jsSrcsDir | ||
? path_1.default.join(packageRoot, pacakgeJson.codegenConfig.jsSrcsDir) | ||
async function parseComponentDescriptorsAsync(packageRoot, packageJson) { | ||
const jsRoot = packageJson?.codegenConfig?.jsSrcsDir | ||
? path_1.default.join(packageRoot, packageJson.codegenConfig.jsSrcsDir) | ||
: packageRoot; | ||
@@ -172,0 +173,0 @@ const results = await (0, fileUtils_1.globMatchFunctorAllAsync)('**/*.{js,jsx,ts,tsx}', matchComponentDescriptors, { |
@@ -11,2 +11,4 @@ # Changelog | ||
- Added Android `BaseReactPackage` for autolinking. ([#33773](https://github.com/expo/expo/pull/33773) by [@vonovak](https://github.com/vonovak)) | ||
### 💡 Others | ||
@@ -13,0 +15,0 @@ |
{ | ||
"name": "expo-modules-autolinking", | ||
"version": "2.0.5", | ||
"version": "2.0.6-canary-20250114-804e26d", | ||
"description": "Scripts that autolink Expo modules.", | ||
@@ -38,3 +38,3 @@ "main": "build/index.js", | ||
"@types/fs-extra": "^9.0.11", | ||
"expo-module-scripts": "~4.0.3", | ||
"expo-module-scripts": "4.0.4-canary-20250114-804e26d", | ||
"minimatch": "^3.0.4" | ||
@@ -52,3 +52,3 @@ }, | ||
}, | ||
"gitHead": "986a4689b91f3efc527f7178a320b987c0005842" | ||
"gitHead": "804e26d8545f2b890dfa80eeb8122036f38d4d0c" | ||
} |
@@ -114,3 +114,3 @@ import glob from 'fast-glob'; | ||
/** | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `TurboReactPackage`. | ||
* Parse the Java or Kotlin class name to for `ReactPackage` or `(Base|Turbo)ReactPackage`. | ||
*/ | ||
@@ -142,3 +142,3 @@ export async function parseNativePackageClassNameAsync( | ||
let lazyTurboReactPackageRegex: RegExp | null = null; | ||
function matchNativePackageClassName(filePath: string, contents: Buffer): string | null { | ||
export function matchNativePackageClassName(filePath: string, contents: Buffer): string | null { | ||
const fileContents = contents.toString(); | ||
@@ -156,6 +156,6 @@ | ||
// [1] Match TurboReactPackage | ||
// [1] Match (Base|Turbo)ReactPackage | ||
if (!lazyTurboReactPackageRegex) { | ||
lazyTurboReactPackageRegex = | ||
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*TurboReactPackage/; | ||
/class\s+(\w+[^(\s]*)[\s\w():]*(\s+extends\s+|:)[\s\w():,]*[^{]*(Base|Turbo)ReactPackage/; | ||
} | ||
@@ -205,6 +205,6 @@ const matchTurboReactPackage = fileContents.match(lazyTurboReactPackageRegex); | ||
packageRoot: string, | ||
pacakgeJson: any | ||
packageJson: any | ||
): Promise<string[]> { | ||
const jsRoot = pacakgeJson?.codegenConfig?.jsSrcsDir | ||
? path.join(packageRoot, pacakgeJson.codegenConfig.jsSrcsDir) | ||
const jsRoot = packageJson?.codegenConfig?.jsSrcsDir | ||
? path.join(packageRoot, packageJson.codegenConfig.jsSrcsDir) | ||
: packageRoot; | ||
@@ -211,0 +211,0 @@ const results = await globMatchFunctorAllAsync( |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
386802
5322
1