-
Notifications
You must be signed in to change notification settings - Fork 144
Check for last instance of .js extension in filename #709
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
Conversation
Sweet, looks like this will fix #703 |
c586c54
to
f8846e9
Compare
const clientName = file.substring(0, file.indexOf('.')); | ||
const clientName = file.includes('analytics.js-') ? | ||
file.substring(0, file.lastIndexOf('.js')) : | ||
file.substring(0, file.indexOf('.')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify to this?
const clientName = file.substring(0, file.lastIndexOf('.js'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would affect the way our .dynamic.js.gz
files are obfuscated and uploaded, which would require a change in how we fetch those files in ajs. It's doable, just would require a bit of a larger change to support and would still have some extra logic, just elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah K... I didn't realize that was a case we had to handle.
Maybe we should we add a comment in the code about what the expected filename formats are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done @silesky !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @arielsilvestri -- I suggested a tweak to the comment (doctests like they have in elixir would be great here =))
46adafd
to
4a3cc75
Compare
Co-authored-by: Seth Silesky <[email protected]>
* Check for last instance of .js extension in filename * adding clarifying comments for change * Update scripts/upload-assets.js Co-authored-by: Seth Silesky <[email protected]> Co-authored-by: Seth Silesky <[email protected]>
* updates clevertap sdks path * updates clevertap sdk url * updates clevertap version in history.md and package.json * updates clevertap sdks path * updates clevertap sdk url * updates clevertap version in history.md and package.json * Check for last instance of .js extension in filename (#709) * Check for last instance of .js extension in filename * adding clarifying comments for change * Update scripts/upload-assets.js Co-authored-by: Seth Silesky <[email protected]> Co-authored-by: Seth Silesky <[email protected]> * Add WalkMe SRI (cloned) (#718) * Add WalkMe SRI Fix previous test and add new cases * Fix unit test Co-authored-by: Francisco Garcia <[email protected]> * version bump (#719) * updates tag from http to https * removes use-https library; loads clevertap over https only * modifies segment identify to use onUserLogin instead of profile.push Co-authored-by: Ariel Silvestri <[email protected]> Co-authored-by: Seth Silesky <[email protected]> Co-authored-by: dsjackins <[email protected]> Co-authored-by: Francisco Garcia <[email protected]>
What does this PR do?
.js
in the filename of a given integration, per https://segment.atlassian.net/browse/LIBWEB-1278Testing
To prevent having to change the structure of a number of filenames/potentially breaking existing functionality, I scoped this change to account for a middleware that's prefix'ed with
analytics.js
in its filename.