siefkenj / unified-latex

Utilities for parsing and manipulating LaTeX ASTs with the Unified.js framework
MIT License
85 stars 20 forks source link

Revert to custom export conditions #68

Closed theseanl closed 7 months ago

theseanl commented 7 months ago

In https://github.com/siefkenj/unified-latex/pull/67, I initially achieved its goal via custom condition that points to .ts source files and applied by specifying it in tsconfig and esbuild configs, but a we have made a choice to make import directly point to .ts source files instead.

It turned out that this later decision conflicts with one's ability to locally install a development version of a package to other third-party package and test it. It is not right to make import point to non-js source files, because the behavior of import is dictated by nodejs and is not customizable. Thus, this PR reverts the latest change.

siefkenj commented 7 months ago

You're talking about running npm link inside the various directories? If npm link is run from inside the dist directory, then this shouldn't be an issue (provided the package.json has been created in that directory). I would prefer a solution of adding the creation of package.json to the build process and having people link directly in the dist folder.

This should come with an explanation in the top-level readme and an npm run link script that automatically calls npm link from inside each dist directory.