Skip to content

feat(ci): adding ymls to run proper CI on project - #4

Merged
gabriel-sisjr merged 11 commits into
developfrom
feature/ci-improvements
May 19, 2026
Merged

feat(ci): adding ymls to run proper CI on project#4
gabriel-sisjr merged 11 commits into
developfrom
feature/ci-improvements

Conversation

@gabriel-sisjr

@gabriel-sisjr gabriel-sisjr commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

This branch consolidates six workstreams that were pending to close the 0.1.x release cycle: (a) a complete CI matrix with five parallel jobs, (b) an automation suite for publishing, prereleases, and docs deploys, (c) a fix for the broken iOS build caused by a C++ symbol collision between Nitro and Swift, plus the migration to Swift 6 strict concurrency, (d) unblocking the example app on Android with Hermes by removing the root cause of dex duplication, (e) a new Docusaurus documentation site with 35 pages, and (f) replacing the placeholder example with a real showcase wired to the 7 public hooks. Library version bumped from 0.1.0 to 0.1.1.

Motivation

  • The iOS build was failing due to a collision between the Swift class SyncProvider and the C++ class margelo::nitro::syncprovider::SyncProvider generated by Nitro, along with multiple concurrency errors under Swift 6 (NSLock.lock()/defer unlock inside @Sendable closures).
  • The example app did not compile on Android: Hermes does not expose crypto.getRandomValues (breaking uuid v7), and applying the com.facebook.react plugin to the module caused :app:mergeLibDexDebug failures due to duplicated *ManagerDelegate classes in consumers.
  • The project had no release automation (npm publish, prereleases, changelog) and no automated documentation deploy.
  • The existing CI was minimal; it lacked parallel coverage of lint, JS tests, library build, Android build, and iOS build with simulator fallback.
  • The example shipped with the library was a multiply placeholder and did not exercise the frozen public API.

Changes

CI

  • Five-job parallel matrix in .github/workflows/ci.yml: lint, test, build-library, build-android, build-ios.
  • Hardened build-ios job with a simulator fallback chain (iPhone 16 → iPhone 17 → iPhone 16 Pro), output via xcbeautify, CocoaPods cache, and a simulator diagnostics step before xcodebuild.
  • New workflows: publish.yml (stable npm release), prerelease.yml (beta channel), deploy-docs.yml (Docusaurus), and docs-link-check.yml (lychee).
  • Turbo inputs kept compatible with the local cache (*/build and example/ios/Pods excluded).

iOS native

  • Swift class renamed from SyncProvider to HybridSyncProvider in ios/SyncProvider.swift to eliminate the collision with margelo::nitro::syncprovider::SyncProvider generated by Nitro. The iosModuleName (SyncProvider) and the JS lookup remain unchanged.
  • nitro.json updated: autolinking.SyncProvider.ios.implementationClassName now points to HybridSyncProvider.
  • Full migration from the lock.lock() + defer { lock.unlock() } pattern to lock.withLock { ... } inside @Sendable closures, satisfying Swift 6 strict concurrency, in the following files:
    • ios/SyncProvider.swift
    • ios/Background/BackgroundSyncManager.swift
    • ios/Connectivity/ConnectivityMonitor.swift
    • ios/Events/SyncEventEmitter.swift
    • ios/HTTP/BackgroundURLSessionDelegate.swift
  • example/ios/Podfile opts in via :testspecs => ['Tests'] to enable native test execution through xcodebuild test.
  • New yarn test:ios script in package.json mirroring the CI command for local parity.

Android & Hermes

  • Removed apply plugin: 'com.facebook.react' from android/build.gradle. Nitro uses yarn nitrogen (not React Codegen), and the plugin was scanning the hoisted node_modules and bundling third-party *ManagerDelegate classes into the library AAR, causing :app:mergeLibDexDebug duplication in consumer apps.
  • generateId migrated from uuid v7 to a pure-JS UUID v4 implementation, removing the dependency on crypto.getRandomValues (absent in Hermes).
  • uuid and @types/uuid dependencies removed from package.json.
  • The example AndroidManifest.xml received the permissions required for the offline + boot scenario (ACCESS_NETWORK_STATE, RECEIVE_BOOT_COMPLETED).

Example app

  • The multiply placeholder was replaced with a real SyncProvider showcase, featuring three tabs (Queue, History, Config) wired to the 7 public hooks of the library (useConnection, useSyncQueue, useSyncStatus, useOfflineQueue, useSyncEvents, useSyncConfig, useAutoSync).
  • react-navigation replaced with an inline tab selector (zero additional navigation dependencies).
  • Fixed duplicated safe-area inset: removed SafeAreaView edges={['top']} from the Queue / History / Config screens, since the tab bar already applies the top padding.
  • Example README rewritten with an offline scenario walkthrough and per-platform run instructions.

