Skip to content

Commit

Permalink
fix: update fe contributing documentation and get dev commands in order
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Mineev authored and umputun committed Nov 30, 2022
1 parent ba19bcc commit 6fe373d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions frontend/apps/remark42/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions site/src/docs/contributing/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://127.0.0.1:9000/web/>, 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 <http://127.0.0.1:9000/web/>, 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 ℹ️
Expand Down

0 comments on commit 6fe373d

Please sign in to comment.