Skip to content

Commit

Permalink
chore: set symlink_node_modules to False in examples/from_source
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jan 11, 2022
1 parent fa84c43 commit a6f0567
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 2 additions & 5 deletions examples/from_source/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
workspace(
name = "from_source",
managed_directories = {"@npm": ["node_modules"]},
)
workspace(name = "from_source")

# In your code, you'd fetch this repository with a `git_repository` call.
# We do this local repository only because this example lives in the same
Expand Down Expand Up @@ -38,7 +35,6 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install

node_repositories(
node_version = "12.13.0",
package_json = ["//:package.json"],
yarn_version = "1.19.1",
)

Expand All @@ -47,5 +43,6 @@ yarn_install(
exports_directories_only = True,
package_json = "//:package.json",
strict_visibility = True,
symlink_node_modules = False,
yarn_lock = "//:yarn.lock",
)
9 changes: 4 additions & 5 deletions examples/from_source/index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@

load("@build_bazel_rules_nodejs//packages/typescript:index.bzl", "ts_project")

def custom_ts_project(name, deps = [], **kwargs):
def custom_ts_project(name, **kwargs):
"""
Helper wrapper around ts_project adding default attributes and dependencies
Args:
name: The name that should be given the this rule
deps: A list of dependencies for this rule
kwargs: All other attrs are passed to ts_project
**kwargs: All other attrs are passed to ts_project
"""

ts_project(
name = name,
tsconfig = "tsconfig.json",
deps = [
deps = kwargs.pop("deps", []) + [
"@npm//tsutils",
"@npm//@types/node",
] + deps,
],
validate = False,
**kwargs
)

0 comments on commit a6f0567

Please sign in to comment.