Skip to content

Commit 159f186

Browse files
committed
replace json md with ts for comments
1 parent 3b77172 commit 159f186

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ Here is the brief overview of what you can find in it:
659659
- [Postgres](docs/postgres.md) - allow remote connections, running in Docker as non-root user to handle file permissions in volumes, free `elephantsql.com` setup for demo purpose
660660
- [api](docs/api.md) - separation of concerns in backend, middleware, controllers, services
661661
- [error handling](docs/error-handling.md) - handling errors in API and `getServerSideProps`, handling errors with ErrorBoundaries and React Query, TypeScript `strict` and `strictNullChecks` options
662-
- [testing](docs/tests.md) - `ts-jest` setup, async tests with React Query, testing forms, mocking Blob class in jsdom for images, userEvent `v14` migration, Suspense and ErrorBoundary in tests, msw, mocking Prisma in unit tests, using Supertest for testing controllers, backend integrations tests with test database, multi projects Jest setup, running tests inside Docker and Github Actions, `jest-preview` setup, code coverage configuration
662+
- [testing](docs/tests.md) - `ts-jest` setup, async tests with React Query, testing forms, mocking Blob class in jsdom for images, userEvent `v14` migration, Suspense and ErrorBoundary in tests, msw, mocking Prisma in unit tests, using Supertest for testing controllers, backend integration tests with test database, multi projects Jest setup, running tests inside Docker and Github Actions, `jest-preview` setup, code coverage configuration
663663
- [Cypress](docs/cypress.md) - local Cypress setup, asserting elements and http requests, handling user session, custom commands and tasks, running Cypress with TypeScript inside Docker, running in Github Actions
664664
- [Docker](docs/docker.md) - writing Dockerfile for dev and prod Next.js, handling environment variables, handling file permissions for volumes, handling Prisma migration and seed, overriding `docker-compose.yml`, live production container setup, custom Cypress image
665665
- [Github Actions](docs/github-actions.md) - building Docker container, running tests, handling environment variables, handling `NODE_ENV` and `APP_ENV` variables, VPS deployment using SSH action

docs/cypress.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ npb-e2e | TS18002: The 'files' list in config file 'tsconfig.json'
207207
3. and started with `cypress run --project ./tests-e2e` from **local** `package.json`, (`tests-e2e/package.json` -> `/app/package.json` (root))
208208
4. Cypress must be started from same folder like `package.json` and `node_modules`
209209

210-
```json
210+
```ts
211211
// tests-e2e/package.json
212212
"scripts": {
213213
"test": "wait-on http://npb-app-test:3001 && cypress run --project ./tests-e2e"
@@ -305,7 +305,7 @@ jobs:
305305

306306
- must use it because of local `package.json`
307307

308-
```json
308+
```ts
309309
// i need this (moves entire folder with default cypress.json)
310310
"cypress": "cypress open --project ./tests-e2e",
311311
// and not this (moves only cypress.json)
@@ -333,7 +333,7 @@ npb-app-test | error - ESLint: Failed to load plugin 'cypress' declared in '.
333333
- better use `env-cmd` or `dotenv-cli`, actually this **is** `dotenv-cli`
334334
- but actually docker-compose.yml and .env.\* files solve this
335335

336-
```json
336+
```ts
337337
// original
338338
"test:e2e:env:original": "dotenv -e .env.test.local -- sh -c 'yarn test:e2e'",
339339
// print args

docs/demo-environments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ DATABASE_URL=postgres://...
151151
- set port and yarnscript in `sandbox.config.json`
152152
- first terminal is readonly log from this inital process, other terminals are normal Linux terminals from container
153153
154-
```json
154+
```ts
155155
{
156156
"infiniteLoopProtection": true,
157157
"hardReloadOnChange": false,

docs/docker.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ docker-compose -f docker-compose.yml -f docker-compose.prod.yml config > docker-
255255

256256
- extends with -f dc1 -f dc2 works, both containers have same name
257257

258-
```json
258+
```ts
259259
// to run npb-app-test omit -f docker-compose.e2e.yml
260260
// exits because it doesn't have start command
261261
"docker:npb-app-test:npb-db-test:up": "docker-compose -f docker-compose.test.yml -p npb-test up -d npb-app-test npb-db-test",
@@ -387,7 +387,7 @@ docker-compose --env-file ./config/.env.dev up
387387

388388
- you can `docker-compose up` single service but you must remove entire `docker-compose.yml` file
389389

390-
```json
390+
```ts
391391
// dev up
392392
"docker:dev:up": "docker-compose -f docker-compose.dev.yml -p npb-dev up",
393393
// entire dev down, also db down, (always same args as up - file and project...)
@@ -399,7 +399,7 @@ docker-compose --env-file ./config/.env.dev up
399399

400400
- test containers explained:
401401

402-
```json
402+
```ts
403403
// same scripts with 2 names, let it be
404404
"docker:test:build": "docker-compose -f docker-compose.test.yml build npb-app-test",
405405
"docker:npb-app-test:build": "docker-compose -f docker-compose.test.yml build npb-app-test",
@@ -439,7 +439,7 @@ yarn docker:test:down
439439

440440
- e2e testing containers explained:
441441

442-
```json
442+
```ts
443443
// all builds are with docker-compose, except live
444444
// can be also with Dockerfile, just image name - tag, d-c better
445445
"docker:npb-app-test:build": "docker-compose -f docker-compose.test.yml build npb-app-test",
@@ -488,7 +488,7 @@ yarn docker:test:e2e:down
488488

489489
### Prod live containers explained
490490

491-
```json
491+
```ts
492492
// use docker build to specify custom tag
493493
// must have full username/image-name to be pushed
494494
"docker:live:build": "dotenv -e ./envs/production-live/.env.production.live.build.local -- bash -c 'docker build -f Dockerfile.prod -t nemanjamitic/nextjs-prisma-boilerplate:latest --build-arg ARG_DATABASE_URL=${DATABASE_URL} --build-arg ARG_NEXTAUTH_URL=${NEXTAUTH_URL} .'",

docs/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ ts-node --cwd <path/to/directory>
207207
208208
- baseUrl to work with ts-node [stackoverflow](https://stackoverflow.com/questions/70515063/ts-config-path-error-error-cannot-find-module-models-userschema)
209209
210-
```json
210+
```ts
211211
// yarn add -D tsconfig-paths
212212
// tsconfig.json:
213213
{

docs/github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ PORT=${!NAME_PORT} # does not work
158158
- all possible methods [tutorial](https://getridbug.com/reactjs/how-to-use-different-env-files-with-nextjs/)
159159
- blitz.js `APP_ENV` [docs](https://blitzjs.com/docs/environment-variables)
160160

161-
```json
161+
```ts
162162
"test:e2e:env": "dotenv -e .env.test.local -- sh -c 'yarn test:e2e'",
163163
```
164164

docs/tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ module.exports = {
758758

759759
- none of the jest tests needs prod built app, only app source; only e2e Cypress needs built prod app
760760

761-
```json
761+
```ts
762762
"test:client": "",
763763
"test:server:unit": "",
764764

0 commit comments

Comments
 (0)