microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.95k stars 601 forks source link

[api-extractor] run api-extractor inside browser #1828

Open csr632 opened 4 years ago

csr632 commented 4 years ago

Is this a feature or a bug?

I am trying to implement an in-browser IDE and want to extract the ts info in browser. Since ts compiler can already run in browser, and the core algorithm of api-extractor don't depend on Node.js, it is hopful to support in-browser usage.

The main obstacle is :

Related issue: https://github.com/microsoft/rushstack/issues/988: this resolved issue already enable us to parse .api.json emmited by api-extractor, in browser. But I also want to run api-extractor inside browser. https://github.com/microsoft/rushstack/issues/1010: discuss about making api-extractor run tsc as a prepare step, emitting '.d.ts' in memory, for api-extractor to consume. Since tsc can already run in browser and emit files into memery, I think if we can make api-extractor resolve/load files from memory(depend on a in-memory filesystem), both these issues would be resolved.

octogonz commented 4 years ago

@csr632 I wrote some comments about this in https://github.com/microsoft/rushstack/issues/1010#issuecomment-614239051