Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug flags and instructions for debugging frontends #1519

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format
(_Note:_ it our intention to improve our release process going forward by using [Semantic Versioning](https://semver.org/spec/v2.0.0.html).)

## Unreleased
- Added:
- Debug flags for public and partner site ([Detroit Team #195](https://github.com/CityOfDetroit/bloom/pull/195), [#1519](https://github.com/bloom-housing/bloom/pull/1519))

### General

Expand Down
19 changes: 19 additions & 0 deletions sites/partners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ This is a reference implementation of the partners-facing web app, providing the
- Copy `.env.template` to `.env.local` and edit variables appropriate to your local environment. S[ee the docs here](https://nextjs.org/docs/basic-features/environment-variables) for more detail on configuration options.
- `yarn dev`

### Debugging
Starting the site with `yarn dev` includes the necessary debug flags.

To connect to it from VS Code, add a configuration to launch.json that looks like
```shell script
{
"name": "Attach to Partners Site",
"port": 9231,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"sourceMaps": true,
"cwd": "${workspaceFolder}/sites/partners"
},
```

## Running end-to-end tests locally

- Start the Next.js server: `yarn test`
Expand Down
2 changes: 1 addition & 1 deletion sites/partners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"dev": "NODE_OPTIONS='--inspect=9230' next -p ${NEXTJS_PORT:-3001}",
"dev": "NODE_OPTIONS='--inspect=9231' next -p ${NEXTJS_PORT:-3001}",
"build": "next build",
"test": "concurrently \"yarn dev\" \"cypress open\"",
"test:headless": "concurrently \"yarn dev\" \"cypress run\"",
Expand Down
19 changes: 19 additions & 0 deletions sites/public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ This is the beginning of a reference implementation of the public-facing web app
- Copy `.env.template` to `.env.local` and edit variables appropriate to your local environment. S[ee the docs here](https://nextjs.org/docs/basic-features/environment-variables) for more detail on configuration options.
- `yarn dev`

### Debugging
Starting the site with `yarn dev` includes the necessary debug flags.

To connect to it from VS Code, add a configuration to launch.json that looks like
```shell script
{
"name": "Attach to Public Site",
"port": 9230,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"sourceMaps": true,
"cwd": "${workspaceFolder}/sites/public"
},
```

## Running end-to-end tests locally

- Start the Next.js server: `yarn test`
Expand Down
2 changes: 1 addition & 1 deletion sites/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"dev": "next -p ${NEXTJS_PORT:-3000}",
"dev": "NODE_OPTIONS='--inspect=9230' next -p ${NEXTJS_PORT:-3000}",
"build": "next build",
"test": "concurrently \"yarn dev\" \"cypress open\"",
"test:headless": "concurrently \"yarn dev\" \"cypress run\"",
Expand Down