Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish the source files alongside the already published source maps on npm #2807

Open
johenning opened this issue Aug 26, 2022 · 2 comments
Labels
feature request Requests for new functionality prio: low

Comments

@johenning
Copy link
Contributor

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

@johenning johenning added the feature request Requests for new functionality label Aug 26, 2022
@fwilhe
Copy link
Contributor

fwilhe commented Aug 26, 2022

Hi @johenning, thanks for the suggestion, we'll see what we can do to improve this.

Best,
Florian

@FrankEssenberger
Copy link
Contributor

FrankEssenberger commented Oct 17, 2022

@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:

microsoft/vscode-js-debug#1427

Once this is merged we will adjust also our code to the URL properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new functionality prio: low
Projects
None yet
Development

No branches or pull requests

4 participants