Skip to content

Commit 10823c9

Browse files
niklas-wortmannbenlesh
authored andcommitted
New Documentation (ReactiveX#3763)
* docs(docs): setup new documentation * docs(ci): docs ci just for full validate
1 parent 2c43af7 commit 10823c9

File tree

2,687 files changed

+159161
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,687 files changed

+159161
-1096
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ cache:
1313
- $HOME/.npm
1414

1515
env:
16+
global:
17+
- secure: "wRUxg3L05UjigEq0zPTfW+vFEPdDQrWFB8O3/p/7LYYL1EqnIvQETd/4g5vnzyu4iysPeCHtMY7a+oyX/LM81JD3EU2nzxfY1bRDL6kyU+KrWNhZ6Jf4XosCUQ1vpdD0jBIlpLoTLr056PUNrS/13onnJHVAWzIhjcDwUJXQlyzR8z32SN3Wa6yjQhHwGvQqqdJB/H83H0BcYTCxwKfut58zQZ+RVcubHj6T+K3LI8OPHvZeK2/NiWcaZB/zky5cD9lFiY7lF+/0PhYPw1EYwbzA2dPhyKxy+d8hweCEFMUb5Z9s980tAd8m1IdqGXPZu51lvj7MMWwj4X2vUUtF9XrB4K2Kt11PSyB49bF2brQI2axsyYWZGeW0nsb8+MlHUa3eli7XR6dA6VVeIJT08ULvXUVzEvXiogHE/5G9ZXVFWDgCkFsXdEAtf2EOo3RpCoUYSXmqRvr9ZBP6C/KMYogENQ8JdTk3SXpn8heo6oraBKfOg0DRfoiMVyl7vfOVQYRgbbDGZVJfcHSYpyFQfqKOMlEiSSyh51PL7Dt6BYSCBoUKh8AAAtIi2+exgTuUHwy8fZBBJm5Bbem8Ku9il89gkOWS8jPYxat8/9HlouNO/COBBb3DUPIKEOE+YwLji44GiVOB4bnZ1Hz1ucBZEvYzFSW3/wac7S9fqDaeOVE="
18+
1619
matrix:
1720
- NODE_VER=8 FULL_VALIDATE=true alias grunt=./node_modules/grunt-cli/bin/grunt
1821
- NODE_VER=9 FULL_VALIDATE=false
@@ -23,6 +26,7 @@ matrix:
2326
before_install:
2427
- nvm install $NODE_VER
2528
- npm install -g npm@6 && npm install -g npx && node -v && npm -v
29+
- npm install -g yarn
2630
- if [ "$FULL_VALIDATE" == "true" ]; then npm install --no-save [email protected] grunt-cli grunt-contrib-connect grunt-run; fi
2731

2832
install:
@@ -34,7 +38,9 @@ script:
3438
- npm run test_check
3539
- npm test
3640
- npm run test:systemjs
41+
- if [ "$FULL_VALIDATE" == "true" ] && [ -n "DANGER_GITHUB_API_TOKEN" ]; then cd docs_app && yarn install && yarn run build; fi
3742

3843
after_success:
3944
- if [ "$FULL_VALIDATE" == "true" ]; then npm run test:cover && npx nyc report --reporter=text-lcov | npx coveralls; fi
4045
- if [ "$FULL_VALIDATE" == "true" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ -n "$SAUCE_ACCESS_KEY" ]; then npm run build_spec_browser && grunt --gruntfile spec/support/mocha.sauce.gruntfile.js; fi
46+
- if [ "$FULL_VALIDATE" == "true"] && [ "$TRAVIS_BRANCH" == "master" ]; then cd docs_app && chmod 755 scripts/deploy-to-firebase.sh && yarn deploy-production; fi
+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Observable, onErrorResumeNext as staticOnErrorResumeNext } from 'rxjs';
2-
3-
Observable.onErrorResumeNext = staticOnErrorResumeNext;
4-
5-
declare module 'rxjs/internal/Observable' {
6-
namespace Observable {
7-
export let onErrorResumeNext: typeof staticOnErrorResumeNext;
8-
}
9-
}
1+
import { Observable, onErrorResumeNext as staticOnErrorResumeNext } from 'rxjs';
2+
3+
Observable.onErrorResumeNext = staticOnErrorResumeNext;
4+
5+
declare module 'rxjs/internal/Observable' {
6+
namespace Observable {
7+
export let onErrorResumeNext: typeof staticOnErrorResumeNext;
8+
}
9+
}

