Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit d5ab394

Browse files
authored
Yarn install instructions (#642)
* document yarn setup workaround - Move setup instructions lower (most users will just be installing this from npm, so they don't need to know about bazel). - Document current workaround for setup. See bazel-contrib/rules_nodejs#46 . * Simplify one-time setup Use the same approach as bazel-run.sh to avoid occupying the bazel server
1 parent 2bab75e commit d5ab394

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ jobs:
88
- checkout
99
- restore_cache:
1010
key: tsickle-{{ checksum "yarn.lock" }}
11-
- run: yarn install # don't bazel's yarn, since yarn install calls bazel, and bazel can't reenter
11+
# Don't lock the bazel server, so that yarn can call bazel again
12+
- run: bazel run @yarn//:yarn --script_path=yarn_install.sh && ./yarn_install.sh
1213
- run: bazel build ...
1314
- save_cache:
1415
key: tsickle-{{ checksum "yarn.lock" }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99

1010
# Bazel working directories
1111
/bazel-*
12+
13+
# See reference to this file in the README.md
14+
yarn_install.sh

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ builds that are seen outside of Google.
3131
We would like to make tsickle usable for everyone but right now if you'd like
3232
to try it you should expect to spend some time debugging and reporting bugs.
3333

34-
## Installation
35-
36-
- Execute `npm i` to install the dependencies.
37-
3834
## Usage
3935

4036
### Project Setup
@@ -102,6 +98,16 @@ Example:
10298

10399
## Development
104100

101+
### One-time setup
102+
103+
Run `bazel run @yarn//:yarn --script_path=yarn_install.sh && ./yarn_install.sh`
104+
to install the dependencies.
105+
106+
> This avoids occupying the `bazel` server, so that `yarn` can call `bazel`
107+
> again.
108+
> Ideally we should just use `bazel-run.sh @yarn//:yarn`, see
109+
> https://stackoverflow.com/questions/47082298/how-can-users-get-bazel-run-sh
110+
105111
### Test commands
106112

107113
- `ibazel test test:unit_test` executes the unit tests in watch mode (use `bazel test test:unit_test` for a

0 commit comments

Comments
 (0)