Skip to content

feat(build): add dual CJS+ESM build and TypeScript declarations#442

Open
lukeundtrug wants to merge 1 commit intosourcegraph:mainfrom
lukeundtrug:feature/make-useable-as-a-library
Open

feat(build): add dual CJS+ESM build and TypeScript declarations#442
lukeundtrug wants to merge 1 commit intosourcegraph:mainfrom
lukeundtrug:feature/make-useable-as-a-library

Conversation

@lukeundtrug
Copy link
Copy Markdown

@lukeundtrug lukeundtrug commented Apr 1, 2026

This is more just a proposal and concrete details should be discussed. I forked scip-typescript because I wanted to use it in a project of mine as a library. Especially the TS types from scip.ts are very interesting to me and I would like to use them.

The current build doesn't emit declarations which is why I chose tsup to build a full CJS + ESM build which now also exposes the types to consumers.

I would appreciate some feedback if you would consider a direction like this. The package as a library, not just a CLI would definitely make sense.

The changes in this PR are breaking, nevertheless, because the current build doesn't bundle anything. I could also try to make it 100% backwards-compatible though. I still chose to go for breaking changes because I think it's a worthwhile discussion to have, which direction the package should go in the future.

Test plan

Ran local tests to ensure behavior remained unchanged.

Solves issue: #443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant