dschmidt / ember-cli-deploy-sentry

An ember-cli-deploy-plugin to upload javascript sourcemaps to Sentry
MIT License
42 stars 51 forks source link

Add an option to be able to upload files with relative path #47

Open dguayrobotiq opened 6 years ago

dguayrobotiq commented 6 years ago

Reading through the Sentry doc and their forum, sometimes it's mandatory to upload files with ~ instead of the full path with host and protocol.

So instead of uploading the files like: https://xxx.cloudfront.net/assets/vendor-7d31c95933a91ffe617f81efb6478c75.js

it should be uploaded as: ~/assets/vendor-7d31c95933a91ffe617f81efb6478c75.js

This allow to ignore the the host and protocol. This can be useful in some case for example, when you want to access assets from multiple origins.

dschmidt commented 6 years ago

So what you need is a mechanism/config option to replace part of the paths with something different?

dguayrobotiq commented 6 years ago

Yes. It could be a simple useRelativePath flag option I guess? In that case, you get the files from the distDir and then you replace host and protocol by ~ if the flag is true. By checking the code, that could be done in the _uploadFile function?

dguayrobotiq commented 6 years ago

@dschmidt I found the option --url-prefix in Sentry documentation that could help: https://docs.sentry.io/learn/cli/releases/#upload-source-maps

dschmidt commented 6 years ago

Okay cool, but that seems to be a feature of the cli and not a documentation of the api endpoint we're using. Anyway this shouldn't be too hard to implement. Mind sending a PR?