rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

pkg_npm substitutions overrides substitution value with stamp

Open kormide opened this issue 3 years ago • 1 comments

🐞 bug report

Affected Rule

The issue is caused by the rule: pkg_npm

Is this a regression?

No

Description

If a stamp is used, pkg_npm replaces the whole substitution value with the stamp.

🔬 Minimal Reproduction

pkg_npm(
    ...
    substitutions = {
        "\"foobar\": \"0.0.0-PLACEHOLDER\"": "\"foobar\": \"{BUILD_SCM_VERSION}\""
    }
)

If BUILD_SCM_VERSION is 1.2.3, the substitution becomes:

1.2.3

rather than

"foobar": "1.2.3"

packager.js appears to replace the entire value with the value of {BUILD_SCM_VERSION} rather than substituting the stamp into the provided value.

🌍 Your Environment

Operating System:

  
  macOS Monterey 12.0.1
  

Output of bazel version:

  
  4.2.2
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
  4.6.0
  

Anything else relevant?

kormide avatar Jan 11 '22 23:01 kormide

This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

github-actions[bot] avatar Jul 14 '22 03:07 github-actions[bot]

This issue was automatically closed because it went 30 days without any activity since it was labeled "Can Close?"

github-actions[bot] avatar Aug 14 '22 03:08 github-actions[bot]