angular / angular/dev-infra

Provide common workspace setup

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
domain: build effort: massive repo: cli repo: components repo: framework
Dominant language
JavaScript
Stars
77
Forks
83
Avg merge
2d 5h
Merged PRs (30d)
37

Description

Provide a common importable function to setup the `WORKSPACE` for downstream repositories, retrieving necessary dependencies and setting up things like node modules.

This would allow us to sychronize the versions of node and rules_nodejs being used by repositories.

Before:
```py
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "5c40083120eadec50a3497084f99bc75a85400ea727e82e0b2f422720573130f",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-beta.0/rules_nodejs-4.0.0-beta.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")

node_repositories(
node_repositories = {
"14.17.0-darwin_amd64": ("node-v14.17.0-darwin-x64.tar.gz", "node-v14.17.0-darwin-x64", "7b210652e11d1ee25650c164cf32381895e1dcb3e0ff1d0841d8abc1f47ac73e"),
"14.17.0-linux_amd64": ("node-v14.17.0-linux-x64.tar.xz", "node-v14.17.0-linux-x64", "494b161759a3d19c70e3172d33ce1918dd8df9ad20d29d1652a8387a84e2d308"),
"14.17.0-windows_amd64": ("node-v14.17.0-win-x64.zip", "node-v14.17.0-win-x64", "6582a7259c433e9f667dcc4ed3e5d68bc514caba2eed40e4626c8b4c7e5ecd5c"),
},
node_version = "14.17.0",
)

yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
```

After:
```py
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "angular-dev-infra",
sha256 = "...",
urls = ["https://github.com/angular/dev-infra-private-builds/..."],
)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the WORKSPACE example and the referenced package.json and yarn.lock inputs, then trace how downstream repositories currently load rules_nodejs, node_repositories, and yarn_install. Done means downstream repositories can import one shared workspace setup and synchronize their Node and rules_nodejs versions without repeating the shown configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.