Skip to content

Commit

Permalink
Additional instructions, in order to be able to run lintfix and other…
Browse files Browse the repository at this point in the history
… commands.
  • Loading branch information
jmfernandez committed May 16, 2024
1 parent 63a97a3 commit 081fcba
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Then, the continuous integration server is available both at 3000 and 8080.
## Adding new dependencies

Once docker compose is up and running, and you want to add some dependencies
to `package.json` and updated `package-lock.json`, you have to do next in
to [package.json](package.json) and updated [package-lock.json](package-lock.json), you have to do next in
a separated terminal:

```bash
Expand All @@ -158,5 +158,29 @@ Have a look at the messages, because some mismatch between the dependencies
of the new packages and the already recorded ones could break havoc.

In those cases, you need to figure out the source of the problem, rollback
both `package.json` and `package-lock.json`, and re-add the updated
dependency.
both [package.json](package.json) and [package-lock.json](package-lock.json), and re-add the updated
dependency.

## Running custom `npm run` commands

Another usual issue is that the CI checks either on service or locally complain
about styling. So, in order to run those checks locally you have to run:

```bash
NPM_RUN=lint docker compose -f docker-compose.devci.yml run npm_run
```

and to (blindly) apply the fixes:

```bash
docker compose -f docker-compose.devci.yml run npm_run
```

or

```bash
NPM_RUN=lintfix docker compose -f docker-compose.devci.yml run npm_run
```

Any other command defined in [package.json](package.json), like `test:unit`
can also be used.
28 changes: 28 additions & 0 deletions docker-compose.devci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,34 @@ services:
- ./stylelint.config.js:/app/stylelint.config.js:ro
- ./tsconfig.json:/app/tsconfig.json:ro

- node-modules-volume:/app/node_modules
npm_run:
build:
context: .
dockerfile: Dockerfile.devci
image: openebench-nuxt:devci
user: ${DEV_UID:-0}:${DEV_GID:-0}
profiles:
- manual
command: npm run ${NPM_RUN:-lintfix}
volumes:
- ./assets:/app/assets
- ./components:/app/components
- ./config:/app/config
- ./layouts:/app/layouts
- ./pages:/app/pages
- ./plugins:/app/plugins
- ./static:/app/static
- ./store:/app/store
- ./stories:/app/stories
- ./test:/app/test
- ./jest.config.js:/app/jest.config.js:ro
- ./nuxt.config.js:/app/nuxt.config.js:ro
- ./package.json:/app/package.json
- ./package-lock.json:/app/package-lock.json
- ./stylelint.config.js:/app/stylelint.config.js:ro
- ./tsconfig.json:/app/tsconfig.json:ro

- node-modules-volume:/app/node_modules
nuxt:
build:
Expand Down

0 comments on commit 081fcba

Please sign in to comment.