[{"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/constants.js":"1","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/generator-version.js":"2","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/generator.js":"3","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/index.js":"4","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/naming.js":"5","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/package-json.js":"6","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/validators.js":"7","/Users/ddashkevich/projects/generator-videojs-plugin/scripts/generate-pkg-lock.js":"8","/Users/ddashkevich/projects/generator-videojs-plugin/scripts/manual-test.js":"9","/Users/ddashkevich/projects/generator-videojs-plugin/scripts/run-integration-tests.js":"10","/Users/ddashkevich/projects/generator-videojs-plugin/test/app.test.js":"11","/Users/ddashkevich/projects/generator-videojs-plugin/test/libs.js":"12"},{"size":1214,"mtime":1674778574283,"results":"13","hashOfConfig":"14"},{"size":231,"mtime":1674778574284,"results":"15","hashOfConfig":"14"},{"size":11121,"mtime":1674778574284,"results":"16","hashOfConfig":"14"},{"size":108,"mtime":1674778574284,"results":"17","hashOfConfig":"14"},{"size":3803,"mtime":1674778574285,"results":"18","hashOfConfig":"14"},{"size":7909,"mtime":1681254286208,"results":"19","hashOfConfig":"14"},{"size":1269,"mtime":1674778574292,"results":"20","hashOfConfig":"14"},{"size":399,"mtime":1674778574297,"results":"21","hashOfConfig":"14"},{"size":698,"mtime":1674778574298,"results":"22","hashOfConfig":"14"},{"size":6107,"mtime":1681251040563,"results":"23","hashOfConfig":"14"},{"size":12362,"mtime":1674778574298,"results":"24","hashOfConfig":"14"},{"size":2438,"mtime":1674778574299,"results":"25","hashOfConfig":"14"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ooo89s",{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"32"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/constants.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/generator-version.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/generator.js",["51","52","53"],"'use strict';\n\nconst _ = require('lodash');\nconst fs = require('fs');\nconst path = require('path');\nconst Generator = require('yeoman-generator');\nconst constants = require('./constants');\nconst naming = require('./naming');\nconst packageJSON = require('./package-json');\nconst validators = require('./validators');\nconst spawnSync = require('child_process').spawnSync;\nconst syncRequest = require('sync-request');\n\nmodule.exports = class extends Generator {\n\n /**\n * Whether or not this plugin is privately licensed.\n *\n * @return {boolean}\n * True if the plugin is privately licensed.\n */\n _isPrivate() {\n return this.config.get('license') === 'private';\n }\n\n /**\n * Removes the leading underscore from a template file name and\n * generates the full destination path for it.\n *\n * @private\n * @example\n * this._dest('some-dir/__foo') // \"/path/to/some-dir/_foo\"\n * this._dest('_some-file.js') // \"/path/to/some-file.js\"\n * this._dest('some-file.js') // \"/path/to/some-file.js\"\n *\n * @param {string} src\n * A template file path.\n *\n * @return {string}\n * A destination file path.\n */\n _dest(src) {\n const basename = path.basename(src);\n let destname = src;\n\n if (_.startsWith(basename, '_')) {\n destname = src.replace(basename, basename.substr(1));\n }\n\n return this.destinationPath(destname);\n }\n\n /**\n * Attempts to get default values for prompts. Async because it may call\n * out to external processes (e.g. Git) to attempt to gather this info.\n *\n * @private\n * @return {Object}\n * An object containing default prompt values.\n */\n _getPromptDefaults() {\n const configs = this.config.getAll();\n const pkg = this._currentPkgJSON || {};\n\n const defaults = _.assign(\n {},\n constants.PROMPT_DEFAULTS,\n configs,\n _.pick(pkg, ['author', 'license', 'name', 'description'])\n );\n\n // At this point, the `defaults.name` may still have the full scope and\n // constants.PREFIX included; so, we get the scope now.\n defaults.scope = naming.getScope(defaults.name);\n\n // Strip out the \"videojs-\" constants.PREFIX from the name for the\n // purposes of the prompt (otherwise it will be rejected by validation).\n defaults.name = naming.getBasicName(defaults.name);\n\n // we need to default the description to an empty string for\n // --hurry\n defaults.description = '';\n\n // The package.json stores a value from `LICENSE_NAMES`, so in that\n // case, we need to find the key instead of the value.\n if (pkg && pkg.license && pkg.license === defaults.license) {\n defaults.license = _.find(_.keys(constants.LICENSE_NAMES), (k) => {\n return constants.LICENSE_NAMES[k] === pkg.license;\n });\n }\n\n const name = this.user.git.name();\n\n // Build up an author string from git if possible as a last-ditch effort.\n if (!defaults.author && name) {\n const email = this.user.git.email();\n\n defaults.author = name;\n\n if (email) {\n defaults.author += ` <${email}>`;\n }\n }\n\n return defaults;\n }\n\n /**\n * Gets prompts for the user.\n *\n * @private\n * @return {Array}\n * An array of prompt definition objects.\n */\n _getPrompts() {\n const defaults = this._getPromptDefaults();\n const prompts = [{\n name: 'scope',\n message: 'Enter a package scope, if any, for npm (optional):',\n default: defaults.scope,\n validate: validators.scope\n }, {\n name: 'name',\n message: `Enter the name of this plugin (a-z/0-9/- only; will be prefixed with \"${constants.PREFIX}\"):`,\n default: defaults.name,\n validate: validators.name\n }, {\n name: 'description',\n message: 'Enter a description for your plugin:',\n default: defaults.description\n }, {\n name: 'author',\n message: 'Enter the author of this plugin:',\n default: defaults.author\n }, {\n type: 'list',\n name: 'license',\n message: 'Choose a license for your plugin',\n default: defaults.license,\n choices: constants.LICENSE_CHOICES\n }, {\n type: 'list',\n name: 'pluginType',\n message: 'Choose a type for your plugin',\n default: defaults.pluginType,\n choices: constants.PLUGIN_TYPE_CHOICES\n }, {\n type: 'confirm',\n name: 'css',\n message: 'Do you want to use css tooling?',\n default: defaults.css\n }, {\n type: 'confirm',\n name: 'docs',\n message: 'Do you want to include documentation tooling?',\n default: defaults.docs\n }, {\n type: 'confirm',\n name: 'lang',\n message: 'Do you need video.js language file infrastructure for internationalized strings?',\n default: defaults.lang\n }, {\n type: 'confirm',\n name: 'library',\n message: 'Do you want to every file in ./src available for use as ./cjs and ./es in other packages?',\n default: defaults.library\n }, {\n type: 'confirm',\n name: 'precommit',\n message: 'Should we lint changed files before allowing `git commit`',\n default: defaults.precommit\n }, {\n type: 'confirm',\n name: 'prepush',\n message: 'Should we run tests before allowing `git push`',\n default: defaults.prepush\n }];\n\n return prompts.filter(p => !_.includes(this._promptsToFilter, p.name));\n }\n\n /**\n * Generates a context object used for providing data to EJS file templates.\n *\n * @param {Object} [configs]\n * Optionally provide custom configs.\n *\n * @return {Object}\n * An object to be used in EJS file templates.\n */\n _getContext(configs) {\n configs = configs || this.config.getAll();\n\n return _.assign(configs, {\n className: `vjs-${configs.name}`,\n pluginFunctionName: naming.getPluginFunctionName(configs.name),\n pluginClassName: naming.getPluginClassName(configs.name),\n moduleName: naming.getModuleName(configs.name),\n isPrivate: this._isPrivate(),\n licenseName: constants.LICENSE_NAMES[configs.license],\n packageName: naming.getPackageName(configs.name, configs.scope),\n pluginName: naming.getPackageName(configs.name),\n version: this._currentPkgJSON && this._currentPkgJSON.version || '0.0.0'\n });\n }\n\n initializing() {\n this._currentPkgJSON = this.fs.readJSON(this.destinationPath('package.json'), null);\n\n this._filesToCopy = [\n '_.editorconfig',\n '_.gitignore',\n '_.npmignore',\n '_.nvmrc'\n ];\n\n this._filesToDownload = [];\n\n this._templatesToCopy = [\n 'scripts/_rollup.config.js',\n 'scripts/_karma.conf.js',\n 'test/_plugin.test.js',\n '_index.html',\n '_CONTRIBUTING.md',\n '_README.md'\n ];\n\n this._promptsToFilter = [];\n\n // The \"hurry\" option skips both prompts and installation.\n if (this.options.hurry) {\n this.options.skipPrompt = this.options.skipInstall = true;\n }\n\n this._preconfigs = {};\n\n // Make sure we filter out the author prompt if there is a current\n // package.json file with an object for the author field.\n if (this._currentPkgJSON && _.isPlainObject(this._currentPkgJSON.author)) {\n this._promptsToFilter.push('author');\n this._preconfigs.author = this._currentPkgJSON.author;\n }\n }\n\n /**\n * Display prompts to the user.\n */\n prompting() {\n if (this.options.skipPrompt) {\n _.assign(this._preconfigs, this._getPromptDefaults());\n return;\n }\n\n this.log('Welcome to the Video.js plugin generator!');\n\n return this.prompt(this._getPrompts()).then((responses) => {\n _.assign(this._preconfigs, responses);\n });\n }\n\n /**\n * Store configs, generate template rendering context, alter the setup for\n * file structure.\n */\n configuring() {\n this.config.set(this._preconfigs);\n delete this._preconfigs;\n\n this.context = this._getContext();\n\n if (!this._isPrivate()) {\n this._filesToDownload.push({\n dest: '.github/workflows/ci.yml',\n url: 'https://raw.githubusercontent.com/videojs/.github/main/workflow-templates/ci.yml'\n });\n }\n\n if (this.context.lang) {\n this._filesToCopy.push('lang/_en.json');\n }\n\n if (this.context.css) {\n this._templatesToCopy.push('src/_plugin.css');\n this._templatesToCopy.push('scripts/_postcss.config.js');\n }\n }\n\n /**\n * Perform various writing tasks.\n *\n * @property {Object} writing\n */\n writing() {\n try {\n fs.statSync(this._dest('CHANGELOG.md'));\n } catch (x) {\n this.fs.copy(this.templatePath('_CHANGELOG.md'), this._dest('CHANGELOG.md'));\n }\n\n this.fs.copyTpl(\n this.templatePath(`src/_plugin-${this.context.pluginType}.js`),\n this._dest('src/_plugin.js'),\n this.context\n );\n\n this._templatesToCopy.forEach(src => {\n this.fs.copyTpl(this.templatePath(src), this._dest(src), this.context);\n });\n\n this._filesToCopy.forEach(src => {\n this.fs.copy(this.templatePath(src), this._dest(src));\n });\n\n this._filesToDownload.forEach(({url, dest}) => {\n const response = syncRequest('GET', url);\n\n this.fs.write(this.destinationPath(dest), response.getBody('utf8'));\n });\n\n const file = constants.LICENSE_FILES[this.config.get('license')];\n\n if (file) {\n this.fs.copyTpl(\n this.templatePath(file),\n this.destinationPath('LICENSE'),\n this.context\n );\n }\n\n const pkg = packageJSON(this._currentPkgJSON, this.context);\n const lock = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'plugin', 'package-lock.json')));\n\n lock.name = pkg.name;\n lock.version = pkg.version;\n\n // We want to use normal JSON.stringify here because we want to\n // preserve whatever ordering existed in the _currentPkgJSON object.\n this.fs.write(this.destinationPath('package.json'), JSON.stringify(pkg, null, 2));\n this.fs.write(this.destinationPath('package-lock.json'), JSON.stringify(lock, null, 2));\n }\n\n /**\n * Install npm dependencies; we don't have any Bower dependencies; so,\n * we don't want to run that (or depend on it in any way).\n */\n install() {\n const result = spawnSync('npm', ['--version']);\n\n // no access to npm uh oh, lets let yeoman throw an error\n if (result.status !== 0) {\n return this.npmInstall();\n }\n\n // get the major version for npm\n const major = parseFloat(result.stdout.toString().trim().split('.')[0]);\n\n if (!major || major <= 5) {\n return this.npmInstall();\n }\n\n // this.npmInstall automaticall handles\n // skipInstall, but our custom install does not.\n // handle it now.\n if (this.options.skipInstall) {\n this.log('Skipping Install, to install later please run: npm i --package-lock-only && npm ci');\n return;\n }\n\n spawnSync('npm', ['i', '--prefer-offline', '--no-audit', '--progress=false'], {stdio: 'inherit', cwd: this.destinationRoot()});\n }\n\n /**\n * Display a final message to the user.\n */\n end() {\n if (this.options.hurry) {\n return;\n }\n\n this.log(`All done; ${this.context.pluginName} is ready to go!`);\n }\n};\n","/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/index.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/naming.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/package-json.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/generators/app/validators.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/scripts/generate-pkg-lock.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/scripts/manual-test.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/scripts/run-integration-tests.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/test/app.test.js",[],"/Users/ddashkevich/projects/generator-videojs-plugin/test/libs.js",[],{"ruleId":"54","severity":1,"message":"55","line":207,"column":15,"nodeType":"56","messageId":"57","endLine":243,"endColumn":4},{"ruleId":"58","severity":1,"message":"59","line":245,"column":3,"nodeType":"60","messageId":"61","endLine":247,"endColumn":6},{"ruleId":"58","severity":1,"message":"59","line":342,"column":3,"nodeType":"60","messageId":"61","endLine":345,"endColumn":6},"require-jsdoc","Missing JSDoc comment.","FunctionExpression","missingJSDocComment","valid-jsdoc","Missing JSDoc @return for function.","Block","missingReturn"]