Skip to content

Commit e26ed21

Browse files
authored
Merge branch 'main' into feature/network-detection-switching
2 parents 25f3972 + 1f93056 commit e26ed21

556 files changed

Lines changed: 59773 additions & 7276 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.detoxrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ module.exports = {
1818
type: 'ios.app',
1919
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/SubTrackr.app',
2020
build:
21-
'xcodebuild -workspace ios/subtrackr.xcworkspace -scheme subtrackr -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
21+
'xcodebuild -workspace ios/SubTrackr.xcworkspace -scheme SubTrackr -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
2222
},
2323
'ios.release': {
2424
type: 'ios.app',
2525
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/SubTrackr.app',
2626
build:
27-
'xcodebuild -workspace ios/subtrackr.xcworkspace -scheme subtrackr -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
27+
'xcodebuild -workspace ios/SubTrackr.xcworkspace -scheme SubTrackr -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
2828
},
2929
'android.debug': {
3030
type: 'android.apk',

.eslintrc.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,32 @@
1111
},
1212
"rules": {
1313
"prettier/prettier": "error",
14-
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
14+
"@typescript-eslint/no-unused-vars": [
15+
"error",
16+
{
17+
"argsIgnorePattern": "^_",
18+
"varsIgnorePattern": "^_",
19+
"caughtErrorsIgnorePattern": "^_",
20+
"destructuredArrayIgnorePattern": "^_"
21+
}
22+
],
1523
"@typescript-eslint/explicit-function-return-type": "off",
1624
"@typescript-eslint/no-explicit-any": "warn",
17-
"no-console": ["warn", { "allow": ["warn", "error"] }]
25+
"no-console": ["warn", { "allow": ["warn", "error"] }],
26+
"import/no-unresolved": [
27+
"error",
28+
{
29+
"ignore": [
30+
"@sentry/react-native",
31+
"bcryptjs",
32+
"expo-image",
33+
"expo-linking",
34+
"expo-local-authentication",
35+
"react-native-performance",
36+
"../../backend/services/shared/monitoring"
37+
]
38+
}
39+
]
1840
},
1941
"ignorePatterns": [
2042
"node_modules/",

.github/workflows/ci.yml

Lines changed: 136 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: '20'
11-
RUST_VERSION: '1.85'
11+
RUST_VERSION: '1.88'
1212

1313
jobs:
1414
commitlint:
@@ -39,7 +39,7 @@ jobs:
3939
run: npm ci --legacy-peer-deps
4040

4141
- name: Validate PR commits
42-
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose
42+
run: npx commitlint --from=origin/${{ github.event.pull_request.base.ref }} --to=HEAD --verbose
4343

4444
# ─────────────────────────────────────────────────────────
4545
# TypeScript / React Native Checks
@@ -50,6 +50,8 @@ jobs:
5050
steps:
5151
- name: Checkout code
5252
uses: actions/checkout@v4
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
5355

5456
- name: Setup Node.js
5557
uses: actions/setup-node@v4
@@ -69,7 +71,30 @@ jobs:
6971
run: npm ci --legacy-peer-deps
7072

7173
- name: Check formatting (Prettier)
74+
id: prettier-check
7275
run: npm run format:check
76+
continue-on-error: true
77+
78+
- name: Auto-fix formatting issues
79+
if: steps.prettier-check.outcome == 'failure'
80+
run: |
81+
echo "Formatting inconsistencies detected. Executing auto-fixer..."
82+
npm run format:write || npx prettier --write "src/**/*.{ts,tsx,js,json,md}"
83+
84+
- name: Commit and Push formatting fixes
85+
if: steps.prettier-check.outcome == 'failure'
86+
uses: stefanzweifel/git-auto-commit-action@v5
87+
with:
88+
commit_message: 'chore: automated code formatting fixes via CI pipeline'
89+
commit_user_name: 'github-actions[bot]'
90+
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
91+
92+
- name: Enforce strict layout check
93+
if: steps.prettier-check.outcome == 'failure'
94+
run: |
95+
echo "❌ Code styles were inconsistent. Automated modifications have been pushed to your branch."
96+
echo "Please pull latest changes locally or wait for the subsequent workflow run execution pass."
97+
exit 1
7398
7499
- name: Run ESLint
75100
run: npm run lint
@@ -201,6 +226,19 @@ jobs:
201226
if: steps.cache-node-modules.outputs.cache-hit != 'true'
202227
run: npm ci --legacy-peer-deps
203228

229+
- name: Patch metro exports for @expo/cli compatibility
230+
run: |
231+
node -e "
232+
const fs=require('fs');
233+
const p='node_modules/metro/package.json';
234+
if(!fs.existsSync(p)) process.exit(0);
235+
const m=JSON.parse(fs.readFileSync(p,'utf8'));
236+
if(!m.exports||m.exports['./src/lib/TerminalReporter']) process.exit(0);
237+
m.exports['./src/lib/TerminalReporter']='./src/lib/TerminalReporter.js';
238+
fs.writeFileSync(p,JSON.stringify(m,null,2));
239+
console.log('Patched metro exports to add ./src/lib/TerminalReporter');
240+
"
241+
204242
- name: Run Expo export
205243
run: npm run build
206244
env:
@@ -265,9 +303,9 @@ jobs:
265303
uses: actions/cache@v4
266304
with:
267305
path: |
268-
~/.cargo/registry/index/
269-
~/.cargo/registry/cache/
270-
~/.cargo/git/db/
306+
~/cargo/registry/index/
307+
~/cargo/registry/cache/
308+
~/cargo/git/db/
271309
contracts/target/
272310
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
273311
restore-keys: |
@@ -293,9 +331,9 @@ jobs:
293331
uses: actions/cache@v4
294332
with:
295333
path: |
296-
~/.cargo/registry/index/
297-
~/.cargo/registry/cache/
298-
~/.cargo/git/db/
334+
~/cargo/registry/index/
335+
~/cargo/registry/cache/
336+
~/cargo/git/db/
299337
contracts/target/
300338
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
301339
restore-keys: |
@@ -321,9 +359,9 @@ jobs:
321359
uses: actions/cache@v4
322360
with:
323361
path: |
324-
~/.cargo/registry/index/
325-
~/.cargo/registry/cache/
326-
~/.cargo/git/db/
362+
~/cargo/registry/index/
363+
~/cargo/registry/cache/
364+
~/cargo/git/db/
327365
contracts/target/
328366
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
329367
restore-keys: |
@@ -339,15 +377,47 @@ jobs:
339377
load-test:
340378
name: k6 Load Test
341379
runs-on: ubuntu-latest
380+
continue-on-error: true
381+
strategy:
382+
fail-fast: false
383+
matrix:
384+
scenario: [subscription, billing, contract]
342385
steps:
343386
- name: Checkout code
344387
uses: actions/checkout@v4
345388

346-
- name: Run k6 Load Test
347-
uses: grafana/k6-action@v0.5.1
389+
- name: Prepare reports directory
390+
run: mkdir -p load-tests/reports
391+
392+
- name: Install k6
393+
run: |
394+
sudo gpg -k
395+
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg \
396+
--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
397+
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" \
398+
| sudo tee /etc/apt/sources.list.d/k6.list
399+
sudo apt-get update
400+
sudo apt-get install -y k6
401+
402+
- name: Run k6 Load Test (${{ matrix.scenario }})
403+
run: k6 run load-tests/run.js --env SCENARIO=${{ matrix.scenario }} --quiet
404+
405+
- name: Rename report for this scenario
406+
if: always()
407+
run: |
408+
for ext in json md html; do
409+
if [ -f "load-tests/reports/summary.$ext" ]; then
410+
mv "load-tests/reports/summary.$ext" "load-tests/reports/${{ matrix.scenario }}.$ext"
411+
fi
412+
done
413+
414+
- name: Upload load test report
415+
if: always()
416+
uses: actions/upload-artifact@v4
348417
with:
349-
filename: load-tests/run.js
350-
flags: --env SCENARIO=subscription
418+
name: load-test-report-${{ matrix.scenario }}
419+
path: load-tests/reports/
420+
if-no-files-found: ignore
351421

352422
# ─────────────────────────────────────────────────────────
353423
# Bundle Size Monitoring
@@ -370,12 +440,24 @@ jobs:
370440
- name: Install dependencies
371441
run: npm ci --legacy-peer-deps
372442

443+
- name: Patch metro exports for @expo/cli compatibility
444+
run: |
445+
node -e "
446+
const fs=require('fs');
447+
const p='node_modules/metro/package.json';
448+
if(!fs.existsSync(p)) process.exit(0);
449+
const m=JSON.parse(fs.readFileSync(p,'utf8'));
450+
if(!m.exports||m.exports['./src/lib/TerminalReporter']) process.exit(0);
451+
m.exports['./src/lib/TerminalReporter']='./src/lib/TerminalReporter.js';
452+
fs.writeFileSync(p,JSON.stringify(m,null,2));
453+
console.log('Patched metro exports to add ./src/lib/TerminalReporter');
454+
"
455+
373456
- name: Check bundle size (PR)
374457
if: github.event_name == 'pull_request'
375-
uses: andresz1/size-limit-action@v1
376-
with:
377-
github_token: ${{ secrets.GITHUB_TOKEN }}
378-
build_script: 'npm run build'
458+
run: npx size-limit
459+
env:
460+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
379461

380462
- name: Build app
381463
if: github.event_name != 'pull_request'
@@ -392,6 +474,36 @@ jobs:
392474
name: bundle-size-report-${{ github.sha }}
393475
path: bundle-size-report.json
394476

477+
# ─────────────────────────────────────────────────────────
478+
# Performance Monitoring
479+
# ─────────────────────────────────────────────────────────
480+
performance:
481+
name: Performance Budget Check
482+
runs-on: ubuntu-latest
483+
steps:
484+
- name: Checkout code
485+
uses: actions/checkout@v4
486+
487+
- name: Setup Node.js
488+
uses: actions/setup-node@v4
489+
with:
490+
node-version: ${{ env.NODE_VERSION }}
491+
cache: 'npm'
492+
493+
- name: Cache node modules
494+
uses: actions/cache@v4
495+
id: cache-node-modules
496+
with:
497+
path: node_modules
498+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
499+
500+
- name: Install dependencies
501+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
502+
run: npm ci --legacy-peer-deps
503+
504+
- name: Run performance benchmark
505+
run: npm run performance:benchmark
506+
395507
# ─────────────────────────────────────────────────────────
396508
# Merge Protection (only on PRs)
397509
# ─────────────────────────────────────────────────────────
@@ -413,6 +525,7 @@ jobs:
413525
rust-build,
414526
load-test,
415527
bundle-size,
528+
performance,
416529
]
417530
steps:
418531
- name: All checks passed
@@ -439,6 +552,7 @@ jobs:
439552
rust-build,
440553
load-test,
441554
bundle-size,
555+
performance,
442556
]
443557
steps:
444558
- name: Check for failures
@@ -457,8 +571,9 @@ jobs:
457571
[ "${{ needs.rust-tests.result }}" != "success" ] || \
458572
[ "${{ needs.rust-build.result }}" != "success" ] || \
459573
[ "${{ needs.load-test.result }}" != "success" ] || \
460-
[ "${{ needs.bundle-size.result }}" != "success" ]; then
574+
[ "${{ needs.bundle-size.result }}" != "success" ] || \
575+
[ "${{ needs.performance.result }}" != "success" ]; then
461576
echo "One or more CI checks failed"
462577
exit 1
463578
fi
464-
echo "All CI checks passed successfully!"
579+
echo "All CI checks passed successfully!"

