Skip to content

[fix] Pfelement dependency should be pinned for all elements. #1780

@heyMP

Description

@heyMP

Description of the issue

Our components do not currently point to a pinned version of pfelement in their dependencies. They point to the latest minor release. In other words, they use a carrot(^) when defining the dependency. What you end up with is that there will be a chance that you end up with a version mismatch between the element and pfelement.

For example

  "dependencies": {
    "@patternfly/pfe-card": "1.10.0"
  },

Will result in the following packages being installed:

    "node_modules/@patternfly/pfe-card": {
      "version": "1.10.0",
      "resolved": "https://registry.npmjs.org/@patternfly/pfe-card/-/pfe-card-1.10.0.tgz",
      "integrity": "sha512-/RETcKoE+LGUQRQ80GbJ7IVQxRZ3UU81Apl9NAQNIrrcKEXoQaoQAilv6uQQ2oaXzLvo9HWFvhuTVqDNJcUmYA==",
      "dependencies": {
        "@patternfly/pfelement": "^1.10.0"
      },
      "engines": {
        "node": ">=10 <13"
      }
    },
    "node_modules/@patternfly/pfelement": {
      "version": "1.11.1",
      "resolved": "https://registry.npmjs.org/@patternfly/pfelement/-/pfelement-1.11.1.tgz",
      "integrity": "sha512-qy4saYS+YCecmYzdlp+JJX3PfFg/ksQHblr0MpYKhOueR/KsGm/tjCYoqbyRMqRd4eK+PJf9t1p0506j3ZOAZw==",
      "engines": {
        "node": ">=10 <13"
      }
    },

Steps to reproduce

  1. Create a fresh directory
  2. cd into the directory and run npm init -y to create a package.json file.
  3. Run npm i --save @patternfly/[email protected]
  4. Check package-lock.json and verify that @patternfly/pfelement is at version 1.11.1

Proposed Solution

We should pin the @patternfly/pfelement dependency to the save version as the component. This will prevent version mismatches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions