tact icon indicating copy to clipboard operation
tact copied to clipboard

Finalize `index.ts` and export it in package.json

Open jubnzv opened this issue 5 months ago • 3 comments

Currently, Tact API users must write imports in the following format:

import { SrcInfo } from "@tact-lang/compiler/dist/grammar/ast";

It would be more convenient if they could write one of the following:

import { SrcInfo } from "@tact-lang/compiler";
import { SrcInfo } from "@tact-lang/compiler/grammar";

To achieve this, we should finalize the exports in the index.ts files and add them to package.json. Here is an example:

  "exports": {
    ".": {
      "import": "./dist/src/index.js",
      "require": "./dist/src/index.js"
    },
    "./*": "./dist/src/*"
  },

Related: https://github.com/tact-lang/tact/issues/740 and https://github.com/tact-lang/tact/issues/543

jubnzv avatar Sep 02 '24 01:09 jubnzv