From 9ad0b8e089dfe2d8090cd84e5c45199676004cbc Mon Sep 17 00:00:00 2001 From: Matt Leon <108271225+wydengyre@users.noreply.github.com> Date: Sat, 15 Jun 2024 09:15:31 -0400 Subject: [PATCH] makefile: separate out type definition move (#50) --- Makefile | 6 ++++-- src/ocr-engine.ts | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3e2a81e..9a0242d 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ checkformat: node_modules/.bin/prettier --check {src,test}/**/*.js .PHONY: typecheck -typecheck: +typecheck: build/tesseract-core.d.ts node_modules/.bin/tsc .PHONY: test @@ -164,7 +164,6 @@ build/tesseract-core.js build/tesseract-core.wasm: src/lib.cpp src/tesseract-ini $(EMSDK_DIR)/emcc src/lib.cpp $(EMCC_FLAGS) \ -I$(INSTALL_DIR)/include/ -L$(INSTALL_DIR)/lib/ -ltesseract -lleptonica -lembind \ -o build/tesseract-core.js - cp src/tesseract-core.d.ts build/ # Build fallback WASM binary for browsers that don't support WASM SIMD. The JS # output from this build is not used. @@ -173,6 +172,9 @@ build/tesseract-core-fallback.js build/tesseract-core-fallback.wasm: src/lib.cpp -I$(INSTALL_DIR)/include/ -L$(FALLBACK_INSTALL_DIR)/lib/ -L$(INSTALL_DIR)/lib -ltesseract -lleptonica -lembind \ -o build/tesseract-core-fallback.js +build/tesseract-core.d.ts: src/tesseract-core.d.ts build + cp $< $@ + dist/tesseract-core.wasm: build/tesseract-core.wasm mkdir -p dist/ cp $< $@ diff --git a/src/ocr-engine.ts b/src/ocr-engine.ts index cbc7dda..82e136a 100644 --- a/src/ocr-engine.ts +++ b/src/ocr-engine.ts @@ -1,4 +1,3 @@ -// @ts-ignore - Don't error if library hasn't been built yet. import initTesseractCore from "../build/tesseract-core"; import { imageDataFromBitmap } from "./utils";