@callstack/react-native-legal-shared
Version:
Shared code for all packages
47 lines (46 loc) • 1.78 kB
TypeScript
type LicenseObj = {
author?: string;
content?: string;
description?: string;
file?: string;
type?: string;
url?: string;
version: string;
};
/**
* Makes a deep-check between array items and provided object, returns true if array has provided object.
*/
export declare function arrayIncludesObject(array?: unknown[], object?: unknown): boolean | undefined;
/**
* Scans `package.json` and searches for all packages under `dependencies` field. Supports monorepo projects.
*/
export declare function scanDependencies(appPackageJsonPath: string): Record<string, LicenseObj>;
/**
* Generates LicensePlist-compatible metadata for NPM dependencies
*
* This will take scanned NPM licenses and produce following output inside iOS project's directory:
*
* | - ios
* | ---- myawesomeapp
* | ---- myawesomeapp.xcodeproj
* | ---- myawesomeapp.xcodeworkspace
* | ---- license_plist.yml <--- generated LicensePlist config with NPM dependencies
* | ---- Podfile
* | ---- Podfile.lock
*/
export declare function generateLicensePlistNPMOutput(licenses: Record<string, LicenseObj>, iosProjectPath: string): void;
/**
* Generates AboutLibraries-compatible metadata for NPM dependencies
*
* This will take scanned NPM licenses and produce following output inside android project's directory:
*
* | - android
* | ---- app
* | ---- config <--- generated AboutLibraries config directory
* | ------- libraries <--- generated directory with JSON files list of NPM dependencies
* | ------- licenses <--- generated directory with JSON files list of used licenses
* | ---- build.gradle
* | ---- settings.gradle
*/
export declare function generateAboutLibrariesNPMOutput(licenses: Record<string, LicenseObj>, androidProjectPath: string): void;
export {};