Skip to content

Commit 1cb93ce

Browse files
nouraellmAndrewKushnir
authored andcommitted
docs: highlight scripts in markdown (angular#47778)
This PR highlights all lines of code/cmds/error messages by specifying the use language PR Close angular#47778
1 parent b0318f8 commit 1cb93ce

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

docs/BAZEL.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Contact Alex Eagle with questions.
190190
If a build seems slow you can use Bazel to diagnose where time is spent.
191191

192192
The first step is to generate a profile of the build using the `--profile filename_name.profile` flag.
193-
```
193+
```sh
194194
yarn bazel build //packages/compiler --profile filename_name.profile
195195
```
196196

@@ -199,20 +199,20 @@ This will generate a `filename_name.profile` that you can then analyse using [an
199199
## Using the console profile report
200200

201201
You can obtain a simple report directly in the console by running:
202-
```
202+
```sh
203203
yarn bazel analyze-profile filename_name.profile
204204
```
205205

206206
This will show the phase summary, individual phase information and critical path.
207207

208208
You can also list all individual tasks and the time they took using `--task_tree`.
209-
```
209+
```sh
210210
yarn bazel analyze-profile filename_name.profile --task_tree ".*"
211211
```
212212

213213
To show all tasks that take longer than a certain threshold, use the `--task_tree_threshold` flag.
214214
The default behavior is to use a 50ms threshold.
215-
```
215+
```sh
216216
yarn bazel analyze-profile filename_name.profile --task_tree ".*" --task_tree_threshold 5000
217217
```
218218

@@ -225,15 +225,15 @@ Compiling TypeScript shows as:
225225

226226
To filter all tasks by TypeScript compilations that took more than 5 seconds, use:
227227

228-
```
228+
```sh
229229
yarn bazel analyze-profile filename_name.profile --task_tree "Compiling TypeScript" --task_tree_threshold 5000
230230
```
231231

232232
### Using the HTML profile report
233233

234234
A more comprehensive way to visualize the profile information is through the HTML report:
235235

236-
```
236+
```sh
237237
yarn bazel analyze-profile filename_name.profile --html --html_details --html_histograms
238238
```
239239

@@ -283,15 +283,13 @@ e.g: `yarn bazel test packages/core/test/bundling/forms:symbol_test`
283283
#### mkdir missing
284284
If you see the following error::
285285
```
286-
287286
ERROR: An error occurred during the fetch of repository 'npm':
288287
Traceback (most recent call last):
289288
File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 618, column 15, in _yarn_install_impl
290289
_copy_file(repository_ctx, repository_ctx.attr.package_json)
291290
File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 345, column 17, in _copy_file
292291
fail("mkdir -p %s failed: \nSTDOUT:\n%s\nSTDERR:\n%s" % (dirname, result.stdout, result.stderr))
293292
Error in fail: mkdir -p _ failed:
294-
295293
```
296294
The `msys64` library and associated tools (like `mkdir`) are required to build Angular.
297295

@@ -301,18 +299,17 @@ After that, a `git clean -xfd`, `yarn`, and `yarn build` should resolve this iss
301299

302300
### Xcode
303301

304-
If you see the following error:
302+
If running `yarn bazel build packages/...` returns the following error:
305303

306304
```
307-
$ yarn bazel build packages/...
308305
ERROR: /private/var/tmp/[...]/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL
309306
ERROR: Analysis of target '//packages/core/test/render3:render3' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
310307
```
311308

312309
It might be linked to an interaction with VSCode.
313310
If closing VSCode fixes the issue, you can add the following line to your VSCode configuration:
314311

315-
```
312+
```json
316313
"files.exclude": {"bazel-*": true}
317314
```
318315

@@ -322,7 +319,7 @@ If VSCode is not the root cause, you might try:
322319

323320
- Quit VSCode (make sure no VSCode is running).
324321

325-
```
322+
```sh
326323
bazel clean --expunge
327324
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
328325
sudo xcodebuild -license

docs/CARETAKER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tool will automatically merge it based on the applied target label.
1717

1818
To merge a PR run:
1919

20-
```
20+
```sh
2121
$ yarn ng-dev pr merge <pr number>
2222
```
2323

0 commit comments

Comments
 (0)