Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
627b708
Refactor mobile app utilities into new modules
transphorm Nov 7, 2025
1a96451
prettier
transphorm Nov 7, 2025
09337e3
update lock, feedback from codex
transphorm Nov 7, 2025
78c4cbb
fix path
transphorm Nov 7, 2025
c3115ec
keep some files in utils
transphorm Nov 7, 2025
d15fbdb
fix tests
transphorm Nov 7, 2025
740445f
Merge branch 'dev' into codex/restructure-utils-and-organize-project-…
transphorm Nov 8, 2025
91a0138
Merge branch 'dev' into codex/restructure-utils-and-organize-project-…
transphorm Nov 8, 2025
8ac17b3
update paths
transphorm Nov 8, 2025
ebe307d
remove old docs
transphorm Nov 8, 2025
7ccc282
cr feedback
transphorm Nov 8, 2025
a15d84b
flatten inefficient paths
transphorm Nov 8, 2025
c598c44
better structure
transphorm Nov 8, 2025
4deb1db
update test folder structure
transphorm Nov 8, 2025
e123454
migrate images
transphorm Nov 8, 2025
c9df435
fix import
transphorm Nov 8, 2025
c117d9b
fix Sentry path
transphorm Nov 8, 2025
57b7550
Merge branch 'dev' into codex/restructure-utils-and-organize-project-…
transphorm Nov 11, 2025
54b48e5
Merge branch 'dev' into codex/restructure-utils-and-organize-project-…
transphorm Nov 12, 2025
2c9c71c
update ignore
transphorm Nov 12, 2025
721544e
save wip migration
transphorm Nov 12, 2025
5bcc9c8
more updates
transphorm Nov 12, 2025
961e979
standardize component names
transphorm Nov 12, 2025
02da491
rename assets
transphorm Nov 12, 2025
83d24a6
fix linting
transphorm Nov 12, 2025
a425e22
add barrel exports. final refactor commit
transphorm Nov 12, 2025
df43d65
fix formatting
transphorm Nov 12, 2025
7cf4b1e
fix nav bar
transphorm Nov 12, 2025
652ddcf
reduce bundle size
transphorm Nov 12, 2025
d012c36
remove dupe license
transphorm Nov 12, 2025
7105a66
fix test
transphorm Nov 12, 2025
671eb02
Merge branch 'dev' into codex/restructure-utils-and-organize-project-…
transphorm Nov 12, 2025
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
5 changes: 2 additions & 3 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
f506113a22e5b147132834e4659f5af308448389:app/tests/utils/deeplinks.test.ts:generic-api-key:183
5a67b5cc50f291401d1da4e51706d0cfcf1c2316:app/tests/utils/deeplinks.test.ts:generic-api-key:182
0e4555eee6589aa9cca68f451227b149277d8c90:app/tests/src/utils/points/api.test.ts:generic-api-key:34
feb433e3553f8a7fa6c724b2de5a3e32ef079880:app/ios/Podfile.lock:generic-api-key:2594
3d0e1b4589680df2451031913d067b1b91dafa60:app/ios/Podfile.lock:generic-api-key:2594
3d0e1b4589680df2451031913d067b1b91dafa60:app/tests/utils/deeplinks.test.ts:generic-api-key:208
app/ios/Podfile.lock:generic-api-key:2594
app/tests/src/navigation/deeplinks.test.ts:generic-api-key:208
circuits/circuits/gcp_jwt_verifier/example_jwt.txt:jwt:1
25 changes: 15 additions & 10 deletions app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ module.exports = {
},
],

// Custom rule to prevent export * (bad for tree shaking)
// This rule prevents the use of export * which disables tree shaking
// and can significantly increase bundle size. Use selective exports instead.
'no-restricted-syntax': [
'error',
{
selector: 'ExportAllDeclaration',
message:
'export * is forbidden. Use selective exports for better tree shaking. Example: export { specific1, specific2 } from "./module"',
},
],

// Override rules conflicting with TypeScript union formatting

