Skip to content

Feature: Automatic documentation generation from TSDoc comments and Improved Workflow #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"eslint.format.enable": true,
"files.exclude": {
"dist/": true,
"node_modules/": true
"node_modules/": true,
"temp/": true
},
"testExplorer.useNativeTesting": true
},
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
node_modules
docs
43 changes: 43 additions & 0 deletions .github/workflows/docgen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Documentation Generation

on:
push:
branches:
- main

jobs:
build:
name: Build and Documentation
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Run clean
run: npm run clean

- name: Run build
run: npm run build

- name: Generate documentation
run: |
npm run docs

- name: Force-add changes
run: git add --force docs

- name: Commit and force push changes
run: |
git config --global user.name "Documentation Bot"
git config --global user.email "[email protected]"
git commit -a -m "Automated: Update documentation and clean temp folder"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/dist/
/docs/
/node_modules/
/temp/
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
./github
*.md
./docs
./temp
*.md
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ First off, thanks for taking the time to contribute! ❤️
New features, ideas and bug fixes are always welcome! Everyone interacting in the project's code bases or issue trackers, is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md).

> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
>
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
Expand All @@ -15,8 +16,7 @@ In order to contribute to this project, follow a few easy steps:
1. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this repository and clone it on your machine
2. Open the local repository with [Visual Studio Code](https://code.visualstudio.com) with the remote development feature enabled (install the [Remote Development extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack))
3. Create a branch `my-awesome-feature` and commit to it
4. Run `npm run format`, `npm run lint`, `npm run test` and `npm run build`,
or `npm run format && npm run lint && npm run test && npm run build` and verify that they complete without errors.
4. Run npm run `pre-pull-request` and verify that they complete without errors.
5. Push `my-awesome-feature` branch to GitHub and open a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
6. Liked some of my work? Buy me a ☕ (or more likely 🍺)

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ export const TodoItem = ({ item }) => {
};
```

## Documentation

The full documentation for this project can be found in [docs/react-directus.md](docs/react-directus.md). It contains detailed information about the components, usage, and additional features.

## 📱 React Native

To make the project fully compatible with React Native you need to install the [localstorage-polyfill](https://www.npmjs.com/package/localstorage-polyfill) package:
Expand Down
38 changes: 38 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"projectFolder": ".",
"mainEntryPointFilePath": "<projectFolder>/dist/types/index.d.ts",
"compiler": {
"tsconfigFilePath": "<projectFolder>/tsconfig.json"
},
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/temp/",
"includeForgottenExports": true
},
"docModel": {
"enabled": true,
"includeForgottenExports": true,
"projectFolderUrl": "https://github.com/gremo/react-directus"
},
"dtsRollup": {
"enabled": true
},
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"default": {
"logLevel": "none"
}
},
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
}
}
}
Loading