From 6fe373d540da2b1fede9f4094e1bbab4b273d5e8 Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Tue, 29 Nov 2022 19:30:42 -0500 Subject: [PATCH] fix: update fe contributing documentation and get dev commands in order --- frontend/apps/remark42/package.json | 5 +++-- frontend/package.json | 2 +- site/src/docs/contributing/frontend/index.md | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/apps/remark42/package.json b/frontend/apps/remark42/package.json index 25e2a20877..859ccafb06 100644 --- a/frontend/apps/remark42/package.json +++ b/frontend/apps/remark42/package.json @@ -3,8 +3,9 @@ "version": "0.16.0", "license": "MIT", "scripts": { - "dev": "cross-env REMARK_URL=http://127.0.0.1:8080 webpack serve --mode development", - "start": "cross-env REMARK_API_BASE_URL=https://demo.remark42.com webpack serve --mode development", + "dev": "cross-env REMARK_URL=http://127.0.0.1:8080 pnpm dev:custom", + "dev:demo": "cross-env REMARK_API_BASE_URL=https://demo.remark42.com pnpm dev:custom", + "dev:custom": "webpack serve --mode development", "build": "webpack --mode production", "build:analyze": "webpack --mode production --analyze", "lint": "run-p lint:*", diff --git a/frontend/package.json b/frontend/package.json index 5569006c00..7f11748a53 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,7 @@ "scripts": { "prepare": "if [ -z \"$CI\" ]; then cd .. && husky install frontend/.husky; else echo \"Skip Husky Hooks\"; fi", "lint-staged": "lint-staged", - "dev:remark42": "turbo run dev --filter=@remark42/app", + "dev:app": "turbo run dev --filter=@remark42/app", "test:api": "turbo run test --filter=@remark42/api", "coverage:api": "turbo run coverage --filter=@remark42/api", "type-check:api": "turbo run type-check --filter=@remark42/api", diff --git a/site/src/docs/contributing/frontend/index.md b/site/src/docs/contributing/frontend/index.md index 6f84674ee9..249ad429c1 100644 --- a/site/src/docs/contributing/frontend/index.md +++ b/site/src/docs/contributing/frontend/index.md @@ -36,12 +36,12 @@ Please use `127.0.0.1` and not `localhost` to access the server; otherwise, CORS You can run frontend against demo instance of Remark42. This method of running Remark42 frontend code is preferred when you make a translation or visual adjustments that are easy to see without extensive testing. For this method we use our demo instance of Remark42 served on https://demo.remark42.com -For local development mode with Hot Reloading, use `pnpm start:app`. In this case, `webpack` will serve files using `webpack-dev-server` on `127.0.0.1:9000`. By visiting , you will get a page with the main comments' widget communicating with a demo server backend running on `https://demo.remark42.com`. But you will not be able to log in with any OAuth providers due to security reasons. +For local development mode with Hot Reloading, use `pnpm dev:app`. In this case, `webpack` will serve files using `webpack-dev-server` on `127.0.0.1:9000`. By visiting , you will get a page with the main comments' widget communicating with a demo server backend running on `https://demo.remark42.com`. But you will not be able to log in with any OAuth providers due to security reasons. -You can attach the frontend to the locally running backend by providing the `REMARK_URL` environment variable. +You can attach the frontend to the locally running backend from `frontend/apps/remark42` folder and providing the `REMARK_URL` environment variable. ```shell -npx cross-env REMARK_URL=http://127.0.0.1:8080 pnpm dev:app +npx cross-env REMARK_URL=http://127.0.0.1:8080 pnpm dev:custom ``` ::: note ℹ️