compat/add/observable/pairs.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Observable, pairs as staticPairs } from 'rxjs';
2-
3-
Observable.pairs = staticPairs;
4-
5-
declare module 'rxjs/internal/Observable' {
6-
namespace Observable {
7-
export let pairs: typeof staticPairs;
8-
}
9-
}
1+
import { Observable, pairs as staticPairs } from 'rxjs';
2+
3+
Observable.pairs = staticPairs;
4+
5+
declare module 'rxjs/internal/Observable' {
6+
namespace Observable {
7+
export let pairs: typeof staticPairs;
8+
}
9+
}
+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Observable } from 'rxjs';
2-
import { onErrorResumeNext } from '../../operator/onErrorResumeNext';
3-
4-
(Observable as any).prototype.onErrorResumeNext = onErrorResumeNext;
5-
6-
declare module 'rxjs/internal/Observable' {
7-
interface Observable<T> {
8-
onErrorResumeNext: typeof onErrorResumeNext;
9-
}
10-
}
1+
import { Observable } from 'rxjs';
2+
import { onErrorResumeNext } from '../../operator/onErrorResumeNext';
3+
4+
(Observable as any).prototype.onErrorResumeNext = onErrorResumeNext;
5+
6+
declare module 'rxjs/internal/Observable' {
7+
interface Observable<T> {
8+
onErrorResumeNext: typeof onErrorResumeNext;
9+
}
10+
}

compat/add/operator/timestamp.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Observable } from 'rxjs';
2-
import { timestamp } from '../../operator/timestamp';
3-
4-
(Observable as any).prototype.timestamp = timestamp;
5-
6-
declare module 'rxjs/internal/Observable' {
7-
interface Observable<T> {
8-
timestamp: typeof timestamp;
9-
}
10-
}
1+
import { Observable } from 'rxjs';
2+
import { timestamp } from '../../operator/timestamp';
3+
4+
(Observable as any).prototype.timestamp = timestamp;
5+
6+
declare module 'rxjs/internal/Observable' {
7+
interface Observable<T> {
8+
timestamp: typeof timestamp;
9+
}
10+
}

docs_app/.angular-cli.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "site"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"img",
12+
"assets",
13+
"generated",
14+
"app/search/search-worker.js",
15+
"favicon.ico",
16+
"pwa-manifest.json",
17+
"google385281288605d160.html",
18+
{ "glob": "custom-elements.min.js", "input": "../node_modules/@webcomponents/custom-elements", "output": "./assets/js" },
19+
{ "glob": "native-shim.js", "input": "../node_modules/@webcomponents/custom-elements/src", "output": "./assets/js" }
20+
],
21+
"index": "index.html",
22+
"main": "main.ts",
23+
"polyfills": "polyfills.ts",
24+
"test": "test.ts",
25+
"tsconfig": "tsconfig.app.json",
26+
"testTsconfig": "tsconfig.spec.json",
27+
"prefix": "aio",
28+
"serviceWorker": false,
29+
"styles": ["styles.scss"],
30+
"scripts": [],
31+
"environmentSource": "environments/environment.ts",
32+
"environments": {
33+
"dev": "environments/environment.ts",
34+
"next": "environments/environment.next.ts",
35+
"stable": "environments/environment.stable.ts",
36+
"archive": "environments/environment.archive.ts"
37+
}
38+
}
39+
],
40+
"e2e": {
41+
"protractor": {
42+
"config": "tests/e2e/protractor.conf.js"
43+
}
44+
},
45+
"lint": [
46+
{
47+
"project": "src/tsconfig.app.json"
48+
},
49+
{
50+
"project": "src/tsconfig.spec.json"
51+
},
52+
{
53+
"project": "tests/e2e/tsconfig.e2e.json"
54+
}
55+
],
56+
"test": {
57+
"karma": {
58+
"config": "src/karma.conf.js"
59+
}
60+
},
61+
"defaults": {
62+
"styleExt": "scss",
63+
"component": {
64+
"inlineStyle": true
65+
},
66+
"build": {
67+
"namedChunks": true
68+
}
69+
}
70+
}

