react-native-legal 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/bare-plugin/build/android/androidCommand.js +3 -3
- package/bare-plugin/build/ios/iosCommand.js +3 -3
- package/bare-plugin/src/android/androidCommand.ts +1 -1
- package/bare-plugin/src/ios/iosCommand.ts +1 -1
- package/package.json +2 -2
- package/plugin/build/android/withAndroidLegal.js +3 -3
- package/plugin/build/ios/withIosLegal.js +3 -3
- package/plugin/src/android/withAndroidLegal.ts +1 -1
- package/plugin/src/ios/withIosLegal.ts +1 -1
- package/plugin-utils/build/android.js +2 -2
- package/plugin-utils/src/android.ts +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-legal" align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<img alt="React Native Legal" src="
|
|
3
|
+
<img alt="React Native Legal" src="https://github.com/callstackincubator/react-native-legal/raw/refs/heads/main/images/rn-legal-banner.jpg">
|
|
4
4
|
</picture>
|
|
5
5
|
</a>
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|

|
|
14
14
|

|
|
15
15
|

|
|
16
|
-

|
|
17
17
|

|
|
18
18
|

|
|
19
19
|
|
|
@@ -71,13 +71,13 @@ npm i --save-dev license-kit
|
|
|
71
71
|
### Node.js - API
|
|
72
72
|
|
|
73
73
|
```sh
|
|
74
|
-
yarn add -D @callstack/
|
|
74
|
+
yarn add -D @callstack/licenses
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
or
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
|
-
npm i --save-dev @callstack/
|
|
80
|
+
npm i --save-dev @callstack/licenses
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
## Usage
|
|
@@ -86,8 +86,8 @@ This tool is split into 4 parts:
|
|
|
86
86
|
|
|
87
87
|
- a React Native library that lets you display native screen with a list of all dependencies and their licenses
|
|
88
88
|
- an [Expo config plugin](https://docs.expo.dev/config-plugins/introduction/?redirected) (for Expo projects) and a [custom community cli plugin](https://github.com/react-native-community/cli/blob/main/docs/plugins.md) (for bare RN projects)
|
|
89
|
-
- a standalone CLI tool that can be used in any Node.js project to generate license metadata
|
|
90
|
-
- a shared package that exposes the core functionality of the license management tool, allowing customization of presentation logic in your Node.js scripts
|
|
89
|
+
- a standalone CLI tool that can be used in any Node.js project to generate license metadata (`license-kit`)
|
|
90
|
+
- a shared package that exposes the core functionality of the license management tool, allowing customization of presentation logic in your Node.js scripts (`@callstack/licenses`)
|
|
91
91
|
|
|
92
92
|
### I want to generate licenses in my Expo project <a name="usage-expo"></a>
|
|
93
93
|
|
|
@@ -181,7 +181,7 @@ For a list of supported flags and the default values, run `npx license-kit --hel
|
|
|
181
181
|
|
|
182
182
|
### I want to customize the presentation of the licenses in my JS/TS project
|
|
183
183
|
|
|
184
|
-
You can use the `@callstack/
|
|
184
|
+
You can use the `@callstack/licenses` package to access the core functionalities of the license management tool. To do so, please read the [programmatic usage documentation](https://callstackincubator.github.io/react-native-legal/docs/programmatic-usage#usage).
|
|
185
185
|
|
|
186
186
|
## Expo
|
|
187
187
|
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.androidCommand = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const licenses_1 = require("@callstack/licenses");
|
|
9
9
|
const addListActivity_1 = require("./addListActivity");
|
|
10
10
|
const applyAndConfigureAboutLibrariesPlugin_1 = require("./applyAndConfigureAboutLibrariesPlugin");
|
|
11
11
|
const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
|
|
@@ -16,8 +16,8 @@ const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
|
|
|
16
16
|
* installs & configures AboutLibraries Gradle plugin and adds Android Activity with a list of dependencies and their licenses
|
|
17
17
|
*/
|
|
18
18
|
function androidCommand(androidProjectPath) {
|
|
19
|
-
const licenses = (0,
|
|
20
|
-
(0,
|
|
19
|
+
const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(path_1.default.resolve(androidProjectPath, '..'), 'package.json'));
|
|
20
|
+
(0, licenses_1.writeAboutLibrariesNPMOutput)(licenses, androidProjectPath);
|
|
21
21
|
(0, declareAboutLibrariesPlugin_1.declareAboutLibrariesPlugin)(androidProjectPath);
|
|
22
22
|
(0, applyAndConfigureAboutLibrariesPlugin_1.applyAndConfigureAboutLibrariesPlugin)(androidProjectPath);
|
|
23
23
|
(0, addListActivity_1.addListActivity)(androidProjectPath);
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.iosCommand = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const licenses_1 = require("@callstack/licenses");
|
|
9
9
|
const addSettingsBundle_1 = require("./addSettingsBundle");
|
|
10
10
|
const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPhase");
|
|
11
11
|
/**
|
|
@@ -15,8 +15,8 @@ const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPha
|
|
|
15
15
|
* configures Settings.bundle and registers a shell script generating LicensePlist metadata for iOS dependencies
|
|
16
16
|
*/
|
|
17
17
|
function iosCommand(iosProjectPath) {
|
|
18
|
-
const licenses = (0,
|
|
19
|
-
(0,
|
|
18
|
+
const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(path_1.default.resolve(iosProjectPath, '..'), 'package.json'));
|
|
19
|
+
(0, licenses_1.writeLicensePlistNPMOutput)(licenses, iosProjectPath);
|
|
20
20
|
(0, addSettingsBundle_1.addSettingsBundle)(iosProjectPath);
|
|
21
21
|
(0, registerLicensePlistBuildPhase_1.registerLicensePlistBuildPhase)(iosProjectPath);
|
|
22
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/
|
|
3
|
+
import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/licenses';
|
|
4
4
|
|
|
5
5
|
import { addListActivity } from './addListActivity';
|
|
6
6
|
import { applyAndConfigureAboutLibrariesPlugin } from './applyAndConfigureAboutLibrariesPlugin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/
|
|
3
|
+
import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/licenses';
|
|
4
4
|
|
|
5
5
|
import { addSettingsBundle } from './addSettingsBundle';
|
|
6
6
|
import { registerLicensePlistBuildPhase } from './registerLicensePlistBuildPhase';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-legal",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Acknowledge OSS libraries used in your React Native app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react-native-builder-bob": "0.23.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@callstack/
|
|
61
|
+
"@callstack/licenses": "^0.2.1",
|
|
62
62
|
"glob": "^7.1.3",
|
|
63
63
|
"xcode": "^3.0.1",
|
|
64
64
|
"xml2js": "^0.6.2"
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.withAndroidLegal = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const licenses_1 = require("@callstack/licenses");
|
|
9
9
|
const config_plugins_1 = require("expo/config-plugins");
|
|
10
10
|
const addListActivity_1 = require("./addListActivity");
|
|
11
11
|
const applyAndConfigureAboutLibrariesPlugin_1 = require("./applyAndConfigureAboutLibrariesPlugin");
|
|
@@ -18,8 +18,8 @@ const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
|
|
|
18
18
|
*/
|
|
19
19
|
const withAndroidLegal = (config) => {
|
|
20
20
|
(0, config_plugins_1.withAndroidManifest)(config, async (exportedConfig) => {
|
|
21
|
-
const licenses = (0,
|
|
22
|
-
(0,
|
|
21
|
+
const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
|
|
22
|
+
(0, licenses_1.writeAboutLibrariesNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
|
|
23
23
|
return exportedConfig;
|
|
24
24
|
});
|
|
25
25
|
config = (0, declareAboutLibrariesPlugin_1.declareAboutLibrariesPlugin)(config);
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.withIosLegal = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const licenses_1 = require("@callstack/licenses");
|
|
9
9
|
const config_plugins_1 = require("expo/config-plugins");
|
|
10
10
|
const addSettingsBundle_1 = require("./addSettingsBundle");
|
|
11
11
|
const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPhase");
|
|
@@ -17,8 +17,8 @@ const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPha
|
|
|
17
17
|
*/
|
|
18
18
|
const withIosLegal = (config) => {
|
|
19
19
|
(0, config_plugins_1.withXcodeProject)(config, async (exportedConfig) => {
|
|
20
|
-
const licenses = (0,
|
|
21
|
-
(0,
|
|
20
|
+
const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
|
|
21
|
+
(0, licenses_1.writeLicensePlistNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
|
|
22
22
|
return exportedConfig;
|
|
23
23
|
});
|
|
24
24
|
config = (0, addSettingsBundle_1.addSettingsBundle)(config);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/
|
|
3
|
+
import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/licenses';
|
|
4
4
|
import { type ConfigPlugin, withAndroidManifest } from 'expo/config-plugins';
|
|
5
5
|
|
|
6
6
|
import { addListActivity } from './addListActivity';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/
|
|
3
|
+
import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/licenses';
|
|
4
4
|
import { type ConfigPlugin, withXcodeProject } from 'expo/config-plugins';
|
|
5
5
|
|
|
6
6
|
import { addSettingsBundle } from './addSettingsBundle';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addListActivityUtil = exports.applyAndConfigureAboutLibrariesPluginUtil = exports.declareAboutLibrariesPluginUtil = void 0;
|
|
4
|
-
const
|
|
4
|
+
const licenses_1 = require("@callstack/licenses");
|
|
5
5
|
/**
|
|
6
6
|
* Applies Gradle Plugin Portal & AboutLibraries Gradle plugin repositories (if needed) inside root build.gradle
|
|
7
7
|
*/
|
|
@@ -55,7 +55,7 @@ exports.applyAndConfigureAboutLibrariesPluginUtil = applyAndConfigureAboutLibrar
|
|
|
55
55
|
*/
|
|
56
56
|
function addListActivityUtil(activities) {
|
|
57
57
|
const listActivity = prepareListActivity();
|
|
58
|
-
if (!
|
|
58
|
+
if (!licenses_1.MiscUtils.arrayIncludesObject(activities, listActivity)) {
|
|
59
59
|
activities?.push(listActivity);
|
|
60
60
|
console.log('About Libraries activity - ADDED');
|
|
61
61
|
}
|