Tooling and Environments
The Aven monorepo uses a bunch of half-baked tooling to develop against several platforms at once, managing deploys, and publishing to npm.
We need a JS development environment that allows us to do the following *within one repo*:
Build apps that are packaged with different bundlers. Eg. Metro for React Native and Webpack/Razzle for Web/SSR, respectively.
Publish sub-packages to NPM
Configurable deployment for CI
Enable private repos that extend the open source monorepo.
Aven Tools, like Aven itself, is unabashedly opinionated. But it needs significant improvements in order to meet its goals, and contributions are especially wanted in this area. This document attempts to describe the current state of the tooling, but we have a long way to go on quality and documentation. Please jump in the issues!
Aven Tools is an incomplete attempt to accomplish these goals
Concepts
Packages/Apps
All packages are folders that live in the top-level directory of the repo. Apps are a special type of package.
Packages are configured with an "aven" field under the package.json.
Currently, every package needs to explicitly refer to the dependencies on other packages in the repo (local packages), as well as the packages from the main package file.
Package Configuration
Every sub-package is required to have an "aven" field
Environment
An environment is a specification of a way to run an app. The following environments are currently in the repo:
web - Built upon Razzle, (built upon Webpack), enables web with SSR
reactnative - React native environment with Metro
expo - A react native environment with a bunch of addditional built-ins
dom - A react-native-dom environment
Because AvenTools has suffered from a bit of neglect, there are two APIs for defining an environment, and two mechanisms which you can use to run one.
API
Start
yarn start app-name
Will start the app in your repo named app-name
Build
yarn build app-name
Will build the app in your repo named app-name
Publish
yarn publish package-name
Will publish the package in your repo named package-name to npm
Deploy
yarn start app-name
Will run the deploy script of the environment