Skip to content

Conversation

@JasonVMo
Copy link
Collaborator

Description

This change creates a new @rnx-kit/core-types package for core configuration types, manifest types, lint types, and so on. This avoids pulling in implementations when not needed and generally cleans up the dependency graph.

There are also several places where using rnx-kit packages via an API from outside rnx-kit weren't exposing types correctly because the types came from a devDependency package (because the implementation wasn't needed) but as a result the types weren't being exported correctly. Having a lightweight types package allows for these to be correctly marked as dependencies causing the types to resolve correctly from outside the repo.

  • despite the move, all packages that previously exported types still do so, they just now do it via re-exporting the types from the new package.

KitConfig and Supporting Types

The KitConfig was coming out of the @rnx-kit/config package which was pulling in several metro plugin packages for the types. Some plugin types were defined in the config package, some were defined locally, regardless it created a bit of a dependency snarl. These were the primary types moved into the new package.

  • the plugin configurations that were still in their own packages were moved into the core-types
  • esbuild and metro are marked as optional peer dependencies which allows those types to be fulfilled when necessary without creating a costly transitive dependency install chain.
  • the align deps config was separated out and defined on its own with the ability to template it with extended capabilities. This makes creating custom presets more ergonomic.

Package Manifest Types

The PackageManifest type has been moved from tools-node into core-types. It has also been greatly improved by:

  • adding most of the standard package.json types
  • adding a typed entry for the KitConfig (this was impossible due to circular dependency issues before)

I also added a PackageData type which is designed as a parameter type for functions that want to take a folder and manifest pairing which can be fulfilled by PackageInfo or by other implementations. This will be used in subsequent changes.

AllPlatforms

I also moved the AllPlatforms type here, and changed it to be based on an array definition ensuring those stay in sync.

Test plan

This is almost 100% type only (with the exception of the ALL_PLATFORM_VALUES array so automated tests + pipelines should be sufficient.

@github-actions github-actions bot added feature: metro This is related to Metro feature: align-deps This is related to align-deps feature: cli This is related to CLI labels Feb 10, 2026
@JasonVMo JasonVMo enabled auto-merge (squash) February 10, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: align-deps This is related to align-deps feature: cli This is related to CLI feature: metro This is related to Metro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant