GithubHelp home page GithubHelp logo

lugtag-h1 / package-json-validator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from expediagroup/package-json-validator

0.0 0.0 0.0 647 KB

A Github Action for validating package.json conventions.

License: Apache License 2.0

Shell 0.31% TypeScript 99.69%

package-json-validator's Introduction

Release

package-json-validator

A Github Action for validating package.json conventions.

Usage

Use the rules input to specify one or more rules you would like to check for your package.json.

Ranges

The "ranges" rule validates that all package.json dependencies are exact versions, or use only the allowed version ranges specified. Click here for details about version ranges.

The following usage would allow "my-package": "1.2.3" but prevent "my-package": "^1.2.3".

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: ranges

You can also specify allowed-ranges. The following would allow "my-package": "^1.2.3" but prevent "my-package": "~1.2.3".

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: ranges
      allowed-ranges: ^

Tags

The "tags" rule validates that all package.json dependencies contain no tagged versions, or use only the allowed tags specified. Click here for details about tags.

The following usage would allow "my-package": "1.2.3" but prevent "my-package": "1.2.3-alpha.456.0".

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: tags

The following usage would allow "my-package": "1.2.3-canary.456.0" but prevent "my-package": "1.2.3-alpha.456.0".

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: tags
      allowed-tags: canary

Specify dependency-types to denote which type of package.json dependencies you wish to validate. Valid options include dependencies, devDependencies, peerDependencies, and optionalDependencies. Defaults to dependencies.

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: ranges
      dependency-types: devDependencies

Other Usages

You may also enforce multiple rules (and pass additional inputs) like this:

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - uses: ExpediaGroup/package-json-validator@v1
    with:
      rules: |
        ranges
        tags
      allowed-ranges: |
        ^
        *
      allowed-tags: |
        alpha
        canary
      dependency-types: |
        dependencies
        devDependencies

Contact

This project is part of Expedia Group Open Source but also maintained by Dan Adajian

License

The scripts and documentation in this project are released under the Apache 2 License.

Contributions

  • Follow semantic-release commit formatting. See CONTRIBUTING.md for details.

package-json-validator's People

Contributors

dependabot[bot] avatar danadajian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.