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