Skip to content

feat: [SDK-4323] create OneSignal Capacitor SDK - #1

Merged
fadi-george merged 13 commits into
mainfrom
fadi/sdk-4323-create-onesignal-capacitor-sdk
Apr 20, 2026
Merged

feat: [SDK-4323] create OneSignal Capacitor SDK#1
fadi-george merged 13 commits into
mainfrom
fadi/sdk-4323-create-onesignal-capacitor-sdk

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Modernize the OneSignal Capacitor SDK build toolchain, convert to ESM-only, and add CI/CD infrastructure.

Details

Motivation

Set up the OneSignal Capacitor SDK with modern tooling, CI/CD pipelines, and code quality infrastructure to establish a solid foundation for the plugin.

Scope

Build & Module System:

  • Converted to ESM-only module format ("type": "module") with single import export
  • Migrated from Vitest + vite-plugin-dts to the Vite Plus (vp) toolchain for building, linting, formatting, and testing
  • Updated tsconfig.json to use ESNext module with bundler resolution

iOS Refactor:

  • Inlined OneSignalCapacitor wrapper class directly into OneSignalCapacitorPlugin.swift, removing the unnecessary abstraction layer

CI/CD & Infrastructure:

  • Added GitHub workflows: CI checks, CD publish, CodeQL analysis, release PR creation, Linear deployment tracking, PR title linting, and project board automation
  • Added PR template
  • Added pre-commit hooks via .vite-hooks/pre-commit with vp staged

Code Quality:

  • Reformatted all source and test files with oxfmt (single quotes, sorted imports)
  • Added oxlint with type-aware linting and type checking
  • Disabled typescript/unbound-method rule for test files
  • Added vitest coverage support

What is NOT changed:

  • No public API changes
  • No changes to Android native code
  • No behavioral changes to iOS native bridge calls (only removed the wrapper indirection)

Testing

Unit testing

All existing unit tests pass under the new Vite Plus test runner. Coverage support was added via @vitest/coverage-v8.

Manual testing

Build (vp pack), lint (vp check), and test (vp test) all pass locally.

Affected code checklist

  • Notifications
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Note: No public API behavior changes. The export format changed from dual CJS/ESM to ESM-only, which is a packaging change.

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

@linear

linear Bot commented Apr 3, 2026

Copy link
Copy Markdown

Comment thread android/build.gradle Outdated
Comment thread src/definitions.ts
Comment thread src/definitions.ts
Rename `android/build.gradle` to `android/build.gradle.kts` and port the
build configuration to Kotlin DSL for better type safety and IDE support.
Update the release workflow to reference the new filename.

Made-with: Cursor

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small nit but otherwise looking good to me

Comment thread android/build.gradle.kts Outdated
Comment thread android/build.gradle.kts Outdated
Comment thread android/build.gradle.kts Outdated
Move AGP, Kotlin, OneSignal SDK, appcompat, junit, espresso, SDK API
levels, and other Android versions into a Gradle version catalog so
they live in one place and match the structure reviewers expect.

The buildscript {} block and the module body read from the catalog via
small inline parsers. Capacitor consumer apps still override the
standard Capacitor properties (compileSdkVersion, minSdkVersion,
targetSdkVersion, kotlin_version, junitVersion, androidxAppCompatVersion)
via rootProject.extra, so there is no change to how consumers configure
the plugin.

Also bump the OneSignal Android SDK pin to 5.7.7 (latest).

Made-with: Cursor
@fadi-george
fadi-george merged commit 6e3ac34 into main Apr 20, 2026
2 of 5 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-4323-create-onesignal-capacitor-sdk branch April 20, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants