Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 9 additions & 4 deletions app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -26,9 +27,6 @@ module.exports = {
'web/dist/',
'.tamagui/*',
'*.js.map',
'*.d.ts',
'metro.config.cjs',
'docs/examples/',
'tests/e2e/',
],
settings: {
Expand Down Expand Up @@ -167,6 +165,14 @@ module.exports = {
'@typescript-eslint/indent': 'off',
},
overrides: [
{
files: ['docs/examples/**/*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'no-unused-vars': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['tests/**/*.{ts,tsx}'],
parserOptions: {
Expand Down Expand Up @@ -196,7 +202,6 @@ module.exports = {
sourceType: 'script',
},
rules: {
'header/header': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-undef': 'off',
},
Expand Down
1 change: 1 addition & 0 deletions app/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
// Granular import example: Circuit utilities only
// This will tree-shake out passport parsing, certificate parsing, etc.

import { generateCircuitInputsDSC } from '@selfxyz/common/utils/circuits';

Check failure on line 5 in app/docs/examples/tree-shaking/granular-circuits-example.ts

View workflow job for this annotation

GitHub Actions / lint

Run autofix to sort these imports!
import type { PassportData } from '@selfxyz/common/types/passport';

export function exampleCircuitUsage(passportData: PassportData) {
Expand Down
1 change: 1 addition & 0 deletions app/docs/examples/tree-shaking/level2-optimal-example.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
// Level 2 Granular Import Example - Optimal Tree Shaking
// This demonstrates the new file-based imports for maximum optimization

// Import only core constants (no country data, vkey, etc.)
import {

Check failure on line 6 in app/docs/examples/tree-shaking/level2-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Run autofix to sort these imports!
API_URL,
PASSPORT_ATTESTATION_ID,
} from '@selfxyz/common/constants/core';
Expand All @@ -17,11 +18,11 @@
// This will result in the smallest possible bundle
// Only the specific functions and constants we use are included

console.log('Using API:', API_URL);

Check warning on line 21 in app/docs/examples/tree-shaking/level2-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
console.log('Attestation ID:', PASSPORT_ATTESTATION_ID);

Check warning on line 22 in app/docs/examples/tree-shaking/level2-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

const hashedData = hash(JSON.stringify(data));
console.log('Hashed passport data:', hashedData);

Check warning on line 25 in app/docs/examples/tree-shaking/level2-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

return {
api: API_URL,
Expand Down
1 change: 1 addition & 0 deletions app/docs/examples/tree-shaking/level3-migration-guide.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
/**
* LEVEL 3 MIGRATION GUIDE - Function-Level Granular Imports
*
Expand Down Expand Up @@ -25,7 +26,7 @@
// ============================================================================

// ✅ Hash Functions - Import only what you need
import { hash } from '@selfxyz/common/utils/hash/sha'; // ~3KB instead of 15KB

Check failure on line 29 in app/docs/examples/tree-shaking/level3-migration-guide.ts

View workflow job for this annotation

GitHub Actions / lint

Run autofix to sort these imports!
import { flexiblePoseidon } from '@selfxyz/common/utils/hash/poseidon'; // ~2KB instead of 15KB
// No need to import custom hash functions if not used

Expand Down Expand Up @@ -68,7 +69,7 @@
* USE CASE 2: Circuit Worker - Only needs circuit generation
* Bundle size reduction: ~45KB → ~8KB (82% smaller!)
*/
export function circuitWorkerOptimalImports() {

Check failure on line 72 in app/docs/examples/tree-shaking/level3-migration-guide.ts

View workflow job for this annotation

GitHub Actions / lint

Expected circuitWorkerOptimalImports before frontendOptimalImports
// Only import the specific circuit generator needed
// import { generateCircuitInputsDSC } from '@selfxyz/common/utils/circuits/dscInputs';
// import { flexiblePoseidon } from '@selfxyz/common/utils/hash/poseidon';
Expand All @@ -79,7 +80,7 @@
* USE CASE 3: Certificate Parser - Only needs certificate operations
* Bundle size reduction: ~35KB → ~10KB (71% smaller!)
*/
export function certificateParserOptimalImports() {

Check failure on line 83 in app/docs/examples/tree-shaking/level3-migration-guide.ts

View workflow job for this annotation

GitHub Actions / lint

Expected certificateParserOptimalImports before circuitWorkerOptimalImports
// Only import certificate-specific functions
// import { parseCertificateSimple } from '@selfxyz/common/utils/certificates/parseSimple';
// import { identifyCurve } from '@selfxyz/common/utils/certificates/curveUtils';
Expand Down
1 change: 1 addition & 0 deletions app/docs/examples/tree-shaking/level3-optimal-example.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
// Level 3 Function-Based Import Example - Maximum Tree Shaking
// This demonstrates the new function-level imports for ultimate optimization
// ✅ Uses clean re-exports (safe, no regression risk)

// ✅ LEVEL 3: Import only specific hash functions (not entire hash module)
import { hash } from '@selfxyz/common/utils/hash/sha';

Check failure on line 7 in app/docs/examples/tree-shaking/level3-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Run autofix to sort these imports!
import { flexiblePoseidon } from '@selfxyz/common/utils/hash/poseidon';

// ✅ LEVEL 3: Import only specific circuit generator (not entire circuits module)
Expand All @@ -30,16 +31,16 @@
// Only the specific individual functions we use are included
// Bundle size reduction: ~75-90% compared to broad imports!

console.log('Using API:', API_URL);

Check warning on line 34 in app/docs/examples/tree-shaking/level3-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
console.log('Attestation ID:', PASSPORT_ATTESTATION_ID);

Check warning on line 35 in app/docs/examples/tree-shaking/level3-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

// Use specific hash function from SHA module
const hashedData = hash([1, 2, 3, 4], 'hex');
console.log('SHA hashed data:', hashedData);

Check warning on line 39 in app/docs/examples/tree-shaking/level3-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

// Use specific Poseidon function for commitment
const poseidonHash = flexiblePoseidon([BigInt(1), BigInt(2)]);
console.log('Poseidon hash:', poseidonHash);

Check warning on line 43 in app/docs/examples/tree-shaking/level3-optimal-example.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

// Use specific passport functions
const parsedData = initPassportDataParsing(data);
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/helpers/android.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module Fastlane
module Helpers
module Android
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/helpers/common.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module Fastlane
module Helpers
module Common
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/helpers/ios.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module Fastlane
module Helpers
module IOS
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/helpers/slack.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module Fastlane
module Helpers
module Slack
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/test/app_name_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
require "minitest/autorun"
require "json"
require "tmpdir"
Expand Down
1 change: 1 addition & 0 deletions app/fastlane/test/helpers_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
require "minitest/autorun"
require_relative "../helpers"

Expand Down
1 change: 1 addition & 0 deletions app/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
Expand Down
1 change: 1 addition & 0 deletions app/metro.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('node:path');

Check failure on line 3 in app/metro.config.cjs

View workflow job for this annotation

GitHub Actions / lint

Expected 1 empty line after require statement not followed by another require
const defaultConfig = getDefaultConfig(__dirname);
const { assetExts, sourceExts } = defaultConfig.resolver;

Expand Down
1 change: 1 addition & 0 deletions app/react-native.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
module.exports = {
project: {
ios: {},
Expand Down
1 change: 1 addition & 0 deletions app/scripts/analyze-tree-shaking.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/bundle-analyze-ci.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { execSync } = require('child_process');
const fs = require('fs');
const os = require('os');
Expand All @@ -23,7 +24,7 @@
return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];
}

function checkBundleSize(bundleSize, platform) {

Check warning on line 27 in app/scripts/bundle-analyze-ci.cjs

View workflow job for this annotation

GitHub Actions / lint

'platform' is already declared in the upper scope on line 8 column 7
const thresholdMB = BUNDLE_THRESHOLDS_MB[platform];
const thresholdBytes = thresholdMB * 1024 * 1024;

Expand Down
1 change: 1 addition & 0 deletions app/scripts/check-duplicate-headers.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

const fs = require('fs');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/cleanup-ios-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
# Reset Xcode project after local fastlane builds
set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions app/scripts/generate-changelog.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

# Simple changelog generator that creates release notes from git history
# Usage: ./generate-changelog.sh [from_tag] [to_tag]
Expand Down
1 change: 1 addition & 0 deletions app/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11

# Simple release script for manual version bumping and tagging
# Usage: ./release.sh [major|minor|patch]
Expand Down
1 change: 1 addition & 0 deletions app/scripts/test-e2e-local.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
# Unified Local E2E Testing Script
# Run this from the app directory

Expand Down
1 change: 1 addition & 0 deletions app/scripts/test-tree-shaking.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/tests/alias-imports.test.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { describe, it, beforeEach } = require('node:test');
const assert = require('node:assert');
const path = require('node:path');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/tests/bundle-analyze-ci.test.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/tests/cleanup-ios-build.test.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const fs = require('fs');
const path = require('path');
const os = require('os');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/tests/mobile-deploy-confirm-module.test.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { describe, it } = require('node:test');
const assert = require('node:assert');
const child_process = require('child_process');
Expand Down
1 change: 1 addition & 0 deletions app/scripts/tests/tree-shaking.test.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
const { describe, it } = require('node:test');
const assert = require('node:assert');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions app/src/types/png.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
declare module '*.png' {
const content: any;
export default content;
Expand Down
1 change: 1 addition & 0 deletions app/src/types/svg.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
declare module '*.svg' {
import React from 'react';
import { SvgProps } from 'react-native-svg';
Expand Down
Loading