Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Jan 6, 2026

Summary

  • replace wildcard constants exports with named re-exports for better tree shaking
  • keep constants entrypoint mapping intact for Metro resolution

Testing

  • Not run (not requested)

Codex Task

Summary by CodeRabbit

  • Chores

    • Reorganized internal build scripts and package configuration across multiple workspaces for improved consistency.
    • Added demo mobile build script to streamline development workflow.
  • Refactor

    • Optimized internal constants organization through index consolidation for improved developer experience.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

A new constants barrel index was created to re-export analytics events, color tokens, font identifiers, and layout constants. Concurrently, package.json script entries were reorganized and consolidated across three configuration files to improve structure and eliminate duplication.

Changes

Cohort / File(s) Summary
Constants barrel
packages/mobile-sdk-alpha/src/constants/index.ts
New index file re-exporting analytics event types (AadhaarEvents, AppEvents, AuthEvents, etc.), color tokens (amber50, blue600, slate variants, zinc shades, etc.), font families (advercase, dinot, plexMono), NFC_IMAGE, and extraYPadding from submodules.
Build script reorganization
circuits/package.json
Relocated build:deps script entry to appear before build-all instead of after build-register-id; command unchanged.
Upgrade script consolidation
contracts/package.json
Added/reorganized upgrade, upgrade:status, and upgrade:history script entries; upgrade:status repositioned after upgrade:registry with identical command value.
Demo script consolidation
package.json
Consolidated demo:mobile script entry, removing duplicate placement while maintaining command: yarn build:mobile-sdk && yarn build:demo && yarn workspace mobile-sdk-demo start.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

📦 Constants bundled, scripts aligned,
A tidy barrel, neatly designed,
No logic shifted, just organized grace,
Duplicates trimmed from their rightful place! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks complete adherence to the template. While it covers what is being changed (Summary section), it omits the 'Tested' and 'How to QA' sections required by the template. Add 'Tested' section explaining test coverage and 'How to QA' section with repeatable testing steps, or clarify why testing details are not applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: refining constants re-exports in the mobile SDK by replacing wildcards with named exports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e43ca8 and 5cc0124.

📒 Files selected for processing (4)
  • circuits/package.json
  • contracts/package.json
  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Check types across the codebase by running yarn types
Run yarn types or yarn typecheck to check TypeScript types across the codebase
Run yarn build to build the package for distribution
Before committing changes, ensure TypeScript types are valid by running yarn types
Before committing changes, ensure the build succeeds by running yarn build
Before creating a PR, ensure yarn types passes (TypeScript validation)
Before creating a PR, ensure yarn build succeeds (package builds correctly)
Ensure no breaking changes to public API or document them properly
Verify cross-platform compatibility for both React Native and Web environments
This package uses TypeScript with strict type checking
Use ESLint with TypeScript-specific rules
Use platform detection Platform.OS === 'web' when adding platform-specific code
Maintain type definitions that are complete and accurate

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn lint to check for linting issues or yarn lint:fix to automatically fix them

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/index.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn validate:exports to verify that exports are properly configured

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
🧠 Learnings (26)
📓 Common learnings
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use real imports from `selfxyz/mobile-sdk-alpha` in tests instead of mocking the entire package
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use ES6 `import` statements instead of `require()` when possible
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Maintain type definitions that are complete and accurate
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before creating a PR, ensure `yarn types` passes (TypeScript validation)
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure the build succeeds by running `yarn build`
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/{package.json,app/app.json} : Bump version in `package.json` and `app.json` before deployment

Applied to files:

  • contracts/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • contracts/package.json
  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Document complex native module changes in PRs

Applied to files:

  • contracts/package.json
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Use `yarn build:deps` to build all workspace dependencies before running the app

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Run `yarn test:build` to build, test, check types, and lint in one comprehensive command

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Run `yarn build` to build the package for distribution

Applied to files:

  • circuits/package.json
  • package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Use Yarn workspaces for monorepo management in this project.

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Run yarn install once before running any other commands to install root dependencies and set up husky hooks

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Before creating a PR, ensure yarn build succeeds for all workspaces

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure the build succeeds by running `yarn build`

Applied to files:

  • circuits/package.json
  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Run `yarn fmt` to check formatting or `yarn fmt:fix` to automatically format files with Prettier

Applied to files:

  • circuits/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/package.json : Run `yarn validate:pkg` to verify that package conditions are valid

Applied to files:

  • package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before creating a PR, ensure `yarn build` succeeds (package builds correctly)

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure TypeScript types are valid by running `yarn types`

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Run `yarn types` or `yarn typecheck` to check TypeScript types across the codebase

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{js,ts,tsx,jsx} : Run `yarn lint` to check for linting issues or `yarn lint:fix` to automatically fix them

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Check types across the codebase by running `yarn types`

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before creating a PR, ensure `yarn types` passes (TypeScript validation)

Applied to files:

  • package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Maintain type definitions that are complete and accurate

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : This package uses TypeScript with strict type checking

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test
  • GitHub Check: test-common
  • GitHub Check: type-check
  • GitHub Check: run_circuit_tests
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
🔇 Additional comments (4)
contracts/package.json (1)

73-77: LGTM - Script reorganization improves consistency.

The upgrade-related scripts have been reorganized for better grouping. Commands remain unchanged, so this is purely an organizational improvement with no functional impact.

package.json (1)

20-20: LGTM - Demo script chains commands logically.

The new demo:mobile script properly chains the build and start commands in the correct sequence, ensuring the mobile SDK and demo are built before starting.

circuits/package.json (1)

8-8: LGTM - Script relocation has no functional impact.

