Skip to content

Commit

Permalink
Add debug flags and instructions for debugging frontends (#195)
Browse files Browse the repository at this point in the history
* add debug flags and instructions to frontend package.json files and readmes

* update changelog
  • Loading branch information
avaleske authored Jul 15, 2021
1 parent 3a52b04 commit a973d12
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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).)

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

## Unreleased

## 1.0.4 / 2021-07-07
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

0 comments on commit a973d12

Please sign in to comment.