{"version":3,"sources":["jsdelivr-header.js","/npm/generator-feathers-namespace@3.1.1/generators/app/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,UAAY,QAAQ,uBACpB,KAAO,QAAQ,QACf,WAAa,QAAQ,cACrB,UAAE,WAAc,QAAQ,UAE9B,OAAO,QAAU,cAA2B,UAC1C,WAAA,CAAa,EAAM,GACjB,MAAM,EAAM,GAEZ,KAAK,MAAQ,CACX,KAAM,KAAK,IAAI,MAAQ,QAAQ,MAAM,MAAM,KAAK,KAAK,MACrD,YAAa,KAAK,IAAI,YACtB,IAAK,KAAK,IAAI,aAAe,KAAK,IAAI,YAAY,KAGpD,KAAK,aAAe,CAClB,uBACA,qBACA,4BACA,sBACA,gBACA,cACA,SACA,UACA,QAGF,KAAK,gBAAkB,CACrB,SACA,QACA,UACA,kBAEJ,CAEA,SAAA,GACE,MAAM,EAAe,KAAK,aAAa,OAAO,KAAK,iBAChD,OAAO,CACN,sBACA,uBACA,uBAEE,EAAU,CAAC,CACf,KAAM,OACN,QAAS,eACT,MAAO,KAAK,IAAI,KAChB,QAAS,KAAK,MAAM,KACpB,OAAQ,UACR,SAAU,IAGkB,EAAa,MAAK,IAC1C,MAAM,EAAiB,EAAW,QAAQ,KACpC,GAA0B,IAApB,EAAwB,EAAiB,EAAW,OAGhE,OAFuB,EAAW,UAAU,EAAG,KAErB,CAAK,KAIxB,kCAAkC,mBAAuB,yDAKnE,CACD,KAAM,cACN,QAAS,cACT,MAAO,KAAK,IAAI,aACf,CACD,KAAM,MACN,QAAS,+CACT,QAAS,MACT,OAAQ,KAAK,IAAI,aAAe,KAAK,IAAI,YAAY,MACpD,CACD,KAAM,WACN,KAAM,OACN,QAAS,sEACT,QAAS,eACT,QAAS,CAAC,CACR,KAAM,MACN,MAAO,gBACN,CACD,KAAM,OACN,MAAO,oBAER,CACD,KAAM,WACN,KAAM,YACN,QAAS,mCACT,QAAS,CAAC,CACR,KAAM,OACN,MAA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AAiB,CAC1C,SAAS,GAEb","file":"/npm/generator-feathers-namespace@3.1.1/generators/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-feathers-namespace@3.1.1/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","const Generator = require('../../lib/generator');\nconst path = require('path');\nconst makeConfig = require('./configs');\nconst { kebabCase } = require('lodash');\n\nmodule.exports = class AppGenerator extends Generator {\n  constructor (args, opts) {\n    super(args, opts);\n\n    this.props = {\n      name: this.pkg.name || process.cwd().split(path.sep).pop(),\n      description: this.pkg.description,\n      src: this.pkg.directories && this.pkg.directories.lib\n    };\n\n    this.dependencies = [\n      '@feathersjs/feathers',\n      '@feathersjs/errors',\n      '@feathersjs/configuration',\n      '@feathersjs/express',\n      'serve-favicon',\n      'compression',\n      'helmet',\n      'winston',\n      'cors'\n    ];\n\n    this.devDependencies = [\n      'eslint',\n      'mocha',\n      'request',\n      'request-promise'\n    ];\n  }\n\n  prompting () {\n    const dependencies = this.dependencies.concat(this.devDependencies)\n      .concat([\n        '@feathersjs/express',\n        '@feathersjs/socketio',\n        '@feathersjs/primus'\n      ]);\n    const prompts = [{\n      name: 'name',\n      message: 'Project name',\n      when: !this.pkg.name,\n      default: this.props.name,\n      filter: kebabCase,\n      validate (input) {\n        // The project name can not be the same as any of the dependencies\n        // we are going to install\n        const isSelfReferential = dependencies.some(dependency => {\n          const separatorIndex = dependency.indexOf('@');\n          const end = separatorIndex !== -1 ? separatorIndex : dependency.length;\n          const dependencyName = dependency.substring(0, end);\n\n          return dependencyName === input;\n        });\n\n        if (isSelfReferential) {\n          return `Your project can not be named '${input}' because the '${input}' package will be installed as a project dependency.`;\n        }\n\n        return true;\n      }\n    }, {\n      name: 'description',\n      message: 'Description',\n      when: !this.pkg.description\n    }, {\n      name: 'src',\n      message: 'What folder should the source files live in?',\n      default: 'src',\n      when: !(this.pkg.directories && this.pkg.directories.lib)\n    }, {\n      name: 'packager',\n      type: 'list',\n      message: 'Which package manager are you using (has to be installed globally)?',\n      default: 'npm@>= 3.0.0',\n      choices: [{\n        name: 'npm',\n        value: 'npm@>= 3.0.0'\n      }, {\n        name: 'Yarn',\n        value: 'yarn@>= 0.18.0'\n      }]\n    }, {\n      type: 'checkbox',\n      name: 'providers',\n      message: 'What type of API are you making?',\n      choices: [{\n        name: 'REST',\n        value: 'rest',\n        checked: true\n      }, {\n        name: 'Realtime via Socket.io',\n        value: 'socketio',\n        checked: true\n      }, {\n        name: 'Realtime via Primus',\n        value: 'primus',\n      }],\n      validate (input) {\n        if (input.indexOf('primus') !== -1 && input.indexOf('socketio') !== -1) {\n          return 'You can only pick SocketIO or Primus, not both.';\n        }\n\n        return true;\n      }\n    }];\n\n    return this.prompt(prompts).then(props => {\n      this.props = Object.assign(this.props, props);\n    });\n  }\n\n  writing () {\n    const props = this.props;\n    const pkg = this.pkg = makeConfig.package(this);\n    const context = Object.assign({}, props, {\n      hasProvider (name) {\n        return props.providers.indexOf(name) !== -1;\n      }\n    });\n\n    // Static content for the root folder (including dotfiles)\n    this.fs.copy(this.templatePath('static'), this.destinationPath());\n    this.fs.copy(this.templatePath('static', '.*'), this.destinationPath());\n    // Static content for the directories.lib folder\n    this.fs.copy(this.templatePath('src'), this.destinationPath(props.src));\n    // This hack is necessary because NPM does not publish `.gitignore` files\n    this.fs.copy(this.templatePath('_gitignore'), this.destinationPath('', '.gitignore'));\n\n    this.fs.copyTpl(\n      this.templatePath('README.md'),\n      this.destinationPath('', 'README.md'),\n      context\n    );\n\n    this.fs.copyTpl(\n      this.templatePath('app.js'),\n      this.destinationPath(props.src, 'app.js'),\n      context\n    );\n\n    this.fs.copyTpl(\n      this.templatePath('app.test.js'),\n      this.destinationPath(this.testDirectory, 'app.test.js'),\n      context\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath('package.json'),\n      pkg\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath('config', 'default.json'),\n      makeConfig.configDefault(this)\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath('config', 'production.json'),\n      makeConfig.configProduction(this)\n    );\n  }\n\n  install () {\n    this.props.providers.forEach(provider => {\n      const type = provider === 'rest' ? 'express' : provider;\n\n      this.dependencies.push(`@feathersjs/${type}`);\n    });\n\n    this._packagerInstall(this.dependencies, {\n      save: true\n    });\n\n    this._packagerInstall(this.devDependencies, {\n      saveDev: true\n    });\n  }\n};\n"]}