Skip to content

Commit

Permalink
feat: 🧑‍💻 add readme script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kira272921 committed Mar 13, 2022
1 parent 3ea9857 commit b4ebdcc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
38 changes: 19 additions & 19 deletions README.md
Expand Up @@ -39,6 +39,25 @@ Thirdweb snippets for enhancing your the developer experience while working with
| `transferToken` | Transfer token to address | Bundle Collection module |
| `transferNFTAddr` | Transfer a specific amount of NFT from an address | Bundle Collection module |
| `unwrapNFT` | Unwrap a NFT | Bundle Collection module |
| `tokenBalance` | Get the balance of a token | Token module |
| `tokenBalanceOf` | Get the balance of a token for a specific address | Token module |
| `tokenBurn` | Burn tokens owned by the owner | Token module |
| `tokenBurnFrom` | Burn tokens owned by a specific address | Token module |
| `tokenGet` | Get details about a token module | Token module |
| `tokenGetAllHolderBalances` | Get all the balances of all holders | Token module |
| `tokenGetDelegation` | Get the delegation of a token | Token module |
| `tokenGetDelegationOf` | Get the delegation of a token for a specific address | Token module |
| `tokenGetValue` | Get the value for the specified amount of a token | Token module |
| `getVoteBalance` | Get information of the vote balance for yourself | Token module |
| `getVoteBalanceOf` | Get information about the vote balance for the specified address | Token module |
| `tokenMint` | Mint specific amount of tokens | Token module |
| `tokenMintBatchTo` | Mint specific amount of tokens to multiple addresses in a batch | Token module |
| `tokenMintTo` | Mint specific amount of tokens to a specific address | Token module |
| `tokenTotalSupply` | Get the total supply of a token module | Token module |
| `tokenTransfer` | Transfer specific amount of tokens to a specific address | Token module |
| `tokenTransferBatch` | Transfer specific amounts of tokens to multiple addresses in a batch | Token module |
| `tokenTransferFrom` | Transfer specific amount of tokens from an address to another address | Token module |
| `tokenTransferFromBatch` | Transfer specific amounts of tokens from multiple addresses to another addresses in a batch | Token module |
| `initVote` | Initialize the Vote module | Vote Collection module |
| `getBalanceChain` | Get the balance of the project wallet in the native token of the chain | Vote Collection module |
| `getBalanceERC20` | Get the balance of the project wallet in a particular ERC20 token contract | Vote Collection module |
Expand Down Expand Up @@ -66,25 +85,6 @@ Thirdweb snippets for enhancing your the developer experience while working with
| `getNftOwner` | Get the owner of a NFT | Nft Collection module |
| `getNftTotalSupply` | Get the total supply of a NFT collection | Nft Collection module |
| `transferNft` | Transfer an NFT to a specific address | Nft Collection module |
| `tokenBalance` | Get the balance of a token | Token module |
| `tokenBalanceOf` | Get the balance of a token for a specific address | Token module |
| `tokenBurn` | Burn tokens owned by the owner | Token module |
| `tokenBurnFrom` | Burn tokens owned by a specific address | Token module |
| `tokenGet` | Get details about a token module | Token module |
| `tokenGetAllHolderBalances` | Get all the balances of all holders | Token module |
| `tokenGetDelegation` | Get the delegation of a token | Token module |
| `tokenGetDelegationOf` | Get the delegation of a token for a specific address | Token module |
| `tokenGetValue` | Get the value for the specified amount of a token | Token module |
| `getVoteBalance` | Get information of the vote balance for yourself | Token module |
| `getVoteBalanceOf` | Get information about the vote balance for the specified address | Token module |
| `tokenMint` | Mint specific amount of tokens | Token module |
| `tokenMintBatchTo` | Mint specific amount of tokens to multiple addresses in a batch | Token module |
| `tokenMintTo` | Mint specific amount of tokens to a specific address | Token module |
| `tokenTotalSupply` | Get the total supply of a token module | Token module |
| `tokenTransfer` | Transfer specific amount of tokens to a specific address | Token module |
| `tokenTransferBatch` | Transfer specific amounts of tokens to multiple addresses in a batch | Token module |
| `tokenTransferFrom` | Transfer specific amount of tokens from an address to another address | Token module |
| `tokenTransferFromBatch` | Transfer specific amounts of tokens from multiple addresses to another addresses in a batch | Token module |


## Show your support
Expand Down
5 changes: 0 additions & 5 deletions data/constants.json

This file was deleted.

23 changes: 23 additions & 0 deletions data/readmeConstants.js
@@ -0,0 +1,23 @@
const readmeTop = `# thirdweb-snippets
Thirdweb snippets for enhancing your the developer experience while working with thirdweb 🚀!
## Usage
`;

const readmeBottom = `
## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2022 [Avneesh Agarwal](https://github.com/avneesh0612).<br />
This project is [GNU](https://github.com/avneesh0612/thirdweb-snippets/blob/main/LICENSE) licensed.
`
export {
readmeTop,
readmeBottom
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -17,7 +17,8 @@
"release:patch": "standard-version --release-as patch",
"release:major": "standard-version --release-as major",
"format": "prettier --write '**/*.{ts,json,md,js}'",
"genReadme": "node scripts/generateReadme.js"
"genReadme": "node scripts/generateReadme.js",
"pre-commit": "yarn run genReadme && yarn run format && git add -A ."
},
"categories": [
"Snippets"
Expand Down
23 changes: 2 additions & 21 deletions scripts/generateReadme.js
@@ -1,28 +1,9 @@
import fs from "fs";
import { markdownTable } from "markdown-table";

import constants from '../data/constants.js'
import convertFileName from "../utils/convertFileName.js";

const readmeTop = `# thirdweb-snippets
Thirdweb snippets for enhancing your the developer experience while working with thirdweb 🚀!
## Usage
`;

const readmeBottom = `
## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2022 [Avneesh Agarwal](https://github.com/avneesh0612).<br />
This project is [GNU](https://github.com/avneesh0612/thirdweb-snippets/blob/main/LICENSE) licensed.
`;
import { readmeTop, readmeBottom } from "../data/readmeConstants.js";
import constants from '../data/constants.js'

let finalSnippets = [
["Prefix", "Description", "Module"]
Expand Down

0 comments on commit b4ebdcc

Please sign in to comment.