Documentation & website

  • New website/ workspace with Docusaurus and 35 pages organized into getting-started, guides, api-reference, architecture, production, migration, development, and troubleshooting.
  • New docs:* scripts in the root package.json for start, build, and serve of the site.
  • Root README rewritten: hooks table aligned with the frozen public API, new sections for addSyncEventListener and SYNC_EVENT_CHANNEL, a Types & enums section, and links to the Docusaurus site.
  • CONTRIBUTING.md gained a "Critical Nitro Workflow" section documenting the 6-step cycle for adding or changing a Nitro method.
  • context7.json added for indexing by the Context7 MCP.
  • Automated link verification via lychee in the docs-link-check.yml workflow.

Release & metadata

  • release-it configured with @release-it/conventional-changelog for automatic CHANGELOG.md generation from conventional commits.
  • publish.yml and prerelease.yml workflows cover stable releases and the beta channel via GitHub Actions.
  • package.json updated: version 0.1.00.1.1, description revised, keywords expanded, and homepage pointing to the Docusaurus site.
  • CHANGELOG.md initialized in the Keep-a-Changelog format.

Public API impact

  • No breaking changes to the JS/TS surface. All exports from src/index.tsx, hooks, and types remain identical.
  • Nitro iosModuleName remains SyncProvider. The NitroModules.createHybridObject<SyncProvider>('SyncProvider') lookup is still valid.
  • The Android Kotlin class remains SyncProvider in com.margelo.nitro.syncprovider.
  • Only an internal rename of the Swift implementation (SyncProviderHybridSyncProvider); transparent to consumers.
  • Version bump 0.1.00.1.1 (patch — fixes and tooling only, no contract changes).

Validation checklist

  • yarn lint
  • yarn typecheck
  • yarn test
  • yarn prepare (library build via bob)
  • yarn turbo run build:android
  • yarn turbo run build:ios
  • yarn example android
  • yarn example ios
  • docs-link-check.yml workflow green (lychee)

@gabriel-sisjr gabriel-sisjr self-assigned this May 18, 2026
@gabriel-sisjr gabriel-sisjr added type: enhancement Improvement to an existing feature. platform: cli CLI, tooling, or build process. labels May 18, 2026
Add website/ workspace with 35 pages across getting-started,
guides, api-reference, architecture, production, migration,
development and troubleshooting. Wire docs:* scripts, ignore
build outputs, and add lychee config for link checking.
Update Hooks table to the frozen public API shape, add Listener
helpers section (addSyncEventListener / SYNC_EVENT_CHANNEL),
extend Types & enums, and add Documentation section linking to
the live Docusaurus site.
Document the 6-step lifecycle for adding or changing a Nitro
method: edit spec, run nitrogen, implement Swift and Kotlin,
re-export in facade, typecheck/lint/test, rebuild example.
…flows

Wire release-it with conventional-changelog and add GitHub Actions for
npm publish, beta prereleases, Docusaurus deploy, and docs link checks.
Add Queue/History/Config tabs wired to all 7 hooks, Android offline
and boot permissions, and refresh README with an offline walkthrough.
Tab bar paddingTop already pads the status bar; SafeAreaView edges
['top'] in Queue/History/Config was re-applying it, creating an
unwanted gap above the first card.
- generateId: replace uuid v7 with pure-JS v4 (Hermes lacks
  crypto.getRandomValues); drop uuid + @types/uuid deps
- android: remove com.facebook.react plugin so Codegen stops
  dex-duplicating RN view-manager delegates into the AAR
- example: replace react-navigation with a built-in tab switcher
@gabriel-sisjr
gabriel-sisjr force-pushed the feature/ci-improvements branch from d076c5f to 618ac4a Compare May 19, 2026 00:28
- rename Swift impl class to HybridSyncProvider
- migrate NSLock to withLock under @sendable closures
- harden iOS test CI with destination fallback and xcbeautify
- add yarn test:ios mirror and opt-in :testspecs
- bump to v0.1.1
@gabriel-sisjr
gabriel-sisjr merged commit 3b56cb4 into develop May 19, 2026
2 checks passed
@gabriel-sisjr
gabriel-sisjr deleted the feature/ci-improvements branch May 19, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: cli CLI, tooling, or build process. type: enhancement Improvement to an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant