Skip to content

feat(cli): allow extra XCFrameworks in local SPM package - #514

Merged
hurali97 merged 2 commits into
callstack:mainfrom
DanielPotorCK:feat/extra-spm-xcframeworks
Nov 10, 2026
Merged

hurali97 merged 2 commits into
callstack:mainfrom
DanielPotorCK:feat/extra-spm-xcframeworks

Conversation

@DanielPotorCK

@DanielPotorCK DanielPotorCK commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add ios.extraSpmXcframeworks so package:ios --add-spm-package can include host-side XCFrameworks as SPM binary targets
  • Reserve declared names during app-framework resolution; missing paths fail hard

Test plan

  • Unit tests for createLocalSpmPackage / config schema
  • Optional: local package:ios --add-spm-package with a stub extra XCFramework

closes #468

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The change still has active moderate and critical issues that can stage artifacts outside the package, delete required frameworks, or generate invalid and potentially injectable Swift code.

3 open issues
What changed in this PR

Adds support for configuring host-side XCFrameworks through ios.extraSpmXcframeworks, allowing package:ios --add-spm-package to include them as binary targets in the generated local Swift package.

Changes:

  • Adds TypeScript and JSON schema configuration for extra XCFrameworks.
  • Stages declared XCFrameworks and includes them in Package.swift.
  • Reserves configured framework names during automatic detection.
  • Adds CLI forwarding, tests, documentation, and a changeset.

Review findings:

  • Critical: XCFramework names must be validated as safe Swift identifiers and filesystem path segments.
  • Moderate: Reserved/generated names and duplicate extra entries must be rejected before staging.
  • Moderate: Symlinked XCFramework paths must be resolved safely before copying.

This pull request requires changes.

File Summary
packages/​cli/​src/​types.ts Defines extra SPM XCFramework configuration and packaging options.
packages/​cli/​src/​brownfield/​utils/​createLocalSpmPackage.ts Stages extra XCFrameworks and adds them to the generated SPM package.
packages/​cli/​src/​brownfield/​utils/​__tests__/​createLocalSpmPackage.test.ts Tests copying, resolution, missing paths, ordering, and path handling.
packages/​cli/​src/​brownfield/​commands/​packageIos.ts Forwards project-root and extra XCFramework configuration to package generation.
packages/​cli/​src/​brownfield/​commands/​__tests__/​packageIos.action.test.ts Verifies forwarding of extra XCFramework configuration.
packages/​cli/​src/​__tests__/​config.test.ts Tests valid and malformed extra XCFramework configuration.
packages/​cli/​schema.json Adds schema validation for ios.extraSpmXcframeworks.
docs/​docs/​docs/​cli/​brownfield.mdx Documents extra XCFramework support in the CLI guide.
docs/​docs/​docs/​api-reference/​configuration.mdx Documents the new iOS configuration option.
.changeset/​extra-spm-xcframeworks.md Records the CLI feature release.

Review effort: Lite

@hurali97
hurali97 merged commit 6517ec5 into callstack:main Nov 10, 2026
14 checks passed
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.

package:ios --add-spm-package: allow project-declared extra XCFrameworks as binary targets

3 participants