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

chore: set symlink_node_modules to False in examples/from_source #3212

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)