ci: Cap 9 deprecated native API guard

Merged
RI
2mo ago
+260-0

What

  • Add scripts/check-cap9-deprecated.mjs and check:cap9-deprecated script.
  • Run the guard in CI alongside check:wiring (Android, iOS, web jobs).

Why

  • Catch Capacitor 9–removed native APIs before the Cap 9 toolchain migration.
  • Cordova SwiftPM product lines in Package.swift are intentionally allowed (Cap 8 still needs them).

How

  • Mirror check-capacitor-plugin-wiring.mjs: scan plugin android/src/main, ios/Sources, and root Package.swift.
  • Fail on hasOption, getConfigValue, @NativePlugin, saved-call helpers, legacy permission helpers, CAPBridge.*, and CAPNotifications.

Testing

  • node scripts/check-cap9-deprecated.mjs
  • bun run check:wiring

Not Tested

  • Full bun run verify locally (CI runs platform jobs).
Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Tests

    • Added automated checks for deprecated Capacitor 9 APIs in Android, iOS, and web build workflows.
    • Build validation now reports detected deprecated API usage with file and line details.
  • Chores

    • Added a reusable command for running the Capacitor 9 compatibility check locally or in CI.
    • Checks support projects with Android and/or iOS capabilities and complete successfully when no applicable platforms are configured.