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

Configure automatic docs generation #425

Merged
merged 15 commits into from
Apr 1, 2024
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://github.com/github/linguist#overrides
# https://github.com/github-linguist/linguist/blob/master/docs/overrides.md
# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
src/proto/compiled.js linguist-generated
src/proto/compiled.d.ts linguist-generated
49 changes: 49 additions & 0 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Update docs

on:
workflow_dispatch:
release:
types: [released]

permissions:
contents: write

jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
ref: "gh-pages"
repository: ${{ github.event.pull_request.head.repo.full_name }}
path: "docs"

- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: |
npm install -g typedoc

- name: Re-generate docs
run: |
MAJOR_VERSION=v$(node -p "require('./package.json').version.split('.')[0]")
DOCS_OUTPUT_FOLDER=${GITHUB_WORKSPACE}/docs/${MAJOR_VERSION}

mkdir -p $DOCS_OUTPUT_FOLDER

npm ci
typedoc --out $DOCS_OUTPUT_FOLDER src/index.ts --includeVersion

cd ${GITHUB_WORKSPACE}/docs

# See: https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Re-generated docs." --allow-empty
git push
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{
}
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ MultiversX SDK for JavaScript and TypeScript (written in TypeScript).

## Documentation

- [Cookbook](https://docs.multiversx.com/sdk-and-tools/sdk-js/sdk-js-cookbook/)
- [Cookbook](https://docs.multiversx.com/sdk-and-tools/sdk-js/sdk-js-cookbook/)
- [Auto-generated documentation](https://multiversx.github.io/mx-sdk-js-core/)

## Distribution

Expand Down Expand Up @@ -63,4 +64,4 @@ In order to run the tests **in the browser**, do as follows:
make clean && npm run browser-tests
```

For the `localnet` tests, make sure you have a *local testnet* up & running. In order to start a *local testnet*, follow [this](https://docs.multiversx.com/developers/setup-local-testnet/).
For the `localnet` tests, make sure you have a _local testnet_ up & running. In order to start a _local testnet_, follow [this](https://docs.multiversx.com/developers/setup-local-testnet/).
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "12.19.1",
"version": "12.19.2",
"description": "MultiversX SDK for JavaScript and TypeScript",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* A library for interacting with the MultiversX blockchain (in general) and Smart Contracts (in particular).
*
* @packageDocumentation
*/

require('./globals');

export * from "./account";
Expand Down
2 changes: 1 addition & 1 deletion src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const createTransactionHasher = require("blake2b");
const TRANSACTION_HASH_LENGTH = 32;

/**
* An abstraction for creating, signing and broadcasting transactions.
* An abstraction for creating and signing transactions.
*/
export class Transaction {
/**
Expand Down
Loading