-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add tweetify script for generating social media posts #673
Conversation
@@ -66,7 +66,7 @@ import { resolveTokenEncoder } from "../../core/src/encoders" | |||
import { writeFile } from "fs/promises" | |||
|
|||
async function setupTraceWriting(trace: MarkdownTrace, filename: string) { | |||
logVerbose(`writing trace to ${filename}`) | |||
logVerbose(`trace: ${filename}`) |
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.
The log message has been changed from writing trace to ${filename}
to trace: ${filename}
. This change might affect the clarity of the log message. Please ensure that the new log message provides enough context for debugging. 😊
generated by pr-review-commit
log_message_change
@@ -66,7 +66,7 @@ import { resolveTokenEncoder } from "../../core/src/encoders" | |||
import { writeFile } from "fs/promises" | |||
|
|||
async function setupTraceWriting(trace: MarkdownTrace, filename: string) { | |||
logVerbose(`writing trace to ${filename}`) | |||
logVerbose(`trace: ${filename}`) | |||
await ensureDir(dirname(filename)) |
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.
The function ensureDir(dirname(filename))
might throw an error if the directory cannot be created. It's important to handle this error to prevent the application from crashing. Consider wrapping this function call in a try-catch block. 😇
generated by pr-review-commit
missing_error_handling
@@ -66,7 +66,7 @@ import { resolveTokenEncoder } from "../../core/src/encoders" | |||
import { writeFile } from "fs/promises" | |||
|
|||
async function setupTraceWriting(trace: MarkdownTrace, filename: string) { | |||
logVerbose(`writing trace to ${filename}`) | |||
logVerbose(`trace: ${filename}`) | |||
await ensureDir(dirname(filename)) | |||
await writeFile(filename, "", { encoding: "utf-8" }) |
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.
The function writeFile(filename, "", { encoding: "utf-8" })
might throw an error if the file cannot be written. It's important to handle this error to prevent the application from crashing. Consider wrapping this function call in a try-catch block. 😇
generated by pr-review-commit
missing_error_handling
This pull request adds a new script called "tweetify" for generating social media posts. The script generates tweets about documentation pages and includes instructions for generating posts for Twitter and LinkedIn. It also provides information about the documentation structure, routing, type definitions, and samples.