cloud-sdk-js
cloud-sdk-js copied to clipboard
Publish the source files alongside the already published source maps on npm
Is your feature request related to a problem? Please describe. When reading Cloud SDK code in the installed module folder or when stepping through it while debugging, the code is not as readable as it could be, because only the compiled JavaScript files are available, not the original TypeScript files.
Cloud SDK packages published on npm only contain the dist
folder, which in turn contains .js
(results of TS compilation), .d.ts
(type definition files) and .d.ts.map
(source maps). They do not contain the original source code, though they are referenced in the source maps, e.g.:
@sap-cloud-sdk/connectivity/dist/scp-cf/destination/destination-from-service.d.ts.map
{"version":3,"file":"destination-from-service.d.ts","sourceRoot":"","sources":["../../../src/scp-cf/destination/destination-from-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAM1D,OAAO,EACL,uBAAuB,EAExB,MAAM,8BAA8B,CAAC;AAmFtC;;;;;;;GAOG;AACH,wBAAsB,oCAAoC,CACxD,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAK7B"}
I believe the only thing missing here is the src
folder. If I copy the src
from Github into my local installation everything works as expected.
Describe the solution you'd like
Publish the src
folder for all packages (.spec.ts
files are unnecessary though).
Alternatively, use inlineSources
instead of sourceMap
in https://github.com/SAP/cloud-sdk-js/blob/main/tsconfig.json.
Impact / Priority Low, just a quality of life improvement.
Affected development phase: all
Impact: Inconvenience
Timeline: Not time sensitive
Hi @johenning, thanks for the suggestion, we'll see what we can do to improve this.
Best, Florian
@johenning there has been some movement to the ticket. Just to update we wanted to provide the sourcemaps via a URL so that they are only downloaded if needed. This was not supported by VSC code yet but a PR is on the way:
https://github.com/microsoft/vscode-js-debug/pull/1427
Once this is merged we will adjust also our code to the URL properly.
Due to the current priority, we won't work on it.