Skip to content

Commit 4d6d3b4

Browse files
committed
adopt makefile for readability
1 parent 625cd78 commit 4d6d3b4

File tree

6 files changed

+1302
-463
lines changed

6 files changed

+1302
-463
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"json.schemaDownload.enable": true
3-
}
3+
}

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ZIP_FILE="extension.zip"
2+
HASH_ALG="sha384"
3+
4+
.PHONY: install all dev prod build format lint clean
5+
6+
install:
7+
npm i -g pnpm
8+
pnpm i
9+
10+
all: build
11+
12+
dev:
13+
NODE_OPTIONS="--loader=ts-node/esm" \
14+
./node_modules/.bin/webpack --progress --watch --mode=development
15+
16+
prod:
17+
NODE_OPTIONS="--loader=ts-node/esm --no-warnings" \
18+
NODE_ENV="production" \
19+
./node_modules/.bin/webpack --mode=production
20+
21+
build:
22+
make lint
23+
make prod
24+
25+
rm -rf $(ZIP_FILE)
26+
zip -r $(ZIP_FILE) ./bundle ./manifest.json > /dev/null
27+
28+
FILE_HASH=$$(openssl dgst -$(HASH_ALG) -binary $(ZIP_FILE) | openssl base64 -A); \
29+
echo "$(ZIP_FILE) (hash-$(HASH_ALG)): $$FILE_HASH"
30+
31+
format:
32+
./node_modules/.bin/prettier . --write
33+
34+
lint:
35+
./node_modules/.bin/tsc -noEmit
36+
37+
clean:
38+
rm -rf ./node_modules
39+
rm -rf $(ZIP_FILE)
40+
rm -rf ./bundle/js/

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ Chrome extension to compare objects in memory with console.diff(old, new) devtoo
6868

6969
- Compared objects, after being serialized, and stored in `chrome.storage.local` wich has 10MB limit.
7070

71-
- Will not work on `file:///` prorocol and https://chrome.google.com/webstore site.
72-
7371
### API
7472

7573
- **console.diff(left, right)** - compare left and right arguments
@@ -126,12 +124,11 @@ Historically, left side represents the old state and right side the new state.
126124
### How to build
127125

128126
- requires npm/nodejs
129-
- requires pnpm `npm i -g pnpm`
130127

131128
```sh
132-
pnpm i
133-
pnpm dev # local development
134-
pnpm zip # make extension.zip
129+
make install # to install dependencies
130+
make all # build for prod and make extension.zip
131+
make dev # local development
135132
```
136133

137134
### Protection

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"description": "Chrome extension to compare objects in memory with console.diff(old, new) devtools function",
55
"private": true,
66
"scripts": {
7-
"test": "echo \"no test\" && exit 1",
8-
"dev": "NODE_OPTIONS=\"--loader=ts-node/esm\" webpack --progress --watch --mode=development",
9-
"prod": "NODE_OPTIONS=\"--loader=ts-node/esm --no-warnings\" NODE_ENV=production webpack --mode=production",
10-
"lint": "tsc -noEmit",
11-
"format": "prettier . --write",
12-
"zip": "./scripts/package.sh"
7+
"test": "echo \"no test\" && exit 1"
138
},
149
"repository": {
1510
"type": "git",

0 commit comments

Comments
 (0)