leds-spark-lib
Version:
Biblioteca de geração de código
84 lines (82 loc) • 3.1 kB
JavaScript
/**
* Assets Generator Module
*
* This module generates static assets used throughout the application,
* including images, styles, and other static resources. It creates the
* necessary files in the assets directory for use in the Vue application.
*
* Generated Assets:
* - logo.png: Application logo in PNG format
* - logo.svg: Vector version of the logo
* - style.css: Global stylesheet with Tailwind integration
*/
import fs from "fs";
import { expandToString } from "../../../../util/template-string.js";
import path from "path";
/**
* Main assets generator function
*
* Creates all static assets needed by the application.
*
* @param project_abstraction - Project metadata (not directly used in assets)
* @param target_folder - Directory where assets will be generated
*
* Assets Structure:
* assets/
* ├── logo.png - Bitmap logo for general use
* ├── logo.svg - Vector logo for scalable display
* └── style.css - Global styles with Tailwind
*/
export function generate(project_abstraction, target_folder) {
fs.writeFileSync(path.join(target_folder, 'logo.png'), generatePng(project_abstraction, target_folder));
fs.writeFileSync(path.join(target_folder, 'logo.svg'), generateSvg(project_abstraction, target_folder));
fs.writeFileSync(path.join(target_folder, 'style.css'), generateStyle(project_abstraction, target_folder));
}
/**
* Generates PNG logo content
*
* Creates the PNG logo for the application based on project metadata.
* Currently returns an empty template - implementers should add their
* own logo generation logic here.
*
* @param project_abstraction - Project metadata for customizing the logo
* @param target_folder - Directory where the logo will be saved
* @returns {string} Content for the PNG logo file
*/
function generatePng(project_abstraction, target_folder) {
return expandToString `
`;
}
/**
* Generates SVG logo content
*
* Creates the SVG vector logo for the application. The SVG format
* provides a scalable version of the logo suitable for various display sizes.
* Currently returns an empty template - implementers should add their
* own SVG logo definition here.
*
* @param project_abstraction - Project metadata for customizing the logo
* @param target_folder - Directory where the logo will be saved
* @returns {string} Content for the SVG logo file
*/
function generateSvg(project_abstraction, target_folder) {
return expandToString `
`;
}
/**
* Generates global stylesheet content
*
* Creates the main stylesheet for the application, incorporating
* Tailwind CSS for utility-first styling. This serves as the base
* stylesheet where global styles and Tailwind imports are defined.
*
* @param project_abstraction - Project metadata for potential style customization
* @param target_folder - Directory where the stylesheet will be saved
* @returns {string} Content for the global stylesheet
*/
function generateStyle(project_abstraction, target_folder) {
return expandToString `
@import "tailwindcss";
`;
}
//# sourceMappingURL=generate.js.map