-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
Added codemod support for legacy projects with a /src folder #4290
Conversation
…inside a /src directory
🦋 Changeset detectedLatest commit: d9be9f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…actually calling the function and added path.resolve's to findPagesDirectory
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.
thanks for the PR @Doc0x1! this is a good start.
const appDir = path.resolve("app")
I feel the above line we should make the following change
- const appDir = path.resolve("app")
+ const appDir = fs.existsSync(path.resolve("app")) ? fs.existsSync(path.resolve("src"))
since in this case the user has the files only in src directory and not in the app
blitz/packages/codemod/src/upgrade-legacy.ts
Line 1317 in a09685a
getAllFiles(path.resolve("pages"), [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
we should use the same utility here.
other than these, looks good!
Okay @siddhsuresh sounds good, I'll implement those changes once I'm back home |
…ries located in /src
@siddhsuresh Okay, should be good to go for review. Let me know if there's anything else. Also I decided to throw an Error around line 49 inside a try catch statement in the event that appDir is just an empty string to add a bit of error handling towards the start. |
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.
LGTM!
Added @Doc0x1 contributions for doc and code |
What are the changes and their implications?
Changes the codemod upgrade-legacy tool to add support for legacy projects which have folders nested inside a /src directory
Bug Checklist
pnpm changeset
in the root directory)Feature Checklist
pnpm changeset
in the root directory)