{"version":3,"sources":["jsdelivr-header.js","/npm/generator-feathers@4.7.0/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,gCACA,gBACA,cACA,SACA,iBACA,QAGF,KAAK,gBAAkB,CACrB,UACA,QAEJ,CAEA,SAAA,GACE,MAAM,EAAe,KAAK,aAAa,OAAO,KAAK,iBAChD,OAAO,CACN,sBACA,uBACA,uBAEE,EAAU,CAAC,CACf,KAAM,OACN,KAAM,WACN,QAAS,+CACT,QAAS,KACT,QAAS,CACP,CAAE,KAAM,aAAc,MAAO,MAC7B,CAAE,KAAM,aAAc,MAAO,QAE9B,CACD,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,MACT,QAAS,CACP,CAAE,KAAM,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AAS,KAEX,SAAtB,KAAK,MAAM,QACb,KAAK,gBAAgB,KAAK,WAG5B,KAAK,gBAAkB,KAAK,gBAAgB,OAAO,CACjD,KAAK,MAAM,OACX,mCACA,6BAEJ,MACE,KAAK,gBAAgB,KAAK,KAAK,MAAM,QAGvC,KAAK,gBAAgB,KAAK,KAAK,MAAM,QAErC,KAAK,iBAAiB,KAAK,gBAAiB,CAC1C,SAAS,GAGb,CAEA,GAAA,GACE,GAAI,KAAK,cAAsC,WAAtB,KAAK,MAAM,OAAqB,OAEzD,MAAQ,GAAc,KAAK,MAAM,SAAS,MAAM,KAE/B,SAAb,EACF,KAAK,aAAa,EAAU,CAAC,MAAO,OAAQ,UAE5C,KAAK,aAAa,EAAU,CAAC,MAAO,OAAQ,KAAM,SAEtD","file":"/npm/generator-feathers@4.7.0/generators/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-feathers@4.7.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","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      '@feathersjs/transport-commons',\n      'serve-favicon',\n      'compression',\n      'helmet',\n      'winston@^3.0.0',\n      'cors'\n    ];\n\n    this.devDependencies = [\n      'nodemon',\n      'axios'\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      type: 'list',\n      name: 'language',\n      message: 'Do you want to use JavaScript or TypeScript?',\n      default: 'js',\n      choices: [\n        { name: 'JavaScript', value: 'js' },\n        { name: 'TypeScript', value: 'ts'  }\n      ],\n    }, {\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',\n      choices: [\n        { name: 'npm', value: 'npm@>= 3.0.0'   },\n        { name: 'Yarn', 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', value: 'rest',     checked: true },\n        { name: 'Realtime via Socket.io', value: 'socketio', checked: true },\n        { name: 'Realtime via Primus', 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      type: 'list',\n      name: 'tester',\n      message: 'Which testing framework do you prefer?',\n      default: 'mocha',\n      choices: [\n        { name: 'Mocha + assert', value: 'mocha' },\n        { name: 'Jest', value: 'jest'  }\n      ]\n    }, {\n      name: 'authentication',\n      message: 'This app uses authentication',\n      type: 'confirm',\n      default: true\n    }];\n\n    const jsPrompts = [{\n      type: 'list',\n      name: 'linter',\n      message: 'Which coding style do you want to use?',\n      default: 'eslint',\n      choices: [\n        { name: 'ESLint', value: 'eslint' },\n        { name: 'StandardJS', value: 'standard'  }\n      ],\n    }];\n\n    return this.prompt(prompts).then(props => {\n      props = Object.assign({}, this.props, props, {\n        linter: 'eslint'\n      });\n\n      if (props.language === 'js') {\n        return this.prompt(jsPrompts).then(jsProps => {\n          return Object.assign({}, props, jsProps);\n        });\n      } else {\n        return props;\n      }\n    }).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.srcTemplatePath('app'),\n      this.srcDestinationPath(this.libDirectory, 'app'),\n      context\n    );\n\n    this.fs.copyTpl(\n      this.srcTemplatePath(`app.test.${props.tester}`),\n      this.srcDestinationPath(this.testDirectory, 'app.test'),\n      context\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath('package.json'),\n      pkg\n    );\n\n    if (this.isTypescript) {\n      this.fs.writeJSON(\n        this.destinationPath('tsconfig.json'),\n        makeConfig.tsconfig(this)\n      );\n\n      if (props.tester === 'jest') {\n        this.fs.copyTpl(\n          this.templatePath('jest.config.js'),\n          this.destinationPath('jest.config.js'),\n          context\n        );\n      }\n    }\n    \n    if (props.linter === 'eslint') {\n      this.fs.writeJSON(\n        this.destinationPath('.eslintrc.json'),\n        makeConfig.eslintrc(this)\n      );\n    }\n\n    this.fs.writeJSON(\n      this.destinationPath(this.configDirectory, 'default.json'),\n      makeConfig.configDefault(this)\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath(this.configDirectory, 'production.json'),\n      makeConfig.configProduction(this)\n    );\n\n    this.fs.writeJSON(\n      this.destinationPath(this.configDirectory, 'test.json'),\n      makeConfig.configTest(this)\n    );\n\n    if (props.authentication) {\n      // Create the users service\n      this.composeWith(require.resolve('../authentication'), {\n        props: { tester: props.tester }\n      });\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      if (provider === 'primus') {\n        this.dependencies.push('ws');\n      }\n    });\n\n    this._packagerInstall(this.dependencies, {\n      save: true\n    });\n\n    if (this.isTypescript) {\n      const excluded = [\n        'nodemon',\n      ];\n      this.devDependencies = this.devDependencies.concat([\n        '@types/compression',\n        '@types/cors',\n        '@types/serve-favicon',\n        'shx',\n        'ts-node-dev',\n        'typescript',\n        `@types/${this.props.tester}`\n      ]).filter(item => !excluded.includes(item));\n\n      if (this.props.tester === 'jest') {\n        this.devDependencies.push('ts-jest');\n      }\n      \n      this.devDependencies = this.devDependencies.concat([\n        this.props.linter,\n        '@typescript-eslint/eslint-plugin',\n        '@typescript-eslint/parser',\n      ]);\n    } else {\n      this.devDependencies.push(this.props.linter);\n    }\n\n    this.devDependencies.push(this.props.tester);\n\n    this._packagerInstall(this.devDependencies, {\n      saveDev: true\n    });\n\n  }\n\n  end () {\n    if (this.isTypescript && this.props.linter !== 'eslint') return;\n    \n    const [ packager, ] = this.props.packager.split('@');\n\n    if (packager === 'yarn') {\n      this.spawnCommand(packager, ['run', 'lint', '--fix']);\n    } else {\n      this.spawnCommand(packager, ['run', 'lint', '--', '--fix']);\n    }\n  }\n};\n"]}