docs_app/.gitignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/out-tsc
6+
/src/generated
7+
/tmp
8+
9+
# dependencies
10+
/node_modules
11+
12+
# IDEs and editors
13+
/.idea
14+
.project
15+
.classpath
16+
.c9/
17+
*.launch
18+
.settings/
19+
*.sublime-workspace
20+
21+
# IDE - VSCode
22+
.vscode/*
23+
!.vscode/settings.json
24+
!.vscode/tasks.json
25+
!.vscode/launch.json
26+
!.vscode/extensions.json
27+
28+
# misc
29+
/.sass-cache
30+
/connect.lock
31+
/coverage
32+
/libpeerconnection.log
33+
debug.log
34+
npm-debug.log
35+
testem.log
36+
/typings
37+
yarn-error.log
38+
39+
# e2e
40+
/e2e/*.js
41+
/e2e/*.map
42+
protractor-results*.txt
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
47+
48+
# copied dependencies
49+
src/assets/js/lunr*

docs_app/README.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Angular documentation project (https://angular.io)
2+
3+
Everything in this folder is part of the documentation project. This includes
4+
5+
* the web site for displaying the documentation
6+
* the dgeni configuration for converting source files to rendered files that can be viewed in the web site.
7+
* the tooling for setting up examples for development; and generating live-example and zip files from the examples.
8+
9+
## Developer tasks
10+
11+
We use `yarn` to manage the dependencies and to run build tasks.
12+
You should run all these tasks from the `angular/aio` folder.
13+
Here are the most important tasks you might need to use:
14+
15+
* `yarn` - install all the dependencies.
16+
* `yarn setup` - install all the dependencies, boilerplate, stackblitz, zips and run dgeni on the docs.
17+
* `yarn setup-local` - same as `setup`, but use the locally built Angular packages for aio and docs examples boilerplate.
18+
19+
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
20+
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
21+
22+
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
23+
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
24+
* `yarn lint` - check that the doc-viewer code follows our style rules.
25+
* `yarn test` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
26+
* `yarn e2e` - run all the e2e tests for the doc-viewer.
27+
28+
* `yarn docs` - generate all the docs from the source files.
29+
* `yarn docs-watch` - watch the Angular source and the docs files and run a short-circuited doc-gen for the docs that changed.
30+
* `yarn docs-lint` - check that the doc gen code follows our style rules.
31+
* `yarn docs-test` - run the unit tests for the doc generation code.
32+
33+
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder.
34+
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
35+
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs.
36+
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
37+
38+
* `yarn example-e2e` - run all e2e tests for examples
39+
- `yarn example-e2e --setup` - force webdriver update & other setup, then run tests
40+
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
41+
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
42+
43+
* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
44+
45+
## Using ServiceWorker locally
46+
47+
Since abb36e3cb, running `yarn start --prod` will no longer set up the ServiceWorker, which
48+
would require manually running `yarn sw-manifest` and `yarn sw-copy` (something that is not possible
49+
with webpack serving the files from memory).
50+
51+
If you want to test ServiceWorker locally, you can use `yarn build` and serve the files in `dist/`
52+
with `yarn http-server dist -p 4200`.
53+
54+
For more details see #16745.
55+
56+
57+
## Guide to authoring
58+
59+
There are two types of content in the documentation:
60+
61+
* **API docs**: descriptions of the modules, classes, interfaces, decorators, etc that make up the Angular platform.
62+
API docs are generated directly from the source code.
63+
The source code is contained in TypeScript files, located in the `angular/packages` folder.
64+
Each API item may have a preceding comment, which contains JSDoc style tags and content.
65+
The content is written in markdown.
66+
67+
* **Other content**: guides, tutorials, and other marketing material.
68+
All other content is written using markdown in text files, located in the `angular/aio/content` folder.
69+
More specifically, there are sub-folders that contain particular types of content: guides, tutorial and marketing.
70+
71+
* **Code examples**: code examples need to be testable to ensure their accuracy.
72+
Also, our examples have a specific look and feel and allow the user to copy the source code. For larger
73+
examples they are rendered in a tabbed interface (e.g. template, HTML, and TypeScript on separate
74+
tabs). Additionally, some are live examples, which provide links where the code can be edited, executed, and/or downloaded. For details on working with code examples, please read the [Code snippets](https://angular.io/guide/docs-style-guide#code-snippets), [Source code markup](https://angular.io/guide/docs-style-guide#source-code-markup), and [Live examples](https://angular.io/guide/docs-style-guide#live-examples) pages of the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
75+
76+
We use the [dgeni](https://github.com/angular/dgeni) tool to convert these files into docs that can be viewed in the doc-viewer.
77+
78+
The [Authors Style Guide](https://angular.io/guide/docs-style-guide) prescribes guidelines for
79+
writing guide pages, explains how to use the documentation classes and components, and how to markup sample source code to produce code snippets.
80+
81+
### Generating the complete docs
82+
83+
The main task for generating the docs is `yarn docs`. This will process all the source files (API and other),
84+
extracting the documentation and generating JSON files that can be consumed by the doc-viewer.
85+
86+
### Partial doc generation for editors
87+
88+
Full doc generation can take up to one minute. That's too slow for efficient document creation and editing.
89+
90+
You can make small changes in a smart editor that displays formatted markdown:
91+
>In VS Code, _Cmd-K, V_ opens markdown preview in side pane; _Cmd-B_ toggles left sidebar
92+
93+
You also want to see those changes displayed properly in the doc viewer
94+
with a quick, edit/view cycle time.
95+
96+
For this purpose, use the `yarn docs-watch` task, which watches for changes to source files and only
97+
re-processes the the files necessary to generate the docs that are related to the file that has changed.
98+
Since this task takes shortcuts, it is much faster (often less than 1 second) but it won't produce full
99+
fidelity content. For example, links to other docs and code examples may not render correctly. This is
100+
most particularly noticed in links to other docs and in the embedded examples, which may not always render
101+
correctly.
102+
103+
The general setup is as follows:
104+
105+
* Open a terminal, ensure the dependencies are installed; run an initial doc generation; then start the doc-viewer:
106+
107+
```bash
108+
yarn setup
109+
yarn start
110+
```
111+
112+
* Open a second terminal and start watching the docs
113+
114+
```bash
115+
yarn docs-watch
116+
```
117+
118+
>Alternatively, try the consolidated `serve-and-sync` command that builds, watches and serves in the same terminal window
119+
```bash
120+
yarn serve-and-sync
121+
```
122+
123+
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
124+
You can automatically open the browser by using `yarn start -o` in the first terminal.
125+
126+
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
127+
be regenerated, the app will rebuild and the page will reload.
128+
129+
* If you get a build error complaining about examples or any other odd behavior, be sure to consult
130+
the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scripts-js/lib
2+
scripts-js/node_modules
3+
scripts-js/**/test

0 commit comments

Comments
 (0)