-
Notifications
You must be signed in to change notification settings - Fork 116
feat(core-types): Create @rnx-kit/core-types package and consume types from that package #3961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JasonVMo
wants to merge
19
commits into
main
Choose a base branch
from
user/jasonvmo/core-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,352
−375
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7bbee0e
add core-types package to separate types from implementations
JasonVMo 0b12594
move types to core-types package from config
JasonVMo d10dd71
consume the config types from the core-types package
JasonVMo 6752fdf
consume types from @rnx-kit/core-types package
JasonVMo 0408a2c
update README.md for core-types package
JasonVMo b5f0f68
docs(changeset): Move core configuration, manifest, and platform type…
JasonVMo 185f6b2
update readme files from changed packages
JasonVMo fa5e37b
split core-types into bundle-types, config-types, and node-types
JasonVMo 9437f72
docs(changeset):
JasonVMo b70708a
docs(changeset): Split out types for bundling, kit configuration, and…
JasonVMo af49925
update readme files for packages
JasonVMo 3bc1271
formatting changes for README.md files
JasonVMo a60d6af
fix metadata inconsistency
JasonVMo df62c24
add test files to knip files for tools-typescript
JasonVMo 216fecb
remove auto-readme generation from tools-node and tools-react-native …
JasonVMo dd3859b
rename type packages and split plugin types into separate package
JasonVMo 757de7f
docs(changeset): Create dedicated type packages for rnx-kit configura…
JasonVMo a60387b
remove some stray files and references from renaming and splitting
JasonVMo e1f72ba
remove redundant comment
JasonVMo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@rnx-kit/types-bundle-plugin-options": major | ||
| "@rnx-kit/types-bundle-config": major | ||
| "@rnx-kit/types-kit-config": major | ||
| "@rnx-kit/types-node": major | ||
| --- | ||
|
|
||
| Create dedicated type packages for rnx-kit configuration and core node types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| "@rnx-kit/metro-plugin-cyclic-dependencies-detector": patch | ||
| "@rnx-kit/metro-plugin-duplicates-checker": patch | ||
| "@rnx-kit/metro-serializer-esbuild": patch | ||
| "@rnx-kit/metro-plugin-typescript": patch | ||
| "@rnx-kit/tools-react-native": patch | ||
| "@rnx-kit/tools-typescript": patch | ||
| "@rnx-kit/lint-lockfile": patch | ||
| "@rnx-kit/tools-packages": patch | ||
| "@rnx-kit/align-deps": patch | ||
| "@rnx-kit/tools-node": patch | ||
| "@rnx-kit/config": patch | ||
| "@rnx-kit/cli": patch | ||
| --- | ||
|
|
||
| Split out types for bundling, kit configuration, and package manifests into | ||
| dedicated packages" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| `rnx-kit` is a monorepo of React Native tooling created by Microsoft. It provides battle-tested tools for dependency management, Metro bundling enhancements, TypeScript integration, and cross-platform development (iOS, Android, macOS, Windows). | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| - **`packages/`** - Stable, published packages (e.g., `@rnx-kit/cli`, `@rnx-kit/align-deps`, `@rnx-kit/metro-*`) | ||
| - **`incubator/`** - Experimental packages (marked with `"experimental": true` in package.json) | ||
| - **`scripts/`** - Internal build tooling (`rnx-kit-scripts` CLI) | ||
| - **`docsite/`** - Documentation website (separate Yarn workspace) | ||
|
|
||
| ## Build System | ||
|
|
||
| Uses **Nx** for task orchestration with **Yarn Berry** workspaces. | ||
|
|
||
| ### Key Commands (Repository Root) | ||
|
|
||
| ```sh | ||
| yarn # Install dependencies | ||
| yarn build # Build all packages | ||
| yarn build-scope <pkg> # Build specific package with dependencies (e.g., yarn build-scope @rnx-kit/cli) | ||
| yarn test # Build and test all packages | ||
| yarn lint # Lint all packages | ||
| yarn format # Format all packages with Prettier | ||
| yarn clean # Clean build artifacts (git clean) | ||
| ``` | ||
|
|
||
| ### Package-Level Commands | ||
|
|
||
| ```sh | ||
| yarn build # Build current package only | ||
| yarn build --dependencies # Build current package and its dependencies | ||
| yarn test # Run tests (Jest or Node test runner) | ||
| yarn lint # Lint current package | ||
| yarn format # Format current package | ||
| ``` | ||
|
|
||
| ### Running Tests | ||
|
|
||
| - Most packages use Jest with `@rnx-kit/jest-preset` | ||
| - Run specific test: `yarn test path/to/file.test.ts` (from package directory) | ||
| - Tests are in `test/` directories with `.test.ts` extension | ||
|
|
||
| ### CI Commands | ||
|
|
||
| ```sh | ||
| yarn build:ci # Build affected packages | ||
| yarn bundle:ci # Bundle affected packages | ||
| yarn change:check # Verify change files exist for modified packages | ||
| ``` | ||
|
|
||
| ## Package Conventions | ||
|
|
||
| - Each package uses `rnx-kit-scripts` for build/test/lint commands | ||
| - TypeScript source in `src/`, compiled output in `lib/` | ||
| - Standard dev dependencies: `@rnx-kit/eslint-config`, `@rnx-kit/jest-preset`, `@rnx-kit/scripts`, `@rnx-kit/tsconfig` | ||
| - Entry point typically at `src/index.ts` | ||
|
|
||
| ## Creating New Packages | ||
|
|
||
| ```sh | ||
| yarn new-package <name> # Creates in packages/ | ||
| yarn new-package <name> --experimental # Creates in incubator/ | ||
| ``` | ||
|
|
||
| Uses `packages/template` as baseline. | ||
|
|
||
| ## Change Management | ||
|
|
||
| Uses [Changesets](https://github.com/atlassian/changesets) for versioning: | ||
|
|
||
| ```sh | ||
| yarn change # Create change file for PR | ||
| ``` | ||
|
|
||
| One change file per feature/fix; no need for multiple entries when addressing PR feedback. | ||
|
|
||
| ## Key Packages | ||
|
|
||
| - **`@rnx-kit/cli`** - Main CLI (`rnx-cli`) integrating all tools | ||
| - **`@rnx-kit/align-deps`** - Dependency version alignment across repos | ||
| - **`@rnx-kit/metro-*`** - Metro bundler plugins (TypeScript, tree-shaking, duplicate detection) | ||
| - **`@rnx-kit/tools-*`** - Platform-specific utilities (android, apple, node, react-native) | ||
| - **`@rnx-kit/config`** - Configuration loading from `package.json` `rnx-kit` field | ||
|
|
||
| ## Dependency Alignment | ||
|
|
||
| The repo uses `align-deps` to maintain consistent dependency versions. Run from root: | ||
|
|
||
| ```sh | ||
| yarn rnx-align-deps --write # Fix misaligned dependencies | ||
| ``` | ||
|
|
||
| ## Platform-Specific Notes | ||
|
|
||
| - **Test apps**: `packages/test-app` (iOS/Android), `packages/test-app-macos`, `packages/test-app-windows` | ||
| - Native builds require platform toolchains (Xcode, Android Studio, Visual Studio) | ||
| - Pod installation: `yarn install-pods` from test-app directories | ||
|
|
||
| ## Code Style | ||
|
|
||
| - Prettier for formatting, ESLint for linting | ||
| - Run `yarn format` and `yarn lint` before committing | ||
| - Configuration in `.github/prettierrc.json` and `packages/eslint-config/` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,13 +43,16 @@ | |||||||||
| "@rnx-kit/tools-node": "^3.0.3", | ||||||||||
| "@rnx-kit/tools-packages": "^0.1.1", | ||||||||||
| "@rnx-kit/tools-react-native": "^2.3.2", | ||||||||||
| "@rnx-kit/types-bundle-config": "^0.0.1", | ||||||||||
| "@rnx-kit/typescript-service": "^2.0.0" | ||||||||||
| }, | ||||||||||
| "devDependencies": { | ||||||||||
| "@rnx-kit/eslint-config": "*", | ||||||||||
| "@rnx-kit/jest-preset": "*", | ||||||||||
| "@rnx-kit/scripts": "*", | ||||||||||
| "@rnx-kit/tsconfig": "*" | ||||||||||
| "@rnx-kit/tsconfig": "*", | ||||||||||
| "@rnx-kit/types-kit-config": "^0.0.1", | ||||||||||
| "@rnx-kit/types-node": "^0.0.1" | ||||||||||
|
Comment on lines
+54
to
+55
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For dev dependencies, we should use
Suggested change
|
||||||||||
| }, | ||||||||||
| "peerDependencies": { | ||||||||||
| "typescript": ">=4.7.0" | ||||||||||
|
|
||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a separate PR. Let's not scope creep.