mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Fix Workflow Validation error when node pack 'unknown' version (#3179)
This commit is contained in:
@@ -155,9 +155,10 @@ const zAuxId = z
|
||||
)
|
||||
.transform(([username, repo]) => `${username}/${repo}`)
|
||||
|
||||
const zSemVer = z
|
||||
.string()
|
||||
.regex(semverPattern, 'Invalid semantic version (x.y.z)')
|
||||
const zSemVer = z.union([
|
||||
z.string().regex(semverPattern, 'Invalid semantic version (x.y.z)'),
|
||||
z.literal('unknown')
|
||||
])
|
||||
const zGitHash = z.string().regex(gitHashPattern, 'Invalid Git commit hash')
|
||||
const zVersion = z.union([zSemVer, zGitHash])
|
||||
|
||||
|
||||
@@ -176,7 +176,9 @@ describe('parseComfyWorkflow', () => {
|
||||
'0.1.0-alpha.1',
|
||||
'1.3.321',
|
||||
// Git hash
|
||||
'080e6d4af809a46852d1c4b7ed85f06e8a3a72be'
|
||||
'080e6d4af809a46852d1c4b7ed85f06e8a3a72be',
|
||||
// Special case
|
||||
'unknown'
|
||||
]
|
||||
it.each(validVersionStrings)('valid version: %s', async (ver) => {
|
||||
const workflow = JSON.parse(JSON.stringify(defaultGraph))
|
||||
|
||||
Reference in New Issue
Block a user