Skip to content

Commit a461c26

Browse files
committed
test: add raw AIO benchmark repo
1 parent 66f2647 commit a461c26

File tree

1,409 files changed

+91205
-0
lines changed

Some content is hidden

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

1,409 files changed

+91205
-0
lines changed

benchmark/aio/.gitignore

Lines changed: 49 additions & 0 deletions
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*

benchmark/aio/README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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](https://yarnpkg.com) 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 test --watch=false` - run all the unit tests once.
27+
* `yarn e2e` - run all the e2e tests for the doc-viewer.
28+
29+
* `yarn docs` - generate all the docs from the source files.
30+
* `yarn docs-watch` - watch the Angular source and the docs files and run a short-circuited doc-gen for the docs that changed.
31+
* `yarn docs-lint` - check that the doc gen code follows our style rules.
32+
* `yarn docs-test` - run the unit tests for the doc generation code.
33+
34+
* `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.
35+
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
36+
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs.
37+
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
38+
39+
* `yarn example-e2e` - run all e2e tests for examples
40+
- `yarn example-e2e --setup` - force webdriver update & other setup, then run tests
41+
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
42+
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
43+
44+
* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
45+
46+
## Developing on Windows
47+
The `packages/` directory may contain Linux-specific symlinks, which are not recognized by Windows.
48+
These unresolved links cause the docs generation process to fail because it cannot locate certain files.
49+
50+
> Hint: The following steps require administration rights or [Windows Developer Mode](https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development) enabled!
51+
52+
To fix this problem, run `scripts/windows/create-symlinks.sh`. This command creates temporary files where the symlinks used to be. Make sure not to commit those files with your documentation changes.
53+
When you are done making and testing your documentation changes, you can restore the original symlinks and delete the temporary files by running `scripts/windows/remove-symlinks.sh`.
54+
55+
It's necessary to remove the temporary files, because otherwise they're displayed as local changes in your git working copy and certain operations are blocked.
56+
57+
## Using ServiceWorker locally
58+
59+
Running `yarn start` (even when explicitly targeting production mode) does not set up the
60+
ServiceWorker. If you want to test the ServiceWorker locally, you can use `yarn build` and then
61+
serve the files in `dist/` with `yarn http-server dist -p 4200`.
62+
63+
64+
## Guide to authoring
65+
66+
There are two types of content in the documentation:
67+
68+
* **API docs**: descriptions of the modules, classes, interfaces, decorators, etc that make up the Angular platform.
69+
API docs are generated directly from the source code.
70+
The source code is contained in TypeScript files, located in the `angular/packages` folder.
71+
Each API item may have a preceding comment, which contains JSDoc style tags and content.
72+
The content is written in markdown.
73+
74+
* **Other content**: guides, tutorials, and other marketing material.
75+
All other content is written using markdown in text files, located in the `angular/aio/content` folder.
76+
More specifically, there are sub-folders that contain particular types of content: guides, tutorial and marketing.
77+
78+
* **Code examples**: code examples need to be testable to ensure their accuracy.
79+
Also, our examples have a specific look and feel and allow the user to copy the source code. For larger
80+
examples they are rendered in a tabbed interface (e.g. template, HTML, and TypeScript on separate
81+
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).
82+
83+
We use the [dgeni](https://github.com/angular/dgeni) tool to convert these files into docs that can be viewed in the doc-viewer.
84+
85+
The [Authors Style Guide](https://angular.io/guide/docs-style-guide) prescribes guidelines for
86+
writing guide pages, explains how to use the documentation classes and components, and how to markup sample source code to produce code snippets.
87+
88+
### Generating the complete docs
89+
90+
The main task for generating the docs is `yarn docs`. This will process all the source files (API and other),
91+
extracting the documentation and generating JSON files that can be consumed by the doc-viewer.
92+
93+
### Partial doc generation for editors
94+
95+
Full doc generation can take up to one minute. That's too slow for efficient document creation and editing.
96+
97+
You can make small changes in a smart editor that displays formatted markdown:
98+
>In VS Code, _Cmd-K, V_ opens markdown preview in side pane; _Cmd-B_ toggles left sidebar
99+
100+
You also want to see those changes displayed properly in the doc viewer
101+
with a quick, edit/view cycle time.
102+
103+
For this purpose, use the `yarn docs-watch` task, which watches for changes to source files and only
104+
re-processes the the files necessary to generate the docs that are related to the file that has changed.
105+
Since this task takes shortcuts, it is much faster (often less than 1 second) but it won't produce full
106+
fidelity content. For example, links to other docs and code examples may not render correctly. This is
107+
most particularly noticed in links to other docs and in the embedded examples, which may not always render
108+
correctly.
109+
110+
The general setup is as follows:
111+
112+
* Open a terminal, ensure the dependencies are installed; run an initial doc generation; then start the doc-viewer:
113+
114+
```bash
115+
yarn setup
116+
yarn start
117+
```
118+
119+
* Open a second terminal and start watching the docs
120+
121+
```bash
122+
yarn docs-watch
123+
```
124+
125+
>Alternatively, try the consolidated `serve-and-sync` command that builds, watches and serves in the same terminal window
126+
```bash
127+
yarn serve-and-sync
128+
```
129+
130+
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
131+
You can automatically open the browser by using `yarn start -o` in the first terminal.
132+
133+
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
134+
be regenerated, the app will rebuild and the page will reload.
135+
136+
* If you get a build error complaining about examples or any other odd behavior, be sure to consult
137+
the [Authors Style Guide](https://angular.io/guide/docs-style-guide).

benchmark/aio/angular.json

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
{
2+
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
3+
"version": 1,
4+
"cli": {
5+
"packageManager": "yarn"
6+
},
7+
"newProjectRoot": "projects",
8+
"projects": {
9+
"site": {
10+
"root": "",
11+
"sourceRoot": "src",
12+
"projectType": "application",
13+
"architect": {
14+
"build": {
15+
"builder": "@angular-devkit/build-angular:browser",
16+
"options": {
17+
"outputPath": "dist",
18+
"index": "src/index.html",
19+
"main": "src/main.ts",
20+
"tsConfig": "src/tsconfig.app.json",
21+
"aot": true,
22+
"optimization": true,
23+
"buildOptimizer": true,
24+
"outputHashing": "all",
25+
"sourceMap": true,
26+
"statsJson": true,
27+
"extractCss": true,
28+
"extractLicenses": true,
29+
"namedChunks": true,
30+
"vendorChunk": false,
31+
"polyfills": "src/polyfills.ts",
32+
"assets": [
33+
"src/assets",
34+
"src/generated",
35+
"src/app/search/search-worker.js",
36+
"src/pwa-manifest.json",
37+
"src/google385281288605d160.html",
38+
{
39+
"glob": "custom-elements.min.js",
40+
"input": "node_modules/@webcomponents/custom-elements",
41+
"output": "/assets/js"
42+
},
43+
{
44+
"glob": "native-shim.js",
45+
"input": "node_modules/@webcomponents/custom-elements/src",
46+
"output": "/assets/js"
47+
}
48+
],
49+
"styles": [
50+
"src/styles.scss"
51+
],
52+
"scripts": []
53+
},
54+
"configurations": {
55+
"fast": {
56+
"optimization": false
57+
},
58+
"next": {
59+
"fileReplacements": [
60+
{
61+
"src": "src/environments/environment.ts",
62+
"replaceWith": "src/environments/environment.next.ts"
63+
}
64+
],
65+
"serviceWorker": true
66+
},
67+
"stable": {
68+
"fileReplacements": [
69+
{
70+
"src": "src/environments/environment.ts",
71+
"replaceWith": "src/environments/environment.stable.ts"
72+
}
73+
],
74+
"serviceWorker": true
75+
},
76+
"archive": {
77+
"fileReplacements": [
78+
{
79+
"src": "src/environments/environment.ts",
80+
"replaceWith": "src/environments/environment.archive.ts"
81+
}
82+
],
83+
"serviceWorker": true
84+
}
85+
}
86+
},
87+
"serve": {
88+
"builder": "@angular-devkit/build-angular:dev-server",
89+
"options": {
90+
"browserTarget": "site:build"
91+
},
92+
"configurations": {
93+
"fast": {
94+
"browserTarget": "site:build:fast"
95+
},
96+
"next": {
97+
"browserTarget": "site:build:next"
98+
},
99+
"stable": {
100+
"browserTarget": "site:build:stable"
101+
},
102+
"archive": {
103+
"browserTarget": "site:build:archive"
104+
}
105+
}
106+
},
107+
"extract-i18n": {
108+
"builder": "@angular-devkit/build-angular:extract-i18n",
109+
"options": {
110+
"browserTarget": "site:build"
111+
}
112+
},
113+
"test": {
114+
"builder": "@angular-devkit/build-angular:karma",
115+
"options": {
116+
"main": "src/test.ts",
117+
"karmaConfig": "src/karma.conf.js",
118+
"polyfills": "src/polyfills.ts",
119+
"tsConfig": "src/tsconfig.spec.json",
120+
"scripts": [],
121+
"styles": [
122+
"src/styles.scss"
123+
],
124+
"assets": [
125+
"src/assets",
126+
"src/generated",
127+
"src/app/search/search-worker.js",
128+
"src/pwa-manifest.json",
129+
"src/google385281288605d160.html",
130+
{
131+
"glob": "custom-elements.min.js",
132+
"input": "node_modules/@webcomponents/custom-elements",
133+
"output": "/assets/js"
134+
},
135+
{
136+
"glob": "native-shim.js",
137+
"input": "node_modules/@webcomponents/custom-elements/src",
138+
"output": "/assets/js"
139+
}
140+
]
141+
}
142+
},
143+
"lint": {
144+
"builder": "@angular-devkit/build-angular:tslint",
145+
"options": {
146+
"tsConfig": [
147+
"src/tsconfig.app.json",
148+
"src/tsconfig.spec.json"
149+
],
150+
"exclude": []
151+
}
152+
}
153+
}
154+
},
155+
"site-e2e": {
156+
"root": "",
157+
"projectType": "application",
158+
"cli": {},
159+
"schematics": {},
160+
"architect": {
161+
"e2e": {
162+
"builder": "@angular-devkit/build-angular:protractor",
163+
"options": {
164+
"protractorConfig": "tests/e2e/protractor.conf.js",
165+
"devServerTarget": "site:serve"
166+
}
167+
},
168+
"lint": {
169+
"builder": "@angular-devkit/build-angular:tslint",
170+
"options": {
171+
"tsConfig": [
172+
"tests/e2e/tsconfig.e2e.json"
173+
],
174+
"exclude": []
175+
}
176+
}
177+
}
178+
}
179+
},
180+
"schematics": {
181+
"@schematics/angular:component": {
182+
"inlineStyle": true,
183+
"prefix": "aio",
184+
"styleext": "scss"
185+
},
186+
"@schematics/angular:directive": {
187+
"prefix": "aio"
188+
}
189+
}
190+
}

benchmark/aio/database.rules.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rules": {
3+
".read": "auth != null",
4+
".write": "auth != null"
5+
}
6+
}

0 commit comments

Comments
 (0)