包详细信息

package-version-git-tag

sounisi50113.8kMIT3.0.0

Add Git tag corresponding to the version field of package.json

cli, git, git-tag, package

自述文件

package-version-git-tag

Go to the latest release page on npm License: MIT Supported Node.js version: 10.x || 12.x || 14.x Minified Bundle Size Details Install Size Details Dependencies Status Build Status Maintainability Status

Add Git tag corresponding to the version field of package.json.

Install

npm install --save-dev package-version-git-tag

Usage

$ package-version-git-tag --help
package-version-git-tag v3.0.0

Add Git tag corresponding to the version field of package.json

Usage:
  $ package-version-git-tag [options]

Options:
  -V, -v, --version  Display version number 
  -h, --help         Display this message 
  --push             `git push` the added tag to the remote repository 
  --verbose          show details of executed git commands 
  -n, --dry-run      perform a trial run with no changes made

For example, suppose that package.json exists in the current directory, and version is 1.2.3:

{
    "name": "my-awesome-package",
    "version": "1.2.3",
    ...
}

In this case, this command is:

package-version-git-tag

Equivalent to this operation:

$ git tag v1.2.3 -m 1.2.3

If you add the --push flag, it will also run git push. That is, this command is:

package-version-git-tag --push

Equivalent to this operation:

$ git tag v1.2.3 -m 1.2.3
$ git push origin v1.2.3

Customize tag name format

If you want to customize the tag name format, you can take the following steps:

  • If you are execute this command with yarn, change the version-tag-prefix setting of yarn. This can be achieved by executing the following command:

    # Set the tag prefix to "foo-bar-"
    yarn config set version-tag-prefix foo-bar-
    

    Another way is to create the .yarnrc file:

    .yarnrc

    # Set the tag prefix to "foo-bar-"
    version-tag-prefix foo-bar-
    

    Note: Currently, Yarn 2 is not supported.

  • Otherwise, change the tag-version-prefix setting of npm. This can be achieved by executing the following command:

    # Set the tag prefix to "foo-bar-"
    npm config set tag-version-prefix foo-bar-
    

    Another way is to create the .npmrc file:

    .npmrc

    ; Set the tag prefix to "foo-bar-"
    tag-version-prefix = "foo-bar-"
    

Tests

To run the test suite, first install the dependencies, then run npm test:

npm install
npm test

Change Log

see CHANGELOG.md

Contributing

see CONTRIBUTING.md

Related

更新日志

Change Log

Unreleased

3.0.0 (2020-06-02 UTC)

  • Drop support for Node.js 8, 9, 11 and 13
  • Don't pin non-dev dependencies
  • Update dev dependencies

Supported Node version

8.3.0 - 14.x -> 10.x || 12.x || 14.x

  • #138 - Omit unsupported Node.js

Documentation

  • #140 - Update markdown syntax
  • #142 - Fix install step in README
  • #143 - Add Change Log section to README

Updated Dependencies

devDependencies

  • @types/cross-spawn
    • #133 - 6.0.1 -> 6.0.2
  • @typescript-eslint/eslint-plugin
    • #129 - 2.30.0 -> 2.34.0
  • @typescript-eslint/parser
    • #129 - 2.30.0 -> 2.34.0
  • del-cli
    • #134 - 3.0.0 -> 3.0.1
  • lint-staged
    • #127 - 10.2.0 -> 10.2.7
  • sort-package-json
    • #127 - 1.42.1 -> 1.44.0
  • ts-node
    • #128 - 8.9.1 -> 8.10.2
  • typescript
    • #131 - 3.8.3 -> 3.9.3

Added Dependencies

devDependencies

  • #137 - @sounisi5011/readme-generator@0.0.2
  • #137 - check-peer-deps@1.1.3
  • #137 - patch-package@6.2.2

Removed Dependencies

devDependencies

  • #137 - @sounisi5011/check-peer-deps

Tests

  • #146 - Fix error handling of Git.listen() method in node-git-server

Others

  • #136 - Pin only devDependencies
  • #137 - Change project file structure
  • #139 - Enable compilerOptions.inlineSources
  • #141 - Update to strict type definition code
  • #144 - Fix patch-package config

2.1.0 (2020-04-30 UTC)

Features

  • #125 - Add -V option

Breaking Changes

  • #125 - Change output format:

    • $ package-version-git-tag --version
      2.0.3
      

      $ package-version-git-tag --version
      package-version-git-tag/2.0.3 darwin-x64 node-v10.18.0
      
    • $ package-version-git-tag --help
      Usage: bin [options]
      
      Add Git tag corresponding to the version field of package.json
      
      Options:
        -v, --version  output the version number
        --push         `git push` the added tag to the remote repository
        --verbose      show details of executed git commands
        -n, --dry-run  perform a trial run with no changes made
        -h, --help     display help for command
      

      $ package-version-git-tag --help
      package-version-git-tag v2.0.3
      
      Add Git tag corresponding to the version field of package.json
      
      Usage:
        $ package-version-git-tag [options]
      
      Options:
        -V, -v, --version  Display version number 
        -h, --help         Display this message 
        --push             `git push` the added tag to the remote repository 
        --verbose          show details of executed git commands 
        -n, --dry-run      perform a trial run with no changes made
      
    • $ package-version-git-tag --typo-option
      error: unknown option '--typo-option'
      

      $ package-version-git-tag --typo-option
      unknown option: --typoOption
      Try `package-version-git-tag --help` for valid options.
      

Supported Node version

>=8.3.0 -> 8.3.0 - 14.x

  • #122 - Support Node.js 14

Updated Dependencies

devDependencies

  • @typescript-eslint/eslint-plugin
    • #121 - 2.29.0 -> 2.30.0
  • @typescript-eslint/parser
    • #121 - 2.29.0 -> 2.30.0
  • eslint-config-prettier
    • #121 - 6.10.1 -> 6.11.0
  • eslint-plugin-simple-import-sort
    • #121 - 5.0.2 -> 5.0.3
  • lint-staged
    • #120 - 10.1.7 -> 10.2.0
  • make-dir
    • #123 - 3.0.2 -> 3.1.0
  • prettier
    • #120 - 2.0.4 -> 2.0.5
  • sort-package-json
    • #120 - 1.42.0 -> 1.42.1
  • ts-node
    • #123 - 8.9.0 -> 8.9.1

Added Dependencies

dependencies

Removed Dependencies

dependencies

2.0.3 (2020-04-21 UTC)

  • Update dependencies
  • Downgrade supported Node version

Supported Node version

>=8.10.0 -> >=8.3.0

  • #92 - Downgrade supported Node version

Updated Dependencies

dependencies

  • commander
    • #112 - 4.0.1 -> 5.0.0
  • cross-spawn
    • #115 - 7.0.1 -> 7.0.2

devDependencies

  • @typescript-eslint/eslint-plugin
    • #103 - 2.7.0 -> 2.29.0
  • @typescript-eslint/parser
    • #103 - 2.7.0 -> 2.29.0
  • eslint
    • #103 - 6.6.0 -> 6.8.0
  • eslint-config-prettier
    • #103 - 6.5.0 -> 6.10.1
  • eslint-config-standard
    • #103 - 14.1.0 -> 14.1.1
  • eslint-plugin-import
    • #103 - 2.18.2 -> 2.20.2
  • eslint-plugin-node
    • #106 - 10.0.0 -> 11.1.0
  • eslint-plugin-prettier
    • #103 - 3.1.1 -> 3.1.3
  • eslint-plugin-simple-import-sort
    • #106 - 4.0.0 -> 5.0.2
  • git-branch-is
    • #104 - 3.0.0 -> 3.1.0
  • husky
    • #109 - 3.0.9 -> 4.2.5
  • lint-staged
    • #109 - 9.4.2 -> 10.1.6
    • #117 - 10.1.6 -> 10.1.7
  • make-dir
    • #105 - 3.0.0 -> 3.0.2
  • node-git-server
    • #105 - 0.6.0 -> 0.6.1
  • prettier
    • #109 - 1.19.1 -> 2.0.4
  • prettier-package-json
    • #102 - 2.1.0 -> 2.1.3
  • sort-package-json
    • #102 - 1.23.1 -> 1.42.0
  • ts-node
    • #105 - 8.5.0 -> 8.9.0
  • typescript
    • #107 - 3.7.2 -> 3.8.3

Others

  • #101 - Renovate package groups

2.0.2 (2019-11-12 UTC)

Documentation

  • #90 - Fix document

2.0.1 (2019-11-11 UTC)

Documentation

  • #88 - Fix document

2.0.0 (2019-11-11 UTC)

Features

  • #81 - Custom tag prefix
  • #83 - Annotated Git tag
  • #85 - Windows support

Supported Node version

>=8.3.0 -> >=8.10.0

  • #57 - Update dependency eslint to v6.6.0

Documentation

  • #80 - Introduce README generator

Updated Dependencies

dependencies

  • commander
    • #84 - 4.0.0 -> 4.0.1

devDependencies

  • @typescript-eslint/eslint-plugin
    • #86 - 2.6.1 -> 2.7.0
  • @typescript-eslint/parser
    • #86 - 2.6.1 -> 2.7.0
  • eslint
    • #57 - 6.3.0 -> 6.6.0
  • ts-node
    • #82 - 8.4.1 -> 8.5.0

1.2.0 (2019-11-09 UTC)

Features

  • #77 - Add --verbose option
  • #78 - Add --dry-run option

Updated Dependencies

dependencies

  • commander
    • #70 - 3.0.1 -> 4.0.0

devDependencies

  • @types/node
  • @typescript-eslint/eslint-plugin
    • #60 - 2.2.0 -> 2.6.1
  • @typescript-eslint/parser
    • #60 - 2.2.0 -> 2.6.1
  • ava
    • #59 - 2.3.0 -> 2.4.0
  • can-npm-publish
    • #68 - 1.3.1 -> 1.3.2
  • eslint-config-prettier
    • #54 - 6.2.0 -> 6.5.0
  • eslint-plugin-prettier
    • #61 - 3.1.0 -> 3.1.1
  • husky
    • #67 - 3.0.5 -> 3.0.9
  • lint-staged
    • #65 - 9.2.5 -> 9.4.2
  • prettier
    • #72 - 1.18.2 -> 1.19.0
    • #76 - 1.19.0 -> 1.19.1
  • sort-package-json
    • #71 - 1.22.1 -> 1.23.1
  • ts-node
    • #58 - 8.3.0 -> 8.4.1
  • typescript
    • #55 - 3.6.2 -> 3.7.2

Others

  • #73 - Migrate from Travis CI to Azure Pipelines

1.1.2 (2019-09-10 UTC)

Code minifying update: The code included in the package has been minified.

Updated Dependencies

devDependencies

  • @types/node
    • #46 - 12.7.3 -> 12.7.4
  • @typescript-eslint/eslint-plugin
    • #49 - 2.1.0 -> 2.2.0
  • @typescript-eslint/parser
    • #49 - 2.1.0 -> 2.2.0
  • del-cli
    • #48 - 2.0.0 -> 3.0.0
  • eslint-config-prettier
    • #45 - 6.1.0 -> 6.2.0
  • eslint-plugin-node
    • #47 - 9.2.0 -> 10.0.0
  • typescript
    • #38 - 3.5.3 -> 3.6.2

Others

  • #50 - Replace reading of package.json in this package with require() from readJSONFile() function
  • #51 - Change TypeScript output from ES2015 to ES2017
  • #52 - Exclude branches of Git tag indicating package version from CI

1.1.1 (2019-09-02 UTC)

Updated Dependencies

dependencies

  • commander
    • #28 - 2.20.0 -> 3.0.1

devDependencies

  • @types/node
    • #26 - 12.6.9 -> 12.7.3
  • @typescript-eslint/eslint-plugin
    • #30 - 1.13.0 -> 2.0.0
    • #42 - 2.0.0 -> 2.1.0
  • @typescript-eslint/parser
    • #30 - 1.13.0 -> 2.0.0
    • #42 - 2.0.0 -> 2.1.0
  • ava
    • #32 - 2.2.0 -> 2.3.0
  • del
    • #36 - 5.0.0 -> 5.1.0
  • eslint
    • #4 - 5.16.0 -> 6.3.0
  • eslint-config-prettier
    • #33 - 6.0.0 -> 6.1.0
  • eslint-config-standard
    • #34 - 12.0.0 -> 14.1.0
  • eslint-plugin-node
    • #39 - 9.1.0 -> 9.2.0
  • eslint-plugin-standard
    • #35 - 4.0.0 -> 4.0.1
  • git-branch-is
    • #29 - 2.1.0 -> 3.0.0
  • husky
    • #27 - 3.0.2 -> 3.0.5
  • lint-staged
    • #31 - 9.2.1 -> 9.2.5

Removed Dependencies

dependencies

  • #43 - read-pkg

Others

  • #41 - Exclude branches that update packages that cannot be tested with CI

1.1.0 (2019-08-02 UTC)

Features

  • #20 - Add --help option
  • #21 - Add --version option and add CLI description in help

Updated Dependencies

devDependencies

  • @types/node
    • #12 - 12.6.2 -> 12.6.8
    • #22 - 12.6.8 -> 12.6.9
  • @typescript-eslint/eslint-plugin
    • #11 - 1.11.0 -> 1.12.0
    • #16 - 1.12.0 -> 1.13.0
  • @typescript-eslint/parser
    • #11 - 1.11.0 -> 1.12.0
    • #16 - 1.12.0 -> 1.13.0
  • eslint-plugin-import
    • #14 - 2.18.0 -> 2.18.2
  • husky
    • #13 - 3.0.0 -> 3.0.2
  • lint-staged
    • #18 - 9.2.0 -> 9.2.1

Added Dependencies

dependencies

  • #20 - commander@2.20.0
  • #21 - read-pkg@5.2.0

devDependencies

  • #21 - escape-string-regexp@2.0.0

Tests

  • #23 - Use npm's local install for testing

Others

  • #17 - Setting Renovate to follow Emoji Prefix
  • #19 - Setting Renovate to follow Emoji Prefix
  • #23 - Change bin file path: bin/cli.js -> dist/bin.js

1.0.0 (2019-07-12 UTC)