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

Change how version string is loaded from package.json #21

Merged
merged 5 commits into from
Feb 2, 2024

Conversation

mbish
Copy link
Contributor

@mbish mbish commented Jan 22, 2024

Load package.json using require rather than a file read operation

Description

Issue #5 identified that the way this library loads its version data from package.json will
lead to either the wrong version string being put into the user-agent string or a node error
depending on which package.json file is read.

This PR remidies this issue by using require rather than a raw file read, meaning that paths
will be interpreted relative to the source file rather than from the node project root.

Motivation and Context

Issue #5, not breaking people using webpack and generally wanting to have accurate vesrion data in the user-agent string.

How Has This Been Tested?

I've tested this in a web-packed app but I also never got the error indicated in issue #5 so I'm
curious if this fixes the problems identified there.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)

@rfossella
Copy link

@mbish - This seems to have worked for me.

@rfossella
Copy link

Hi @mbish . Do you need anything else from me? Any further testing? Be happy to help.

@mbish
Copy link
Contributor Author

mbish commented Jan 29, 2024

Thanks very much for being willing to test this. Have you tested the update to 2eb74d9? If that works for you then I think we can move forward with this change.

@rfossella
Copy link

Hi - I will take the latest copy and test this today. Thank you,

@AaronAtDuo
Copy link
Contributor

I'll merge this and if @rfossella runs into problems we can do a second PR.

@AaronAtDuo AaronAtDuo merged commit f6bd8be into main Feb 2, 2024
2 checks passed
@AaronAtDuo AaronAtDuo deleted the version-string-change branch February 2, 2024 15:45
@rfossella
Copy link

Hi. So I did a clean uninstall of @duosecurity/duo_universal and then did fresh install v2.0.2. I am now running into the same problem where the package.json file cannot be read in constants.js.

I verified this on two separate boxes after fresh install of 2.0.2 The examples package still works as it always did.

Did nothing out of the ordinary, AFAIK, just added it to my package.json and npm install. Also as a stand-alone install command of package. Am I missing any step(s)?

@rfossella
Copy link

Good news. The latest fix from package-json-fix2 seems to have worked for me. Can we complete a new npm version?

@rfossella
Copy link

Hi - any more updates w/this? DUO deadline is March 31, 2024?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants