Commit 43cebe7
fix(builtin): fix for symlinked node_modules issue bazel-contrib#802
This will fix the bazel-contrib#802 case of deleting and manually re-creating node_modules by no longer writing any files under node_modules.
A few keys caveats:
1. The downside of this is that the root @npm BUILD file grows huge again as all files under node_modules need to be added to exports_files([...]). If Bazel had a method to export all files without explicitly listing them such as exports_files_all() that would solve this problem.
2. npm package that ships with BUILD files would now cause issues with labels used by yarn_install & npm_install generated targets. With this change, packages such as @bazel/typescript which install bazel workspaces now ship with _BUILD.bazel files. The bazel workspaces installer is already looking for files of this name since the current repo rule renames BUILD files for the same reason.
To solve (2), I propose publishing a tool that could be added as a postinstall step to rename all BUILD files under node_modules and prefix them with _. This should not be a common case as most npm packages don't ship with BUILD files but there are a few that do. For example, rxjs < 6.5.0 had build files for a few releases to support building it from source.1 parent 08b231a commit 43cebe7
File tree
65 files changed
+10556
-6044
lines changed- docs/node
- e2e
- bazel_bin
- karma_typescript
- ts_devserver
- ts_library
- googmodule
- examples/protocol_buffers
- internal
- e2e
- fine_grained_deps
- npm
- yarn
- packages
- history-server
- http-server
- node
- npm_install
- test
- golden
- @angular/core
- @gregmagolan
- test-a
- bin
- test-b
- ajv
- jasmine
- bin
- node_modules
- @angular/core
- @gregmagolan
- test-a
- test-b
- ajv
- jasmine
- rxjs
- unidiff
- zone.js
- rxjs
- unidiff
- zone.js
- npm_package
- rollup
- packages
- jasmine
- src
- test
- karma
- typescript
- internal
- devserver
- protobufjs
- scripts
- tools/npm_packages/bazel_workspaces
- a
- subdir
- b
- subdir
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
65 files changed
+10556
-6044
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | 172 | | |
182 | 173 | | |
183 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
| 594 | + | |
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments