Skip to content

Commit 2154576

Browse files
committed
update readme instructions
1 parent 727068f commit 2154576

File tree

1 file changed

+70
-22
lines changed

1 file changed

+70
-22
lines changed

README.md

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ The files this tool creates are used to power
1515
- the latest [Node.js](https://nodejs.org/) LTS
1616
- [yarn v1](https://yarnpkg.com/)
1717

18-
Clone all of the following repositories into the same directory,
19-
and `yarn install` in each one:
18+
Clone all of the following repositories into the same directory so they are "siblings" on the file system
2019

2120
- This repository, `ember-jsonapi-docs`
2221
- [ember-api-docs-data](https://github.com/ember-learn/ember-api-docs-data)
@@ -30,50 +29,99 @@ Then, in `ember.js` and/or `ember-data` repositories, check out the version
3029
tags you want to generate docs for. For example:
3130

3231
```sh
33-
git checkout v3.20.0
32+
get fetch --all
33+
git checkout v5.2.0
3434
```
3535

3636
Generate the JSON docs for `ember` and/or `ember-data`. This will add new JSON
3737
files into the `s3-docs` directory of `ember-api-docs-data`:
3838

3939
```sh
40-
yarn gen --project ember --version "3.20.0"
41-
yarn gen --project ember-data --version "3.20.0"
40+
yarn
41+
yarn gen --project ember --version "5.2.0"
4242
```
4343

44-
Now, run this command to parse the `s3-docs` files into JSON:API docs for
45-
`ember` and/or `ember-data`.
46-
This will add new files into `json-docs` and `rev-index` in `ember-api-docs-data`.
44+
I would recommend committing at this stage so that you can see that the following steps work.
4745

46+
```sh
47+
cd ../ember-api-docs-data/
48+
git add .
49+
git commit -m "add docs for ember v5.2.0"
4850
```
49-
yarn start --project ember --version "3.20.0"
50-
yarn start --project ember-data --version "3.20.0"
51+
52+
Next we need to fix the generated files. (Note: this step could probably be incorporated into ember-jsonapi-docs
53+
but for now this step works).
54+
55+
```sh
56+
node ./clean-urls.js
57+
node ./fix-rev-index.js
58+
git add .
59+
git commit -m "fix urls and rev-index for ember"
5160
```
5261

53-
> ℹ️ **NOTE:** `--version` should match the one in the `package.json` of a target Ember project. If `package.json` uses a release name (e.g. `beta` or `canary`), omit it and use only numbers. For example, if the `package.json` says `3.19.0-beta.2`, use `3.19.0`.
62+
Lastly we need to make sure that each of the new files are valid. You need to run the test suite in `ember-api-docs-data`
5463

55-
> **TIP:** If you are debugging failed builds, periodically discard the changes
56-
made to `ember-api-docs-data`, since changes are made in-place.
64+
```sh
65+
npm i
66+
npm test
67+
```
5768

58-
## View the generated docs in a web app
69+
If you see any errors e.g. `AssertionError: expected '' not to be empty` you need to manually fix these. These are caused by bugs in the yuidoc generation and can probably be fixed in the source files somehow.
5970

60-
From the [ember-api-docs-data](https://github.com/ember-learn/ember-api-docs-data)
61-
repository, start a server for the JSON files:
71+
Once all of the fixes are in place you can commit them:
6272

73+
```sh
74+
git add .
75+
git commit -m "fixing tests for ember"
6376
```
64-
yarn serve
77+
78+
---
79+
80+
Once that is all committed I would recommend doing the same thing for ember-data with new commits:
81+
82+
```sh
83+
cd ../ember-jsonapi-docs
84+
yarn gen --project ember-data --version "5.2.0"
85+
86+
cd ../ember-api-docs-data
87+
88+
git add .
89+
git commit -m "add docs for ember-data v5.2.0"
90+
91+
node ./clean-urls.js
92+
node ./fix-rev-index.js
93+
git add .
94+
git commit -m "fix urls and rev-index for ember-data"
95+
96+
npm test
97+
98+
# if you needed to fix any files you do that now and then
99+
git add .
100+
git commit -m "fixing tests for ember-data"
65101
```
66102

103+
Once that is all done, push it and open a PR 🎉
104+
105+
> ℹ️ **NOTE:** `--version` should match the one in the `package.json` of a target Ember project. If `package.json` uses a release name (e.g. `beta` or `canary`), omit it and use only numbers. For example, if the `package.json` says `3.19.0-beta.2`, use `3.19.0`.
106+
107+
> **TIP:** If you are debugging failed builds, periodically discard the changes
108+
made to `ember-api-docs-data`, since changes are made in-place.
109+
110+
## (Optional) View the generated docs in a web app
111+
112+
The Prembered version of the ember-api-docs expects a folder in its root that links to the `ember-api-docs-data` folder, so all you need to do is create a symbolic link to ember-api-docs-data and you can see the app running locally.
113+
67114
Clone the [ember-api-docs](https://github.com/ember-learn/ember-api-docs)
68115
repository, install dependencies, and start the front end in "local" mode:
69116

70-
```
117+
```sh
71118
git clone https://github.com/ember-learn/ember-api-docs
72-
yarn install
73-
yarn start:local
119+
cd ember-api-docs
120+
ln -s ../ember-api-docs-data # assuming it's checked out in the same folder
121+
npm install
122+
yarn start
74123
```
75124

76-
_Note: you don't need to check out any special branch on ember-api-docs.
77-
`yarn start:local` looks for files served on port 5050_
125+
> Note: at the time of writing this the ember-api-docs app needs to be on the `prember` branch but this will change very soon when we go live with it.
78126
79127
Visit the app in your browser at [http://localhost:4200](http://localhost:4200)

0 commit comments

Comments
 (0)