diff --git a/Taskfile.yml b/Taskfile.yml index b4af4cf2d9..ed47577557 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -21,13 +21,14 @@ tasks: dev:install: summary: Install packages cmds: - - task dev:cli -- yarn install + - yarn install dev:start: summary: Install and run docker compose cmds: - task dev:install - docker compose {{ .DOCKER_COMPOSE_FILES }} up --detach + - yarn dev dev:stop: summary: Stop docker compose environment @@ -63,34 +64,24 @@ tasks: dev:storybook: summary: Run storybook in development mode cmds: - - task dev:cli -- yarn start:storybook:dev - - dev:logs: - summary: Tail docker compose logs for web-pack - cmds: - - docker compose logs node --follow + - yarn start:storybook:dev dev:reset: summary: Install development environment and clean up. cmds: - task dev:down - - task dev:cli -- yarn clean + - yarn clean - rm -rf node_modules - task dev:up dev:test: summary: Run tests cmds: - - docker compose exec node yarn test + - yarn test dev:lint: summary: Run linters cmds: - - task dev:cli -- yarn lint:js - - task dev:cli -- yarn lint:scss - - task dev:cli -- yarn lint:markdown - - dev:cli: - summary: Performs command inside container. Expects parameter(s). - cmds: - - docker compose {{ .DOCKER_COMPOSE_FILES }} run --rm node {{.CLI_ARGS}} + - yarn lint:js + - yarn lint:scss + - yarn lint:markdown diff --git a/docker-compose.yml b/docker-compose.yml index 6f44433ee8..80923be1b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,6 @@ version: '3.7' services: - node: - image: node:20.9 - user: node - init: true - working_dir: /home/node/app - volumes: - - root:/home/node/app - - ~/.npmrc:/home/node/.npmrc - ports: - - "80" - command: 'yarn dev' - tty: true - environment: - VIRTUAL_HOST: dpl-react.docker - VIRTUAL_PORT: 80 - SHELL: '/bin/sh' - STORYBOOK_CLIENT_ID: bdc1d425-9117-4867-acb9-c7307ddc2e0f - YARN_CACHE_FOLDER: /home/node/app/.cache/yarn - wiremock: image: up9inc/wiremock-studio:2.32.0-18 ports: diff --git a/docs/README.md b/docs/README.md index 06f1fac86c..74f1dcb476 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,6 +8,8 @@ Danish public libraries. ### Requirements - [go-task](https://github.com/go-task/task) +- [nvm](https://github.com/nvm-sh/nvm) +- [yarn 1.x](https://classic.yarnpkg.com/lang/en/) - [Docker](https://www.docker.com/products/docker-desktop) - [Dory](https://github.com/FreedomBen/dory) @@ -24,18 +26,16 @@ npm login --registry=https://npm.pkg.github.com ### Howto -1. Run `task dev:start` -2. Access Storybook at - -#### Alternative without Docker - -1. Add `127.0.0.1 dpl-react.docker` to your `/etc/hosts` file -2. Ensure that your node version matches what is specified in `package.json`. -3. Install dependencies: `yarn install` -4. Start storybook `sudo yarn start:storybook:dev` -5. If you need to log in through Adgangsplatformen, you need to change - your url to instead of . This - avoids getting log in errors +1. Ensure that your Node version matches what is specified in `.nvmrc`. +2. Run `task dev:start` + - Storybook will open automatically in a browser + - The console will contain build and lint information +3. If you need to log in through Adgangsplatformen: + - Add `127.0.0.1 dpl-react.docker` to your `/etc/hosts` file + - [Ensure that Node can bind to port 80](https://gist.github.com/guifromrio/6389682) + - Use instead of +4. If you want to use Wiremock instead of production systems run + `task dev:mocks:start` #### Step Debugging in Visual Studio Code (no docker)