add docker deno build to Makefile, clean step, fix app build, .gitignore

This commit is contained in:
Tomáš Mládek 2021-09-23 12:38:41 +02:00
parent ff39c8eeb3
commit f004daaa3c
4 changed files with 19 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.DS_Store
node_modules
.npm
/dist
# local env files

View file

@ -1,4 +1,4 @@
all: deno_lint deno app docker
all: clean deno_lint deno_docker tgbot app
deno_lint:
cd cli && deno lint
@ -8,8 +8,14 @@ deno: ./kollagen
./kollagen:
cd cli && deno compile --import-map ./import_map.json --allow-read --allow-write --unstable -o ../kollagen main.ts
deno_docker:
docker run --rm -v $$PWD:/app denoland/deno compile --import-map /app/cli/import_map.json --allow-read --allow-write --unstable -o /app/kollagen /app/cli/main.ts
app:
npm ci --cache .npm --prefer-offline && npm run build
docker: ./kollagen
docker build -t kollagen-bot -f tgbot/Dockerfile .
tgbot: ./kollagen
docker build -t kollagen-bot -f tgbot/Dockerfile .
clean:
rm -rvf dist kollagen

View file

@ -1,7 +1,14 @@
import { CollageModes } from "./common/collages";
export default class BrowserCollageModes extends CollageModes<CanvasRenderingContext2D, ImageBitmap> {
export default class BrowserCollageModes extends CollageModes<CanvasRenderingContext2D, ImageBitmap, any> {
drawImage(ctx: CanvasRenderingContext2D, image: ImageBitmap, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void {
ctx.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh);
}
createCanvas(w: number, h: number) {
throw new Error("Method not implemented.");
}
canvasToImage(canvas: any): PromiseLike<ImageBitmap> {
throw new Error("Method not implemented.");
}
}

View file

@ -26,7 +26,7 @@ export interface CollageContext {
export interface CollageCanvas {
width: number;
height: number;
getContext: (x: '2d') => CollageContext
getContext: (x: '2d') => CollageContext | null
}
export interface CollageImage {