Skip to content

docs: add README file for packages #41789

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

Closed

Conversation

okwasniewski
Copy link
Contributor

Summary:

This PR adds a new README file to the packages/ directory explaining how to create new packages that are built by internal build scripts (like build.js).

Changelog:

[INTERNAL] [ADDED] - README on how to create new packages

Test Plan:

Not needed

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 4, 2023
@okwasniewski
Copy link
Contributor Author

cc: @huntie

@facebook-github-bot facebook-github-bot added p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 4, 2023
Copy link
Member

@huntie huntie left a comment

Choose a reason for hiding this comment

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

```
2. Add `README.md` and an `index.js` file

### Setting up build step for packages containing `flow` types (Optional)
Copy link
Member

Choose a reason for hiding this comment

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

As things stand today, the root yarn build setup applies only for packages written in Flow and targeting Node.js. In other cases, packages written in plain JS or Flow (or TypeScript, outside this repo) are consumed via @react-native/babel-preset and require no build.

Copy link
Member

@huntie huntie left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! On reflection (discussing this with the team following your message on Discord), I don't think we need these docs here quite yet.

  • Creating a new package is typically an infrequent and per-use-case step for maintainers.
  • This extends to the monorepo yarn build setup, however:
    • This is rapidly evolving piece of dev infra targeting first party packages in the React Native repo.
    • The first draft of this file is missing a lot of detail we'd need to document this.

Therefore, it's made sense so far to use an existing package as a living source of truth rather than maintain stable docs.

I do understand that @callstack/out-of-tree-platforms in react-native-visionos reuses the current yarn build setup. I think perhaps:

  • We can pursue more detailed and focused docs within a scripts/build/README.md, once we have further developed that infra and it applies to more packages.
    • An extra note that this infra is internal and will continue to change in future!
  • If you are anticipating many packages to be created within react-native-visionos, it may be better to iteratively document best practices in that repo for now.

@okwasniewski
Copy link
Contributor Author

Okay, thanks for your review. I will close this PR and move this README to our repo and polish it as we move forward.

An extra note that this infra is internal and will continue to change in future!

What does internal mean in that context? Is it internal to React Native (OSS) or Meta? Because maybe we shouldn't use it for building our visionos packages?

Adding a README would also help us maintain our packages and adjust to your changes as we move forward but I understand that maintaining docs requires more work.

@huntie
Copy link
Member

huntie commented Dec 5, 2023

@okwasniewski Internal to the React Native open source repo — meaning it's developed in open source, but intends to support the configured packages within this immediate repo. (It happens to have a very specific design in order to be compatible with Meta infra.)

Thanks 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants