writeProjectConfigFile () { var configJson = { 'projectName': this.options.projectName, 'qtyScreens': this.options.qtyScreens, 'markupLanguage': this.options.markupLanguage, 'frontEndFramework': this.options.frontEndFramework, 'jQuery': this.options.jQuery || this.options.frontEndFramework, 'generatedBy': 'Pixel2HTML', 'generatorVersion': pkg.version, 'generatedAt': new Date(), } this.fs.writeJSON('./.project.conf', configJson) }
copyHeadFiles () { this.fs.copy( this.templatePath('assets/head/favico.ico'), this.destinationPath(this.paths.src.head + '/favico.ico') ) this.fs.copy( this.templatePath('assets/head/favicon.png'), this.destinationPath(this.paths.src.head + '/favicon.png') ) this.fs.copyTpl( this.templatePath('assets/head/manifest.json.ejs'), this.destinationPath(this.paths.src.head + '/manifest.json'), { projectName: this.options.projectName } ) }
writeHtmlFiles () { if (this.options.markupLanguage === 'html') { for (var i = 1; i < this.options.qtyScreens + 1; i++) { const filePath = i === 1 ? '/index.html' : '/screen-' + i + '.' + this.options.markupLanguage this.fs.copyTpl( this.templatePath('markup/_screen.' + this.options.markupLanguage + '.ejs'), this.destinationPath(this.paths.src.markup + filePath), { screenNumber: i, projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework, jQuery: this.options.jQuery } ) } } }
writeBaseScriptsFiles () { this.log(chalk.yellow('Copying js main file.')) this.fs.copyTpl( this.templatePath('scripts/app.js'), this.destinationPath(this.paths.src.scripts + '/app.js'), { projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework } ) this.fs.copyTpl( this.templatePath('scripts/index.js.ejs'), this.destinationPath(this.paths.src.scripts + '/index.js'), { projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework, jQuery: this.options.jQuery } ) if (this.options.frontEndFramework) { this.fs.copyTpl( this.templatePath('scripts/framework.js.ejs'), this.destinationPath(this.paths.src.scripts + '/framework.js'), { projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework, jQuery: this.options.jQuery } ) } }
this.destinationPath(this.paths.src.styles + '/main/screens/_screen_' + i + '.scss'), { screenNumber: i, projectName: this.options.projectName this.destinationPath(`src/assets/${file}`), { screenNumber: i, projectName: this.options.projectName, qtyScreens: this.options.qtyScreens, frontEndFramework: this.options.frontEndFramework
const validPath = this.wordupProjectPathValid(this.options.projectName) if (validPath !== true) { console.log(validPath) projectName: this.options.projectName, projectType: this.options.projectType, scaffold: true, message: "What's the name of your new project", validate: (val) => this.wordupProjectPathValid(val), default: this.options.projectName || undefined, filter: function(val) { return val.trim() this.answers.wpInstall = await installPrompts.askNew(this.answers.projectName)
this.destinationPath(file), { paths: this.paths, projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework, jQuery: this.options.jQuery,
projectName: this.options.projectName, clientId: this.options.clientId, projectId: this.options.projectId, projectName: this.options.projectName, frontEndFramework: this.options.frontEndFramework, jQuery: this.options.jQuery