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

feat: migrate routing forms to routing #18161

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

VK-RED
Copy link
Contributor

@VK-RED VK-RED commented Dec 13, 2024

What does this PR do?

Screencast

Screencast.from.2024-12-13.16-40-23.webm

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Copy link

vercel bot commented Dec 13, 2024

@VK-RED is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Dec 13, 2024
@graphite-app graphite-app bot requested a review from a team December 13, 2024 11:20
@github-actions github-actions bot added Medium priority Created by Linear-GitHub Sync routing-forms area: routing forms, routing, forms ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work labels Dec 13, 2024
Copy link
Contributor

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:

No release type found in pull request title "Feat/migrate routing forms to routing". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@dosubot dosubot bot added the ✨ feature New feature or request label Dec 13, 2024
@VK-RED VK-RED changed the title Feat/migrate routing forms to routing feat: migrate routing forms to routing Dec 13, 2024
@VK-RED
Copy link
Contributor Author

VK-RED commented Dec 13, 2024

image

Also do we need to update this from Routing Forms to Routing ??

Copy link

graphite-app bot commented Dec 13, 2024

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.

Copy link
Contributor

@Praashh Praashh left a 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 ?

@Praashh
Copy link
Contributor

Praashh commented Dec 13, 2024

image

Also do we need to update this from Routing Forms to Routing ??

no we don't need to update it.

@Praashh Praashh self-assigned this Dec 13, 2024
@VK-RED
Copy link
Contributor Author

VK-RED commented Dec 13, 2024

Sure will add the test cases 👍

@VK-RED
Copy link
Contributor Author

VK-RED commented Dec 14, 2024

Updated the routing

  • /apps/routing-forms/forms -> /routing
  • /apps/routing-forms/:slug -> /routing/:slug

Screencast

Screencast.from.2024-12-14.12-17-32.webm

@VK-RED VK-RED requested a review from Praashh December 18, 2024 02:35

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`);
Copy link
Contributor

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.

Copy link
Contributor Author

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 ??

Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing it

Comment on lines 61 to 67
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;
}
Copy link
Contributor

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();
Copy link
Contributor

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

@VK-RED
Copy link
Contributor Author

VK-RED commented Dec 19, 2024

@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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Created by Linear-GitHub Sync ✨ feature New feature or request Medium priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work routing-forms area: routing forms, routing, forms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-4828] migrate /apps/routing-forms/forms to /routing
2 participants