Skip to content

Commit

Permalink
fix: process ref properties after mods are applied
Browse files Browse the repository at this point in the history
  • Loading branch information
meenahoda committed May 13, 2022
1 parent c3bb393 commit 4ebe21a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
7 changes: 7 additions & 0 deletions lib/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const booter = require('./boot')
const refResolver = require('./refs')
const loadMods = require('./mods/load')
const applyMods = require('./mods/apply')
const processRefProperties = require('./load/tymly-loader/process-ref-properties')

const startupMessages = require('./../startup-messages')

Expand Down Expand Up @@ -38,6 +39,12 @@ async function bootTymly (options, messages) {

applyMods(options, loadedMods, loadedComponents)

processRefProperties(
loadedComponents.blueprintComponents,
loadedComponents.blueprintRefProperties,
messages
)

preBootTymlyRefResolution(
loadedComponents,
messages
Expand Down
8 changes: 5 additions & 3 deletions lib/boot/load/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function load (options) {
pluginComponents: plugins.components,
blueprintPaths: blueprints.paths,
blueprintComponents: blueprints.components,
blueprintRefs: blueprints.tymlyRefs
blueprintRefs: blueprints.tymlyRefs,
blueprintRefProperties: blueprints.refProperties
}
} // load

Expand Down Expand Up @@ -49,7 +50,7 @@ function loadBlueprints (plugins, options) {
options.blueprintPaths
)

const { components, tymlyRefs } = tymlyLoader(
const { components, tymlyRefs, refProperties } = tymlyLoader(
{
sourcePaths: paths,
messages: options.messages,
Expand All @@ -66,7 +67,8 @@ function loadBlueprints (plugins, options) {
return {
paths,
components,
tymlyRefs
tymlyRefs,
refProperties
}
} // loadBlueprints

Expand Down
11 changes: 2 additions & 9 deletions lib/boot/load/tymly-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ module.exports = function tymlyLoader (options) {
)
})

if (options.refProperties) {
processRefProperties(
components,
options.refProperties,
options.messages
)
}

return {
components,
tymlyRefs
tymlyRefs,
refProperties: options.refProperties
}
} // tymlyLoader

0 comments on commit 4ebe21a

Please sign in to comment.