forked from MicrosoftDocs/oufr-dev-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
116 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contributing | ||
|
||
In order to make changes to the files generation logic follow the steps bellow for your inner loop. | ||
|
||
## Local development setup | ||
|
||
1. Clone the repo using the following command. | ||
|
||
``` | ||
git clone https://github.com/MicrosoftDocs/oufr-dev-docs.git | ||
``` | ||
|
||
2. Install the main dependencies for the project to run. | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
3. Install the latest versions of `office-ui-fabric-react` and `@uifabric/fabric-website`. | ||
Note: this are not part of main dependency install run because we want the latest versions in the pipeline to generate most up to date docs. ️️⚠️ DO NOT COMMIT the changes in this step done to `package.json` and `package-lock.json` files. | ||
|
||
``` | ||
npm run install-deps | ||
``` | ||
|
||
4. Run the initial build command which is necessary for the next step. | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
5. Following step needs to be run only once when starting local developer work. This will download all `api.json` files and save them in the `input` folder that is not tracked by git so it does not need to be committed during development. | ||
|
||
``` | ||
npm run download-api-files | ||
``` | ||
|
||
## Local development flow | ||
|
||
1. After running the steps above you are ready to go and make changes in the business logic and run only one command (with one exception described below) every time when you want to verify your changes: | ||
|
||
``` | ||
npm run local | ||
``` | ||
|
||
**_Exception:_** in case you make changes to the logic of downloading the `api.json` files located [here](https://github.com/MicrosoftDocs/oufr-dev-docs/blob/master/src/downloadApiFiles.ts) you will need to rerun steps 4 and 5 from the setup above and then `npm run local`. | ||
|
||
This command runs under the hood several other scripts so you might see some output in the console from different scripts being invoked. | ||
|
||
The end result of it will be tge documentation files outputted in the `office-ui-fabric-react` folder that relates to documentation itself and in the `config` folder that relates to the `api-documenter` config file. | ||
|
||
❕**NOTE:** files generated are git ignored, so in order to be able to verify the changes to documentation files or the `api-documenter` config file that would result from your logic changes, you would need to comment out related lines in the `.gitignore` file before your changes and make the first run after which you should temporarily commit the generated files, ❗️❗️❗️ BUT ❗️❗️❗️ very important to remember to remove them along with un-commenting the `.gitignore` changes before pushing it to the remote. After the first run and committing the generated files, any subsequent run after any of your logic changes will be reflected in the git diff. | ||
|
||
2. When you feel like your changes are good to be pushed to the remote repository, please don't forget to remove the generated files and revert the changes in the `.gitignore` file described in the `NOTE` paragraph above. | ||
|
||
After doing that, you can push changes to the master and you will be able to see the [pipeline](https://uifabric.visualstudio.com/fabricpublic/_build?definitionId=107) described [here](PIPELINE_FLOW.md) triggered and after a successful [release](https://uifabric.visualstudio.com/fabricpublic/_release?_a=releases&view=mine&definitionId=1) deployment, a DocFX publish build will be triggered that can be accessed on their [portal](https://ops.microsoft.com/#/). To be able to access the `oufr-dev-docs` DocFX publish results you most likely will need to sign in with your Github account and also be added as a contributor or repository owner to this repository. It's an important part in verifying if your changes are validated against their strict formatting of yaml and markdown files that are published. | ||
|
||
To verify your changes on the `docs.microsoft` portal you can navigate to the published `staging` branch following [this link](https://review.docs.microsoft.com/en-us/javascript/api/getstarted/getstartedpage?view=office-ui-fabric-react-latest&branch=staging) right after the DocFX publish build has successfully finished. This branch is available to Microsoft employees only and is not going to the `live` branch that is publicly available until next morning after a scheduled run. So make sure at the end of the day you have something that can be published and it looks nice 😊. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Pipeline flow | ||
|
||
The flow of auto updating the documentation consists of 2 stages and is set to happen on a scheduled basis from Monday to Friday at 8:00am. Here is a detailed overview of how it happens: | ||
|
||
1. The build definition yaml file is located [here](https://github.com/MicrosoftDocs/oufr-dev-docs/blob/master/config/azure-pipelines/update-docs.yaml) and is basically the starting point of the automation pipeline (stage 1) that contains the schedule trigger and all necessary steps to generate the documentation files and publish them as an Azure build artifact. [Here](https://uifabric.visualstudio.com/fabricpublic/_build?definitionId=107) is where that build definition gets consumed and runs the automation. An overview of what happens during this build can be represented with these steps: | ||
|
||
- First few tasks are just to setup the environment like: | ||
|
||
1. `npm install` | ||
2. `npm install --save-dev office-ui-fabric-react @uifabric/fabric-website` used to get some documentation that is published with these packages | ||
3. `npm run build` | ||
|
||
- Next task is simply extracting the version of the `office-ui-fabric-react` package and write it to a file that is going to be used later to help keep track of update history. | ||
|
||
- We download all the `api.json` files that are uploaded to an Azure blob storage every time a release of the Fabric packages happen. These are the core files that the documentation gets generated from. | ||
|
||
- Before generating the main yaml files that are outputted by the `api-ducumenter` in the next step we need to generate a config file for it that will represent the navigation structure on the left side that mirrors the one of the Fabric website. During this steps we also generate some overview and example files for each Fabric control and also the GetStartedPage and ResourcesPage. The gist of what happens during this step is: | ||
|
||
1. Create the GetStartedPage and the ResourcesPage by glueing several markdown files for each from the fabric-website package that we installed during the setup step. | ||
2. Create Overview markdown files for each fabric control that are again the result of glueing the Dos, Donts and Overview markdown files that we get from the office-ui-fabric-react package that we installed during the setup step. | ||
3. Create some example files for each fabric control that are simply some iframe windows to the deploy links that are generated after each successful PR merge into Fabric repo. | ||
4. Create the config file that is consumed by the `api-documenter` that will include the above mentioned created files and also provide a defined structure of how the API items should be filtered during the next step. | ||
|
||
- Run the `api-documenter` now that we have teh `api.json` files and the config file ready. This will output to a specified directory all API yaml files plus a `toc.yml` file that is generated following the structure of the config file we provided. | ||
|
||
- Next few steps are just gathering all the generated files and publish them as build artifacts that we will consume them in the next stage of the automation process. | ||
|
||
2. The release pipeline is located [here](https://uifabric.visualstudio.com/fabricpublic/_release?_a=releases&view=mine&definitionId=1) and represents the `stage 2` that is nothing more than saving the new generated files in the first stage to the corresponding branches of the `oufr-dev-docs` repository. Here is what happens in parallel for the `staging` and `live` branches: | ||
|
||
- Download the build artifacts from the first stage (once in the beginning). | ||
|
||
- Delete the old documentation files from their final location (same for each branch). | ||
|
||
- Copy the downloaded files into the location we cleaned up in the previous step (same for each branch). | ||
|
||
- Add a new line in the `FABRIC-VERSION` file to mark the version of the office-ui-fabric-react package used in this run. This is done for history reasons plus to avoid an error in the next step when there are no changes to commit (same for each branch). | ||
|
||
- Commit the changes (same for each branch). | ||
|
||
- Push the changes to the remote repository (same for each branch). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"lib": [ | ||
"es2015", | ||
"dom" | ||
], | ||
] | ||
}, | ||
"include": [ | ||
"src" | ||
|