Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
22 changes: 22 additions & 0 deletions .github/workflows/mobile-sdk-demo-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Mobile SDK Demo CI

on:
pull_request:
paths:
- "packages/mobile-sdk-alpha/demo-app/**"
- ".github/workflows/mobile-sdk-demo-ci.yml"
- ".github/actions/**"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Run demo app tests
run: |
yarn workspace demo-app test
- name: Build demo app
run: |
yarn workspace demo-app build
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"packages/*",
"prover/tests",
"sdk/*",
"scripts/tests"
"scripts/tests",
"packages/mobile-sdk-alpha/demo-app"
],
"scripts": {
"build": "yarn workspaces foreach --topological-dev --parallel --exclude @selfxyz/contracts -i --all run build",
Expand Down
1 change: 1 addition & 0 deletions packages/mobile-sdk-alpha/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
demo-app/**
19 changes: 19 additions & 0 deletions packages/mobile-sdk-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,22 @@ describe('Real mobile-sdk-alpha Integration', () => {
- `npm run validate:exports` — ensure named exports only.
- `npm run validate:pkg` — check packaging and export conditions.
- `npm run report:exports` — output current public symbols.

## Self Demo App

The Self Demo App is a lightweight React Native playground in [`demo-app`](./demo-app).

```bash
# start Metro bundler
yarn workspace demo-app start

# type-check
yarn workspace demo-app build

# run tests
yarn workspace demo-app test

# or via package scripts
cd packages/mobile-sdk-alpha
yarn run:demo
```
17 changes: 17 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import React from 'react';
import { View, Text } from 'react-native';

export default function App() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ fontSize: 20, marginBottom: 12 }}>Self Demo App</Text>
<Text>Register Document</Text>
<Text>Generate Mock</Text>
<Text>Prove QR Code</Text>
</View>
);
}
14 changes: 14 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import React from 'react';
import renderer from 'react-test-renderer';
import { Text } from 'react-native';
import App from '../App';

test('renders menu items', () => {
const rendered = renderer.create(<App />);
const texts = rendered.root.findAllByType(Text).map(node => node.props.children);
expect(texts).toEqual(['Self Demo App', 'Register Document', 'Generate Mock', 'Prove QR Code']);
});
4 changes: 4 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "SelfDemoApp",
"displayName": "Self Demo App"
}
7 changes: 7 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
10 changes: 10 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import { AppRegistry } from 'react-native';

import App from './App';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);
9 changes: 9 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: ['node_modules/(?!(react-native|@react-native|@selfxyz)/)'],
};
25 changes: 25 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/metro.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

const path = require('path');
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

const projectRoot = __dirname;
const sdkRoot = path.resolve(projectRoot, '..');
const monorepoRoot = path.resolve(projectRoot, '../../..');

const config = {
projectRoot,
watchFolders: [sdkRoot],
resolver: {
nodeModulesPaths: [path.resolve(projectRoot, 'node_modules'), path.resolve(monorepoRoot, 'node_modules')],
extraNodeModules: {
'@babel/runtime': path.resolve(monorepoRoot, 'node_modules', '@babel/runtime'),
},
unstable_enableSymlinks: true,
unstable_enablePackageExports: true,
},
};

module.exports = mergeConfig(getDefaultConfig(projectRoot), config);
25 changes: 25 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "demo-app",
"version": "0.0.1",
"private": true,
"main": "index.js",
"scripts": {
"start": "react-native start",
"build": "tsc -p tsconfig.json --noEmit --pretty false",
"test": "jest"
},
"dependencies": {
"@babel/runtime": "^7.25.0",
"react": "18.3.1",
"react-native": "0.76.9"
},
"devDependencies": {
"@tsconfig/react-native": "3.0.0",
"@types/jest": "29.5.11",
"@types/react": "18.3.4",
"jest": "29.7.0",
"metro-react-native-babel-preset": "0.76.9",
"react-test-renderer": "18.3.1",
"typescript": "5.9.2"
}
}
8 changes: 8 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/src/GenerateMock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

export default function GenerateMock() {
// TODO: implement mock generation
return null;
}
8 changes: 8 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/src/ProveQRCode.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

export default function ProveQRCode() {
// TODO: implement QR code proof
return null;
}
8 changes: 8 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/src/RegisterDocument.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

export default function RegisterDocument() {
// TODO: implement register document flow
return null;
}
7 changes: 7 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@tsconfig/react-native/tsconfig.json",
"compilerOptions": {
"strict": true
},
"include": ["src", "App.tsx", "index.js"]
}
5 changes: 4 additions & 1 deletion packages/mobile-sdk-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
"typecheck": "tsc -p tsconfig.json --noEmit",
"types": "tsc -p tsconfig.json --noEmit",
"validate:exports": "node ./scripts/validate-exports.mjs",
"validate:pkg": "node ./scripts/verify-conditions.mjs"
"validate:pkg": "node ./scripts/verify-conditions.mjs",
"run:demo": "yarn workspace demo-app start",
"build:demo": "yarn workspace demo-app build",
"test:demo": "yarn workspace demo-app test"
},
"dependencies": {
"@selfxyz/common": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions packages/mobile-sdk-alpha/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
setupFiles: ['./tests/setup.ts'],
exclude: ['demo-app/**'],
},
});
Loading
Loading