From c5fdd9c3369ed9b1890aa6a66751ccc1f6aa7569 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 8 Nov 2021 16:36:20 -0500 Subject: [PATCH] add type defs when working with relative path imports --- demo/typescript/index.js | 2 +- demo/typescript/index.ts | 4 +--- package.json | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/demo/typescript/index.js b/demo/typescript/index.js index 062894b3..84afb663 100644 --- a/demo/typescript/index.js +++ b/demo/typescript/index.js @@ -5,7 +5,7 @@ */ // demo/typescript/index.ts -import Human from "../../dist/human.esm.js"; +import { Human } from "../../dist/human.esm.js"; var humanConfig = { modelBasePath: "../../models", filter: { equalization: false } diff --git a/demo/typescript/index.ts b/demo/typescript/index.ts index c85d3495..be0126ad 100644 --- a/demo/typescript/index.ts +++ b/demo/typescript/index.ts @@ -7,9 +7,7 @@ * @license MIT */ -/// - -import Human from '../../dist/human.esm.js'; // equivalent of @vladmandic/human +import { Human } from '../../dist/human.esm.js'; // equivalent of @vladmandic/Human const humanConfig = { // user configuration for human, used to fine-tune behavior modelBasePath: '../../models', diff --git a/package.json b/package.json index 1277bd42..c9795023 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "scripts": { "start": "node --no-warnings demo/nodejs/node.js", "dev": "build --profile development", - "build": "rimraf test/build.log && build --profile production && cp src/tfjs/tfjs.esm.d.ts types/dist/", + "build": "rimraf test/build.log && build --profile production && cp src/tfjs/tfjs.esm.d.ts types/dist/ && cp src/human.d.ts dist/human.esm.d.ts", "test": "node --no-warnings --unhandled-rejections=strict --trace-uncaught test/node.js", "lint": "eslint src demo test", "scan": "npx auditjs@latest ossi --dev --quiet" @@ -67,8 +67,8 @@ "@tensorflow/tfjs-node": "^3.11.0", "@tensorflow/tfjs-node-gpu": "^3.11.0", "@types/node": "^16.11.6", - "@typescript-eslint/eslint-plugin": "^5.3.0", - "@typescript-eslint/parser": "^5.3.0", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", "@vladmandic/build": "^0.6.3", "@vladmandic/pilogger": "^0.3.5", "canvas": "^2.8.0", @@ -81,7 +81,7 @@ "eslint-plugin-json": "^3.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.1", - "node-fetch": "^3.0.0", + "node-fetch": "^3.1.0", "rimraf": "^3.0.2", "seedrandom": "^3.0.5", "tslib": "^2.3.1",