This is the baseapp-frontend monorepo that contains our apps and packages.
So, everything inside packages are meant to be part of the @baseapp-frontend packages, for instance:
- /packages
-/authentication
-/tsconfig
In that case, both authentication and tsconfig are unique packages, but they all belong to the @baseapp-frontend organization.
If one of the apps want to consume any package feature, we could simply add that package as a dependency like that:
"dependencies": {
"@baseapp-frontend/authentication": "*",
...
},
And then just import the feature needed:
import { useUser } from '@baseapp-frontend/authentication'
export default function Docs() {
const {user} = useUser()
return (
<div>
<h1>Find User</h1>
<p>{user.firstName}<p>
</div>
)
}authentication: includes authentication modules such aslogin,signup,reset password,multifactor authenticationand more.config: includes reusable configurations foreslint,prettierandjest.core: core of utilities likeauth hooks,permisisons systemandutil functions.[DEPRECATED]design-system-mui: defines ourdesign system configuration(e.g. color pallete, typography, spacings, etc). It also shares reusablecomponentsthat make up the design system as a whole.docs: an app to document some packages's features.graphql: includesGraphQL's configurations and utilities.provider: includes provider of different kinds that have "use client" directive on top.test: extendsReact Testing Libraryfeatures and export some util functions, mocks and test configurations.tsconfig: reusabletypescript configs.utils: includesconstants,functions,hooksandtypesthat are generic enough to be reused between apps and packages.
This step is optional but it is highly suggested you to use NVM.
Instalation instructions can be found here: https://github.com/nvm-sh/nvm#installing-and-updating
Once installed run:
nvm useThis repository uses yarn, so you make sure to have it installed:
To install all apps and packages dependencies, run the following command:
cd baseapp-frontend
yarn installTo build all apps and packages, run the following command:
cd baseapp-frontend
yarn run buildTo develop all apps and packages, run the following command:
cd baseapp-frontend
yarn run devWe have 3 mandatory steps before pushing modifications:
- If we did any modification in any
package, before pushing we need to generate a changeset, that basically is a file that summarize which type of changes we did (major, minor or none) alongside with the summary of those changes. So, to do that we run:
yarn changesetAfter that, we need to choose which packages were changed, the bump they had and write the summary for that change.
- With the changesets created, we need to consume them to actually increase the packages version accordingly. So, we do:
yarn version-packagesAfter running that, you might notice version bumps on the package's version and an update on the package's CHANGELOG.md.
- By now, we just need to commit & push those files and, after merging the PR, the
packages updateswill be automatically published :)