Skip to content

Commit f0fbced

Browse files
jelbournAndrewKushnir
authored andcommitted
docs: update and reorganize contributor docs (angular#56141)
* Move from `docs/` to `contributing-docs/` * Updated file names to better communicate their content * Consolidated content into fewer docs * Updated and/or deleted obsolete info PR Close angular#56141
1 parent 567c2f6 commit f0fbced

25 files changed

+509
-538
lines changed

.pullapprove.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ groups:
925925
conditions:
926926
- >
927927
contains_any_globs(files, [
928-
'docs/PUBLIC_API.md',
929-
'docs/RELEASE_SCHEDULE.md',
928+
'contributing-docs/public-api-surface.md',
930929
'aio/content/guide/npm-packages.md',
931930
'aio/content/guide/browser-support.md',
932931
'aio/content/guide/releases.md',
@@ -1184,8 +1183,8 @@ groups:
11841183
'.ng-dev/**/{*,.*}',
11851184
'.vscode/**/{*,.*}',
11861185
'.yarn/**/{*,.*}',
1187-
'docs/*.md',
1188-
'docs/images/**/{*,.*}',
1186+
'contributing-docs/*.md',
1187+
'contributing-docs/images/**/{*,.*}',
11891188
'goldens/{*,.*}',
11901189
'goldens/public-api/manage.js',
11911190
'modules/{*,.*}',
@@ -1230,7 +1229,6 @@ groups:
12301229
- >
12311230
contains_any_globs(files.exclude("goldens/public-api/manage.js"), [
12321231
'goldens/public-api/**/{*,.*}',
1233-
'docs/NAMING.md',
12341232
'aio/content/guide/angular-package-format.md',
12351233
'aio/content/guide/glossary.md',
12361234
'aio/content/guide/styleguide.md',

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Stack Overflow is a much better place to ask questions since:
3232

3333
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
3434

35-
If you would like to chat about the question in real-time, you can reach out via [our Discord server][discord].
35+
If you would like to chat about the question in real-time, you can reach out via [the Angular community Discord server][discord].
3636

3737

3838
## <a name="issue"></a> Found a Bug?
@@ -138,7 +138,7 @@ If we ask for changes via code reviews then:
138138
git push
139139
```
140140
141-
For more info on working with fixup commits see [here](docs/FIXUP_COMMITS.md).
141+
For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md).
142142
143143
That's it! Thank you for your contribution!
144144

@@ -207,7 +207,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
207207
* All public API methods **must be documented**.
208208
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at **100 characters**.
209209
210-
An automated formatter is available, see [DEVELOPER.md](docs/DEVELOPER.md#formatting-your-source-code).
210+
An automated formatter is available, see [DEVELOPER.md](contributing-docs/building-and-testing-angular#formatting-your-source-code).
211211
212212
213213
## <a name="commit"></a> Commit Message Format
@@ -392,7 +392,7 @@ The following documents can help you sort out issues with GitHub accounts and mu
392392
[coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md
393393
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
394394
[corporate-cla]: https://cla.developers.google.com/about/google-corporate
395-
[dev-doc]: https://github.com/angular/angular/blob/main/docs/DEVELOPER.md
395+
[dev-doc]: ./contributing-docs/building-and-testing-angular.md
396396
[github]: https://github.com/angular/angular
397397
[discord]: https://discord.gg/angular
398398
[individual-cla]: https://cla.developers.google.com/about/google-individual
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<a name="conversation-locking"></a>
2+
3+
# Automatic conversation locking
4+
5+
Closed issues and pull requests are locked automatically after 30 days of inactivity.
6+
7+
## I want to comment on a locked conversation, what should I do?
8+
9+
When an issue has been closed and inactive for over 30 days, the original context is likely
10+
outdated.
11+
If you encounter a similar or related issue in the current version, please open a new issue and
12+
provide up-to-date reproduction instructions.
13+
14+
## Why lock conversations?
15+
16+
Automatically locking closed, inactive issues guides people towards filing new issues with updated
17+
context rather than commenting on a "resolved" issue that contains out-of-date or unrelated
18+
information. As an example, someone may comment "I'm still having this issue", but without
19+
providing any of the additional information the team needs to investigate.
File renamed without changes.

docs/DEVELOPER.md contributing-docs/building-and-testing-angular.md

+47-67
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,27 @@ if you'd like to contribute to Angular.
1919
## Prerequisite Software
2020

2121
Before you can build and test Angular, you must install and configure the
22-
following products on your development machine:
22+
following on your development machine:
2323

24-
* [Git](https://git-scm.com/) and/or the [**GitHub app**](https://desktop.github.com/) (for Mac and Windows);
25-
[GitHub's Guide to Installing Git](https://help.github.com/articles/set-up-git) is a good source of information.\
24+
* [Git](https://git-scm.com/) and/or the [**GitHub app**](https://desktop.github.com/) (for Mac and
25+
Windows);
26+
[GitHub's Guide to Installing Git](https://help.github.com/articles/set-up-git) is a good source
27+
of information.\
2628
**Windows Users**: Git Bash or an equivalent shell is required\
27-
*Windows Powershell and cmd shells are not supported [#46780](https://github.com/angular/angular/issues/46780) so some commands might fail*
29+
*Windows Powershell and cmd shells are not
30+
supported [#46780](https://github.com/angular/angular/issues/46780) so some commands might fail*
2831

29-
* [Node.js](https://nodejs.org), (version specified in [`.nvmrc`](../.nvmrc)) which is used to run a development web server,
32+
* [Node.js](https://nodejs.org), (version specified in [`.nvmrc`](../.nvmrc)) which is used to run a
33+
development web server,
3034
run tests, and generate distributable files.
31-
`.nvmrc` is read by [nvm](https://github.com/nvm-sh/nvm) commands like `nvm install` and `nvm use`.
35+
`.nvmrc` is read by [nvm](https://github.com/nvm-sh/nvm) commands like `nvm install`
36+
and `nvm use`.
3237

33-
* [Yarn](https://yarnpkg.com) (version specified in the engines field of [`package.json`](../package.json)) which is used to install dependencies.
38+
* [Yarn](https://yarnpkg.com) (version specified in the engines field
39+
of [`package.json`](../package.json)) which is used to install dependencies.
3440

35-
* On Windows: [MSYS2](https://www.msys2.org/) which is used by Bazel. Follow the [instructions](https://bazel.build/install/windows#installing-compilers-and-language-runtimes)
36-
37-
* Optional: [Java](https://openjdk.java.net/) version 7 or higher than required by [Closure Compiler](https://developers.google.com/closure/compiler). Most developers will not need this. Java is required for running some integration tests.
41+
* On Windows: [MSYS2](https://www.msys2.org/) which is used by Bazel. Follow
42+
the [instructions](https://bazel.build/install/windows#installing-compilers-and-language-runtimes)
3843

3944
## Getting the Sources
4045

@@ -81,15 +86,18 @@ yarn build
8186

8287
Bazel is used as the primary tool for building and testing Angular.
8388

84-
To see how to run and debug Angular tests locally please refer to the Bazel [Testing Angular](./BAZEL.md#testing-angular) section.
89+
To see how to run and debug Angular tests locally please refer to the
90+
Bazel [Testing Angular](./BAZEL.md#testing-angular) section.
8591

86-
Note that you should execute all test suites before submitting a PR to GitHub (`yarn test //packages/...`).
92+
Note that you should execute all test suites before submitting a PR to
93+
GitHub (`yarn test //packages/...`).
8794

88-
However, affected tests will be executed on our CI infrastructure. So if you forgot to run some affected tests which would fail, GitHub will indicate the error state and present you the failures.
95+
However, affected tests will be executed on our CI infrastructure. So if you forgot to run some
96+
affected tests which would fail, GitHub will indicate the error state and present you the failures.
8997

9098
PRs can only be merged if the code is formatted properly and all tests are passing.
9199

92-
<a name="formatting-your-source-code">
100+
<a name="formatting-your-source-code"></a>
93101
<a name="clang-format"></a>
94102
<a name="prettier"></a>
95103

@@ -100,6 +108,7 @@ use changes in another library or project. To do this developers can build Angul
100108
using `yarn link` build a local project with the created artifacts.
101109

102110
This can be done by running:
111+
103112
```sh
104113
yarn ng-dev misc build-and-link <path-to-local-project-root>
105114
```
@@ -108,11 +117,17 @@ yarn ng-dev misc build-and-link <path-to-local-project-root>
108117

109118
#### Cache
110119

111-
When making changes to Angular packages and testing in a local library/project you need to run `ng cache disable` to disable the Angular CLI disk cache. If you are making changes that are not reflected in your locally served library/project, verify if you have [CLI Cache](https://angular.io/guide/workspace-config#cache-options) disabled.
120+
When making changes to Angular packages and testing in a local library/project you need to
121+
run `ng cache disable` to disable the Angular CLI disk cache. If you are making changes that are not
122+
reflected in your locally served library/project, verify if you
123+
have [CLI Cache](https://angular.io/guide/workspace-config#cache-options) disabled.
112124

113125
#### Invoking the Angular CLI
114126

115-
The Angular CLI needs to be invoked using Node.js [`--preserve-symlinks`](https://nodejs.org/api/cli.html#--preserve-symlinks) flag. Otherwise the symbolic links will be resolved using their real path which causes node module resolution to fail.
127+
The Angular CLI needs to be invoked using
128+
Node.js [`--preserve-symlinks`](https://nodejs.org/api/cli.html#--preserve-symlinks) flag. Otherwise
129+
the symbolic links will be resolved using their real path which causes node module resolution to
130+
fail.
116131

117132
```sh
118133
node --preserve-symlinks --preserve-symlinks-main node_modules/@angular/cli/lib/init.js serve
@@ -124,7 +139,9 @@ Angular uses [prettier](https://clang.llvm.org/docs/ClangFormat.html) to format
124139
If the source code is not properly formatted, the CI will fail and the PR cannot be merged.
125140

126141
You can automatically format your code by running:
127-
- `yarn ng-dev format changed [shaOrRef]`: format only files changed since the provided sha/ref. `shaOrRef` defaults to `main`.
142+
143+
- `yarn ng-dev format changed [shaOrRef]`: format only files changed since the provided
144+
sha/ref. `shaOrRef` defaults to `main`.
128145
- `yarn ng-dev format all`: format _all_ source code
129146
- `yarn ng-dev format files <files..>`: format only provided files
130147

@@ -138,59 +155,17 @@ $ yarn lint
138155

139156
## Publishing Snapshot Builds
140157

141-
When a build of any branch on the upstream fork angular/angular is green on CircleCI, it
158+
When a build of any branch on the upstream fork angular/angular is green on CI, it
142159
automatically publishes build artifacts to repositories in the Angular org. For example,
143160
the `@angular/core` package is published to https://github.com/angular/core-builds.
144161

145162
You may find that your un-merged change needs some validation from external participants.
146163
Rather than requiring them to pull your Pull Request and build Angular locally, they can depend on
147164
snapshots of the Angular packages created based on the code in the Pull Request.
148165

149-
### Getting Packages from Build Artifacts
150-
Each CI run for a Pull Request stores the built Angular packages as
151-
[build artifacts](https://circleci.com/docs/2.0/artifacts). The artifacts are not guaranteed to be
152-
available as a long-term distribution mechanism, but they are guaranteed to be available around the
153-
time of the build.
154-
155-
You can access the artifacts for a specific CI run by going to the workflow page, clicking on the
156-
`publish_packages_as_artifacts` job and then switching to the "ARTIFACTS" tab.
157-
158-
#### Archives for each Package
159-
On the "Artifacts" tab, there is a list of links to compressed archives for Angular packages. The
160-
archive names are of the format `<package-name>-pr<pr-number>-<sha>.tgz` (for example
161-
`core-pr12345-a1b2c3d.tgz`).
162-
163-
One can use the URL to the `.tgz` file for each package to install them as dependencies in a
164-
project they need to test the Pull Request changes against. Both
165-
[npm](https://docs.npmjs.com/cli/install.html) and [yarn](https://yarnpkg.com/lang/en/docs/cli/add)
166-
support installing dependencies from URLs to `.tgz` files, for example by updating the dependencies
167-
in `package.json` to point to the artifact URLs and then running `npm/yarn install`:
168-
169-
```json
170-
"dependencies": {
171-
"@angular/common": "https://<...>.circle-artifacts.com/0/angular/common-pr12345-a1b2c3d.tgz",
172-
"@angular/core": "https://<...>.circle-artifacts.com/0/angular/core-pr12345-a1b2c3d.tgz",
173-
"...": "..."
174-
}
175-
```
176-
177-
#### Download all Packages
178-
In addition to the individual package archives, a `.tgz` file including all packages is also
179-
available (named `all-pr<pr-number>-<sha>.tgz`). This can be used if one prefers to download all
180-
packages locally and test them by either of the following ways:
181-
182-
1. Update the dependencies in `package.json` to point to the local uncompressed package directories.
183-
184-
2. Directly copy the local uncompressed package directories into the `node_modules/` directory of a
185-
project.
186-
187-
Note that (while faster) the second approach has limitations. For example:
188-
a. Any transitive dependencies of the copied packages will not be automatically updated.
189-
b. The packages need to be copied over every time `npm/yarn install` is run.
190-
c. Some package managers (such as `pnpm` or `yarn pnp`) might not work correctly.
191-
192166
### Publishing to GitHub Repos
193-
You can also manually publish `*-builds` snapshots just like our CircleCI build does for upstream
167+
168+
You can also manually publish `*-builds` snapshots just like our CI build does for upstream
194169
builds. Before being able to publish the packages, you need to build them locally by running the
195170
`yarn build` command.
196171

@@ -216,21 +191,26 @@ and create it if it doesn't exist.
216191

217192
#### VS Code
218193

219-
1. Install [Bazel](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel) extension for VS Code.
194+
1. Install [Bazel](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel)
195+
extension for VS Code.
220196

221197
#### WebStorm / IntelliJ
198+
222199
1. Install the [Bazel](https://plugins.jetbrains.com/plugin/8609-bazel) plugin
223-
1. You can find the settings under `Preferences->Other Settings->Bazel Settings`
200+
2. You can find the settings under `Preferences->Other Settings->Bazel Settings`
224201

225202
It will automatically recognize `*.bazel` and `*.bzl` files.
226203

227-
228204
### Remote Build Execution and Remote Caching
229-
Bazel builds in the Angular repository use a shared cache. When a build occurs a hash of the inputs is computed
230-
and checked against available outputs in the shared cache. If an output is found, it is used as the output for the
205+
206+
Bazel builds in the Angular repository use a shared cache. When a build occurs, a hash of the inputs
207+
is computed
208+
and checked against available outputs in the shared cache. If an output is found, it is used as the
209+
output for the
231210
build action rather than performing the build locally.
232211

233212
> Remote Build Execution requires authentication as a google.com account.
234213
235214
#### --config=remote flag
215+
236216
The `--config=remote` flag can be added to enable remote execution of builds.

0 commit comments

Comments
 (0)