The build:deps script has been moved to an earlier position within the scripts section. The command itself is unchanged, so this is purely organizational.

packages/mobile-sdk-alpha/src/constants/index.ts (1)

1-58: [Rewritten review comment]
[Classification tag]


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 580e382818

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/mobile-sdk-alpha/package.json (1)

37-65: Fix export configuration: import and react-native conditions must point to compiled JavaScript, not source TypeScript.

The exports for ./constants, ./constants/analytics, ./constants/colors, and ./constants/fonts (lines 37–65) are broken. The import and react-native conditions must reference compiled .js files from dist/esm/, not raw .ts source files. The types condition can reference source, but consumers expecting to import these will receive uncompiled TypeScript and fail at runtime.

Correct structure (per other exports like ./stores and ./components):

"types": "./dist/esm/constants/index.d.ts",
"react-native": "./dist/esm/constants/index.js",
"import": "./dist/esm/constants/index.js",
"require": "./dist/cjs/constants/index.cjs"

The current validation scripts won't catch this misconfiguration—they only check package structure, not path correctness. This is a breaking change for existing consumers.

🤖 Fix all issues with AI Agents
In @packages/mobile-sdk-alpha/src/constants/index.ts:
- Around line 1-54: Add the required license header at the top of the file, then
reorder the export groups to satisfy the sort-exports rule: place the analytics
export group (starting with AadhaarEvents) first, the images export (NFC_IMAGE)
next, then fonts (advercase), then colors (starting with amber50), and finally
layout (extraYPadding); after making these changes run the workspace linter
(yarn workspace @selfxyz/mobile-sdk-alpha lint:fix) to auto-fix/validate
formatting.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d02a730 and 580e382.

📒 Files selected for processing (2)
  • packages/mobile-sdk-alpha/package.json
  • packages/mobile-sdk-alpha/src/constants/index.ts
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Check types across the codebase by running yarn types
Run yarn types or yarn typecheck to check TypeScript types across the codebase
Run yarn build to build the package for distribution
Before committing changes, ensure TypeScript types are valid by running yarn types
Before committing changes, ensure the build succeeds by running yarn build
Before creating a PR, ensure yarn types passes (TypeScript validation)
Before creating a PR, ensure yarn build succeeds (package builds correctly)
Ensure no breaking changes to public API or document them properly
Verify cross-platform compatibility for both React Native and Web environments
This package uses TypeScript with strict type checking
Use ESLint with TypeScript-specific rules
Use platform detection Platform.OS === 'web' when adding platform-specific code
Maintain type definitions that are complete and accurate

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn lint to check for linting issues or yarn lint:fix to automatically fix them

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/index.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn validate:exports to verify that exports are properly configured

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
packages/mobile-sdk-alpha/**/package.json

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn validate:pkg to verify that package conditions are valid

Files:

  • packages/mobile-sdk-alpha/package.json
🧠 Learnings (23)
📓 Common learnings
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use real imports from `selfxyz/mobile-sdk-alpha` in tests instead of mocking the entire package
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use ES6 `import` statements instead of `require()` when possible
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Maintain type definitions that are complete and accurate
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before creating a PR, ensure `yarn types` passes (TypeScript validation)
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure the build succeeds by running `yarn build`
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Run `yarn build` to build the package for distribution
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : This package uses TypeScript with strict type checking
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Run `yarn types` or `yarn typecheck` to check TypeScript types across the codebase
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Maintain type definitions that are complete and accurate

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : This package uses TypeScript with strict type checking

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Run `yarn types` or `yarn typecheck` to check TypeScript types across the codebase

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Check types across the codebase by running `yarn types`

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure TypeScript types are valid by running `yarn types`

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use ES6 `import` statements instead of `require()` when possible

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Avoid nested `require('react')` or `require('react-native')` calls in test files - use ES6 import statements instead

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Use ES6 `import` statements exclusively - never use `require('react')` or `require('react-native')` in test files

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `@/` alias for src imports and `tests/` alias for test imports in TypeScript/JavaScript files.

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to app/.eslintrc.cjs : Configure ESLint to block `require('react')` and `require('react-native')` calls in test files using the 'no-restricted-syntax' rule with 'CallExpression' selectors

Applied to files:

  • packages/mobile-sdk-alpha/package.json
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Applies to {app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx} : Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Applied to files:

  • packages/mobile-sdk-alpha/package.json
🪛 GitHub Actions: Mobile SDK CI
packages/mobile-sdk-alpha/src/constants/index.ts

[error] 52-52: Lint step 'yarn workspace @selfxyz/mobile-sdk-alpha lint' failed: sort-exports/sort-exports error at 52:1 - "Expected advercase before amber50".

🪛 GitHub Actions: Workspace CI
packages/mobile-sdk-alpha/src/constants/index.ts

[error] 1-1: License header missing or incorrect in /home/runner/work/self/self/packages/mobile-sdk-alpha/src/constants/index.ts. Command 'yarn lint' exited with code 1. Run 'yarn lint --fix' to auto-fix header issues.

🪛 GitHub Check: lint
packages/mobile-sdk-alpha/src/constants/index.ts

[failure] 53-53:
Expected NFC_IMAGE before advercase


[failure] 52-52:
Expected advercase before amber50

⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test
  • GitHub Check: type-check
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android

@transphorm transphorm merged commit 6c420c2 into dev Jan 7, 2026
31 checks passed
@transphorm transphorm deleted the codex/fix-metro-resolver-warnings-for-missing-modules branch January 7, 2026 18:28
jcortejoso pushed a commit that referenced this pull request Jan 15, 2026
* Clarify constants re-exports

* Adjust constants export mapping

* agent feedback. sort all the tings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants