iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
620 stars 210 forks source link

Update `extract-api` to support custom `entry` paths #7288

Closed GerardasB closed 3 weeks ago

GerardasB commented 3 weeks ago

This PR updates the extract-api script to allow the specification of a relative directory for the entry argument. This might be useful for packages that do not deliver cjs modules or have a different module structure. I.e. extract the API from the lib directory: betools extract-api --entry=./lib/core-frontend.

Current usage is not affected by this change - if the entry argument specifies only a file name w/o a directory name, the ./lib/cjs directory is used. I.e. betools extract-api --entry=core-frontend continues to extract the API from lib/cjs directory.