From e0fb5ca50c9baefd3788a4f27a56048b96f1821f Mon Sep 17 00:00:00 2001 From: urielch Date: Sat, 20 Apr 2024 08:54:28 +0200 Subject: [PATCH] patch exports --- .gitignore | 1 + package.json | 5 +++-- src/lib/opencv4nodejs.ts | 4 ++-- tsconfig-common.json | 11 +++++++++++ tsconfig-esm.json | 6 +++--- tsconfig.json | 11 +++-------- 6 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 tsconfig-common.json diff --git a/.gitignore b/.gitignore index 3ee4ee8e4..5ebcf71ac 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ cjs/install/ cjs/lib/ esm/install/ esm/lib/ +types/ diff --git a/package.json b/package.json index 1fbca28c3..eb2d79753 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@u4/opencv4nodejs", - "version": "7.0.0-alpha-2", + "version": "7.0.0-alpha-4", "description": "Asynchronous OpenCV 3.x / 4.x nodejs bindings with JavaScript and TypeScript API.", "keywords": [ "opencv", @@ -60,7 +60,8 @@ "lint": "eslint examples/**/*.ts src/**/*.ts typings/**/*.ts ", "clean": "node-gyp clean", "cleanjs": "rimraf {examples}/**/*.{d.ts,js,map} {cjs,esm}/{lib,install}", - "build-debug": "npm run build && BINDINGS_DEBUG=true node bin/install.js rebuild" + "build-debug": "npm run build && BINDINGS_DEBUG=true node bin/install.js rebuild", + "publish-next": "npm publish --dry-run --tag next" }, "dependencies": { "@u4/opencv-build": "^0.9.1", diff --git a/src/lib/opencv4nodejs.ts b/src/lib/opencv4nodejs.ts index 886c2699f..68bed3d92 100644 --- a/src/lib/opencv4nodejs.ts +++ b/src/lib/opencv4nodejs.ts @@ -3,6 +3,8 @@ import promisify from './promisify'; import extendWithJsSources from './src/index'; import { getOpenCV } from './cvloader'; import type * as openCV from '../../typings/index'; +export type * as openCV from '../../typings/index'; + declare type OpenCVType = typeof openCV; function loadOpenCV(opt?: OpenCVBuildEnvParams): OpenCVType { @@ -31,7 +33,5 @@ for (const key in cv) { } defExport['cv'] = cv; -// export cv; export default defExport; -//export = defExport; diff --git a/tsconfig-common.json b/tsconfig-common.json new file mode 100644 index 000000000..4511ee4e8 --- /dev/null +++ b/tsconfig-common.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES2019", + "strict": false, + "esModuleInterop": true, + "noImplicitReturns": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + }, + "include": [ "src/**/*.ts"] +} diff --git a/tsconfig-esm.json b/tsconfig-esm.json index de9cb9aa7..12347369c 100644 --- a/tsconfig-esm.json +++ b/tsconfig-esm.json @@ -1,11 +1,11 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig-common.json", "compilerOptions": { - "module": "ESNext", + "module": "Node16", "declaration": false, "declarationMap": false, "outDir": "esm", - "moduleResolution": "Node", + "moduleResolution": "Node16", }, } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 17cb56825..a8e4f6b18 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,10 @@ { + "extends": "./tsconfig-common.json", "compilerOptions": { - "target": "ES2019", - "strict": false, - "esModuleInterop": true, - "noImplicitReturns": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, + "module": "commonjs", "declaration": true, "declarationMap": true, + "declarationDir": "types", "outDir": "cjs", - "module": "commonjs", }, - "include": [ "src/**/*.ts"] }