Skip to content

Commit

Permalink
use Makefile instead of docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Feb 2, 2022
1 parent 5c03b9c commit 7272558
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PROJECT_DATA=$(shell pwd)
DOCKER_CONTAINER_NAME=ava-pro-node
DOCKER_CONTAINER_IMAGE=cl00e9ment/node.js-builder

clear-cache:

find . -maxdepth 1 -type d -name .parcel-cache -exec rm -rf {} \+

rm -rf packages/webextension/dist

attach:
docker exec -it $(DOCKER_CONTAINER_NAME) sh

sh:

docker run --rm --name $(DOCKER_CONTAINER_NAME) -v $(PROJECT_DATA):/srv -w /srv -p 1234:1234 -u node -it $(DOCKER_CONTAINER_IMAGE) sh

dev:

docker run --rm --name $(DOCKER_CONTAINER_NAME) -v $(PROJECT_DATA):/srv -w /srv -p 1234:1234 -u node -it $(DOCKER_CONTAINER_IMAGE) sh -c "pnpm install && pnpm run dev"

build:

make clear-cache

docker run --rm --name $(DOCKER_CONTAINER_NAME) -v $(PROJECT_DATA):/srv -w /srv -u node -it $(DOCKER_CONTAINER_IMAGE) sh -c "pnpm install && pnpm run build"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ git clone -b 0.0.2 https://github.com/guesant/ava-pro.git
cd ava-pro
```

#### Development with docker-compose (recommended)
#### Development with Docker (recommended)

We recommend the usage of docker-compose to develop the extension (~~due security reasons lol~~ [[1]](https://thehackernews.com/2021/10/popular-npm-package-hijacked-to-publish.html)).
We recommend the usage of Docker to develop the extension (~~due security reasons lol~~ [[1]](https://thehackernews.com/2021/10/popular-npm-package-hijacked-to-publish.html)).

```sh
docker-compose up dev # -> packages/webextension/dist/dev
docker-compose up build # -> packages/webextension/dist/prod
make dev # -> packages/webextension/dist/dev
make build # -> packages/webextension/dist/prod
```

#### Development with the nodejs from your system
#### Development with the NodeJS from your system

<details>
<summary>Click to expand</summary>
Expand Down
19 changes: 0 additions & 19 deletions docker-compose.yml

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"scripts": {
"format": "prettier --write .",
"lint": "eslint --fix --ext js,ts,tsx,jsx packages",
"lint": "eslint --ext js,ts,tsx,jsx packages",
"lint:fix": "pnpm run lint -- --fix",
"dev": "pnpm run --filter @ava-pro/webextension start",
"build": "pnpm run clear:cache; pnpm run --filter @ava-pro/webextension build",
"clear:cache": "find . -type d -name .parcel-cache -exec rm -rf {} \\+",
"build": "pnpm run --filter @ava-pro/webextension build",
"prepare": "husky install"
},
"lint-staged": {
Expand Down

0 comments on commit 7272558

Please sign in to comment.