@@ -12,6 +12,7 @@ to follow:
1212 - [ Coding Rules] ( #rules )
1313 - [ Commit Message Guidelines] ( #commit )
1414 - [ Signing the CLA] ( #cla )
15+ - [ Updating the Public API] ( #public-api )
1516
1617## <a name =" coc " ></a > Code of Conduct
1718Help us keep Angular open and inclusive. Please read and follow our [ Code of Conduct] [ coc ] .
@@ -274,3 +275,38 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise
274275[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
275276[js-style-guide]: https://google.github.io/styleguide/jsguide.html
276277[stackoverflow]: http://stackoverflow.com/questions/tagged/angular-devkit
278+
279+ ## <a name="public-api"></a> Updating the Public API
280+ Our Public API is protected with TS API Guardian. This is a tool that keeps track of public API surface of our packages.
281+
282+ To test if your change effect the public API you need to run the API guardian on that particular package.
283+
284+ For example in case `@angular-devkit/core` package was modified you need to run:
285+
286+ ```bash
287+ bazel test //etc/api:angular_devkit_core_api
288+ ```
289+
290+ You can also test all packages by running:
291+ ```bash
292+ bazel test //etc/api ...
293+ ```
294+
295+ If you modified the public API, the test will fail. To update the golden files you need to run:
296+
297+ ```bash
298+ bazel run //etc/api:angular_devkit_core_api.accept
299+ ```
300+
301+ **Note**: In some cases we use aliased symbols to create namespaces.
302+
303+ Example:
304+ ```javascript
305+ import * as foo from ' ./foo' ;
306+
307+ export { foo };
308+ ```
309+ There are currently not supported by the API guardian.
310+ To overcome this limitiation we created `_golden-api.ts` in certain packages.
311+
312+ When adding a new API, it might be the case that you need to add it to `_golden-api.ts`.
0 commit comments