Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
55 changes: 55 additions & 0 deletions .github/workflows/docstring-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docstring coverage

on:
pull_request:
branches:
- dev
- staging
- main
push:
branches:
- dev
- staging
- main

jobs:
docstring-coverage:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v4

- name: Cache Yarn dependencies
uses: ./.github/actions/cache-yarn
with:
path: |
.yarn/cache
node_modules
*/node_modules
packages/*/node_modules
cache-version: v1

- name: Install dependencies
uses: ./.github/actions/yarn-install

- name: Generate docstring coverage reports
run: |
yarn docstrings:app > /tmp/docstrings-app.log
yarn docstrings:sdk > /tmp/docstrings-sdk.log
yarn docstrings:report
echo "::group::Mobile app coverage (tail)"
tail -n 25 /tmp/docstrings-app.log || true
echo "::endgroup::"
echo "::group::Mobile SDK coverage (tail)"
tail -n 25 /tmp/docstrings-sdk.log || true
echo "::endgroup::"

- name: Upload coverage snapshots
uses: actions/upload-artifact@v4
with:
name: docstring-coverage
path: |
docs/coverage/*.json
if-no-files-found: warn
14 changes: 14 additions & 0 deletions app/docs/DOCSTRING_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Mobile app docstring style guide

Docstrings for the React Native app live alongside the source in `app/src`. We follow [TSDoc](https://tsdoc.org) conventions so that typed tooling can generate consistent API documentation.

## Authoring guidelines

- Document every exported component, hook, utility, or type alias with a leading `/** ... */` block written in the imperative mood.
- Include `@param`, `@returns`, and `@remarks` tags when they improve clarity, especially for side-effects or platform-specific behaviour.
- Keep examples concise. Prefer inline code blocks for short snippets and use fenced blocks only when you need multiple lines.
- Mention platform differences explicitly (for example, “iOS only”) so consumers understand the scope of the implementation.

## Coverage expectations

Docstring coverage is now monitored through `yarn docstrings:app` and the aggregate `yarn docstrings:report`. The GitHub Actions workflow uploads JSON snapshots from `docs/coverage/*.json`, but coverage targets are not enforced yet—missing docstrings will not block builds. Treat the reports as guardrails and follow up in subsequent PRs if you need to land behaviour quickly.
5 changes: 2 additions & 3 deletions app/metro.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ const config = {
],

transformer: {
babelTransformerPath: require.resolve(
'react-native-svg-transformer/react-native',
),
babelTransformerPath:
require.resolve('react-native-svg-transformer/react-native'),
disableImportExportTransform: true,
inlineRequires: true,
},
Expand Down
6 changes: 4 additions & 2 deletions app/src/screens/app/ModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ const ModalBackDrop = styled(View, {
height: '100%',
});

export interface ModalNavigationParams
extends Omit<ModalParams, 'onButtonPress' | 'onModalDismiss'> {
export interface ModalNavigationParams extends Omit<
ModalParams,
'onButtonPress' | 'onModalDismiss'
> {
callbackId: number;
}

Expand Down
5 changes: 2 additions & 3 deletions app/src/services/points/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ export const getWhiteListedDisclosureAddresses = async (): Promise<
export const hasUserAnIdentityDocumentRegistered =
async (): Promise<boolean> => {
try {
const { loadDocumentCatalogDirectlyFromKeychain } = await import(
'@/providers/passportDataProvider'
);
const { loadDocumentCatalogDirectlyFromKeychain } =
await import('@/providers/passportDataProvider');
const catalog = await loadDocumentCatalogDirectlyFromKeychain();

return catalog.documents.some(doc => doc.isRegistered === true);
Expand Down
10 changes: 4 additions & 6 deletions app/src/stores/pointEventStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,10 @@ export const usePointEventStore = create<PointEventState>()((set, get) => ({

loadDisclosureEvents: async () => {
try {
const { getDisclosurePointEvents } = await import(
'@/services/points/getEvents'
);
const { useProofHistoryStore } = await import(
'@/stores/proofHistoryStore'
);
const { getDisclosurePointEvents } =
await import('@/services/points/getEvents');
const { useProofHistoryStore } =
await import('@/stores/proofHistoryStore');
await useProofHistoryStore.getState().initDatabase();
const disclosureEvents = await getDisclosurePointEvents();
const existingEvents = get().events.filter(e => e.type !== 'disclosure');
Expand Down
214 changes: 214 additions & 0 deletions docs/coverage/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"generatedAt": "2025-10-29T04:28:48.352Z",
"label": "Mobile App",
"totals": {
"exports": 389,
"documented": 38,
"undocumented": 351,
"coverage": 9.77
},
"undocumentedTotal": 351,
"undocumentedSampled": 50,
"undocumented": [
{
"file": "app/src/assets/animations/loader.ts",
"symbol": "loadMiscAnimation"
},
{
"file": "app/src/assets/animations/loader.ts",
"symbol": "loadPassportAnimation"
},
{
"file": "app/src/components/BackupDocumentationLink.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/Disclosures.tsx",
"symbol": "Disclosures"
},
{
"file": "app/src/components/ErrorBoundary.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/FeedbackModal.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/FeedbackModalScreen.tsx",
"symbol": "FeedbackModalScreenParams"
},
{
"file": "app/src/components/FeedbackModalScreen.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/homeScreen/idCard.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/homeScreen/SvgXmlWrapper.native.tsx",
"symbol": "SvgXml"
},
{
"file": "app/src/components/homeScreen/SvgXmlWrapper.native.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/homeScreen/SvgXmlWrapper.web.tsx",
"symbol": "SvgXml"
},
{
"file": "app/src/components/homeScreen/SvgXmlWrapper.web.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/loading/LoadingUI.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/Mnemonic.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/native/PassportCamera.tsx",
"symbol": "PassportCameraProps"
},
{
"file": "app/src/components/native/PassportCamera.tsx",
"symbol": "PassportCamera"
},
{
"file": "app/src/components/native/PassportCamera.web.tsx",
"symbol": "PassportCameraProps"
},
{
"file": "app/src/components/native/PassportCamera.web.tsx",
"symbol": "PassportCamera"
},
{
"file": "app/src/components/native/QRCodeScanner.tsx",
"symbol": "QRCodeScannerViewProps"
},
{
"file": "app/src/components/native/QRCodeScanner.tsx",
"symbol": "QRCodeScannerView"
},
{
"file": "app/src/components/native/QRCodeScanner.web.tsx",
"symbol": "QRCodeScannerViewProps"
},
{
"file": "app/src/components/native/QRCodeScanner.web.tsx",
"symbol": "QRCodeScannerView"
},
{
"file": "app/src/components/native/QRCodeScanner.web.tsx",
"symbol": "default export"
},
{
"file": "app/src/components/native/RCTFragment.tsx",
"symbol": "FragmentProps"
},
{
"file": "app/src/components/native/RCTFragment.tsx",
"symbol": "RCTFragmentViewManagerProps"
},
{
"file": "app/src/components/native/RCTFragment.tsx",
"symbol": "RCTFragment"
},
{
"file": "app/src/components/NavBar/AadhaarNavBar.tsx",
"symbol": "AadhaarNavBar"
},
{
"file": "app/src/components/NavBar/BaseNavBar.tsx",
"symbol": "LeftAction"
},
{
"file": "app/src/components/NavBar/BaseNavBar.tsx",
"symbol": "RightAction"
},
{
"file": "app/src/components/NavBar/BaseNavBar.tsx",
"symbol": "NavBar"
},
{
"file": "app/src/components/NavBar/DefaultNavBar.tsx",
"symbol": "DefaultNavBar"
},
{
"file": "app/src/components/NavBar/DocumentFlowNavBar.tsx",
"symbol": "DocumentFlowNavBar"
},
{
"file": "app/src/components/NavBar/HomeNavBar.tsx",
"symbol": "HomeNavBar"
},
{
"file": "app/src/components/NavBar/IdDetailsNavBar.tsx",
"symbol": "IdDetailsNavBar"
},
{
"file": "app/src/components/NavBar/WebViewNavBar.tsx",
"symbol": "WebViewNavBarProps"
},
{
"file": "app/src/components/NavBar/WebViewNavBar.tsx",
"symbol": "WebViewNavBar"
},
{
"file": "app/src/components/Tips.tsx",
"symbol": "TipProps"
},
{
"file": "app/src/components/Tips.tsx",
"symbol": "Tips"
},
{
"file": "app/src/components/WebViewFooter.tsx",
"symbol": "WebViewFooterProps"
},
{
"file": "app/src/components/WebViewFooter.tsx",
"symbol": "WebViewFooter"
},
{
"file": "app/src/consts/links.ts",
"symbol": "appStoreUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "gitHubUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "playStoreUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "privacyUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "selfUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "supportedBiometricIdsUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "telegramUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "termsUrl"
},
{
"file": "app/src/consts/links.ts",
"symbol": "xUrl"
}
]
}
Loading
Loading