-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
feat: migrate routing forms to routing #18161
base: main
Are you sure you want to change the base?
Conversation
@VK-RED is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (12/13/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (12/13/24)1 label was added to this PR based on Keith Williams's automation. |
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.
We also need test cases for this feature, @VK-RED can you please add ?
Sure will add the test cases 👍 |
Updated the routing
ScreencastScreencast.from.2024-12-14.12-17-32.webm |
|
||
const isTemplate = appMeta.isTemplate; | ||
const appDirname = path.join(isTemplate ? "templates" : "", appFromDb.dirName); | ||
const README_PATH = path.join(process.cwd(), "..", "..", `packages/app-store/${appDirname}/DESCRIPTION.md`); |
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.
Hard-coded paths could cause issues in different environments, also there should be path validation.
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.
Do you have any idea of how can we avoid hard coded Path, I can't think of it ??
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.
we can probably store all path configurations in a centralized config file, and use that file
let source = ""; | ||
|
||
try { | ||
source = fs.readFileSync(postFilePath).toString(); |
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.
this could block the event loop, promise would the better choice to use here.
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.
Changing it
try { | ||
source = fs.readFileSync(postFilePath).toString(); | ||
source = source.replace(/{DESCRIPTION}/g, appMeta.description); | ||
} catch (error) { | ||
/* If the app doesn't have a README we fallback to the package description */ | ||
source = appMeta.description; | ||
} |
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.
it catches all errors, not just file not-found which is bad.
let source = ""; | ||
|
||
try { | ||
source = fs.readFileSync(postFilePath).toString(); |
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.
toString() without encoding specification could cause issues with non UTF8 files
@Praashh The file you have mentioned changes was added Previously when I misunderstood /apps/routing-forms -> /routing . So the apps/web/lib/routing/getStaticProps.ts is no longer needed . |
What does this PR do?
Screencast
Screencast.from.2024-12-13.16-40-23.webm
Mandatory Tasks (DO NOT REMOVE)