Closed AleksandrRogov closed 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.
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.
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:lib
folder is removed. We need to find a way to generate a d.ts file only fordynamics-web-api.ts
. Right now, the declaration is being copied from thelib
folder todist
folder by copyfiles.And because the compilation process is going to be touched, it is also worth looking at the following:
webpack
we use if-def plugin that conditionally includes parts of the code into a result bundle. also, not sure if there is a way to generate both .min.js and .js files is esbuild.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.