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

add github action to update doc #37

merged 10 commits into from
Feb 22, 2022

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Feb 18, 2022

add a github action to automate a commit for updating docs if it's out of date. The action will run api extractor in local mode to build api report file, and the logLevel is updated to 'error' so api extractor will fail in local mode and action will exit with non-zero code

also update build command to remove lib folder before running tsc and api extractor to ensure there's no old files in lib that may generate errors in local build.

J=SLAP-1902
TEST=auto

made a small change to a file's doc and push to pr. see that a commit is made from github action to update docs.

oshi97
oshi97 previously approved these changes Feb 18, 2022
@yen-tt yen-tt dismissed oshi97’s stale review February 18, 2022 20:09

updated build command to delete lib before creating build and running api extractor

@yen-tt yen-tt requested a review from oshi97 February 18, 2022 20:09
@@ -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.

@yen-tt yen-tt requested a review from oshi97 February 18, 2022 22:07
@yen-tt yen-tt merged commit b79bcc0 into main Feb 22, 2022
@yen-tt yen-tt deleted the dev/automate-update-doc branch February 22, 2022 15:17
yen-tt added a commit that referenced this pull request Sep 28, 2022
add a github action to automate a commit for updating docs if it's out of date. The action will run api extractor in local mode to build api report file, and the logLevel is updated to 'error' so api extractor will fail in local mode and action will exit with non-zero code

also update build command to remove lib folder before running tsc and api extractor to ensure there's no old files in lib that may generate errors in local build.

J=SLAP-1902
TEST=auto

made a small change to a file's doc and push to pr. see that a commit is made from github action to update docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants