-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SHELL := /bin/bash
.PHONY: start
start:
make bundle
deno run --allow-env --allow-read --allow-sys --allow-ffi --allow-run npm:chokidar-cli@3.0.0 "public/**/*" -c "make bundle"
.PHONY: format
format:
deno fmt
.PHONY: test
test:
deno fmt --check
deno lint
deno check .
make test-manifest
.PHONY: build-tailwind
build-tailwind:
deno run --allow-env --allow-read --allow-sys --allow-ffi --vendor --unstable-detect-cjs --allow-write=public/css,/var/folders npm:tailwindcss@3.4.17 -i ./public/css/tailwind-input.css -o ./public/css/tailwind.css
.PHONY: bundle
bundle:
@rm -fr ./dist
make build-tailwind
deno run --allow-env --allow-read --allow-sys --allow-run --allow-write=dist bundle.ts
cp -r ./public/images ./dist/images
cp ./public/*.html ./dist
cat ./public/css/style.css ./public/css/tailwind.css > ./dist/bundle.css
cp ./public/firefox.manifest.json ./dist/manifest.json
mv ./dist ./dist-firefox && mkdir -p ./dist && mv ./dist-firefox ./dist/firefox
cp -r ./dist/firefox ./dist/chrome
cp ./public/chrome.manifest.json ./dist/chrome/manifest.json
.PHONY: build
build:
make bundle
cd dist/firefox && deno run --allow-env --allow-read --allow-write --allow-net --allow-sys --allow-ffi --allow-run --allow-scripts npm:web-ext@8.5.0 build
.PHONY: test-manifest
test-manifest:
make bundle
cd dist/firefox && deno run --allow-env --allow-read --allow-write --allow-net --allow-sys --allow-ffi --allow-run --allow-scripts npm:web-ext@8.5.0 lint
.PHONY: load-in-firefox
load-in-firefox:
make test-manifest
@# NOTE: What's below doesn't work because Deno 2.2.11 still doesn't support the internals of web-ext for running the extension, only linting
@#cd dist/firefox && deno run --allow-env --allow-read --allow-write --allow-net --allow-sys --allow-ffi --allow-run --allow-scripts npm:web-ext@8.5.0 run
cd dist/firefox && npx web-ext@8.5.0 run