Skip to content

chore: monorepo setup #1002

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

Merged
merged 6 commits into from
Aug 16, 2023
Merged

chore: monorepo setup #1002

merged 6 commits into from
Aug 16, 2023

Conversation

krizzu
Copy link
Member

@krizzu krizzu commented Aug 14, 2023

Summary

Moving to monorepo!
Scoping dependencies to each workspace (no hoist) as for now. In upcoming PRs will possibly move example to different workspace.

@krizzu krizzu marked this pull request as ready for review August 14, 2023 13:59
@krizzu krizzu requested a review from tido64 August 14, 2023 15:04
Copy link
Member

@tido64 tido64 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 working on this!

@@ -23,6 +23,7 @@ jobs:
run: yarn
- name: Run test ${{ matrix.test-name }}
run: yarn test:${{ matrix.test-name }}
working-directory: packages/default-storage-backend
Copy link
Member

Choose a reason for hiding this comment

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

Should we use prefixes so packages get grouped together? I.e. storage-backend-*, storage-core, etc.

Suggested change
working-directory: packages/default-storage-backend
working-directory: packages/storage-backend-default

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought more about TYPE_OF_STORAGE-storage-backend convention. We already have other storage called sqlite-storage-backend. Besides, I don't think we will have more storages in this monorepo anyway

Copy link
Member

@tido64 tido64 Aug 16, 2023

Choose a reason for hiding this comment

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

It would look a lot nicer in the directory if we stick to the storage-<category>-<implementation> convention though:

storage-backend-default   # What we have in 1.x
storage-backend-mmkv      # Maybe?
storage-backend-os-prefs  # NSUserDefaults (iOS) or SharedPreference (Android)
storage-backend-sqlite    # SQLite
storage-core              # JS
storage-types             # TypeScript interfaces

But I suppose we could also change this later, so I'll let you decide.

Copy link
Member

Choose a reason for hiding this comment

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

This should remain in root so that it gets applied to the whole repository.

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good
How do you use this formatter anyway? Simply calling CLI?

Copy link
Member

@tido64 tido64 Aug 16, 2023

Choose a reason for hiding this comment

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

Yes, you should be able to run clang-format from anywhere. I usually do clang-format -i $(git ls-files '*.cpp' '*.h' '*.m' '*.mm') so that it doesn't pick up files from node_modules etc.

https://github.com/microsoft/react-native-test-app/blob/8e1ba826559915b21f9bcb730f8d920a830ec27c/package.json#L64

@@ -168,3 +177,4 @@ jobs:
git config user.email ${{ secrets.GH_BOT_EMAIL }}
git config user.name ${{ secrets.GH_BOT_NAME }}
yarn semantic-release
Copy link
Member

Choose a reason for hiding this comment

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

Note for later: We should look into replacing semantic-release with something that understands monorepos. In rnx-kit, Changesets has been working very well for us.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sweet, will remember that 🙏

@krizzu krizzu requested a review from tido64 August 16, 2023 09:50
Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

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

Nice work! Thanks for putting this together.

@krizzu krizzu merged commit 03fde4b into main Aug 16, 2023
@krizzu krizzu deleted the monorepo-setup branch August 16, 2023 18:56
@AsyncStorageBot
Copy link
Collaborator

🎉 This PR is included in version 1.19.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants