From 2550588e378048c50e875518856fe53d35e2212c Mon Sep 17 00:00:00 2001 From: Akim Mamedov Date: Mon, 18 Sep 2023 18:12:45 +0700 Subject: [PATCH] Misc fixes --- packages/core/aqua-to-js-compiler/package.json | 5 +++-- packages/core/aqua-to-js-compiler/src/utils.ts | 8 +++++--- packages/core/aqua-to-js-compiler/tsconfig.json | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/core/aqua-to-js-compiler/package.json b/packages/core/aqua-to-js-compiler/package.json index 4f6f40e0..1fe82aa7 100644 --- a/packages/core/aqua-to-js-compiler/package.json +++ b/packages/core/aqua-to-js-compiler/package.json @@ -3,9 +3,10 @@ "type": "module", "version": "0.0.0", "description": "Tool for generating aqua wrapper", - "main": "index.js", + "main": "dist/index.js", "scripts": { - "test": "vitest run" + "test": "vitest run", + "build": "tsc" }, "keywords": [], "author": "Fluence Labs", diff --git a/packages/core/aqua-to-js-compiler/src/utils.ts b/packages/core/aqua-to-js-compiler/src/utils.ts index 0922e43d..8a6205e9 100644 --- a/packages/core/aqua-to-js-compiler/src/utils.ts +++ b/packages/core/aqua-to-js-compiler/src/utils.ts @@ -14,10 +14,12 @@ * limitations under the License. */ -import pkg from '../package.json' assert { type: 'json' }; -import { ArrowType, NonArrowType, ProductType } from '@fluencelabs/interfaces'; +import { NonArrowType, ProductType } from '@fluencelabs/interfaces'; +import { readFile } from 'fs/promises'; -export function getAquaApiVersion() { +export async function getAquaApiVersion() { + const content = await readFile('../package.json'); + const pkg = JSON.parse(content.toString()); return pkg.dependencies['@fluencelabs/aqua-api']; } diff --git a/packages/core/aqua-to-js-compiler/tsconfig.json b/packages/core/aqua-to-js-compiler/tsconfig.json index a4642cf0..4b7aeaa2 100644 --- a/packages/core/aqua-to-js-compiler/tsconfig.json +++ b/packages/core/aqua-to-js-compiler/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../../tsconfig.json", "compilerOptions": { "esModuleInterop": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "outDir": "./dist" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"],