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KAAS,KAAK,gBAAgB,GAAG,SAAmB,KAAS,IACtG,KAAK,QACR,cACA,iBACA,IAIa,KAAK,KAAK,CAAC,oBAAqB,CAAE,IAAK,KAAK,aAAa,cACjE,SAAS,IAChB,KAAK,GAAG,QAAQ,KAAK,aAAa,YAAY,KAAY,KAAK,gBAAgB,GAAG,SAAmB,iBAA8B,IAC9H,KAAK,QACR,cACA,iBACA,GAEN,CAEA,GAAA,GACE,KAAK,IAAI,IACT,KAAK,IAAI,MAAM,MAAM,KAAK,MAAM,2BAChC,KAAK,IAAI,GACX","file":"/npm/@lendi/generator-create-lui-component@2.0.0/generators/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@lendi/generator-create-lui-component@2.0.0/generators/app/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\nconst path = require('path');\nconst Generator = require('yeoman-generator');\nconst yosay = require('yosay');\nconst chalk = require('chalk');\nconst glob = require('fast-glob');\nconst to = require('to-case');\n\nmodule.exports = class extends Generator {\n  initializing() {\n    this.log(yosay(`Welcome to the ${chalk.green('create-lui-component generator')}!`));\n    this.destinationRoot('./packages' || `${process.cwd()}/packages`);\n  }\n\n  async prompting() {\n    this.answers = await this.prompt([\n      {\n        name: 'packageName',\n        type: 'input',\n        message: 'Package name: (e.g. text-input)',\n        store: true,\n      },\n    ]);\n  }\n\n  checking() {\n    if (!this.answers.packageName) {\n      this.env.error('Please provide a package name.');\n    }\n  }\n\n  writing() {\n    this.log('');\n    this.log(`🗃 ${chalk.bold.white('Generating files...')}`);\n    this.log('');\n\n    const PackageName = to.slug(this.answers.packageName || '');\n    const ComponentName = to.pascal(PackageName || '');\n    const date = new Date();\n    const year = date.getFullYear();\n    const month = date.getMonth();\n    const day = date.getDate();\n    \n    // templates\n    const templates = glob.sync([ '**/*.*', '**/**.*'], { cwd: this.templatePath('../templates') });\n    templates.forEach((template) => {\n      // check if it's equal to pacakge.txt\n      if (path.basename(template) === 'package.txt') {\n        this.fs.copyTpl(this.templatePath(`../templates/${template}`), this.destinationPath(`${PackageName}/package.json`), {\n          ...this.answers,\n          PackageName,\n          ComponentName,\n        })\n      } else {\n        this.fs.copyTpl(this.templatePath(`../templates/${template}`), this.destinationPath(`${PackageName}/${template}`), {\n          ...this.answers,\n          PackageName,\n          ComponentName,\n          Date : `${year}-${month+1}-${day}`\n        });\n      }\n    });\n\n    // files\n    const files = glob.sync([ '**/*.*', '!**/*.example.tsx'], { cwd: this.templatePath('../files') });\n    files.forEach((file) => {\n      this.fs.copyTpl(this.templatePath(`../files/${file}`), this.destinationPath(`${PackageName}/src/${file}`), {\n        ...this.answers,\n        PackageName,\n        ComponentName\n      });\n    });\n\n    // examples\n    const examples = glob.sync(['**/*.example.tsx'], { cwd: this.templatePath('../files') });\n    examples.forEach((example) => {\n      this.fs.copyTpl(this.templatePath(`../files/${example}`), this.destinationPath(`${PackageName}/src/${ComponentName}.example.tsx`), {\n        ...this.answers,\n        PackageName,\n        ComponentName\n      });\n    });\n  }\n\n  end() {\n    this.log('');\n    this.log(`🏁 ${chalk.bold.white('Finished generating!')}`);\n    this.log('');\n  }\n};\n"]}