'@typescript-eslint/indent': 'off',
Expand All @@ -191,11 +203,11 @@ module.exports = {
{
// Disable export sorting for files with dependency issues
files: [
'src/components/NavBar/BaseNavBar.tsx',
'src/components/navbar/BaseNavBar.tsx',
'src/navigation/index.tsx',
'src/providers/passportDataProvider.tsx',
'src/utils/cloudBackup/helpers.ts',
'src/utils/haptic/index.ts',
'src/services/cloud-backup/helpers.ts',
'src/integrations/haptics/index.ts',
],
rules: {
'sort-exports/sort-exports': 'off',
Expand Down Expand Up @@ -226,13 +238,6 @@ module.exports = {
'no-console': 'off',
},
},
{
// Allow require imports for dynamic imports in proving machine
files: ['src/utils/proving/provingMachine.ts'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
// Allow require imports for conditional loading in navigation
files: ['src/navigation/index.tsx'],
Expand Down
10 changes: 5 additions & 5 deletions app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import {
TURNKEY_ORGANIZATION_ID,
} from './env';
import ErrorBoundary from './src/components/ErrorBoundary';
import { initSentry, wrapWithSentry } from './src/config/sentry';
import {
TURNKEY_OAUTH_REDIRECT_URI_ANDROID,
TURNKEY_OAUTH_REDIRECT_URI_IOS,
} from './src/devtools/mocks';
import AppNavigation from './src/navigation';
import { AuthProvider } from './src/providers/authProvider';
import { DatabaseProvider } from './src/providers/databaseProvider';
Expand All @@ -28,11 +33,6 @@ import { NotificationTrackingProvider } from './src/providers/notificationTracki
import { PassportProvider } from './src/providers/passportDataProvider';
import { RemoteConfigProvider } from './src/providers/remoteConfigProvider';
import { SelfClientProvider } from './src/providers/selfClientProvider';
import { initSentry, wrapWithSentry } from './src/Sentry';
import {
TURNKEY_OAUTH_REDIRECT_URI_ANDROID,
TURNKEY_OAUTH_REDIRECT_URI_IOS,
} from './src/utils/constants';

import 'react-native-get-random-values';
import 'react-native-url-polyfill/auto';
Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import App from './App';
import { name as appName } from './app.json';
import tamaguiConfig from './tamagui.config';

import './src/utils/ethers';
import './src/utils/crypto/ethers';
import 'react-native-gesture-handler';

// Set global Buffer before any other imports
Expand Down
6 changes: 3 additions & 3 deletions app/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ const NativeModules = {
// Make it available globally for any code that expects it
global.NativeModules = NativeModules;

// Mock @/utils/passportReader to properly expose the interface expected by tests
jest.mock('./src/utils/passportReader', () => {
// Mock @/integrations/nfc/passportReader to properly expose the interface expected by tests
jest.mock('./src/integrations/nfc/passportReader', () => {
const mockScanPassport = jest.fn();
// Mock the parameter count for scanPassport (iOS native method takes 9 parameters)
Object.defineProperty(mockScanPassport, 'length', { value: 9 });
Expand Down Expand Up @@ -905,7 +905,7 @@ jest.mock('react-native-localize', () => ({
}),
}));

jest.mock('./src/utils/notifications/notificationService', () =>
jest.mock('./src/services/notifications/notificationService', () =>
require('./tests/__setup__/notificationServiceMock.js'),
);

Expand Down
15 changes: 9 additions & 6 deletions app/scripts/tests/aliasImports.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ describe('alias-imports transform', () => {
const appRoot = tempRoot;
const srcDir = join(appRoot, 'src');
const testsSrcDir = join(appRoot, 'tests', 'src');
const fileHaptic = join(srcDir, 'utils', 'haptic.ts');
const fileHaptic = join(srcDir, 'integrations', 'haptics.ts');
const deepSpecDir = join(testsSrcDir, 'deep');
const deepSpecFile = join(deepSpecDir, 'spec.ts');

writeFileEnsured(fileHaptic, 'export const h = 1;\n');
writeFileEnsured(
deepSpecFile,
"import { h } from '../../../src/utils/haptic';\nexport const v = h;\n",
"import { h } from '../../../src/integrations/haptics';\nexport const v = h;\n",
);

const project = new Project({
Expand All @@ -203,21 +203,24 @@ describe('alias-imports transform', () => {
const specFile = project.getSourceFileOrThrow(deepSpecFile);
const imports = specFile.getImportDeclarations();
assert.strictEqual(imports.length, 1);
assert.strictEqual(imports[0].getModuleSpecifierValue(), '@/utils/haptic');
assert.strictEqual(
imports[0].getModuleSpecifierValue(),
'@/integrations/haptics',
);
});

it("transforms deep relative require '../../../src/...' to @src alias from tests", () => {
const appRoot = tempRoot;
const srcDir = join(appRoot, 'src');
const testsSrcDir = join(appRoot, 'tests', 'src');
const fileHaptic = join(srcDir, 'utils', 'haptic.ts');
const fileHaptic = join(srcDir, 'integrations', 'haptics.ts');
const deepSpecDir = join(testsSrcDir, 'deep');
const deepSpecFile = join(deepSpecDir, 'req.ts');

writeFileEnsured(fileHaptic, 'module.exports = { h: 1 };\n');
writeFileEnsured(
deepSpecFile,
"const h = require('../../../src/utils/haptic');\nexport const v = h;\n",
"const h = require('../../../src/integrations/haptics');\nexport const v = h;\n",
);

const project = new Project({
Expand All @@ -232,7 +235,7 @@ describe('alias-imports transform', () => {
transformProjectToAliasImports(project, appRoot);

const specFile = project.getSourceFileOrThrow(deepSpecFile);
assert.ok(specFile.getText().includes("require('@/utils/haptic')"));
assert.ok(specFile.getText().includes("require('@/integrations/haptics')"));
});

it('aliases export star re-exports with ../ from sibling directory', () => {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions app/src/components/Disclosures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import type { Country3LetterCode } from '@selfxyz/common/constants';
import { countryCodes } from '@selfxyz/common/constants';
import type { SelfAppDisclosureConfig } from '@selfxyz/common/utils';
import { BodyText } from '@selfxyz/mobile-sdk-alpha/components';
import { slate200, slate500 } from '@selfxyz/mobile-sdk-alpha/constants/colors';

import CheckMark from '@/images/icons/checkmark.svg';
import { slate200, slate500 } from '@/utils/colors';
import CheckMark from '@/assets/icons/checkmark.svg';

interface DisclosureProps {
disclosures: SelfAppDisclosureConfig;
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { ErrorInfo } from 'react';
import React, { Component } from 'react';
import { Text, View } from 'react-native';

import { captureException } from '@/Sentry';
import { flushAllAnalytics, trackNfcEvent } from '@/utils/analytics';
import { captureException } from '@/config/sentry';
import { flushAllAnalytics, trackNfcEvent } from '@/services/analytics';

interface Props {
children: React.ReactNode;
Expand Down
11 changes: 8 additions & 3 deletions app/src/components/FeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ import { Alert, Modal, StyleSheet, Text, TextInput, View } from 'react-native';
import { Button, XStack, YStack } from 'tamagui';

import { Caption } from '@selfxyz/mobile-sdk-alpha/components';

import { black, slate400, white, zinc800, zinc900 } from '@/utils/colors';
import { advercase, dinot } from '@/utils/fonts';
import {
black,
slate400,
white,
zinc800,
zinc900,
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
import { advercase, dinot } from '@selfxyz/mobile-sdk-alpha/constants/fonts';

interface FeedbackModalProps {
visible: boolean;
Expand Down
8 changes: 4 additions & 4 deletions app/src/components/FeedbackModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
SecondaryButton,
Title,
} from '@selfxyz/mobile-sdk-alpha/components';
import { white } from '@selfxyz/mobile-sdk-alpha/constants/colors';

import ModalClose from '@/images/icons/modal_close.svg';
import LogoInversed from '@/images/logo_inversed.svg';
import { white } from '@/utils/colors';
import { confirmTap, impactLight } from '@/utils/haptic';
import ModalClose from '@/assets/icons/modal_close.svg';
import LogoInversed from '@/assets/images/logo_inversed.svg';
import { confirmTap, impactLight } from '@/integrations/haptics';

const ModalBackDrop = styled(View, {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Text, View, XStack, YStack } from 'tamagui';

import { DelayedLottieView } from '@selfxyz/mobile-sdk-alpha';

import CloseWarningIcon from '@/images/icons/close-warning.svg';
import Plus from '@/images/icons/plus_slate600.svg';
import {
black,
cyan300,
Expand All @@ -19,9 +16,12 @@ import {
white,
zinc500,
zinc900,
} from '@/utils/colors';
import { extraYPadding } from '@/utils/constants';
import { advercase, dinot } from '@/utils/fonts';
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
import { advercase, dinot } from '@selfxyz/mobile-sdk-alpha/constants/fonts';

import CloseWarningIcon from '@/assets/icons/close_warning.svg';
import Plus from '@/assets/icons/plus_slate600.svg';
import { extraYPadding } from '@/utils/styleUtils';

interface LoadingUIProps {
animationSource: LottieView['props']['source'];
Expand Down
7 changes: 4 additions & 3 deletions app/src/components/Mnemonic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import React, { useCallback, useState } from 'react';
import { Button, Text, XStack, YStack } from 'tamagui';
import Clipboard from '@react-native-clipboard/clipboard';

import { useSettingStore } from '@/stores/settingStore';
import {
black,
slate50,
Expand All @@ -15,8 +14,10 @@ import {
slate500,
teal500,
white,
} from '@/utils/colors';
import { confirmTap } from '@/utils/haptic';
} from '@selfxyz/mobile-sdk-alpha/constants/colors';

import { confirmTap } from '@/integrations/haptics';
import { useSettingStore } from '@/stores/settingStore';

interface MnemonicProps {
words?: string[];
Expand Down
8 changes: 0 additions & 8 deletions app/src/components/NavBar/index.ts

This file was deleted.

14 changes: 7 additions & 7 deletions app/src/components/PointHistoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import { Card, Text, View, XStack, YStack } from 'tamagui';

import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import { PointEvents } from '@selfxyz/mobile-sdk-alpha/constants/analytics';

import HeartIcon from '@/images/icons/heart.svg';
import StarBlackIcon from '@/images/icons/star_black.svg';
import { usePointEventStore } from '@/stores/pointEventStore';
import {
black,
blue600,
Expand All @@ -26,9 +22,13 @@ import {
slate400,
slate500,
white,
} from '@/utils/colors';
import { dinot, plexMono } from '@/utils/fonts';
import type { PointEvent } from '@/utils/points';
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
import { dinot, plexMono } from '@selfxyz/mobile-sdk-alpha/constants/fonts';

import HeartIcon from '@/assets/icons/heart.svg';
import StarBlackIcon from '@/assets/icons/star_black.svg';
import type { PointEvent } from '@/services/points';
import { usePointEventStore } from '@/stores/pointEventStore';

type Section = {
title: string;
Expand Down
3 changes: 1 addition & 2 deletions app/src/components/Tips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import React from 'react';
import { Text, View } from 'tamagui';

import { Caption } from '@selfxyz/mobile-sdk-alpha/components';

import { slate500 } from '@/utils/colors';
import { slate500 } from '@selfxyz/mobile-sdk-alpha/constants/colors';

export interface TipProps {
title: string;
Expand Down
8 changes: 6 additions & 2 deletions app/src/components/WebViewFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import React from 'react';
import { ArrowLeft, ArrowRight, RotateCcw } from '@tamagui/lucide-icons';

import { Button, XStack, YStack } from '@selfxyz/mobile-sdk-alpha/components';
import {
black,
slate50,
slate400,
} from '@selfxyz/mobile-sdk-alpha/constants/colors';

import { black, slate50, slate400 } from '@/utils/colors';
import { buttonTap } from '@/utils/haptic';
import { buttonTap } from '@/integrations/haptics';

export interface WebViewFooterProps {
canGoBack: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ import {
} from '@selfxyz/common/constants';
import type { PassportData } from '@selfxyz/common/types/passport';
import { isAadhaarDocument, isMRZDocument } from '@selfxyz/common/utils/types';
import AadhaarIcon from '@selfxyz/mobile-sdk-alpha/svgs/icons/aadhaar.svg';
import EPassport from '@selfxyz/mobile-sdk-alpha/svgs/icons/epassport.svg';

import { SvgXml } from '@/components/homeScreen/SvgXmlWrapper';
import LogoGray from '@/images/logo_gray.svg';
import {
black,
slate100,
slate300,
slate400,
slate500,
white,
} from '@/utils/colors';
import { dinot, plexMono } from '@/utils/fonts';
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
import { dinot, plexMono } from '@selfxyz/mobile-sdk-alpha/constants/fonts';
import AadhaarIcon from '@selfxyz/mobile-sdk-alpha/svgs/icons/aadhaar.svg';
import EPassport from '@selfxyz/mobile-sdk-alpha/svgs/icons/epassport.svg';

import LogoGray from '@/assets/images/logo_gray.svg';
import { SvgXml } from '@/components/homescreen/SvgXmlWrapper';

// Import the logo SVG as a string
const logoSvg = `<svg width="47" height="46" viewBox="0 0 47 46" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

// Re-export from the native version - Metro resolver will automatically
// pick the appropriate platform-specific file (.web.tsx or .native.tsx)
export { SvgXml } from '@/components/homeScreen/SvgXmlWrapper.native';
export { default } from '@/components/homeScreen/SvgXmlWrapper.native';
export { SvgXml } from '@/components/homescreen/SvgXmlWrapper.native';
export { default } from '@/components/homescreen/SvgXmlWrapper.native';
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ import type { NativeStackHeaderProps } from '@react-navigation/native-stack';
import { ChevronLeft, HelpCircle } from '@tamagui/lucide-icons';

import { Button, XStack, YStack } from '@selfxyz/mobile-sdk-alpha/components';
import {
black,
slate100,
slate300,
} from '@selfxyz/mobile-sdk-alpha/constants/colors';
import { dinot } from '@selfxyz/mobile-sdk-alpha/constants/fonts';

import { NavBar } from '@/components/NavBar/BaseNavBar';
import { black, slate100, slate300 } from '@/utils/colors';
import { extraYPadding } from '@/utils/constants';
import { dinot } from '@/utils/fonts';
import { buttonTap } from '@/utils/haptic';
import { NavBar } from '@/components/navbar/BaseNavBar';
import { buttonTap } from '@/integrations/haptics';
import { extraYPadding } from '@/utils/styleUtils';

export const AadhaarNavBar = (props: NativeStackHeaderProps) => {
const insets = useSafeAreaInsets();
Expand Down
Loading
Loading