add output warning, improve input check warning

This commit is contained in:
Loren Norman 2025-07-23 15:32:33 -04:00
parent bd002ba253
commit 42bca1b579

View file

@ -154,12 +154,16 @@ BlockDefinition.parseRawDefinition = function(rawBlockDefinition, definitionPath
if(!blockDef.name) { if(!blockDef.name) {
// if no name given, humanize the type property as a default // if no name given, humanize the type property as a default
blockDef.name = rawBlockDefinition.type.split(/[\W_]+/).map(capitalize).join(" ").replace(/^io /i, "") blockDef.name = rawBlockDefinition.type.split(/[\W_]+/).map(capitalize).join(" ").replace(/^io /i, "")
console.warn(`Warning: [${rawBlockDefinition.type}] No "name" property provided, defaulted to: "${blockDef.name}"`) console.warn(`Warning: [${blockDef.type}] No "name" property provided, defaulted to: "${blockDef.name}"`)
}
if(!blockDef.connections) {
console.warn(`Warning: [${blockDef.type}] No "connections" property provided, no defaults.`)
} }
forEach(blockDef.inputs, (input, inputName) => { forEach(blockDef.inputs, (input, inputName) => {
if(!input.check) { if(!input.check && input.type !== 'label') {
console.warn(`Warning: [${blockDef.type}] Input is unchecked: ${inputName}`) console.warn(`Warning: [${blockDef.type}] Input is unchecked: ${inputName} ${input.type}`)
} }
}) })