Skip to content
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

add github action to update doc #37

Merged
merged 10 commits into from
Feb 22, 2022
Merged
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
27 changes: 27 additions & 0 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check and Update Repo's documenation

on: pull_request

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [17.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- name: Update Documentation
uses: EndBug/add-and-commit@v7
with:
message: "Automated update to repo's documentation from github action"
add: '*.md'
yen-tt marked this conversation as resolved.
Show resolved Hide resolved
push: true
default_author: github_actions
21 changes: 0 additions & 21 deletions .github/workflows/validate_docs.yml

This file was deleted.

6 changes: 3 additions & 3 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
*
* DEFAULT VALUE: "warning"
*/
"logLevel": "warning"
"logLevel": "error"

/**
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
Expand Down Expand Up @@ -328,7 +328,7 @@
*/
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
"logLevel": "error"
// "addToApiReportFile": false
},

Expand All @@ -352,7 +352,7 @@
*/
"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
"logLevel": "error"
// "addToApiReportFile": false
}

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
"src"
],
"scripts": {
"build": "tsc && npm run api-extractor && npm run generate-docs",
"build-ci": "tsc && npm run api-extractor-ci && npm run generate-docs",
"build": "rm -rf lib && tsc && npm run api-extractor && npm run generate-docs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've sometimes seen typescript not remove files it should (or that I think it should, anyway), like when I removed components/Filters.tsx, and added the components/Filters folder - imports for components/Filters would point to Filters.tsx instead of Filters/index.tsx. But I've also seen it work as I expect, where it removes the stale files. Do we kind of know why this sometimes happens (or maybe it always happens and I misremembered) and do we need it in all our typescript libs?

Copy link
Contributor Author

@yen-tt yen-tt Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, typescript compiler does not clean or delete files from its outDir folder. It just overwrite files if there's an update but the old ones stay. This was causing problem for me locally with api extractor picking up errors from old generated build files. Looking at these issues (microsoft/TypeScript#13722, microsoft/TypeScript#16057), doesn't look like there's a native solution other than adding some watch functionality or manual clean command.

"dev": "tsc --watch",
"lint": "eslint .",
"api-extractor": "api-extractor run --local --verbose",
"api-extractor-ci": "api-extractor run --verbose",
"generate-docs": "api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",
"prepublishOnly": "npm run build",
"test": "jest --passWithNoTests"
Expand Down
17 changes: 0 additions & 17 deletions scripts/validate_docs.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './components';
export * from './hooks';
export * from './models';
export * from './sections';
export * from './sections';