Add yarn preview:*

This commit is contained in:
Manav Rathi 2024-03-30 17:53:01 +05:30
parent f6abcafc83
commit 5810d2b762
No known key found for this signature in database
3 changed files with 38 additions and 3 deletions

View file

@ -31,7 +31,7 @@ are built against `electron`'s packaged `node` version. We use
to rebuild those modules automatically after each `yarn install` by invoking it
in as the `postinstall` step in our package.json.
### lint and lint-fix
### lint, lint-fix
Use `yarn lint` to check that your code formatting is as expected, and that
there are no linter errors. Use `yarn lint-fix` to try and automatically fix the

View file

@ -1,4 +1,35 @@
# Notes for Developers
# Development
## Yarn commands
### yarn dev:*
Launch the app in development mode. There is one `yarn dev:foo` for each app,
e.g. `yarn dev:auth`. `yarn dev` is a shortcut for `yarn dev:photos`.
The ports are different for the main apps (3000), various sidecars (3001, 3002).
### yarn build:*
Build a production export for the app. This is a bunch of static HTML/JS/CSS
that can be then deployed to any web server.
There is one `yarn build:foo` for each app, e.g. `yarn build:auth`. The output
will be placed in `apps/<foo>/out`, e.g. `apps/auth/out`.
### yarn preview:*
Build a production export and start a local web server to serve it. This uses
Python's built in web server, and is okay for quick testing but should not be
used in production.
The ports are the same as that for `yarn dev:*`
### lint, lint-fix
Use `yarn lint` to check that your code formatting is as expected, and that
there are no linter errors. Use `yarn lint-fix` to try and automatically fix the
issues.
## Monorepo

View file

@ -26,7 +26,11 @@
"dev:payments": "yarn workspace payments next dev -p 3001",
"dev:photos": "yarn workspace photos next dev",
"lint": "yarn prettier --check . && yarn workspaces run eslint .",
"lint-fix": "yarn prettier --write . && yarn workspaces run eslint --fix ."
"lint-fix": "yarn prettier --write . && yarn workspaces run eslint --fix .",
"preview:accounts": "yarn build:accounts && python3 -m http.server -d apps/accounts/out 3001",
"preview:auth": "yarn build:auth && python3 -m http.server -d apps/auth/out 3001",
"preview:cast": "yarn build:cast && python3 -m http.server -d apps/accounts/out 3001",
"preview:photos": "yarn build:photos && python3 -m http.server -d apps/photos/out 3001"
},
"resolutions": {
"libsodium": "0.7.9"