diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..9246b66eaf --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,81 @@ +name: Deploy TypeDoc to GitHub Pages + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9.2.0 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV" + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build stateless.js + run: cd js/stateless.js && pnpm run build + + - name: Generate TypeDoc for stateless.js + run: npx typedoc --options typedoc.stateless.json + + - name: Generate TypeDoc for compressed-token + run: npx typedoc --options typedoc.compressed-token.json + + - name: Create index page + run: cp api-docs-index.html api-docs/index.html + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './api-docs' + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 191d6aee62..fc60f0e3ad 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ !sdk-tests/sdk-anchor-test/target/ **/dist/ +api-docs/ # rpc /rpc/node_modules/ diff --git a/api-docs-index.html b/api-docs-index.html new file mode 100644 index 0000000000..8e8b102cb1 --- /dev/null +++ b/api-docs-index.html @@ -0,0 +1,106 @@ + + + + + + ZK Compression TypeScript SDK - API Documentation + + + +
+

ZK Compression TypeScript SDK

+

API reference documentation for Light Protocol's ZK Compression TypeScript libraries.

+ +
+ +

@lightprotocol/stateless.js

+

Core JavaScript API for ZK Compression and Light Protocol

+
+ + +

@lightprotocol/compressed-token

+

JavaScript client for the compressed-token program

+
+
+ + +
+ + diff --git a/js/compressed-token/README.md b/js/compressed-token/README.md index ebbc5e423e..7b8bacc979 100644 --- a/js/compressed-token/README.md +++ b/js/compressed-token/README.md @@ -14,6 +14,9 @@ package license package weekly downloads + + Ask DeepWiki +

### Installation @@ -29,7 +32,8 @@ npm install --save \ ### Documentation and examples - [Latest Source code](https://github.com/lightprotocol/light-protocol/tree/main/js/compressed-token) -- [Creating and sending compressed tokens](https://www.zkcompression.com/developers/typescript-client#creating-minting-and-transferring-a-compressed-token) +- [Compressed Token Guides](https://www.zkcompression.com/compressed-tokens/guides) +- [Other Libraries](https://lightprotocol.github.io/light-protocol/) ### Getting help diff --git a/js/stateless.js/README.md b/js/stateless.js/README.md index 2765b9b65b..371743fab6 100644 --- a/js/stateless.js/README.md +++ b/js/stateless.js/README.md @@ -14,6 +14,9 @@ package license package weekly downloads + + Ask DeepWiki +

