Skip to content

refactor: update eventsource dependency and clean up code #782

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

rossiam
Copy link
Collaborator

@rossiam rossiam commented Jul 2, 2025

What was done

  • updated eventsource to latest version
  • simplified code some by pushing more directly into the main command class
  • moved handleSignals function to general util module since it's not sse-specific even though that's all we're using it for now

Notes

  • With the older version of eventsource, we didn't have code to make the actual requests for the data like we do now in the fetch function passed to new EventSource. Rather, we just specified extra headers and presumably, it was just using fetch under the hood. I wanted to use axios here since that's what we use everywhere else but I was unable to get axios to work so for now, I'm sticking with fetch (from undici) as show in the eventsource README.
  • I expect it will be likely I will want to refactor this more before releasing the yargs branch. I'm trying to work out how to do a release now that we can't use pkg because we're using ES modules. I've found I can use Deno to build a binary which works for other commands but not this one for some reason.

References

@rossiam rossiam requested a review from a team July 2, 2025 16:48
Copy link

changeset-bot bot commented Jul 2, 2025

⚠️ No Changeset found

Latest commit: 655f572

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rossiam rossiam merged commit a2480d4 into SmartThingsCommunity:yargs Jul 9, 2025
4 checks passed
@rossiam rossiam deleted the update-eventsource branch July 9, 2025 14:49
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.

2 participants