MCPcopy Create free account
hub / github.com/dailydotdev/apps / builderSource

Function builderSource

packages/world-cli/bin/world.js:124–139  ·  view source on GitHub ↗
(realm, family)

Source from the content-addressed store, hash-verified

122}
123
124async function builderSource(realm, family) {
125 /* Filled in with the REALM's own material names. A starting file that says
126 `stone` is a starting file that fails to validate in the forges, and the
127 first thing anyone sees should not be an error about a colour they did not
128 choose. */
129 const roles = rolesOf(realm);
130 return (
131 await readFile(join(HERE, "..", "templates", "object.js"), "utf8")
132 )
133 .replace(/__WALL__/g, roles.wall)
134 .replace(/__ROOF__/g, roles.roof)
135 .replace(/__TRIM__/g, roles.trim)
136 .replace(/__REALM__/g, realm)
137 .replace(/__FAMILY__/g, family)
138 .replace(/__NAME__/g, FAMILIES[family].name);
139}
140
141async function resolveRealmTarget(handle, { realm, district, family }) {
142 const resolved = await resolveTarget(handle, {

Callers 2

scaffoldRealmFunction · 0.85
scaffoldOverrideFunction · 0.85

Calls 2

rolesOfFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected