Skip to content

Commit

Permalink
Merge branch 'dev' into rec
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Nov 12, 2024
2 parents 72bbe37 + 29e6aae commit e9cb08f
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions packages/cli-helpers/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,37 @@ export const pluginConfigSchema = z.object({
),
})
),
scripts: z.object({
replaceByProjectName: z
.object({
search: z.string(),
root: z.string().refine(
(value) => {
if (!isPathInCurrentScope(value)) {
return false
}
return true
},
{ message: "The path should be relative and in the current directory" }
),
})
.or(
z.object({
scripts: z
.object({
replaceByProjectName: z
.object({
search: z.string(),
paths: z.array(
z.string().refine((value) => {
root: z.string().refine(
(value) => {
if (!isPathInCurrentScope(value)) {
return false
}
return true
})
},
{ message: "The path should be relative and in the current directory" }
),
})
),
}),
.or(
z.object({
search: z.string(),
paths: z.array(
z.string().refine((value) => {
if (!isPathInCurrentScope(value)) {
return false
}
return true
})
),
})
)
.optional(),
})
.optional(),
})

export type TPluginConfig = z.infer<typeof pluginConfigSchema>

0 comments on commit e9cb08f

Please sign in to comment.