Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with npm_deploy rule #267

Open
jon-whit opened this issue Nov 2, 2020 · 2 comments
Open

Help with npm_deploy rule #267

jon-whit opened this issue Nov 2, 2020 · 2 comments

Comments

@jon-whit
Copy link

jon-whit commented Nov 2, 2020

First off, thanks for this awesome library of bazel rules. It's been a huge help!

I'm trying to get an npm artifact published to an npm Artifactory registry. Here's what my rules look like:

nodejs_grpc_library(
    name = "pubsub_nodejs_grpc",
    deps = ["//protos/eventhub/pubsub/v1alpha1:pubsub_proto"],
)

load("@graknlabs_bazel_distribution//npm:rules.bzl", "deploy_npm", "assemble_npm")
assemble_npm(
    name = "npm_assemble_pubsub_nodejs",
    target = ":pubsub_nodejs_grpc"
)

deploy_npm(
    name = "npm_deploy_pubsub_nodejs",
    target = "npm_assemble_pubsub_nodejs",
    deployment_properties = "//:deployment.properties"
)

when I run bazel run //...:npm_deploy_pubsub_nodejs -- release the error I get is this:

ERROR: /.../BUILD.bazel:96:11: every rule of type deploy_npm implicitly depends upon the target '@nodejs//:bin/npm', but this target could not be found because of: no such target '@nodejs//:bin/npm': target 'bin/npm' not declared in package '' defined by /.../external/nodejs/BUILD.bazel

Does anyone have any good examples of how to do this with npm? I'm not sure how to best get the target @nodejs//:bin/npm to resolve.

@lolski
Copy link
Member

lolski commented Jun 16, 2022

Apologies for having missed this issue. We are using this rule in our NodeJS client release pipeline.

Therefore, if you have a look at how we declare deploy_npm target in this BUILD file, as well as looking at how we declare all the dependencies in the WORKSPACE file you should have full information on how to make it work on your end.

@alexjpwalker
Copy link
Member

Hi @jon-whit . Were you able to get deploy_npm working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants