Skip to content

Commit 55f23b6

Browse files
authored
fix: multiple version resolution support, fixes #55 (#56)
* feat: scanning of nested dependencies in case of version conflicts; fixes #55 * feat!: iOS plugin to generate licenses list including version numbers * feat!: new shared API including more metadata in LicenseObj * fix: proper URLs to repositories of libraries on Android * chore: added changesets * fix(test): adjust tests after recent changes * docs: clean up docstrings in common.ts * feat: more precise information about skipped package * fix(ci): adjust E2E tests initial fling scrolling to longer lists * feat: more metadata in LicenseObj * docs: instructions to install packages as dev dependencies * chore: updated missing docstring after CR * chore: upgraded project.pbxproj * chore: updated iOS demo gif * fix(test): matchers for iOS E2E tests to take into account the version text present on items
1 parent e89ba1f commit 55f23b6

29 files changed

Lines changed: 347 additions & 143 deletions

.changeset/lazy-corners-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'license-kit': minor
3+
---
4+
5+
Support for scanning of conflicting versions of installed libraries

.changeset/modern-beds-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@callstack/react-native-legal-shared': minor
3+
---
4+
5+
Support for scanning of conflicting versions of installed libraries

.changeset/smart-drinks-rest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-legal': minor
3+
---
4+
5+
Support for scanning of conflicting versions of installed libraries, fixed missing links on screen items on Android

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Automagically generate license acknowledgements for your React Native app and an
3636

3737
| Android | iOS | AndroidTV | tvOS |
3838
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
39-
| ![Android example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-expo.gif) | ![iOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/ios-expo.gif) | ![AndroidTV example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-tv.gif) | ![tvOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/tvos.gif) |
39+
| ![Android example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-expo.gif) | ![iOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/ios-bare.gif) | ![AndroidTV example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-tv.gif) | ![tvOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/tvos.gif) |
4040

4141
## Documentation
4242

@@ -71,13 +71,13 @@ npm i --save-dev license-kit
7171
### Node.js - API
7272

7373
```sh
74-
yarn add @callstack/react-native-legal-shared
74+
yarn add -D @callstack/react-native-legal-shared
7575
```
7676

7777
or
7878

7979
```sh
80-
npm i --save @callstack/react-native-legal-shared
80+
npm i --save-dev @callstack/react-native-legal-shared
8181
```
8282

8383
## Usage

docs/docs/docs/programmatic-usage.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ In case your use case involves programmatic usage of the functionality provided
1212

1313
To get started, install the package using your preferred package manager:
1414

15-
<PackageManagerTabs command="install @callstack/react-native-legal-shared" />
15+
<PackageManagerTabs
16+
command={{
17+
npm: 'npm install -D @callstack/react-native-legal-shared',
18+
pnpm: 'pnpm add -D @callstack/react-native-legal-shared',
19+
yarn: 'yarn add -D @callstack/react-native-legal-shared',
20+
bun: 'bun add -d @callstack/react-native-legal-shared',
21+
}}
22+
/>
1623

1724
## Usage
1825

@@ -48,7 +55,7 @@ const licensePlistReport = generateLicensePlistNPMOutput(licenses);
4855
const markdownString = md
4956
.joinBlocks(
5057
Object.entries(licenses)
51-
.flatMap(([packageName, { version, author, content, description, file, type, url }]) => [
58+
.flatMap(([packageKey, { name: packageName, version, author, content, description, file, type, url }]) => [
5259
md.heading(packageName, { level: 2 }),
5360
'\n',
5461
`Version: ${version}<br/>\n`,

docs/docs/docs/react-native.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To get started, install the package using your preferred package manager:
1313

1414
<PackageManagerTabs command="install react-native-legal" />
1515

16-
| ![Android example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-expo.gif) | ![iOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/ios-expo.gif) | ![AndroidTV example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-tv.gif) | ![tvOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/tvos.gif) |
16+
| ![Android example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-expo.gif) | ![iOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/ios-bare.gif) | ![AndroidTV example](https://github.com/callstackincubator/react-native-legal/raw/main/static/android-tv.gif) | ![tvOS example](https://github.com/callstackincubator/react-native-legal/raw/main/static/tvos.gif) |
1717
| :-----------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: |
1818
| **Android** | **iOS** | **AndroidTV** | **tvOS** |
1919

docs/docs/docs/standalone-cli.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ We expose the `license-kit` package as a CLI for managing and analyzing Open Sou
1212

1313
To get started, install the package using your preferred package manager:
1414

15-
<PackageManagerTabs command="install license-kit" />
15+
<PackageManagerTabs
16+
command={{
17+
npm: 'npm install -D license-kit',
18+
pnpm: 'pnpm add -D license-kit',
19+
yarn: 'yarn add -D license-kit',
20+
bun: 'bun add -d license-kit',
21+
}}
22+
/>
1623

1724
## Features
1825

examples/bare-example/e2e/checkLicenses/android.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tags:
1212
- assertVisible: 'OSS Notice'
1313
# workaround for long list issue taking ages to scroll to 'r*' packages (causing a timeout)
1414
- repeat:
15-
times: 7
15+
times: 10
1616
commands:
1717
- swipe:
1818
start: 50%, 90%

examples/bare-example/e2e/checkLicenses/ios.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ tags:
1212
- assertVisible: 'OSS Notice'
1313
# workaround for long list issue taking ages to scroll to 'r*' packages (causing a timeout)
1414
- repeat:
15-
times: 2
15+
times: 4
1616
commands:
1717
- swipe:
18-
start: 50%, 90%
18+
start: 50%, 95%
1919
end: 50%, 0%
2020
duration: 50
2121
- scrollUntilVisible:
2222
label: Scroll to React Native library
23-
element: 'react-native'
23+
element: 'react-native (.*)'
2424
direction: 'DOWN'
2525
timeout: 100000
2626
speed: 80
2727
- takeScreenshot: 'e2e_results/react-native_list_element'
28-
- tapOn: 'react-native'
28+
- tapOn: 'react-native (.*)'
2929
- takeScreenshot: 'e2e_results/react-native_entry'
30-
- assertVisible: 'react-native'
30+
- assertVisible: 'react-native (.*)'
3131
- assertVisible: 'MIT License'
3232
- assertVisible: 'OSS Notice'
3333
- tapOn: 'OSS Notice'

examples/bare-example/ios/ReactNativeLegalBareExample.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
);
302302
runOnlyForDeploymentPostprocessing = 0;
303303
shellPath = /bin/sh;
304-
shellScript = "${PODS_ROOT}/LicensePlist/license-plist --output-path ./Settings.bundle";
304+
shellScript = "${PODS_ROOT}/LicensePlist/license-plist --add-version-numbers --output-path ./Settings.bundle";
305305
};
306306
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
307307
isa = PBXShellScriptBuildPhase;

0 commit comments

Comments
 (0)