Skip to content

Commit

Permalink
docs: add doc generator (#150)
Browse files Browse the repository at this point in the history
* fix: bump axios to patched version

GHSA-74fj-2j2h-c42q

* docs: add generator
  • Loading branch information
aheckmann authored Jan 19, 2022
1 parent 809b0f4 commit 057420f
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
- name: Update docs
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
yarn gh-pages -d docs -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ surprise users when Experimental API modifications occur.

## Documentation

Visit [https://docs.metaplex.com/sdk/js/getting-started](https://docs.metaplex.com/sdk/js/getting-started) to get started.
- [API Docs](https://metaplex-foundation.github.io/js)
- [Guides](https://docs.metaplex.com/sdk/js/getting-started)

## Community

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"url": "https://github.com/metaplex/js.git"
},
"scripts": {
"build:docs": "typedoc",
"doc": "typedoc",
"doc:update": "yarn doc && ./sh/update-docs",
"build": "rimraf lib && rollup -c",
"dev": "rollup -c --watch",
"lint": "eslint \"{src,test}/**/*.ts\" --format stylish",
Expand Down Expand Up @@ -55,7 +56,7 @@
"@solana/spl-token": "^0.1.8",
"@solana/web3.js": "^1.30.2",
"@types/bs58": "^4.0.1",
"axios": "^0.21.4",
"axios": "^0.25.0",
"bn.js": "^5.2.0",
"borsh": "^0.4.0",
"bs58": "^4.0.1",
Expand Down Expand Up @@ -93,6 +94,7 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"gh-pages": "^3.2.3",
"husky": "^7.0.2",
"jest": "^27.1.0",
"node-stream-zip": "^1.15.0",
Expand All @@ -119,4 +121,4 @@
"@commitlint/config-conventional"
]
}
}
}
20 changes: 20 additions & 0 deletions sh/update-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env sh

MAIN_BRANCH='main'
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

if [[ $CURRENT_BRANCH != $MAIN_BRANCH ]]; then
echo "Aborting doc generation. Please switch to the $MAIN_BRANCH branch to generate documentation."
exit 1
fi

if [[ -z $(git status --porcelain) ]];
then
echo "Publishing docs to gh-pages.."
yarn gh-pages -d docs
echo "Docs will be live in a few seconds: https://metaplex-foundation.github.io/js"
else
echo "Aborting doc generation. Please commit any changes before updating docs."
echo ""
git status
fi
1 change: 1 addition & 0 deletions src/programs/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @internal */
export * as transactions from '../transactions';

export * as auction from '@metaplex-foundation/mpl-auction';
Expand Down
1 change: 1 addition & 0 deletions src/providers/storage/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './arweave';
export * as storage from './Storage';
10 changes: 2 additions & 8 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"entryPoints": [
"src/actions/index.ts",
"src/programs/auction/index.ts",
"src/programs/metadata/index.ts",
"src/programs/metaplex/index.ts",
"src/programs/index.ts",
"src/programs/vault/index.ts",
"src/index.ts"
"src/"
],
"excludeInternal": true,
"excludePrivate": true,
"out": "./docs"
}
}
Loading

0 comments on commit 057420f

Please sign in to comment.