Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@
"babel-jest": "^29.5.0",
"eslint": "^8.44.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"hermes-engine": "^0.11.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify these dependencies are not used by the library's source code and confirm the ideal location.

Moving these four packages to devDependencies ensures they won't be installed as runtime dependencies for library consumers. However, per the PR objectives, these should ideally be in the example app's package.json rather than the root devDependencies, since they appear to be example/sample-app-only dependencies.

Verify the following:

  1. Confirm that the library's source code in src/ does not import any of these packages: hermes-engine, react-native-safe-area-context, react-native-screens, react-native-webview
  2. Check whether an example app directory exists with its own package.json that should contain these dependencies
  3. Confirm that moving these to devDependencies (rather than the example app's package.json) is the intended final state, or if this is a temporary measure

Also applies to: 68-70


🏁 Script executed:

#!/bin/bash
# Description: Verify that the four moved packages are not imported in library source code

# Search for imports of the four moved packages in the src/ directory
echo "=== Searching for hermes-engine imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx 'from.*hermes|import.*hermes' src/

echo "=== Searching for react-native-safe-area-context imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx 'from.*safe-area-context|import.*safe-area-context' src/

echo "=== Searching for react-native-screens imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx 'from.*react-native-screens|import.*react-native-screens' src/

echo "=== Searching for react-native-webview imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx 'from.*react-native-webview|import.*react-native-webview' src/

echo "=== Checking if example directory exists ==="
fd -t d '^example$' .

echo "=== Listing contents of example directory if present ==="
find . -maxdepth 2 -type d -name example -exec ls -la {} \;

Length of output: 2088


🏁 Script executed:

#!/bin/bash
# Description: Verify package locations and verify no imports in library source

# Fix: Use simpler approach without problematic type flags
echo "=== Checking root package.json devDependencies section ==="
grep -A 30 '"devDependencies"' package.json | grep -E 'hermes-engine|react-native-safe-area-context|react-native-screens|react-native-webview'

echo "=== Checking example/package.json for these packages ==="
grep -E 'hermes-engine|react-native-safe-area-context|react-native-screens|react-native-webview' example/package.json

echo "=== Searching for package imports in src/ (hermes) ==="
rg -n 'hermes' src/ 2>/dev/null || echo "No hermes matches"

echo "=== Searching for package imports in src/ (safe-area-context) ==="
rg -n 'safe-area-context' src/ 2>/dev/null || echo "No safe-area-context matches"

echo "=== Searching for package imports in src/ (screens) ==="
rg -n 'react-native-screens' src/ 2>/dev/null || echo "No react-native-screens matches"

echo "=== Searching for package imports in src/ (webview) ==="
rg -n 'react-native-webview' src/ 2>/dev/null || echo "No react-native-webview matches"

echo "=== Full example/package.json contents ==="
cat example/package.json

Length of output: 3016


Move these packages to example/package.json instead of root devDependencies.

Verification confirms the library source code does not import any of these packages, so moving them from dependencies was correct. However, moving them to root devDependencies is problematic:

  1. hermes-engine is now duplicated: exists in both root devDependencies (from this PR) and example/package.json (existing)
  2. react-native-safe-area-context, react-native-screens, react-native-webview are in root devDependencies but missing from example/package.json where the example app needs them
  3. Root devDependencies should only contain dev tooling (linters, compilers, etc.), not app dependencies

Add these packages to example/package.json where the example app requires them, remove the duplication for hermes-engine, and remove all three from root devDependencies.

🤖 Prompt for AI Agents
In package.json around line 61, the PR incorrectly added app libraries to the
root devDependencies; remove "hermes-engine", "react-native-safe-area-context",
"react-native-screens", and "react-native-webview" from the root
devDependencies, ensure "hermes-engine" is not duplicated (keep it only in
example/package.json), and add "react-native-safe-area-context",
"react-native-screens", and "react-native-webview" into example/package.json (as
dependencies or devDependencies as appropriate for the example app) so the
example app has the required packages and the root devDependencies only contain
tooling.

"jest": "^29.5.0",
"metro-react-native-babel-preset": "^0.77.0",
"react": "^19.1.0",
"react-native": "^0.79.6",
"react-native-codegen": "^0.0.7",
"react-test-renderer": "^19.1.0",
"react-native-safe-area-context": "^5.6.1",
"react-native-screens": "^4.16.0",
"react-native-webview": "^13.16.0",
"typescript": "^5.8.3"
},
"peerDependencies": {
Expand Down Expand Up @@ -92,14 +96,6 @@
"bugs": {
"url": "https://github.com/Usercentrics/react-native-sdk/issues"
},
"dependencies": {
"hermes-engine": "^0.11.0",
"install": "^0.13.0",
"npm": "^11.6.0",
"react-native-safe-area-context": "^5.6.1",
"react-native-screens": "^4.16.0",
"react-native-webview": "^13.16.0"
},
"codegenConfig": {
"name": "RNUsercentricsModule",
"type": "all",
Expand Down