AleksandrRogov / DynamicsWebApi

DynamicsWebApi is a Microsoft Dataverse Web API helper library for JavaScript & TypeScript
MIT License
268 stars 58 forks source link

Remove intermediary compilation folder `lib` #144

Closed AleksandrRogov closed 1 year ago

AleksandrRogov commented 1 year ago

Right now the lib folder is only used by webpack to bundle it for the web browsers. The tests are using typescript files directly through mocha's own compilation process. Therefore, there is no need to keep it in the repo anymore. There are several issues with it though:

And because the compilation process is going to be touched, it is also worth looking at the following:

If anyone has any suggestions, please feel free to comment.

This does not necessarily need to be done for v2 release, but I will mark it as v2 anyways.

AleksandrRogov commented 1 year ago

Unfortunately, the lib folder has to be there for older test files. There is a broader issue with an npm package that is being produced right now. Npm package must include a single compiled file (in this case there will be several one for browser and another for Node.js app) there is no need to have neither lib or src folders in there - only dist. For browser we already use combine all files and produce a UMD module. Need to do the same for Node.js only to produce a CommonJS module. Not sure about ESM modules yet, will decide later.

AleksandrRogov commented 1 year ago

Successfully moved bundling to esbuild. The only problem I could not fix is the nyc reporting. For some reason it was counting some statements as missed even though the lines were hit several times. It could be the issue with the source maps generated by the esbuild, this will need more investigation. For now coverage is being done via the tsc compiler.