From 50493db0900ecbe06452404b73675fa846153b2c Mon Sep 17 00:00:00 2001 From: Wassim Chegham Date: Tue, 26 Mar 2019 15:56:12 +0100 Subject: [PATCH] Update to nodejs rules 0.31.1 nodejs_binary entry_point is now a label --- README.md | 4 ---- WORKSPACE | 3 --- package.bzl | 4 ++-- sass/BUILD | 2 +- sass/sass_repositories.bzl | 5 ++++- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e674321..5a1d8f9 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,6 @@ rules_sass_dependencies() # Setup repositories which are needed for the Sass rules. load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories") sass_repositories() - -# Setup the NodeJS toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") -node_repositories() ``` ## Basic Example diff --git a/WORKSPACE b/WORKSPACE index ec2ee74..c586976 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,9 +5,6 @@ load("//:package.bzl", "rules_sass_dependencies", "rules_sass_dev_dependencies") rules_sass_dependencies() rules_sass_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") -node_repositories() - load("//:defs.bzl", "sass_repositories") sass_repositories() diff --git a/package.bzl b/package.bzl index a4cdf68..f79d027 100644 --- a/package.bzl +++ b/package.bzl @@ -26,8 +26,8 @@ def rules_sass_dependencies(): _include_if_not_defined( http_archive, name = "build_bazel_rules_nodejs", - url = "https://github.com/bazelbuild/rules_nodejs/releases/download/0.30.1/rules_nodejs-0.30.1.tar.gz", - sha256 = "abcf497e89cfc1d09132adfcd8c07526d026e162ae2cb681dcb896046417ce91", + sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"], ) # Dependencies from the NodeJS rules. We don't want to use the "package.bzl" dependency macro diff --git a/sass/BUILD b/sass/BUILD index 94aaea1..d962fd8 100644 --- a/sass/BUILD +++ b/sass/BUILD @@ -10,7 +10,7 @@ exports_files([ # Executable for the sass_binary rule nodejs_binary( name = "sass", - entry_point = "sass/sass.js", + entry_point = "@build_bazel_rules_sass_deps//node_modules/sass:sass.js", install_source_map_support = False, data = [ "@build_bazel_rules_sass_deps//sass", diff --git a/sass/sass_repositories.bzl b/sass/sass_repositories.bzl index c4bc68f..7c37f9f 100644 --- a/sass/sass_repositories.bzl +++ b/sass/sass_repositories.bzl @@ -14,12 +14,15 @@ "Install Sass toolchain dependencies" -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install", "check_rules_nodejs_version") def sass_repositories(): """Set up environment for Sass compiler. """ + # 0.31.1: entry_point attribute of rules_nodejs is now a label + check_rules_nodejs_version("0.31.1") + yarn_install( name = "build_bazel_rules_sass_deps", package_json = "@io_bazel_rules_sass//sass:package.json",