forked from refinedev/refine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unique check on create-resource with refine-cli (refinedev#3063)
* feat: add unique check * chore: changeset * fix: remove unuse lib * refactor: move getResourcePath method to utils folder
- Loading branch information
1 parent
27df262
commit 949b8bd
Showing
3 changed files
with
46 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@pankod/refine-cli": patch | ||
--- | ||
|
||
Added unique check on `create-resource` with `refine-cli`. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ProjectTypes } from "@definitions/projectTypes"; | ||
|
||
export const getResourcePath = ( | ||
projectType: ProjectTypes, | ||
): { path: string; alias: string } => { | ||
switch (projectType) { | ||
case ProjectTypes.NEXTJS: | ||
return { | ||
path: "src/components", | ||
alias: "../src/components", | ||
}; | ||
case ProjectTypes.REMIX: | ||
return { | ||
path: "app/components", | ||
alias: "~/components", | ||
}; | ||
} | ||
|
||
// vite and react | ||
return { | ||
path: "src/pages", | ||
alias: "pages", | ||
}; | ||
}; |