From 96d5848a9c44ad6b235b047f5e44cca0aa2eec6e Mon Sep 17 00:00:00 2001 From: thekiba Date: Mon, 12 Feb 2024 01:57:09 +0400 Subject: [PATCH] refactor: optimize imports --- src/astbuilder/fill_constructors.ts | 2 +- src/astbuilder/handle_field.ts | 2 +- src/astbuilder/handle_type.ts | 2 +- src/astbuilder/utils.ts | 2 +- src/main.ts | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/astbuilder/fill_constructors.ts b/src/astbuilder/fill_constructors.ts index 23a4047..e058e8c 100644 --- a/src/astbuilder/fill_constructors.ts +++ b/src/astbuilder/fill_constructors.ts @@ -8,7 +8,7 @@ import { NameExpr, NegateExpr, NumberExpr, -} from "@ton-community/tlb-parser/dist/ast/nodes"; +} from "@ton-community/tlb-parser"; import * as crc32 from "crc-32"; import { TLBBinaryOp, diff --git a/src/astbuilder/handle_field.ts b/src/astbuilder/handle_field.ts index 5e88e4f..17c70b6 100644 --- a/src/astbuilder/handle_field.ts +++ b/src/astbuilder/handle_field.ts @@ -11,7 +11,7 @@ import { FieldNamedDef, MathExpr, NameExpr, -} from "@ton-community/tlb-parser/dist/ast/nodes"; +} from "@ton-community/tlb-parser"; import { TLBField } from "../ast"; import { getType } from "./handle_type"; import { TLBConstructorBuild, TLBTypeBuild } from "./utils"; diff --git a/src/astbuilder/handle_type.ts b/src/astbuilder/handle_type.ts index 83d0b23..d5e5a92 100644 --- a/src/astbuilder/handle_type.ts +++ b/src/astbuilder/handle_type.ts @@ -9,7 +9,7 @@ import { NegateExpr, NumberExpr, Expression as ParserExpression, -} from "@ton-community/tlb-parser/dist/ast/nodes"; +} from "@ton-community/tlb-parser"; import { TLBBinaryOp, TLBFieldType, diff --git a/src/astbuilder/utils.ts b/src/astbuilder/utils.ts index 1d530d5..03f891f 100644 --- a/src/astbuilder/utils.ts +++ b/src/astbuilder/utils.ts @@ -5,7 +5,7 @@ import { NegateExpr, NumberExpr, SimpleExpr, -} from "@ton-community/tlb-parser/dist/ast/nodes"; +} from "@ton-community/tlb-parser"; import { TLBBinaryOp, TLBConstructorTag, diff --git a/src/main.ts b/src/main.ts index 60f2f83..aae046b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { Program } from "@ton-community/tlb-parser/dist/ast/nodes"; +import { ast, Program } from "@ton-community/tlb-parser"; import { TLBCode, TLBType } from "./ast"; import { TLBCodeBuild, @@ -9,8 +9,6 @@ import { fillConstructors } from "./astbuilder/fill_constructors"; import { CodeBuilder } from "./generators/CodeBuilder"; import { CodeGenerator, CommonGenDeclaration } from "./generators/generator"; import { TypescriptGenerator } from "./generators/typescript/generator"; - -import { ast } from "@ton-community/tlb-parser"; import fs from 'fs' @@ -83,4 +81,4 @@ export function generateCode(inputPath: string, outputPath: string, resultLangua } } generateCodeWithGenerator(inputPath, outputPath, getGenerator); -} \ No newline at end of file +}