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C,KAAM,OACN,KAAM,cACN,QAAS,uBACT,SAAU,KAAe,yDAAyD,KAAK,IAAsB,sDAE9G,CACC,KAAM,OACN,KAAM,OACN,QAAS,4HACT,SAAU,CACT,MAAO,gBACP,MAAO,QAKJ,QAAgB,OAAO,EAAW,CAAE,oBAEtC,EAAQ,OAAQ,EAAQ,KAAM,EAAQ,cACzC,QAAQ,IAAI,mBAA6B,wBACzC,SAAS,QAAQ,EAAQ,QAAS,EAAQ,KAAM,EAAQ,aAIzD,EAvCD","file":"/npm/express-boilerplate-generator@1.1.0/lib/cli.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/express-boilerplate-generator@1.1.0/lib/cli.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\nconst path = require('path');\nconst expressGenTs = require('./express-generator');\nconst { prompt } = require('prompts');\nconst { say } = require('cfonts');\n\nconst options = [\n\t{\n\t\tdescription: 'Express Server Boilerplate without Auth',\n\t\tdefaultName: 'express-server-boilerplate',\n\t\ttemplateName: 'express-server-boilerplate',\n\t\tdependencies: 'cookie-parser dotenv express express-async-errors helmet mongoose morgan snyk swagger-ui-express',\n\t\tdevDependencies: '@types/express @types/cookie-parser @types/find @types/helmet @types/jsonfile @types/mongoose @types/morgan @types/node @types/swagger-ui-express @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint find fs-extra git-cz jsonfile nodemon ts-node tsconfig-paths typedoc typescript'\n\t}, {\n\t\tdescription: 'Express Server Boilerplate with Auth',\n\t\tdefaultName: 'express-server-boilerplate-auth',\n\t\ttemplateName: 'express-server-boilerplate-auth',\n\t\tdependencies: 'bcryptjs cookie-parser dotenv express express-async-errors helmet mongoose morgan passport passport-jwt passport-local',\n\t\tdevDependencies: '@types/express @types/cookie-parser @types/passport @types/bcryptjs @types/find @types/helmet @types/jsonfile @types/mongoose @types/morgan @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint find fs-extra git-cz jsonfile nodemon ts-node tsconfig-paths typescript @types/passport-jwt'\n\t}\n];\n\n\nconst getDest = (option, destFolder, projectName) => {\n\treturn `${path.join(process.cwd(), destFolder)}/${projectName || option.defaultName}`;\n};\n\n\nconst initiate = async (option, path, projectName) => {\n\ttry {\n\t\tconst destination = getDest(option, path, projectName);\n\t\tawait expressGenTs(option, destination);\n\t\tconsole.log('\\x1b[32m\\x1b[40m%s\\x1b[0m', `Project setup complete! at ${destination}`);\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n};\n\n\nsay('express server generator', {\n\tfont: 'chrome',\n\talign: 'center',\n\tcolors: ['system'],\n\tbackground: 'transparent',\n\tletterSpacing: 1,\n\tlineHeight: 1,\n\tspace: true,\n});\n\n\nsay('opendevs', {\n\tfont: 'chrome',\n\talign: 'right',\n\tcolors: ['system'],\n\tbackground: 'transparent',\n\tletterSpacing: 1,\n\tlineHeight: 1,\n\tspace: true,\n\tgradient: ['#fff', '#89d8d3'],\n});\n\n\nconsole.log('\\x1b[33m\\x1b[40m%s\\x1b[0m', 'Setting up new Express Server Boilerplate project...\\n');\n\n\nconst onCancel = () => {\n\tconsole.log('\\x1b[31m%s\\x1b[0m', 'Project creation failed!');\n};\n\n\n(async () => {\n\tconst questions = [\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'option',\n\t\t\tmessage: 'Select a option for the type of project',\n\t\t\tvalidate: value => value >= 1 && value <=2 ? true : 'Specify number in the range of 1 - 2',\n\t\t\tsuggest: (input, choices) => choices.filter(i => i.value),\n\t\t\tchoices: options.map((el, index) => ({ value: index, title: el.templateName, description: el.description })),\n\t\t\tfallback: {\n\t\t\t\ttitle: 'Using default',\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tname: 'projectName',\n\t\t\tmessage: 'Specify project name',\n\t\t\tvalidate: projectName => /^(@[a-z0-9-~][a-z0-9-._~]*\\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName) ? true : 'Invalid project name, please follow npm guidelines'\n\t\t},\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tname: 'path',\n\t\t\tmessage: '[OPTIONAL] Specify directory where you want to create the project, if no path is provided current directory will be used.',\n\t\t\tfallback: {\n\t\t\t\ttitle: 'Using default',\n\t\t\t\tvalue: './'\n\t\t\t}\n\t\t}\n\t];\n\n\tconst answers = await prompt(questions, { onCancel });\n\n\tif (answers.option, answers.path, answers.projectName) {\n\t\tconsole.log('\\x1b[33m\\x1b[40m%s\\x1b[0m', 'Let\\'s get started...');\n\t\tinitiate(options[answers.option], answers.path, answers.projectName);\n\t}\n\n\n})();\n"]}