From 1ae16bd130827ccee497fe895a99ef1eb4812780 Mon Sep 17 00:00:00 2001 From: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:32:11 -0400 Subject: [PATCH] fix: Make `yarn up:expose` actually expose Cloud Manager (#9297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * make expose command work * Added changeset: Made yarn up:expose actually expose Cloud Manager on all interfaces * add some basic docs * Update docs/GETTING_STARTED.md Fix `envrionments` ➡️ `environments` typo Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> --------- Co-authored-by: Banks Nussman Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> --- docs/GETTING_STARTED.md | 27 +++++++++---------- package.json | 2 +- .../pr-9297-tech-stories-1687467224725.md | 5 ++++ packages/manager/package.json | 1 + 4 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 packages/manager/.changeset/pr-9297-tech-stories-1687467224725.md diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index d93eb702dec..0b09c94ba73 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -23,7 +23,7 @@ $ curl https://get.volta.sh | bash - ## Add nvm to your .*rc file, or open a new terminal window. + ## Add volta to your .*rc file, or open a new terminal window. $ volta install node@18.14.1 @@ -42,26 +42,25 @@ 10. Navigate to the root directory of the repository, then start Cloud Manager and the JS client with `yarn up`. 11. After installation, Cloud Manager should be running at http://localhost:3000. -## Serving a production build of Cloud Manager: +## Serving a production build of Cloud Manager -Since Cloud Manager was generated using Create React App, `yarn build` can be used to generate an optimized production bundle: +You can then serve these files however you prefer or use our included local http server. ```bash +yarn install:all - yarn install:all - - yarn workspace linode-manager build +yarn workspace linode-manager build +yarn workspace linode-manager run start:ci ``` -You can then serve these files however you prefer, for example, with [http-server](https://www.npmjs.com/package/http-server): - -```bash - - npm install -g http-server +## Exposing Cloud Manager's dev server to the network - cd packages/manager/build +By default, Cloud Manager's dev server only listens on `localhost`. If you need to +expose the Vite dev server, you can use the following command. - http-server . +> **Note**: This is useful for running Cloud Manager's dev server in Docker-like environments -``` +```bash +yarn up:expose +``` \ No newline at end of file diff --git a/package.json b/package.json index ecbc01e5081..73062fa178b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "up:expose": "yarn install:all && yarn build:validation && yarn build:sdk && yarn start:all:expose", "dev": "yarn install:all && yarn start:all", "start:all": "concurrently -n api-v4,validation,manager -c blue,yellow,green \"yarn workspace @linode/api-v4 start\" \"yarn workspace @linode/validation start\" \"yarn workspace linode-manager start\"", - "start:all:expose": "concurrently -n api-v4,validation,manager -c blue,yellow,green \"yarn workspace @linode/api-v4 start\" \"yarn workspace @linode/validation start\" \"yarn workspace linode-manager start --host\"", + "start:all:expose": "concurrently -n api-v4,validation,manager -c blue,yellow,green \"yarn workspace @linode/api-v4 start\" \"yarn workspace @linode/validation start\" \"yarn workspace linode-manager start:expose\"", "start:manager": "yarn workspace linode-manager start", "start:manager:ci": "yarn workspace linode-manager start:ci", "clean": "rm -rf node_modules && rm -rf packages/@linode/api-v4/node_modules && rm -rf packages/manager/node_modules && rm -rf packages/@linode/validation/node_modules", diff --git a/packages/manager/.changeset/pr-9297-tech-stories-1687467224725.md b/packages/manager/.changeset/pr-9297-tech-stories-1687467224725.md new file mode 100644 index 00000000000..58d12af0cda --- /dev/null +++ b/packages/manager/.changeset/pr-9297-tech-stories-1687467224725.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tech Stories +--- + +Made yarn up:expose actually expose Cloud Manager on all interfaces ([#9297](https://github.com/linode/manager/pull/9297)) diff --git a/packages/manager/package.json b/packages/manager/package.json index 0efa742d65a..317b276d7ac 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -91,6 +91,7 @@ "postinstall": "patch-package", "compare": "./scripts/jira-changelog.sh", "start": "concurrently --raw \"vite\" \"tsc --watch --preserveWatchOutput\"", + "start:expose": "concurrently --raw \"vite --host\" \"tsc --watch --preserveWatchOutput\"", "start:ci": "yarn serve ./build -p 3000 -s --cors", "lint": "yarn run eslint . --ext .js,.ts,.tsx --quiet", "build": "node scripts/prebuild.mjs && vite build",