-
-
Notifications
You must be signed in to change notification settings - Fork 740
feat: support github custom domain #458
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
Conversation
|
LGTM |
atinux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work done @nozomuikuta 👏
|
Thank you for reviewing! In fact, I found some bugs in my PR. 🙇 That is, |
|
Sorry for multi-posting. I found a thing to reconsider. According to GitHub Enterprise's spec, it is possible that host name for repositories and that for API are different. As far as I googled, there are some patterns like following:
Fortunately, it seems that the path to edit files and that to get releases are always same.
Then, I have a question about how to handle this issue. Which do you think is approach that is most suitable for Nuxt's way or its DX? Case 1
Case 2
Whichever, |
|
@nozomuikuta I prefer the Case 2, for advanced use case, they can edit settings.json, this way we keep as simple as simple the create-nuxt-content-docs :) |
|
I fixed my PR based on your opinion. First, I reverted changes on Second, I added An alternative approach would be to make Third, I modified related parts of docs again (adding description about Forth, of course I ran |
| const { github = '', githubApi = '' } = state.settings | ||
|
|
||
| // GitHub Enterprise | ||
| if (github.startsWith('http') && githubApi.startsWith('http')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enough to check just existence of the 2 settings?
if (github && githubApi) { ... }There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be enough I guess
|
@nozomuikuta Oh yes indeed, #468 has been merged! |
f7bd207 to
9033555
Compare
|
Thank you for letting me know! |
Types of changes
Description
This PR implements #439, and lets us fetch repositories hosted on GitHub Enterprise, whose API has other domain than
api.github.amrom.workers.dev.I defined a Vuex getter
githubUrlsthat returns an object whose values are full urls to get data of repository and its releases.In addition, I modified related part of docs and SAO prompts.
Checklist:
What and how I tested my changes
create-nuxt-contentFirst, I added a test case to check whether it creates files correctly when developer assign full url of repository instead of
owner/repostring.Second, I ran
yarn testin the project root and all the tests were passed.theme-docsFirst, I ran
yarn linkfor all the packages (@nuxt/content,@nuxt/theme-docs, andcreate-nuxt-content).Second, I ran the linked
create-nuxt-contentto gettheme-docsfiles.Third, I replaced the installed
@nuxt/theme-docswith my local one, and ranyarn run dev, resulting in that releases are correctly fetched.It would be fine to test the full-url case with GitHub repository instead of GitHub Enterprise, because what is different is only the form of the original string, not actual reachability of the API.
P.S. This is my very first PR for open source project in my life. 👶