fix: example building + add CI step to catch failure of any example code#581
Merged
Conversation
Updates docs to use tsx. It isn't worth the hassle to individually build examples.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Explicitly return a status code of 1 if an error is caught.
TarikGul
approved these changes
Jun 5, 2025
TarikGul
left a comment
Member
There was a problem hiding this comment.
Overall looks good.
I noticed some of the examples are doing:
void (async () => {
try {
await main();
} catch (err) {
console.error(err);
process.exit(1);
} finally {
process.exit();
}
})();And others are the same as before, is there a reason for that?
Contributor
Author
@TarikGul Good catch. I will fix. Looks like my find/replace wasn't recursive. edit: and that led to detecting more failing examples |
50715f1 to
0960b28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
tsxto run the examplestsxas a dev dep{ throwOnConnect: true })Build issues were introduced here: #561
Here is an example of a CI Job failing because of examples failing.
Motivation
I noticed that some examples were not working and that the build script no longer worked. Adding a CI step will help maintain the examples, which in turns help new users get familiar with the codebase and how to use it.
Failing examples
Prior to this MR the many examples were failing. They have been added as exception in
run_example.shunder the reason for their failing.It also seem like for moonriver we get
which may correspond with what was going on here: #572
New issue - to be fixed later
I created an issue so we can address these failing examples later: #582