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O,CAC7B,KAAM,OACN,KAAM,WACN,QAAS,8DACT,YAEA,GAAU,EAAO,UAAgC,SAApB,EAAO,gBAC9B,KAAK,MAAM,EAAO,SAAU,CAAC,KAAK,mBAEhD,CAER","file":"/npm/generator-code@1.11.18/generators/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-code@1.11.18/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","/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\n'use strict';\n\nimport Generator from 'yeoman-generator';\nimport yosay from 'yosay';\nimport { fileURLToPath } from 'url';\nimport * as path from 'path';\nimport * as env from './env.js';\nimport which from 'which';\nimport colortheme from './generate-colortheme.js';\nimport commandjs from './generate-command-js.js';\nimport commandts from './generate-command-ts.js';\nimport commandweb from './generate-command-web.js';\nimport extensionpack from './generate-extensionpack.js';\nimport keymap from './generate-keymap.js';\nimport language from './generate-language.js';\nimport localization from './generate-localization.js';\nimport notebook from './generate-notebook-renderer.js';\nimport snippets from './generate-snippets.js';\n\n\n\n/**\n * @typedef {{\n * insiders: boolean,\n * installDependencies: boolean,\n * dependencyVersions: Object.<string, string>,\n * dep: (name: string) => string,\n * vsCodeEngine: string,\n * type: string,\n * name: string,\n * description: string,\n * displayName: string,\n * pkgManager: 'npm' | 'yarn' | 'pnpm',\n * gitInit: boolean,\n * bundler: 'webpack' | 'esbuild' | 'unbundled',\n * proposedAPI: boolean,\n * }} ExtensionConfig\n *\n * @typedef {{\n * id: string,\n * insidersName?: string,\n * aliases: string[],\n * name: string,\n * update?: boolean,\n * prompting: (generator: Generator, extensionConfig: ExtensionConfig) => Promise<void>,\n * writing: (generator: Generator, extensionConfig: ExtensionConfig) => void,\n * endMessage?: (generator: Generator, extensionConfig: ExtensionConfig) => void,\n * }} ExtensionGenerator\n */\n\n\n/**\n * @type {ExtensionGenerator[]}\n */\nconst extensionGenerators = [\n    commandts, commandjs, colortheme, language, snippets, keymap, extensionpack, localization,\n    commandweb, notebook\n]\n\nexport default class extends Generator {\n\n    /**\n     * @type {ExtensionConfig}\n     */\n    extensionConfig;\n\n    constructor(args, opts) {\n        super(args, opts);\n        this.description = 'Generates a Visual Studio Code extension ready for development.';\n\n        this.argument('destination', { type: String, required: false, description: `\\n    The folder to create the extension in, absolute or relative to the current working directory.\\n    Use '.' for the current folder. If not provided, defaults to a folder with the extension display name.\\n  ` })\n\n        this.option('insiders', { type: Boolean, alias: 'i', description: 'Show the insiders options for the generator' });\n        this.option('quick', { type: Boolean, alias: 'q', description: 'Quick mode, skip all optional prompts and use defaults' });\n        this.option('open', { type: Boolean, alias: 'o', description: 'Open the generated extension in Visual Studio Code' });\n        this.option('openInInsiders', { type: Boolean, alias: 'O', description: 'Open the generated extension in Visual Studio Code Insiders' });\n        this.option('skipOpen', { type: Boolean, alias:'s', description: 'Skip opening the generated extension in Visual Studio Code' });\n        this.option('extensionType', { type: String, alias: 't', description: extensionGenerators.slice(0, 6).map(e => e.aliases[0]).join(', ') + '...' });\n        this.option('extensionDisplayName', { type: String, alias: 'n', description: 'Display name of the extension' });\n        this.option('extensionId', { type: String, description: 'Id of the extension' });\n        this.option('extensionDescription', { type: String, description: 'Description of the extension' });\n\n        this.option('pkgManager', { type: String, description: `'npm', 'yarn' or 'pnpm'` });\n        this.option('bundler', { type: String, description: `Bundle the extension: 'webpack', 'esbuild'` });\n        this.option('gitInit', { type: Boolean, description: `Initialize a git repo` });\n\n        this.option('snippetFolder', { type: String, description: `Snippet folder location` });\n        this.option('snippetLanguage', { type: String, description: `Snippet language` });\n\n        this.extensionConfig = Object.create(null);\n        this.extensionConfig.installDependencies = false;\n        this.extensionConfig.insiders = false;\n\n        this.extensionGenerator = undefined;\n\n        this.abort = false;\n    }\n\n    async initializing() {\n        if (this.options['insiders']) {\n            this.extensionConfig.insiders = true;\n        }\n\n        // Welcome\n        if (!this.extensionConfig.insiders) {\n            this.log(yosay('Welcome to the Visual Studio Code Extension generator!'));\n        } else {\n            this.log(yosay('Welcome to the Visual Studio Code Insiders Extension generator!'));\n        }\n\n        const destination = this.options['destination'];\n        if (destination) {\n            const folderPath = path.resolve(this.destinationPath(), destination);\n            this.destinationRoot(folderPath);\n        }\n\n        // evaluateEngineVersion\n        const dependencyVersions = await env.getDependencyVersions();\n        this.extensionConfig.dependencyVersions = dependencyVersions;\n        this.extensionConfig.dep = function (name) {\n            const version = dependencyVersions[name];\n            if (typeof version === 'undefined') {\n                throw new Error(`Module ${name} is not listed in env.js`);\n            }\n            return `${JSON.stringify(name)}: ${JSON.stringify(version)}`;\n        };\n        this.extensionConfig.vsCodeEngine = await env.getLatestVSCodeVersion();\n    }\n\n    async prompting() {\n\n        // Ask for extension type\n        const extensionType = this.options['extensionType'];\n        if (extensionType) {\n            const extensionTypeId = 'ext-' + extensionType;\n            const extensionGenerator = extensionGenerators.find(g => g.aliases.indexOf(extensionType) !== -1);\n            if (extensionGenerator) {\n                this.extensionConfig.type = extensionGenerator.id;\n            } else {\n                this.log(\"Invalid extension type: \" + extensionType + '\\nPossible types are: ' + extensionGenerators.map(g => g.aliases.join(', ')).join(', '));\n                this.abort = true;\n            }\n        } else {\n            const choices = [];\n            for (const g of extensionGenerators) {\n                const name = this.extensionConfig.insiders ? g.insidersName : g.name;\n                if (name) {\n                    choices.push({ name, value: g.id })\n                }\n            }\n            this.extensionConfig.type = (await this.prompt({\n                type: 'list',\n                name: 'type',\n                message: 'What type of extension do you want to create?',\n                pageSize: choices.length,\n                choices,\n            })).type;\n\n        }\n\n        this.extensionGenerator = extensionGenerators.find(g => g.id === this.extensionConfig.type);\n        try {\n            await this.extensionGenerator.prompting(this, this.extensionConfig);\n        } catch (e) {\n            console.log(e);\n            this.abort = true;\n        }\n\n    }\n    // Write files\n    writing() {\n        if (this.abort) {\n            return;\n        }\n        if (!this.options['destination'] && !this.extensionGenerator.update) {\n            this.destinationRoot(this.destinationPath(this.extensionConfig.name))\n        }\n        this.env.cwd = this.destinationPath();\n\n        this.log();\n        this.log(`Writing in ${this.destinationPath()}...`);\n\n        const currentFilename = fileURLToPath(import.meta.url);\n        this.sourceRoot(path.join(currentFilename, '../templates/' + this.extensionConfig.type));\n\n        return this.extensionGenerator.writing(this, this.extensionConfig);\n    }\n\n    // Installation\n    install() {\n        if (this.abort) {\n            // @ts-ignore\n            this.env.options.skipInstall = true;\n            return;\n        }\n        if (this.extensionConfig.installDependencies) {\n            // @ts-ignore\n            this.env.options.nodePackageManager = this.extensionConfig.pkgManager;\n        } else {\n            // @ts-ignore\n            this.env.options.skipInstall = true;\n        }\n    }\n\n    // End\n    async end() {\n        if (this.abort) {\n            return;\n        }\n\n        if (this.extensionGenerator.update) {\n            this.log('');\n            this.log('Your extension has been updated!');\n            this.log('');\n            this.log('To start editing with Visual Studio Code, use the following commands:');\n            this.log('');\n            if (!this.extensionConfig.insiders) {\n                this.log('     code .');\n            } else {\n                this.log('     code-insiders .');\n            }\n            this.log(`     ${this.extensionConfig.pkgManager} run compile-web`);\n            this.log('');\n            return;\n        }\n\n        // Git init\n        if (this.extensionConfig.gitInit) {\n            await this.spawn('git', ['init', '--quiet']);\n        }\n\n        if (this.extensionConfig.proposedAPI) {\n            await this.spawn(this.extensionConfig.pkgManager, ['run', 'update-proposed-api']);\n        }\n        this.log('');\n\n        this.log('Your extension ' + this.extensionConfig.name + ' has been created!');\n        this.log('');\n\n        const [codeStableLocation, codeInsidersLocation] = await Promise.all([which('code').catch(() => undefined), which('code-insiders').catch(() => undefined)]);\n\n        if (!this.extensionConfig.insiders && !this.options['open'] && !this.options['openInInsiders'] && !this.options['quick'] && !this.options['skipOpen']) {\n            const cdLocation = this.options['destination'] || this.extensionConfig.name;\n\n            this.log('To start editing with Visual Studio Code, use the following commands:');\n            this.log('');\n            if (!this.extensionConfig.insiders) {\n                this.log('     code ' + cdLocation);\n            } else {\n                this.log('     code-insiders ' + cdLocation);\n            }\n            this.log('');\n        }\n        this.log('Open vsc-extension-quickstart.md inside the new extension for further instructions');\n        this.log('on how to modify, test and publish your extension.');\n        this.log('');\n\n        if (this.extensionGenerator.endMessage) {\n            this.extensionGenerator.endMessage(this, this.extensionConfig);\n        }\n\n        this.log('For more information, also visit http://code.visualstudio.com and follow us @code.');\n        this.log('\\r\\n');\n\n        if (this.options['skipOpen']) {\n            return;\n        }\n\n        if (this.options[\"open\"]) {\n            if (codeStableLocation) {\n                this.log(`Opening ${this.destinationPath()} in Visual Studio Code...`);\n                await this.spawn(codeStableLocation, [this.destinationPath()]);\n            } else {\n                this.log(`'code' command not found.`);\n            }\n        } else if (this.options[\"openInInsiders\"]) {\n            if (codeInsidersLocation) {\n                this.log(`Opening ${this.destinationPath()} with Visual Studio Code Insiders...`);\n                await this.spawn(codeInsidersLocation, [this.destinationPath()]);\n            } else {\n                this.log(`'code-insiders' command not found.`);\n            }\n        } else if (codeInsidersLocation || codeStableLocation) {\n            if (this.options[\"quick\"]) {\n                await this.spawn(codeInsidersLocation || codeStableLocation, [this.destinationPath()]);\n            } else {\n                const choices = [];\n                if (codeInsidersLocation) {\n                    choices.push({ name: \"Open with `code-insiders`\", value: codeInsidersLocation });\n                }\n                if (codeStableLocation) {\n                    choices.push({ name: \"Open with `code`\", value: codeStableLocation });\n                }\n                choices.push({ name: \"Skip\", value: 'skip' });\n\n                const answer = await this.prompt({\n                    type: \"list\",\n                    name: \"openWith\",\n                    message: \"Do you want to open the new folder with Visual Studio Code?\",\n                    choices\n                });\n                if (answer && answer.openWith && answer.openWith !== 'skip') {\n                    await this.spawn(answer.openWith, [this.destinationPath()]);\n                }\n            }\n        }\n    }\n}\n"]}