.github/workflows/e2e-detox.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ jobs:
8282
java-version: '17'
8383
- name: Expo Prebuild
8484
run: npx expo prebuild -p android
85+
- name: Patch Kotlin 1.9 to 2.1.20 in expo Gradle included builds
86+
run: |
87+
for f in \
88+
node_modules/expo-dev-launcher/expo-dev-launcher-gradle-plugin/build.gradle.kts \
89+
node_modules/expo-modules-autolinking/android/expo-gradle-plugin/build.gradle.kts \
90+
node_modules/expo-modules-autolinking/android/expo-gradle-plugin/expo-autolinking-plugin-shared/build.gradle.kts \
91+
node_modules/expo-modules-core/expo-module-gradle-plugin/build.gradle.kts; do
92+
if [ -f "$f" ]; then
93+
sed -i 's/version "1\.[0-9][^"]*"/version "2.1.20"/g' "$f"
94+
echo "Patched $f: $(grep -E 'version \"[0-9]' $f | head -2)"
95+
fi
96+
done
97+
[ -f android/build.gradle ] && \
98+
sed -i 's/kotlinVersion = "1\.[0-9][^"]*"/kotlinVersion = "2.1.20"/' android/build.gradle || true
8599
- name: Build Detox Android
86100
run: npm run e2e:build-android
87101
- name: Detox Android — core lifecycle

.github/workflows/fuzz-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
components: llvm-tools
4444

4545
- name: Install cargo-fuzz
46-
run: cargo install cargo-fuzz --locked
46+
run: cargo install --git https://github.com/rust-fuzz/cargo-fuzz cargo-fuzz
4747

4848
- name: Restore seed corpus from cache
4949
uses: actions/cache@v4

0 commit comments

Comments
 (0)