Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize index.ts and export it in package.json #776

Open
Tracked by #314
jubnzv opened this issue Sep 2, 2024 · 2 comments
Open
Tracked by #314

Finalize index.ts and export it in package.json #776

jubnzv opened this issue Sep 2, 2024 · 2 comments
Labels
api Tact's TypeScript API for third-party tools enhancement New feature or request

Comments

@jubnzv
Copy link
Member

jubnzv commented Sep 2, 2024

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: #740 and #543

@jubnzv jubnzv added enhancement New feature or request api Tact's TypeScript API for third-party tools labels Sep 2, 2024
@anton-trunov
Copy link
Member

and add them to package.json.

Somehow @ton/ton-core works without this step:

@jubnzv
Copy link
Member Author

jubnzv commented Sep 2, 2024

They somehow put index.js and index.d.js to the dist folder instead dist/src: https://www.npmjs.com/package/@ton/core?activeTab=code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Tact's TypeScript API for third-party tools enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants