-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
✨feature: add doc #1986
✨feature: add doc #1986
Conversation
TODO:
|
I guess it may caused by get pages token failed. |
Still not working. This is the yaml file it recommended me when I tried to configure a static HTML setup through Github Actions. Perhaps something is missing from your diff? Could you look into it for me? # Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 |
Looks like |
logger report [Branch "doc" is not allowed to deploy to github-pages due to environment protection rules.] Go to your GitHub Repository: Click on "Settings": Navigate to "Branches": Select "Add rule": Enter "doc" as the branch name: Configure Protection Rules: Require pull request reviews before merging: If you have this enabled, make sure it allows merging without approval. You might need to disable it temporarily for the "doc" branch. Require status checks to pass before merging: Ensure that the necessary checks (e.g., GitHub Pages deployment) are not required for the "doc" branch. Include administrators: Make sure this option is checked if you want administrators to be exempt from these rules. Save Changes: |
Ok, well, I can verify the results of the doc command locally. Perhaps we should make the doc jobs only run on master. Having it run on pull requests will just pollute the CI with failed tests. |
Deploy doc task has updated, it will only take effect on master branch. |
I wonder about versioning. If it would be possible to have it recognize whether it's being deployed on master or a tag and change the URL path? Then maybe people could navigate to older versions by clicking a link to the docs generated for a specific tag. I would hope that the default page is the last tagged version or something. If that's not possible, I guess it's fine. I'd also like to flesh out some of the documentation in this PR so that the first release of the docs isn't so bare bones. If you can help by documenting any of the smaller stuff I'd appreciate it. The more the better. |
This looks fine. I am a little worried about tests and their copy-pasted doc-equivalents going stale... but I think as long as I remember to mention fixing the doc strings in review it should be fine.
Yeah, this is a "nice to have" You are awesome, thanks for your help! |
package.json
Outdated
@@ -54,6 +54,7 @@ | |||
"bech32": "^2.0.0", | |||
"bip174": "^2.1.1", | |||
"bs58check": "^3.0.1", | |||
"typedoc-plugin-bitcoinjs-runcase": "^1.0.1", |
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.
Shouldn't this be a devDependency?
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.
Yes, it should me. I remember this but maybe something is wrong!!
I want to tell you about another thing.
I added an executable environment to the document to help us more flexibly display related cases and provide user testing.
The background is as follows
- We have a lot of test cases. Moving too many cases will affect the organizational structure of our code, and the workload will be huge.
- For related cases, single testing can be combined with the context to understand more, more comprehensively and more efficiently.
To achieve this goal, I did the following things, which also cost me a lot of time:
- Build bitcoinjs-lib browser version
- Develop typedoc-plugin-bitcoinjs-runcase plug-in to support sneaking into the executable environment
- Modify relevant comment tags
You can view the relevant effects here: https://jasonandjay.github.io/bitcoinjs-lib/functions/address.fromBase58Check.html
I think this is a great feature, but I need your help evaluating whether it's suitable
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.
That way we can tell the user to test here and find more cases in the single test
Then we only need to give a correct usage method in example (I customized a @case tag), so that the construction efficiency of our document will be much higher
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.
@junderw please take a look
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.
@jasonandjay typedoc-plugin-bitcoinjs-runcase
is a production dependency and has react
and react-dom
as dependencies. That doesn't belong in bitcoinjs at all.
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.
@pajasevi yes, i will change it later, i want to know is this the right direction to add an executable environment to the document to simplify the case in the single test? so as to proceed with the next step.
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.
This will take a while to review.
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.
Perhaps this should be in a follow up pr
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.
Review typedoc plugin or comments in our repository?
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.
Adding typedoc-plugin-bitcoinjs-runcase
should be in a separate PR is what I'm saying.
Got it It will now be more efficient for us to improve the documentation Or, let’s add the key comments in the document first, and then add the run case. What do you think? |
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.
Amazing work.
I did two things
|
Thanks. That lowers the scope of the review significantly. I'll take another look later today. |
Is there anything that needs to be optimized? Maybe we can push document construction to next step. |
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.
LGTM. Great job. Github is being weird. Crossing finger that this works lol.
Deployed successfully! https://bitcoinjs.github.io/bitcoinjs-lib/ Maybe add this to the README? |
Add bitcoinjs-lib documentation