Cryptosheets
Cryptosheets monorepo setup utilizing Yarn Workspaces, Lerna, Docker, and Azure.
Prerequisites
- Yarn - NPM package manager replacement
- Lerna - link dependencies between packages
- Docker - Containerized deployments [Link][https://docs.docker.com/docker-for-windows/install/]
- Azure CLI - Commands to push to Azure Container Registry (ACR) and Azure App Service [Link][https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest]
npm i -g yarn lerna
Install
yarn bootstrap
The bootstrap command utilizes Lerna, and completes the following actions:
- Runs a
prepare
script inside any packages that contain a prepare. - Installs all required modules in parallel, and hoists to the root level
yarn i
Brings up the interactive scripts runner for all commands inside of terminal. See package-scripts.js
for explanations of all scripts
Resources
Terminology
Environments
- Local: Runs application from computer at localhost:
port
. Ex. http://localhost:3000 - Dev/development: Runs application in development mode. Unoptimized. Typically contains enhanced debugging features
- Staging: Pushes application and builds application to prepare for transition to
dev
orprod
server - Production: Runs application in production mode. Uses advanced techniques such as compression. For an example, see https://expressjs.com/en/advanced/best-practice-performance.html
Environment Methods
- Dev: Starts application in development environment, typically localhost
- Build: Runs application through build process
- Deploy: Deploys build application to production environment
Environment Variables (.env)
.env files can be downloaded from the following url: TBD
Building a Gatsby theme
https://www.gatsbyjs.org/tutorial/building-a-theme/#set-up-gatsby-theme-events-and-site
Adding packages to themes
- Add dependencies to site:
yarn workspace <site> add <dependency>
- Add dependencies to theme:
yarn workspace <theme> add <dependency>
Changing Ant Design variables
Theme Documentation https://ant.design/docs/react/customize-theme
Raw Variables https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less