Skip to content

Commit

Permalink
Added console logs to project fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
funwithtriangles committed Feb 28, 2020
1 parent 8fa6347 commit 7504ef2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions projectFixScripts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-console" : 0
}
}
19 changes: 16 additions & 3 deletions projectFixScripts/0.5-0.6.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fix(data => {
const node = data.nodes[key]

if (!node.optionIds) {
// option Ids now share the same array property
// option IDs now share the same array property
console.log(`${node.id}: Converting option IDs into one array`)
node.optionIds = []
parseOldOptions('lfoOptionIds', node)
parseOldOptions('midiOptionIds', node)
Expand All @@ -23,24 +24,32 @@ fix(data => {

// We now have valueType, default is "float"
const becomeFloat = ['param', 'macro', 'macroTargetParamLink']
if (!node.valueType && becomeFloat.includes(node.type)) node.valueType = 'float'
if (!node.valueType && becomeFloat.includes(node.type)) {
console.log(`${node.id}: ${node.type} set to "float" valueType by default`)
node.valueType = 'float'
}

// Shots become shotFloat
if (node.type === 'shot') {
console.log(`${node.id}: added "shotFloat" valueType for shot`)
node.valueType = 'shotFloat'
}

// Selects become enums
if (node.type === 'select') {
delete node.type
node.valueType = 'enum'
console.log(`${node.id}: "select" type becomes "enum" valueType`)
}

// Convert macro param link start values from "false" to "null"
if (node.type === 'macro' && node.targetParamLinks) {
for (let key in node.targetParamLinks) {
const obj = node.targetParamLinks[key]
if (obj.startValue === false) obj.startValue = null
if (obj.startValue === false) {
console.log(`${node.id}: false macro start value becomes null`)
obj.startValue = null
}
}
}

Expand All @@ -52,6 +61,7 @@ fix(data => {
node.action.payload && node.action.payload.type &&
!node.action.payload.channel
) {
console.log(`${node.id}: linkableAction U_SCENE_SELECT_CHANNEL payload.type becomes payload.channel`)
const p = node.action.payload
const channel = p.type
delete p.type
Expand All @@ -61,6 +71,7 @@ fix(data => {

// Check if new core nodes are missing
if (data.nodes.areErrorPopupsDisabled === undefined) {
console.log(`adding missing areErrorPopupsDisabled core node`)
data.nodes.areErrorPopupsDisabled = {
title: 'Disable Error Popups',
id: 'areErrorPopupsDisabled',
Expand All @@ -69,6 +80,8 @@ fix(data => {
}
}

console.log(`Checked ${Object.keys(data.nodes).length} nodes`)

return data
})

0 comments on commit 7504ef2

Please sign in to comment.