Set up and run Linode's UI packages locally.
This repository uses Yarn Workspaces, a solution to transform JavaScript-based repositories into a single monorepo. This is useful because it allows us to maintain multiple projects in one place, with shared dependencies.
There are 3 package.json files: 1 for the root, and one for each folder in packages/. Running yarn will install everything, and "hoist" as much as possible into the root node_modules folder. There is a single yarn.lock in the root directory.
Most of the time you will directly use the commands from this documentation. If you have to run a specific command the rule is:
- To run a command in both packages:
yarn workspace <command> - To run a command in a single package
yarn workspace @linode/api-v4 <command>, oryarn workspace linode-manager <command>
The workspace names are defined in the root package.json
- @linode/api-v4:
/packages/@linode/api-v4 - linode-manager:
/packages/linode-manager
-
Fork or clone this repository.
-
Log into cloud.linode.com and create an OAuth client.
-
Create an .env file for Cloud Manager and place it in the
packages/managerdirectory. -
Make sure you are using a supported version of Node.js (10.16 is recommended). Installing Node with Homebrew will result in a more recent version that can cause problems with our automation. We recommend using NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/<NVM-LATEST-VERSION>/install.sh | bash ## Follow the instructions to add NVM to your .*rc file, or open a new terminal window nvm install 10.16 nvm use 10.16 node --version ## v10.16.0
-
Make sure you have a recent version of Yarn (1.22+):
yarn --version npm install -g yarn --upgrade
-
Start Cloud Manager and the JS client with
yarn up.
See this document
To learn more about the available commands read COMMANDS
Please see our contributing and code conventions guides for instructions on how to get started with contributing to this project.
Since Cloud Manager was generated using Create React App, yarn build can be used to generate an optimized production bundle:
yarn install:all
yarn workspace linode-manager buildYou can then serve these files however you prefer, for example:
npm install -g http-server
cd packages/manager/build
http-server .We also provide two ways to serve the build app using Docker:
Build a container based on the Dockerfile and starts the manager server (this operation is slow):
yarn docker:localStart a small NGINX container to serve the files:
yarn start:nginx