Skip to content

Commit a1e0558

Browse files
Foxandxsspetebacondarwin
authored andcommitted
docs(aio): applying some feedback
1 parent dfe0eb0 commit a1e0558

4 files changed

Lines changed: 27 additions & 25 deletions

File tree

aio/tools/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ into files that are consumed by the AIO application.
6565
Dgeni is configured by "packages", which contain services and processors. Some of these packages are installed as `node_modules`
6666
from the [dgeni-packages](https://github.com/angular/dgeni-packages) and some are specific to the AIO project.
6767

68-
The project specific packages are stored in the `aio/tools/transforms` folder. See the [README.md](plunker-builder/README.md)
69-
for more details.
68+
The project specific packages are stored in the `aio/tools/transforms` folder. See the [README.md](transforms/README.md)
69+
for more details.

aio/tools/example-zipper/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In the AIO application, we offer the reader the option to download each example
44

55
## Example zipper
66

7-
The `exampleZipper.js` tool is very similar to the Plunker's `builder.js`. The latter creates an HTML file with all the examples' files and the former creates a .zip file instead. They both use the `plnkr.json` file to flag an example as something to plunker a zip. For example:
7+
The `exampleZipper.js` tool is very similar to the Plunker's `builder.js`. The latter creates an HTML file with all the examples' files and the former creates a zip file instead. They both use the `plnkr.json` file to flag an example as something to plunker or zip. For example:
88

99
```json
1010
{
@@ -21,11 +21,11 @@ The `exampleZipper.js` tool is very similar to the Plunker's `builder.js`. The
2121

2222
The zipper will use this information for creating new zips.
2323

24-
## Three kind of examples
24+
## Three kinds of examples
2525

2626
The majority of examples in AIO use `System.js` but there are also `CLI` and `Webpack` projects. This tool is able to differentiate between them.
2727

28-
The boilerplate uses a `package.json` that contains packages and scripts tags to run any kind of example. Using that `package.json` in the zips would confuse the users.
28+
The boilerplate uses a `package.json` that contains packages and scripts to run any kind of example. Using that `package.json` in the zips would confuse the users.
2929

3030
Thanks to the `package.json` customizer, we can create a new `package.json` on the fly that would only contain the packages and scripts needed to run that example.
3131

@@ -40,19 +40,19 @@ Here you find a:
4040
* **base.json** - All the common scripts and packages
4141
* **cli.json** - Extra scripts and packages for the CLI
4242
* **webpack.json** - Extra scripts and packages for Webpack
43-
* **systemjs.json** - All the system.js related packages but it also contains the remainder scripts that are not in the other files.
43+
* **systemjs.json** - All the System.js related packages but it also contains the remainder scripts that are not in the other files.
4444

4545
The tool will also give some standard names to the scripts.
4646

4747
## The zipper.json
4848

4949
As mentioned, the tool uses the `plnkr.json` as a flag and also a configuration file for the zipper. The problem is that not all examples have a plunker but they could offer a zip instead.
5050

51-
In those cases, you can create a `zipper.json` file with with the same syntax. It will be ignored by the plunker tool.
51+
In those cases, you can create a `zipper.json` file with the same syntax. It will be ignored by the plunker tool.
5252

5353
## Choosing the zip "type"
5454

55-
In both `plnkr.json` and `zipper.json` you can use two new properties:
55+
In both `plnkr.json` and `zipper.json` you can use two extra properties for the zipper configuration:
5656

5757
```
5858
{
@@ -62,12 +62,12 @@ In both `plnkr.json` and `zipper.json` you can use two new properties:
6262
}
6363
```
6464

65-
This would generate a .zip for a webpack application and it will also remove everything related with SystemJS.
65+
This would generate a zip for a webpack application and it will also remove everything related with SystemJS.
6666

6767
## Executing the zip generation
6868

69-
`generateSipz.js` will create a zip for each `plnk.json` or `zipper.json` it finds.
69+
`generateZips.js` will create a zip for each `plnkr.json` or `zipper.json` it finds.
7070

71-
Where? at `src/generated/zips/`.
71+
Where? At `src/generated/zips/`.
7272

7373
Then the `<live-example>` embedded component will look at this folder to get the zip it needs for the example.

aio/tools/examples/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In order to build, run and test these examples independently we need to install
66

77
## Boilerplate overview
88

9-
As mentioned, many of the documentation pages contains snippets extracted from real example applications. To achieve that, all those applications needs to contain a basic boilerplate. E.g. a `node_modules` folder, `package.json` with scripts, `system.js` configuration, etc.
9+
As mentioned, many of the documentation pages contain snippets extracted from real example applications. To achieve that, all those applications needs to contain a basic boilerplate. E.g. a `node_modules` folder, `package.json` with scripts, `system.js` configuration, etc.
1010

1111
No one wants to maintain the boilerplate on each example, so the goal of this tool is to provide a generic boilerplate that works in all the examples.
1212

@@ -18,17 +18,17 @@ Among these files, there are a few special ones:
1818

1919
* **src/systemjs.config.js** - This is the configuration of System.js used to run the example locally.
2020
* **src/systemjs.config.web.js** - This configuration replaces the previous one on Plunkers.
21-
* **/src/systemjs.config.web.build.js** - Same as the previous one but for `-builds` versions.
21+
* **/src/systemjs.config.web.build.js** - Same as the previous one but for using angular's `-builds` versions.
2222
* **src/systemjs-angular-loader.js** - It is a System.js plugin that removes the need of `moduleId`.
23-
* **package.json** - This package.json only contains script tags, no dependencies. It contains the different tasks needed to run any example. Doesn't matter if CLI, System.js or Webpack.
24-
* **plnkr.json** - This file is used by the Plunker tool to generate a plunker for an example. This concrete file is just a placeholder. Authors needs to tweak it for each guide.
23+
* **package.json** - This package.json only contains scripts, no dependencies. It contains the different tasks needed to run any example. Doesn't matter if CLI, System.js or Webpack.
24+
* **plnkr.json** - This file is used by the Plunker tool to generate a plunker for an example. This concrete file is just a placeholder. Authors needs to tweak it for each guide. More at the [plunker docs](../plunker-builder/README.md).
2525
* **example-config.json** - This file serves as a flag to indicate that the current folder is an example. This concrete file is just a placeholder. More on this later in this readme.
2626

2727
### The example-config.json
2828

2929
So what is this **example-config.json** again? If an author wants to create a new example, say `/aio/content/examples/awesome-example`. The author needs to create an empty `example-config.json` in that folder. That serves as a flag so this tool will say "Hey, that is an example, let's copy all the boilerplate there".
3030

31-
So when the tool runs, it finds **all** the folders with a `example-config.json` file, and puts a copy of the boilerplate in those folders.
31+
So when the tool runs, it finds **all** the folders with an `example-config.json` file, and puts a copy of the boilerplate in those folders.
3232

3333
Normally the file is empty, but we can add information in it, for example:
3434

@@ -46,7 +46,7 @@ In this case, this would indicate that this is a CLI example. Won't make any dif
4646

4747
With all the boilerplate files in place, the only missing piece are the installed packages. For that we have a `/aio/tools/examples/shared/package.json` which contains **all** the packages needed to run all the examples.
4848

49-
After installing this dependencies, a `node_modules` will be created at `/aio/tools/examples/shared/node_modules`. This folder will be **symlinked** into each example. So it is not a copy like the other boilerplate files. This solution works in all OSes.
49+
After installing these dependencies, a `node_modules` will be created at `/aio/tools/examples/shared/node_modules`. This folder will be **symlinked** into each example. So it is not a copy like the other boilerplate files. This solution works in all OSes. Windows may require admin rights.
5050

5151
### End to end tests
5252

@@ -56,9 +56,9 @@ This tool expects all the examples to be build with `npm run build`. If an examp
5656

5757
### add-example-boilerplate.js
5858

59-
This script install all the dependencies that are shared among all the examples, creates the `node_modules` symlinks and copy all the boilerplate files where needed. It won't do anything about plunkers nor e2e tests.
59+
This script installs all the dependencies that are shared among all the examples, creates the `node_modules` symlinks and copy all the boilerplate files where needed. It won't do anything about plunkers nor e2e tests.
6060

61-
It also contains a function to remove all the boilerplate. It uses a `git clean -xdf` to do the job. It will remove all files that doesn't exist in the git repository, **including any new file that you are working on that hasn't been stage yet.** So be sure to save your work before removing the boilerplate.
61+
It also contains a function to remove all the boilerplate. It uses a `git clean -xdf` to do the job. It will remove all files that don't exist in the git repository, **including any new file that you are working on that hasn't been stage yet.** So be sure to save your work before removing the boilerplate.
6262

6363
### run-example-e2e.js
6464

aio/tools/plunker-builder/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Both flavours are created within `builder.js`. How is a plunker created? What is
1010

1111
An "executable" plunker is an HTML file with a `<form>` that makes a post to plunker on submit. It contains an `<input>` element for each file we need in the plunker.
1212

13+
The form will be submitted on load, so you can either double click the HTML file or open it with an anchor tag to open the plunker.
14+
1315
So the `builder.js` job is to get all the needed files from an example and build this HTML file for you.
1416

15-
For plunkers, we use an special `systemjs.config` that exists in `/aio/tools/examples/shared/boilerplate/src/systemjs.config.web.js` and we also add the Google's copyright to each file.
17+
For plunkers, we use a special `systemjs.config` that exists in `/aio/tools/examples/shared/boilerplate/src/systemjs.config.web.js` and we also add the Google's copyright to each file.
1618

1719
## Customizing the generation per example basis
1820

19-
How do this tool know about what is an example and what is not? It will look for all folders containing a `plnkr.json` file. If found, all files within the folder and subfolders will be used in the plunker, with a few generic exceptions that you can find at `builder.js`.
21+
How does this tool know what is an example and what is not? It will look for all folders containing a `plnkr.json` file. If found, all files within the folder and subfolders will be used in the plunker, with a few generic exceptions that you can find at `builder.js`.
2022

2123
You can use the `plnkr.json` to customize the plunker generation. For example:
2224

@@ -37,18 +39,18 @@ Here you can specify a description for the plunker, some tags, a basePath and al
3739

3840
## Classic plunkers and embedded ones
3941

40-
Luckily, both kind of plunkers are very similar, the are created in the same way with a minor exceptions.
42+
Luckily, both kind of plunkers are very similar, they are created in the same way with minor exceptions.
4143

4244
To handle those exceptions, we have the `embeddedPlunker.js` and the `regularPlunker.js`. Thanks to them, the `builder.js` is as generic as possible.
4345

4446
## Executing the plunker generation
4547

46-
`generatePlunkers.js` will create a classic plunker and a embedded plunker for each `plnk.json` it finds.
48+
`generatePlunkers.js` will create a classic plunker and an embedded plunker for each `plnkr.json` it finds.
4749

48-
Where? at `src/generated/live-examples/`.
50+
Where? At `src/generated/live-examples/`.
4951

5052
Then the `<live-example>` embedded component will look at this folder to get the plunker it needs for the example.
5153

52-
## Appendix: Why not generating plunkers on runtime?
54+
## Appendix: Why not generating plunkers at runtime?
5355

5456
At AngularJS, all the plunkers were generated a runtime. The downside is that all the example codes would need to be deployed as well and they won't be no longer useful after the plunker is generated. This tool takes a few seconds to run, and the end result is only 3mb~.

0 commit comments

Comments
 (0)