MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / buildPlugin

Function buildPlugin

dashboard/build.shared.mjs:216–241  ·  view source on GitHub ↗
(
  dir,
  bannerLabel,
  { tailwind = false, primitives = false } = {},
)

Source from the content-addressed store, hash-verified

214}
215
216export async function buildPlugin(
217 dir,
218 bannerLabel,
219 { tailwind = false, primitives = false } = {},
220) {
221 await runRsbuildConfig(createPluginBuildConfig(dir));
222 if (bannerLabel) {
223 const distJs = path.join(dashboardRoot, dir, "dist/index.js");
224 const js = await fs.readFile(distJs, "utf8");
225 await fs.writeFile(distJs, `${pluginBannerComment(bannerLabel)}\n${js}`, "utf8");
226 }
227 const distCss = path.join(dashboardRoot, dir, "dist/style.css");
228 await fs.mkdir(path.dirname(distCss), { recursive: true });
229 if (tailwind) {
230 await compileTailwindCss(path.join(dashboardRoot, dir, "src"), distCss);
231 } else {
232 await fs.copyFile(path.join(dashboardRoot, dir, "src/styles.css"), distCss);
233 }
234 if (primitives) {
235 const [prim, plugin] = await Promise.all([
236 fs.readFile(path.join(dashboardRoot, "lib/primitives.css"), "utf8"),
237 fs.readFile(distCss, "utf8"),
238 ]);
239 await fs.writeFile(distCss, `${prim}\n${plugin}`, "utf8");
240 }
241}
242
243export async function buildHolographicPlugin() {
244 await buildPlugin("holographic", "holographic-memory", {

Callers 2

mainFunction · 0.90
buildHolographicPluginFunction · 0.85

Calls 4

runRsbuildConfigFunction · 0.85
createPluginBuildConfigFunction · 0.85
pluginBannerCommentFunction · 0.85
compileTailwindCssFunction · 0.85

Tested by

no test coverage detected