[
  {
    "path": ".github/workflows/build.yml",
    "content": "name: build\n\non: [push, pull_request]\n\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        node: [\"12\"]\n        os: [ubuntu-latest, macOS-latest, windows-latest]\n    name: test in ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions/setup-node@v2\n        with:\n          node-version: ${{ matrix.node }}\n\n      - name: Environment\n        run: |\n          node -v\n          npm -v\n          yarn --version\n\n      - name: Install\n        run: |\n          yarn\n\n      - name: Lint\n        run: |\n          npm run lint\n\n      - name: Compile\n        run: |\n          npm run compile\n\n      - name: Package\n        run: |\n          npx vsce package -o ./vscode-changelog-generator.vsix --yarn\n\n      - uses: actions/upload-artifact@v2\n        if: runner.os == 'linux'\n        with:\n          name: package\n          path: ./vscode-changelog-generator.vsix\n\n  release:\n    runs-on: ubuntu-latest\n    name: \"Release to vscode market and github\"\n    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')\n    needs: build\n    steps:\n      - uses: actions/download-artifact@v2\n        with:\n          name: package\n\n      - uses: actions/setup-node@v2\n        with:\n          node-version: \"12.x\"\n\n      - name: publish to vscode market\n        # require Azure DevOps Personal Access Token\n        run: npx vsce publish --packagePath ./vscode-changelog-generator.vsix --pat ${{ secrets.ADO_TOKEN }}\n\n      - uses: softprops/action-gh-release@v1\n        name: publish to Github\n        env:\n          # require Github Personal Access Token\n          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          files: |\n            ./vscode-changelog-generator.vsix\n          draft: false\n"
  },
  {
    "path": ".gitignore",
    "content": "out\nnode_modules\n.vscode-test/\n*.vsix\n*.lock\npackage-lock.json\n*.log\n.DS_Store"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n\t// See http://go.microsoft.com/fwlink/?LinkId=827846\n\t// for the documentation about the extensions.json format\n\t\"recommendations\": [\n\t\t\"eg2.tslint\"\n\t]\n}"
  },
  {
    "path": ".vscode/launch.json",
    "content": "// A launch configuration that compiles the extension and then opens it inside a new window\n// Use IntelliSense to learn about possible attributes.\n// Hover to view descriptions of existing attributes.\n// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n{\n\t\"version\": \"0.2.0\",\n    \"configurations\": [\n        \n        {\n            \"name\": \"Extension\",\n            \"type\": \"extensionHost\",\n            \"request\": \"launch\",\n            \"runtimeExecutable\": \"${execPath}\",\n            \"args\": [\n                \"--extensionDevelopmentPath=${workspaceFolder}\"\n            ],\n            \"outFiles\": [\n                \"${workspaceFolder}/out/**/*.js\"\n            ],\n            \"preLaunchTask\": \"npm: watch\"\n        },\n        {\n            \"name\": \"Extension Tests\",\n            \"type\": \"extensionHost\",\n            \"request\": \"launch\",\n            \"runtimeExecutable\": \"${execPath}\",\n            \"args\": [\n                \"--extensionDevelopmentPath=${workspaceFolder}\",\n                \"--extensionTestsPath=${workspaceFolder}/out/test\"\n            ],\n            \"outFiles\": [\n                \"${workspaceFolder}/out/test/**/*.js\"\n            ],\n            \"preLaunchTask\": \"npm: watch\"\n        }\n    ]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "// Place your settings in this file to overwrite default and user settings.\n{\n    \"files.exclude\": {\n        \"out\": false // set this to true to hide the \"out\" folder with the compiled JS files\n    },\n    \"search.exclude\": {\n        \"out\": true // set this to false to include \"out\" folder in search results\n    },\n    \"editor.tabSize\": 2,\n    \"cSpell.language\": \"en\"\n}"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "// See https://go.microsoft.com/fwlink/?LinkId=733558\n// for the documentation about the tasks.json format\n{\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"type\": \"npm\",\n            \"script\": \"watch\",\n            \"problemMatcher\": \"$tsc-watch\",\n            \"isBackground\": true,\n            \"presentation\": {\n                \"reveal\": \"never\"\n            },\n            \"group\": {\n                \"kind\": \"build\",\n                \"isDefault\": true\n            }\n        }\n    ]\n}"
  },
  {
    "path": ".vscodeignore",
    "content": ".vscode/**\n.vscode-test/**\nout/test/**\nout/**/*.map\nsrc/**\n.gitignore\ntsconfig.json\ntslint.json\n*.gif\n*.log\nrenovate.json\n.github"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# [0.4.0](https://github.com/axetroy/vscode-changelog-generator/compare/v0.3.1...v0.4.0) (2019-05-31)\n\n\n### Features\n\n* add context for changelog.md ([976b7c3](https://github.com/axetroy/vscode-changelog-generator/commit/976b7c3))\n* build with @zeit/ncc ([cc76b45](https://github.com/axetroy/vscode-changelog-generator/commit/cc76b45))\n\n\n\n## [0.3.1](https://github.com/axetroy/vscode-changelog-generator/compare/v0.3.0...v0.3.1) (2019-04-01)\n\n\n### Features\n\n* support outputUnreleased options ([bbab14f](https://github.com/axetroy/vscode-changelog-generator/commit/bbab14f))\n* update i18n ([ef82d5b](https://github.com/axetroy/vscode-changelog-generator/commit/ef82d5b))\n\n\n\n# [0.3.0](https://github.com/axetroy/vscode-changelog-generator/compare/v0.2.1...v0.3.0) (2019-03-10)\n\n\n### Features\n\n* exec cli with build-in node. support window. close [#1](https://github.com/axetroy/vscode-changelog-generator/issues/1) ([12021d5](https://github.com/axetroy/vscode-changelog-generator/commit/12021d5))\n\n\n\n## [0.2.1](https://github.com/axetroy/vscode-changelog-generator/compare/v0.2.0...v0.2.1) (2019-03-10)\n\n\n### Bug Fixes\n\n* executable not work ([d5a4ba9](https://github.com/axetroy/vscode-changelog-generator/commit/d5a4ba9))\n\n\n\n# [0.2.0](https://github.com/axetroy/vscode-changelog-generator/compare/v0.1.1...v0.2.0) (2019-03-10)\n\n\n### Features\n\n* support i18n ([4d21b5b](https://github.com/axetroy/vscode-changelog-generator/commit/4d21b5b))\n\n\n\n## [0.1.1](https://github.com/axetroy/vscode-changelog-generator/compare/v0.1.0...v0.1.1) (2019-03-10)\n\n\n### Bug Fixes\n\n* eslint ([3235ecb](https://github.com/axetroy/vscode-changelog-generator/commit/3235ecb))\n\n\n\n# 0.1.0 (2019-03-10)\n\n\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2019 axetroy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "> ⚠️ Deprecated and no longer maintained, please go to [vscode-whatchanged](https://github.com/release-lab/vscode-whatchanged)\n\n# Visual Studio Code extension to generate changelog\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/axetroy/vscode-changelog-generator/build)\n![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/axetroy.vscode-changelog-generator)\n![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/axetroy.vscode-changelog-generator)\n![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/axetroy.vscode-changelog-generator)\n![Visual Studio Marketplace Rating](https://img.shields.io/visual-studio-marketplace/r/axetroy.vscode-changelog-generator)\n![Visual Studio Marketplace Rating (Stars)](https://img.shields.io/visual-studio-marketplace/stars/axetroy.vscode-changelog-generator)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/axetroy/vscode-changelog-generator)\n![GitHub repo size](https://img.shields.io/github/repo-size/axetroy/vscode-changelog-generator)\n![GitHub](https://img.shields.io/github/license/axetroy/vscode-changelog-generator)\n\n## Screenshot\n\n![Screenshot](screenshot.gif)\n\n## License\n\nThe [MIT License](LICENSE)\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vscode-changelog-generator\",\n  \"displayName\": \"changelog-generator\",\n  \"description\": \"An extension to generate changelog.\",\n  \"version\": \"1.0.4\",\n  \"publisher\": \"axetroy\",\n  \"engines\": {\n    \"vscode\": \"^1.55.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/axetroy/vscode-changelog-generator.git\"\n  },\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/axetroy/vscode-changelog-generator/issues\"\n  },\n  \"homepage\": \"https://github.com/axetroy/vscode-changelog-generator#readme\",\n  \"keywords\": [\n    \"changelog\"\n  ],\n  \"categories\": [\n    \"Other\"\n  ],\n  \"icon\": \"resources/icon.png\",\n  \"main\": \"./out/index\",\n  \"activationEvents\": [\n    \"onCommand:changelog.generate\"\n  ],\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"changelog.generate\",\n        \"title\": \"%cmd.generate.title%\",\n        \"category\": \"CHANGELOG\"\n      }\n    ],\n    \"menus\": {\n      \"explorer/context\": [\n        {\n          \"when\": \"resourceFilename =~ /^changelog(.md)?$/i\",\n          \"command\": \"changelog.generate\",\n          \"group\": \"changelog\"\n        }\n      ],\n      \"commandPalette\": [\n        {\n          \"command\": \"changelog.generate\"\n        }\n      ]\n    }\n  },\n  \"scripts\": {\n    \"vscode:prepublish\": \"npm run compile\",\n    \"compile\": \"tsc -p ./\",\n    \"clean\": \"npx rimraf ./out\",\n    \"watch\": \"tsc -watch -p ./\",\n    \"postinstall\": \"node ./node_modules/vscode/bin/install\",\n    \"lint\": \"tslint -p ./ -c tslint.json\",\n    \"test\": \"npm run compile && node ./node_modules/vscode/bin/test\",\n    \"changelog\": \"conventional-changelog -p angular -i CHANGELOG.md -s -r 0\",\n    \"publish\": \"npx vsce publish\"\n  },\n  \"devDependencies\": {\n    \"@types/execa\": \"2.0.0\",\n    \"@types/mocha\": \"9.0.0\",\n    \"@types/node\": \"14.17.16\",\n    \"tslint\": \"6.1.3\",\n    \"tslint-config-prettier\": \"1.18.0\",\n    \"typescript\": \"4.3.4\",\n    \"vscode\": \"1.1.37\"\n  },\n  \"dependencies\": {\n    \"conventional-changelog-cli\": \"^2.1.1\",\n    \"execa\": \"^5.0.0\",\n    \"vscode-nls-i18n\": \"^0.2.2\"\n  }\n}\n"
  },
  {
    "path": "package.nls.json",
    "content": "{\n  \"cmd.generate.title\": \"Generate changelog\",\n  \"info.select_preset\": \"Please select a preset\",\n  \"info.output_unreleased\": \"Whether include un-release changes?\",\n  \"info.release_count\": \"How many version change logs do you want to generate?\",\n  \"info.release_count_meta\": \"if value is '0'. then generate all versions.\",\n  \"info.generating\": \"Generating changelog...\",\n  \"placeholder.select.workspace\": \"Select a workspace to generate changelog\",\n  \"validator.interger\": \"Please enter an interger number.\"\n}\n"
  },
  {
    "path": "package.nls.zh-cn.json",
    "content": "{\n  \"cmd.generate.title\": \"生成变更日志\",\n  \"info.select_preset\": \"请选择一种预设风格\",\n  \"info.output_unreleased\": \"是否包含未发布的变更日志？\",\n  \"info.release_count\": \"你要生成多少个版本的变更日志？\",\n  \"info.release_count_meta\": \"如果输入 ‘0‘， 则生成全部版本。\",\n  \"info.generating\": \"正在生成变更日志...\",\n  \"placeholder.select.workspace\": \"选择工作空间以生成变更日志\",\n  \"validator.interger\": \"请输入一个整数\"\n}\n"
  },
  {
    "path": "package.nls.zh-tw.json",
    "content": "{\n  \"cmd.generate.title\": \"生成變更日誌\",\n  \"info.select_preset\": \"请选择一种预设风格\",\n  \"info.output_unreleased\": \"是否包含未發布的變更日誌？\",\n  \"info.release_count\": \"你要生成多少個版本的變更日誌？\",\n  \"info.release_count_meta\": \"如果輸入 ‘0‘， 則生成全部版本。\",\n  \"info.generating\": \"正在生成變更日誌...\",\n  \"placeholder.select.workspace\": \"選擇工作空間以生成變更日誌\",\n  \"validator.interger\": \"請輸入一個整數\"\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ]\n}\n"
  },
  {
    "path": "src/index.ts",
    "content": "import VSCODE = require(\"vscode\");\nimport * as path from \"path\";\nimport * as execa from \"execa\";\nimport { init, localize } from \"vscode-nls-i18n\";\n\nenum Preset {\n  Angular = \"angular\",\n  Atom = \"atom\",\n  CodeMirror = \"codemirror\",\n  Ember = \"ember\",\n  Eslint = \"eslint\",\n  Express = \"express\",\n  JQuery = \"jquery\",\n  JsCs = \"jscs\",\n  JsHint = \"jshint\"\n}\n\ntype IConfig = {\n  preset: Preset;\n  releaseCount: number;\n  outputUnreleased: boolean;\n};\n\nexport function activate(context: VSCODE.ExtensionContext) {\n  const vs: typeof VSCODE = require(\"vscode\");\n  init(context.extensionPath);\n\n  async function prickWorkspace(): Promise<VSCODE.WorkspaceFolder | undefined> {\n    const workspaces = vs.workspace.workspaceFolders;\n    if (!workspaces) {\n      return;\n    }\n    if (workspaces.length === 1) {\n      return workspaces[0];\n    }\n    if (workspaces.length > 1) {\n      return vs.window.showWorkspaceFolderPick({\n        placeHolder: localize(\"placeholder.select.workspace\")\n      });\n    }\n\n    return;\n  }\n\n  async function generate(cwd: string, config: IConfig) {\n    const cli = path.join(\n      context.extensionPath,\n      \"node_modules\",\n      \"conventional-changelog-cli\",\n      \"cli.js\"\n    );\n\n    const args = [\n      cli,\n      \"--preset\",\n      config.preset,\n      \"--release-count\",\n      config.releaseCount + \"\",\n      config.outputUnreleased ? \"--output-unreleased\" : \"\"\n    ].filter(v=> v);\n\n    const changelog = await vs.window.withProgress(\n      {\n        location: vs.ProgressLocation.Notification,\n        title: localize(\"info.generating\")\n      },\n      async (progress, token) => {\n        try {\n          const { all } = await execa(process.execPath, args, {\n            cwd,\n            all: true,\n            preferLocal: true,\n            execPath: process.execPath\n          });\n\n          return all;\n        } catch (err) {\n          console.error(err)\n          throw new Error(err.message)\n        }\n      }\n    );\n\n    if (changelog) {\n      const document = await vs.workspace.openTextDocument({\n        language: \"markdown\",\n        content: changelog\n      });\n\n      vs.window.showTextDocument(document);\n    }\n  }\n\n  context.subscriptions.push(\n    vs.commands.registerCommand(\"changelog.generate\", async () => {\n      const workspaceFolder = await prickWorkspace();\n\n      if (!workspaceFolder) {\n        return;\n      }\n\n      const workspacePath = workspaceFolder.uri.fsPath;\n\n      let currentStep = 1;\n      const totalSteps = 3;\n\n      const preset: Preset = await new Promise(resolve => {\n        const quickPick = vs.window.createQuickPick();\n        quickPick.title = localize(\"info.select_preset\");\n        quickPick.step = currentStep;\n        quickPick.totalSteps = totalSteps;\n\n        quickPick.items = [\n          Preset.Angular,\n          Preset.Atom,\n          Preset.CodeMirror,\n          Preset.Ember,\n          Preset.Eslint,\n          Preset.Express,\n          Preset.JQuery,\n          Preset.JsCs,\n          Preset.JsHint\n        ].map(v => {\n          return {\n            label: v\n          };\n        });\n\n        quickPick.onDidChangeSelection(selection => {\n          currentStep = quickPick.step = (quickPick.step as number) + 1;\n          quickPick.hide();\n\n          resolve(selection[0].label as Preset);\n        });\n\n        quickPick.onDidHide(() => quickPick.dispose());\n\n        quickPick.show();\n      });\n\n      const outputUnreleased: boolean = await new Promise(resolve => {\n        const quickPick = vs.window.createQuickPick();\n        quickPick.title = localize(\"info.output_unreleased\");\n        quickPick.step = currentStep;\n        quickPick.totalSteps = totalSteps;\n\n        quickPick.items = [\"Yes\", \"No\"].map(v => {\n          return {\n            label: v\n          };\n        });\n\n        quickPick.onDidChangeSelection(selection => {\n          currentStep = quickPick.step = (quickPick.step as number) + 1;\n          quickPick.hide();\n\n          resolve(selection[0].label === \"Yes\" ? true : false);\n        });\n\n        quickPick.onDidHide(() => quickPick.dispose());\n\n        quickPick.show();\n      });\n\n      const releaseCount: number = await new Promise(resolve => {\n        const input = vs.window.createInputBox();\n        input.title = localize(\"info.release_count\");\n        input.step = currentStep;\n        input.totalSteps = totalSteps;\n        input.value = \"0\";\n        input.show();\n        input.prompt = localize(\"info.release_count_meta\");\n\n        input.onDidChangeValue(() => {\n          input.validationMessage = undefined;\n        });\n\n        input.onDidAccept(() => {\n          const val = +input.value;\n\n          if (isNaN(val)) {\n            input.validationMessage = localize(\"validator.interger\");\n            return;\n          }\n\n          input.hide();\n          resolve(+input.value);\n        });\n\n        input.onDidHide(() => input.dispose());\n      });\n\n      await generate(workspacePath, {\n        preset,\n        releaseCount,\n        outputUnreleased\n      });\n    })\n  );\n}\n"
  },
  {
    "path": "src/test/extension.test.ts",
    "content": "//\n// Note: This example test is leveraging the Mocha test framework.\n// Please refer to their documentation on https://mochajs.org/ for help.\n//\n\n// The module 'assert' provides assertion methods from node\nimport * as assert from \"assert\";\n\n// You can import and use all API from the 'vscode' module\n// as well as import your extension to test it\n// import * as vscode from 'vscode';\n// import * as myExtension from '../extension';\n\n// Defines a Mocha test suite to group tests of similar kind together\nsuite(\"Extension Tests\", () => {\n  // Defines a Mocha unit test\n  test(\"Something 1\", () => {\n    assert.equal(-1, [1, 2, 3].indexOf(5));\n    assert.equal(-1, [1, 2, 3].indexOf(0));\n  });\n});\n"
  },
  {
    "path": "src/test/index.ts",
    "content": "//\n// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING\n//\n// This file is providing the test runner to use when running extension tests.\n// By default the test runner in use is Mocha based.\n//\n// You can provide your own test runner if you want to override it by exporting\n// a function run(testRoot: string, clb: (error:Error) => void) that the extension\n// host can call to run the tests. The test runner is expected to use console.log\n// to report the results back to the caller. When the tests are finished, return\n// a possible error to the callback or null if none.\n\nimport * as testRunner from \"vscode/lib/testrunner\";\n\n// You can directly control Mocha options by uncommenting the following lines\n// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info\ntestRunner.configure({\n  ui: \"tdd\", // the TDD UI is being used in extension.test.ts (suite, test, etc.)\n  useColors: true // colored output from test results\n});\n\nmodule.exports = testRunner;\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"target\": \"es6\",\n    \"outDir\": \"out\",\n    \"lib\": [\"es6\"],\n    \"sourceMap\": true,\n    \"rootDir\": \"src\",\n    /* Strict Type-Checking Option */\n    \"strict\": true /* enable all strict type-checking options */,\n    /* Additional Checks */\n    \"noUnusedLocals\": true /* Report errors on unused locals. */\n    // \"noImplicitReturns\": true, /* Report error when not all code paths in function return a value. */\n    // \"noFallthroughCasesInSwitch\": true, /* Report errors for fallthrough cases in switch statement. */\n    // \"noUnusedParameters\": true,  /* Report errors on unused parameters. */\n  },\n  \"exclude\": [\"node_modules\", \".vscode-test\"]\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"extends\": [\"tslint:latest\", \"tslint-config-prettier\"],\n  \"rules\": {\n    \"object-literal-sort-keys\": false,\n    \"ordered-imports\": false,\n    \"member-ordering\": false,\n    \"no-unused-variable\": true,\n    \"no-var-requires\": false,\n    \"no-implicit-dependencies\": false,\n    \"max-classes-per-file\": false,\n    \"no-submodule-imports\": false,\n    \"no-console\": false,\n    \"no-this-assignment\": false\n  }\n}\n"
  }
]