{"version":3,"sources":["jsdelivr-header.js","/npm/generator-modx-package@0.0.0/app/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,IAII,UAJA,KAAO,QAAQ,QACf,KAAO,QAAQ,QACf,OAAS,QAAQ,oBACjB,GAAK,QAAQ,qBAGb,qBAAuB,OAAO,QAAU,SAA8B,EAAM,EAAS,GACvF,OAAO,WAAW,KAAK,MAAM,KAAM,WAenC,KAAK,IAAM,KAAK,MAAM,KAAK,iBAAiB,KAAK,KAAK,UAAW,qBACjE,UAAY,KAAK,kBAAkB,MAAM,KAAK,KAC9C,QAAQ,IAAI,KAAK,kBACnB,EAEA,KAAK,SAAS,qBAAsB,OAAO,WAAW,MAEtD,qBAAqB,UAAU,OAAS,WACtC,IAAI,EAAK,KAAK,QAGd,QAAQ,IAAI,KAAK,QAEjB,IAAI,EAAU,CAAC,CAChB,KAAO,OACP,QAAU,2CACV,QAAU,SAAS,GACd,OAAO,UAAU,UAAU,OAAO,EACvC,GAEC,CACE,KAAO,cACV,QAAU,6CACP,QAAU,mCAEZ,CACE,KAAO,YACV,QAAU,8CACP,QAAU,SAEZ,CACE,KAAO,aACP,KAAK,OACR,QAAU,0CACV,QAAS,CAAC,QAAQ,OAAO,KAAK,YAC3B,QAAU,MAEZ,CACE,KAAO,WACP,KAAO,cACP,QAAU,4EACV,QAAU,CAAC,CACT,KAAO,YACP,SAAU,GAEf,CACK,KAAO,SACP,SAAU,GAEf,CACK,KAAO,WACP,SAAU,GAEf,CACK,KAAO,UACP,SAAU,GAEf,CACK,KAAO,gBACP,SAAU,KAGd,CACD,KAAK,UACF,KAAO,YACV,QAAU,kDACP,SAAU,GAEZ,CACD,KAAK,UACF,KAAO,eACV,QAAU,8FACP,SAAU,GAEZ,CACE,KAAO,WACV,QAAU,+CACV,KAAO,SAAS,GACX,OAAO,EAAM,YACf,EACA,SAAW,SAAS,GACrB,OAAO,CACN,GAEF,CACE,KAAO,UACV,QAAU,8CACV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CAAsC,uCAEnD,KAAK,aACN,KAAK,MAAM,mBAAqB,KAAK,KAAO,qBAC5C,KAAK,SAAS,qCAAqC,sCAElD,KAAK,aACN,KAAK,SAAS,sCAAsC,sCAEtD,KAAK,MAAM,mBAAqB,KAAK,KAAO,YAC5C,KAAK,MAAM,mBAAqB,KAAK,KAAO,eAE5C,KAAK,SAAS,kCAAkC,mBAAqB,KAAK,KAAO,oBACjF,KAAK,SAAS,qCAAqC,mBAAqB,KAAK,KAAO,uBACpF,KAAK,SAAS,mCAAmC,mBAAqB,KAAK,KAAO,qBAC/E,KAAK,cAAc,KAAK,SAAS,2BAA2B,2BAC/D,KAAK,SAAS,8BAA8B,8BAC5C,KAAK,SAAS,kCAAkC,iCAElD,EAEA,qBAAqB,UAAU,aAAe,WAG9C","file":"/npm/generator-modx-package@0.0.0/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-modx-package@0.0.0/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';\nvar util = require('util');\nvar path = require('path');\nvar yeoman = require('yeoman-generator');\nvar _s = require('underscore.string');\nvar pathNames;\n\nvar MODXPackageGenerator = module.exports = function MODXPackageGenerator(args, options, config) {\n  yeoman.generators.Base.apply(this, arguments);\n\n  /*this.on('end', function () {\n    this.installDependencies({\n\t  skipInstall: options['skip-install'],\n\t  callback: function() {\n\t\tthis.emit('dependenciesInstalled');\n\t  }.bind(this)\n    });\n  });*/\n\n  /*this.on('dependenciesInstalled', function() {\n      this.spawnCommand('grunt', ['build']);\n  });*/\n\n  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));\n  pathNames = this.destinationRoot().split(path.sep);\n  console.log(this.destinationRoot());\n};\n\nutil.inherits(MODXPackageGenerator, yeoman.generators.Base);\n\nMODXPackageGenerator.prototype.askFor = function askFor() {\n  var cb = this.async();\n\n  // have Yeoman greet the user.\n  console.log(this.yeoman);\n\n  var prompts = [{\n\tname : 'name',\n\tmessage : 'What would you like to name your Add-on?',\n\tdefault : function(props) {\n      return pathNames[pathNames.length-1];\n\t}\n  },\n  {\n    name : 'description',\n\tmessage : 'How would you describe this manager theme?',\n    default : 'The best MODX Add-on ever made!'\n  },\n  {\n    name : 'versionNo',\n\tmessage : 'What is the version number of your package?',\n    default : '0.0.0'\n  },\n  {\n    name : 'pkgRelease',\n    type:'list',\n\tmessage : 'Choose a release type for your package.',\n\tchoices: ['alpha','beta','pl','Other...'],\n    default : 'pl'\n  },\n  {\n    type : 'checkbox',\n    name : 'pkgElements',\n    message : 'Use spacebar and arrow keys to select the elements you \\'d like to package',\n    choices : [{\n      name : 'Templates',\n      checked : false\n    },\n\t{\n      name : 'Chunks',\n      checked : false\n    },\n\t{\n      name : 'Snippets',\n      checked : false\n    },\n\t{\n      name : 'Plugins',\n      checked : false\n    },\n\t{\n      name : 'Property Sets',\n      checked : false\n    }]\n  },\n  {\n\ttype:'confirm',\n    name : 'pkgAssets',\n\tmessage : 'Will you be including assets with your package?',\n    default : true\n  },\n  {\n\ttype:'confirm',\n    name : 'createConfig',\n\tmessage : 'Would you like to create a config file now? You\\'ll need to supply a path to a MODX install.',\n    default : false\n  },\n  {\n    name : 'modxPath',\n\tmessage : 'Enter the absolute path to your MODX install',\n\twhen : function(props) {\n      return props.createConfig;\n    },\n    validate : function(props) {\n\t  return true;\n    }\n  },\n  {\n    name : 'modxUrl',\n\tmessage : 'Enter the absolute URL to your MODX install',\n\twhen : function(props) {\n      return props.createConfig;\n    },\n    validate : function(props) {\n\t  return true;\n    }\n  },\n  {\n    name : 'configKey',\n\tmessage : 'Optionally set a unique config key',\n\twhen : function(props) {\n      return props.createConfig;\n    },\n    default : 'config'\n  },\n  {\n    type:'confirm',\n    name:'enterAuthor',\n    message:'Would you like to enter some author and project related info?',\n    default:true\n},\n  {\n\tname : 'authorName',\n\tmessage : 'Author name',\n\tdefault : '',\n    when : function(props) {\n      return props.enterAuthor;\n    }\n  },\n  {\n\tname : 'authorEmail',\n\tmessage : 'Author email',\n\tdefault : '',\n    when : function(props) {\n      return props.enterAuthor;\n    }\n  },\n  {\n\tname : 'authorUrl',\n\tmessage : 'Author url',\n\tdefault : '',\n    when : function(props) {\n      return props.enterAuthor;\n    }\n  },\n  {\n\tname : 'gitRepo',\n\tmessage : 'Project git repository',\n\tdefault : function(props) {\n\t\treturn (props.enterAuthor && props.authorName) ? 'git://github.com/' + _s.slugify(props.authorName.replace(/ /g,'')) + '/' + _s.slugify(props.name) + '.git' : ''\n\t},\n    when : function(props) {\n      return props.enterAuthor;\n    }\n  },\n  {\n\tname : 'gitIssues',\n\tmessage : 'Project issues tracker',\n\tdefault : function(props) {\n\t\tif(!props.gitRepo) return '';\n\t\tvar _s = props.gitRepo;\n\t\t_s = _s.substring(0,_s.length-4);\n\t\treturn _s.replace('git://','https://') + '/issues';\n\t},\n    when : function(props) {\n      return props.gitRepo && props.gitRepo.length > 0;\n    }\n  }\n];\n\n  this.prompt(prompts, function (props) {\n\tvar _d = new Date();\n\tthis.createdOn = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate();\n    this.name = props.name;\n    this.slug = _s.slugify(props.name);\n    this.description = props.description;\n    this.versionNo = props.versionNo;\n    this.pkgRelease = props.pkgRelease;\n    this.createConfig = props.createConfig;\n    this.modxPath = (props.modxPath) ? ((props.modxPath.slice(-1) == '/') ? props.modxPath : props.modxPath + '/') : '';\n    this.modxUrl = (props.modxUrl) ? ((props.modxUrl.slice(-1) == '/') ? props.modxUrl : props.modxUrl + '/') : '';\n    this.configKey = props.configKey;\n    this.pkgElements = props.pkgElements;\n    this.pkgAssets = props.pkgAssets;\n    this.pkgTemplates = (this.pkgElements.indexOf('Templates') != -1) ? true : false;\n    this.pkgChunks = (this.pkgElements.indexOf('Chunks') != -1) ? true : false;\n    this.pkgSnippets = (this.pkgElements.indexOf('Snippets') != -1) ? true : false;\n    this.pkgPlugins = (this.pkgElements.indexOf('Plugins') != -1) ? true : false;\n    this.pkgPropertySets = (this.pkgElements.indexOf('Property Sets') != -1) ? true : false;\n    this.pkgSettings = (this.pkgElements.indexOf('System Settings') != -1) ? true : false;\n    this.authorName = props.authorName;\n    this.authorEmail = props.authorEmail;\n    this.authorUrl = props.authorUrl;\n    this.gitRepo = props.gitRepo;\n    this.gitIssues = props.gitIssues;\n    cb();\n  }.bind(this));\n};\n\nMODXPackageGenerator.prototype.app = function app() {\n  this.mkdir('_build');\n  this.mkdir('_build/data');\n  if(this.pkgAssets) {\n    this.mkdir('assets');\n    this.mkdir('assets/components');\n    this.mkdir('assets/components/' + this.slug);\n  }\n  if(this.pkgPropertySets) {\n    this.mkdir('_build/data/properties');\n    this.template('core/components/properties/_properties.php','_build/data/properties/properties.' + this.slug + '.php');\n  }\n  this.mkdir('core');\n  this.mkdir('core/components');\n  this.mkdir('core/components/' + this.slug);\n  this.mkdir('core/components/' + this.slug + '/docs');\n  this.mkdir('core/components/' + this.slug + '/elements');\n  if(this.pkgTemplates) {\n    this.mkdir('core/components/' + this.slug + '/elements/templates');\n    this.template('_build/data/_transport.templates.php','_build/data/transport.templates.php');\n  }\n  if(this.pkgChunks) {\n    this.mkdir('core/components/' + this.slug + '/elements/chunks');\n    this.template('_build/data/_transport.chunks.php','_build/data/transport.chunks.php');\n  }\n  if(this.pkgSnippets) {\n    this.mkdir('core/components/' + this.slug + '/elements/snippets');\n    this.template('_build/data/_transport.snippets.php','_build/data/transport.snippets.php');\n  }\n  if(this.pkgPlugins) {\n    this.mkdir('core/components/' + this.slug + '/elements/plugins');\n    this.template('_build/data/_transport.plugins.php','_build/data/transport.plugins.php');\n  }\n  if(this.pkgSettings) {\n    this.template('_build/data/_transport.settings.php','_build/data/transport.settings.php');\n  }\n  this.mkdir('core/components/' + this.slug + '/lexicon');\n  this.mkdir('core/components/' + this.slug + '/lexicon/en');\n\n  this.template('core/components/docs/readme.txt','core/components/' + this.slug + '/docs/readme.txt');\n  this.template('core/components/docs/changelog.txt','core/components/' + this.slug + '/docs/changelog.txt');\n  this.template('core/components/docs/license.txt','core/components/' + this.slug + '/docs/license.txt');\n  if(this.createConfig) this.template('_build/_build.config.php','_build/build.config.php'); \n  this.template('_build/_build.transport.php','_build/build.transport.php'); \n  this.template('_build/_build.config.sample.php','_build/build.config.sample.php');\n\n};\n\nMODXPackageGenerator.prototype.projectfiles = function projectfiles() {\n  //this.copy('editorconfig', '.editorconfig');\n  //this.copy('jshintrc', '.jshintrc');\n};\n"]}