## Usage @@ -33,8 +36,8 @@ For a more detailed documentation on usage, please check [the respective section For example implementations, including web and Node, refer to the respective repositories: - [Web application example implementation](https://github.com/Lightprotocol/example-web-client) - - [Node server example implementation](https://github.com/Lightprotocol/example-nodejs-client) +- [Other Libraries](https://lightprotocol.github.io/light-protocol/) ## Troubleshooting diff --git a/package.json b/package.json index c9cd4265e4..e29b76f96d 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "playwright": "^1.55.1", "prettier": "^3.6.2", "syncpack": "^13.0.4", + "typedoc": "^0.28.14", "typescript": "^5.9.3" }, "packageManager": "pnpm@9.2.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4414b33ede..e73e579217 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: syncpack: specifier: ^13.0.4 version: 13.0.4(typescript@5.9.3) + typedoc: + specifier: ^0.28.14 + version: 0.28.14(typescript@5.9.3) typescript: specifier: ^5.9.3 version: 5.9.3 @@ -1130,6 +1133,9 @@ packages: resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@gerrit0/mini-shiki@3.14.0': + resolution: {integrity: sha512-c5X8fwPLOtUS8TVdqhynz9iV0GlOtFUT1ppXYzUUlEXe4kbZ/mvMT8wXoT8kCwUka+zsiloq7sD3pZ3+QVTuNQ==} + '@hapi/hoek@9.3.0': resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} @@ -1696,6 +1702,21 @@ packages: '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@shikijs/engine-oniguruma@3.15.0': + resolution: {integrity: sha512-HnqFsV11skAHvOArMZdLBZZApRSYS4LSztk2K3016Y9VCyZISnlYUYsL2hzlS7tPqKHvNqmI5JSUJZprXloMvA==} + + '@shikijs/langs@3.15.0': + resolution: {integrity: sha512-WpRvEFvkVvO65uKYW4Rzxs+IG0gToyM8SARQMtGGsH4GDMNZrr60qdggXrFOsdfOVssG/QQGEl3FnJ3EZ+8w8A==} + + '@shikijs/themes@3.15.0': + resolution: {integrity: sha512-8ow2zWb1IDvCKjYb0KiLNrK4offFdkfNVPXb1OZykpLCzRU6j+efkY+Y7VQjNlNFXonSw+4AOdGYtmqykDbRiQ==} + + '@shikijs/types@3.15.0': + resolution: {integrity: sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw==} + + '@shikijs/vscode-textmate@10.0.2': + resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} + '@sideway/address@4.1.4': resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} @@ -2138,6 +2159,9 @@ packages: '@types/glob@7.2.0': resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/http-cache-semantics@4.0.2': resolution: {integrity: sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==} @@ -2177,6 +2201,9 @@ packages: '@types/tar@6.1.13': resolution: {integrity: sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw==} + '@types/unist@3.0.3': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/uuid@8.3.4': resolution: {integrity: sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==} @@ -3130,6 +3157,10 @@ packages: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} @@ -4269,6 +4300,9 @@ packages: resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -4314,6 +4348,9 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lunr@2.3.9: + resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} @@ -4328,6 +4365,10 @@ packages: resolution: {integrity: sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -4335,6 +4376,9 @@ packages: md5.js@1.3.5: resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -4894,6 +4938,10 @@ packages: public-encrypt@4.0.3: resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} + punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -5596,6 +5644,13 @@ packages: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} + typedoc@0.28.14: + resolution: {integrity: sha512-ftJYPvpVfQvFzpkoSfHLkJybdA/geDJ8BGQt/ZnkkhnBYoYW6lBgPQXu6vqLxO4X75dA55hX8Af847H5KXlEFA==} + engines: {node: '>= 18', pnpm: '>= 10'} + hasBin: true + peerDependencies: + typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x + typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -5611,6 +5666,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -6882,6 +6940,14 @@ snapshots: '@eslint/core': 0.15.2 levn: 0.4.1 + '@gerrit0/mini-shiki@3.14.0': + dependencies: + '@shikijs/engine-oniguruma': 3.15.0 + '@shikijs/langs': 3.15.0 + '@shikijs/themes': 3.15.0 + '@shikijs/types': 3.15.0 + '@shikijs/vscode-textmate': 10.0.2 + '@hapi/hoek@9.3.0': {} '@hapi/topo@5.1.0': @@ -7444,6 +7510,26 @@ snapshots: '@rtsao/scc@1.1.0': {} + '@shikijs/engine-oniguruma@3.15.0': + dependencies: + '@shikijs/types': 3.15.0 + '@shikijs/vscode-textmate': 10.0.2 + + '@shikijs/langs@3.15.0': + dependencies: + '@shikijs/types': 3.15.0 + + '@shikijs/themes@3.15.0': + dependencies: + '@shikijs/types': 3.15.0 + + '@shikijs/types@3.15.0': + dependencies: + '@shikijs/vscode-textmate': 10.0.2 + '@types/hast': 3.0.4 + + '@shikijs/vscode-textmate@10.0.2': {} + '@sideway/address@4.1.4': dependencies: '@hapi/hoek': 9.3.0 @@ -8138,6 +8224,10 @@ snapshots: '@types/minimatch': 5.1.2 '@types/node': 22.16.5 + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.3 + '@types/http-cache-semantics@4.0.2': {} '@types/json-schema@7.0.15': {} @@ -8174,6 +8264,8 @@ snapshots: '@types/node': 22.16.5 minipass: 4.2.8 + '@types/unist@3.0.3': {} + '@types/uuid@8.3.4': {} '@types/uuid@9.0.8': {} @@ -9256,6 +9348,8 @@ snapshots: ansi-colors: 4.1.3 strip-ansi: 6.0.1 + entities@4.5.0: {} + env-paths@2.2.1: {} environment@1.1.0: {} @@ -10662,6 +10756,10 @@ snapshots: lines-and-columns@2.0.3: {} + linkify-it@5.0.0: + dependencies: + uc.micro: 2.1.0 + locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -10704,6 +10802,8 @@ snapshots: dependencies: yallist: 3.1.1 + lunr@2.3.9: {} + magic-string@0.30.11: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -10716,6 +10816,15 @@ snapshots: map-obj@5.0.0: {} + markdown-it@14.1.0: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + math-intrinsics@1.1.0: {} md5.js@1.3.5: @@ -10724,6 +10833,8 @@ snapshots: inherits: 2.0.4 safe-buffer: 5.2.1 + mdurl@2.0.0: {} + merge2@1.4.1: {} micromatch@4.0.5: @@ -11291,6 +11402,8 @@ snapshots: randombytes: 2.1.0 safe-buffer: 5.2.1 + punycode.js@2.3.1: {} + punycode@2.3.1: {} pure-rand@6.1.0: {} @@ -12143,12 +12256,23 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 + typedoc@0.28.14(typescript@5.9.3): + dependencies: + '@gerrit0/mini-shiki': 3.14.0 + lunr: 2.3.9 + markdown-it: 14.1.0 + minimatch: 9.0.5 + typescript: 5.9.3 + yaml: 2.8.1 + typescript@4.9.5: {} typescript@5.9.2: {} typescript@5.9.3: {} + uc.micro@2.1.0: {} + unbox-primitive@1.0.2: dependencies: call-bind: 1.0.8 diff --git a/typedoc.compressed-token.json b/typedoc.compressed-token.json new file mode 100644 index 0000000000..b52bf927b2 --- /dev/null +++ b/typedoc.compressed-token.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "name": "@lightprotocol/compressed-token", + "entryPoints": ["js/compressed-token/src/index.ts"], + "out": "api-docs/compressed-token", + "exclude": [ + "**/node_modules/**", + "**/*.test.ts", + "**/*.spec.ts", + "**/tests/**", + "**/dist/**", + "**/playwright.config.ts" + ], + "excludePrivate": true, + "excludeProtected": false, + "excludeInternal": true, + "skipErrorChecking": true, + "readme": "js/compressed-token/README.md", + "tsconfig": "js/compressed-token/tsconfig.json", + "compilerOptions": { + "skipLibCheck": true + }, + "plugin": [], + "navigation": { + "includeCategories": true, + "includeGroups": true + }, + "categorizeByGroup": true, + "sort": ["source-order"], + "kindSortOrder": [ + "Function", + "Class", + "Interface", + "TypeAlias", + "Variable", + "Enum" + ], + "searchInComments": true, + "visibilityFilters": { + "protected": true, + "private": false, + "inherited": true, + "external": false + }, + "hideGenerator": false, + "includeVersion": true, + "githubPages": true, + "navigationLinks": { + "Other Libraries": "../index.html", + "Documentation": "https://www.zkcompression.com", + "GitHub": "https://github.com/Lightprotocol/light-protocol" + } +} diff --git a/typedoc.stateless.json b/typedoc.stateless.json new file mode 100644 index 0000000000..c838aa0f84 --- /dev/null +++ b/typedoc.stateless.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "name": "@lightprotocol/stateless.js", + "entryPoints": ["js/stateless.js/src/index.ts"], + "out": "api-docs/stateless.js", + "exclude": [ + "**/node_modules/**", + "**/*.test.ts", + "**/*.spec.ts", + "**/tests/**", + "**/dist/**", + "**/playwright.config.ts" + ], + "excludePrivate": true, + "excludeProtected": false, + "excludeInternal": true, + "skipErrorChecking": true, + "readme": "js/stateless.js/README.md", + "tsconfig": "js/stateless.js/tsconfig.json", + "compilerOptions": { + "skipLibCheck": true + }, + "plugin": [], + "navigation": { + "includeCategories": true, + "includeGroups": true + }, + "categorizeByGroup": true, + "sort": ["source-order"], + "kindSortOrder": [ + "Function", + "Class", + "Interface", + "TypeAlias", + "Variable", + "Enum" + ], + "searchInComments": true, + "visibilityFilters": { + "protected": true, + "private": false, + "inherited": true, + "external": false + }, + "hideGenerator": false, + "includeVersion": true, + "githubPages": true, + "navigationLinks": { + "Other Libraries": "../index.html", + "Documentation": "https://www.zkcompression.com", + "GitHub": "https://github.com/Lightprotocol/light-protocol" + } +}