upgrade serve and customize serve command #2805
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current directions in
docs/readme
are a bit confusing. It says to use yarn “build” and “serve”, but that just opens a directory explorer which is kind of confusing.Additionally, the paths don’t actually work when you navigate around.
To get docs to render you have to click through to 3 levels of folders to get to the right path and then it will render:
http://localhost:3000/dist/open-source/victory/
,However, if you then try and click on
/docs
you’ll get a 404 because the content is served with/dist
in the path, but the href is forhttp://localhost:3000/open-source/victory/about
To fix this, I added a custom
yarn serve
command which letsserve
know to serve the/dist
path. This fixes the path issues and allows the author to navigate around and test the site on their local machine properly.The only outstanding issue now is that going to the default route still opens the file explorer. Since serve doesn’t seem to allow for setting a prefix, I updated the documentation to explain what URL the actual docs will be hosted at.
Finally, serve was a couple of major versions behind, so I upgraded it to latest.
Type of Change
How Has This Been Tested?