@keel-ai/modules-autolinking
v0.1.0
Published
Per-module autolinking + dev CLI for Keel modules — `keel-module` validate / link / install + the module.yml schema/parser + Podfile/Gradle snippet generators. Sibling of @keel-ai/modules-core, mirroring Expo's expo-modules-autolinking split.
Downloads
87
Readme
@keel-ai/modules-autolinking
Per-module autolinking + dev CLI for Keel
modules — sibling of @keel-ai/modules-core, mirroring Expo's
expo-modules-autolinking
split.
Why it's separate from @keel-ai/modules-core
@keel-ai/modules-core is the native runtime + codegen that modules
sit on (Swift KeelModule base + JSI install + Swift Macros + Kotlin
KSP — the platform foundation). Autolinking is the module-system
orchestration layer: scanning, generating provider files, and the
per-module helper CLI for module authors. Expo splits these too
(expo-modules-core vs expo-modules-autolinking); Keel mirrors the
split so each package has one job.
Library API
import {
loadModuleSpec,
validateModuleSpec,
generatePodfileSnippet,
generateGradleSnippet,
checkSpecSources,
scanModules,
generateIOSProvider,
generateAndroidProvider,
type ModuleSpec,
type ScannedModule,
} from '@keel-ai/modules-autolinking';loadModuleSpec(root)/validateModuleSpec(yaml)— parse + lintmodule.yml.generatePodfileSnippet(spec, root)/generateGradleSnippet(spec, root)— emit per-module autolink snippets. ⚠️ The Podfile snippet applies only to CocoaPods iOS modules — in practice the React-coupledapple-signin/google-signin(theyimport React). The React-free modules (modules-core+ leaf packages + the 5 vendor modules) ship as SPM source targets, wired by hand in the host'sPackage.swift/project.yml;keel-module linkdoes not emit SPM declarations.scanModules(hostRoot)— scan<host>/node_modulesfor packages carrying amodule.yml.generateIOSProvider(modules)/generateAndroidProvider(modules)— emitKeelModulesProvider.{swift,kt}that registers each scanned module's class withKeelModuleRegistrarat startup.checkSpecSources(spec, root)— verify declared source paths exist (shared with@keel-ai/module-scripts'publish).
CLI (keel-module)
Per-module daily-dev — scaffolding is in the standalone
create-keel-module package (npm create keel-module …),
test/publish are in @keel-ai/module-scripts.
keel-module validate [path=.]
keel-module link [module-path=.]
keel-module install [--host=<path>] [module-path=.]
keel-module autolink --platform=ios|android --out=<file> [--host=<dir>] [--package=<kotlin-pkg>]See keel-module help for the full docstring.
Status
Both halves of autolinking are implemented:
- Per-module (
link/install) — emit Podfile + Gradle snippets for one module. - Host-level (
autolink) — scan<host>/node_modules, then emitKeelModulesProvider.{swift,kt}registering every discovered module withKeelModuleRegistrar(the analog ofexpo-modules-autolinking's scan binary). Run it as a build phase (Xcode / Gradle) or by hand.
iOS note: only React-coupled Pod modules (apple-signin /
google-signin) flow through the Podfile snippet path. The React-free
SPM modules (modules-core + leaf + vendor) are declared in the host's
Package.swift / project.yml by hand — but autolink still generates
their KeelModulesProvider.swift registration entries.
License
Apache-2.0.
