diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..ca2b7874 Binary files /dev/null and b/.DS_Store differ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5c2f891d..1132e6a8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,10 +12,13 @@ jobs: steps: - uses: actions/checkout@v2 - uses: oven-sh/setup-bun@v1 + - name: Install dependencies run: bun link + - name: Install dependencies run: bun install + - name: Run Prettier run: bun x prettier --check . diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..16a86fc0 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,49 @@ +name: "typedoc" + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: oven-sh/setup-bun@v1 + + - name: Install Protobuf Compiler + run: sudo apt-get install -y protobuf-compiler + + - name: Install dependencies + run: bun link + + - name: Install dependencies + run: bun install + + - name: Build dependencies + run: bun run build + + - name: Build docs + run: bun run docs + + - uses: actions/upload-pages-artifact@v2 + with: + path: ./docs + deploy: + runs-on: ubuntu-latest + environment: + name: githubs + url: ${{ steps.deployment.outputs.page_url }} + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + # https://github.com/actions/deploy-pages + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index 3c3629e6..7ee4cf2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +docs \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 3532e370..b311eff3 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/.github/dojo-mark-full-dark.svg b/media/dojo-mark-full-dark.svg similarity index 100% rename from .github/dojo-mark-full-dark.svg rename to media/dojo-mark-full-dark.svg diff --git a/package.json b/package.json index bfeae5eb..42c07e2a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,10 @@ "devDependencies": { "lerna": "^8.0.0", "prettier": "^3.0.3", - "tsup": "^8.0.1" + "tsup": "^8.0.1", + "typedoc": "^0.25.4", + "typedoc-material-theme": "^1.0.1", + "typedoc-plugin-coverage": "^2.2.0" }, "scripts": { "build-core": "bun run --cwd packages/core build", @@ -31,7 +34,8 @@ "clean": "rm -rf node_modules packages/create-burner/node_modules node_modules packages/create-dojo/node_modules packages/core/node_modules packages/utils/node_modules packages/torii-client/node_modules packages/torii-wasm/node_modules packages/react/node_modules bun.lockb packages/create-burner/bun.lockb packages/core/bun.lockb packages/utils/bun.lockb packages/torii-client/bun.lockb packages/torii-wasm/bun.lockb packages/react/bun.lockb && rm -rf examples/react-app/node_modules examples/react-app/bun.lockb examples/react-phaser-example/node_modules examples/react-phaser-example/bun.lockb", "prettier-check": "bun x prettier --check .", "prettier": "bun x prettier --write .", - "release": "bun run build && bun run prettier && npx lerna publish --no-private --force-publish" + "release": "bun run build && bun run prettier && npx lerna publish --no-private --force-publish", + "docs": "npx typedoc --out docs" }, "dependencies": {} } diff --git a/packages/create-burner/src/manager/burnerManager.ts b/packages/create-burner/src/manager/burnerManager.ts index 1748ed68..9be8ed2b 100644 --- a/packages/create-burner/src/manager/burnerManager.ts +++ b/packages/create-burner/src/manager/burnerManager.ts @@ -209,7 +209,7 @@ export class BurnerManager { const burners: BurnerStorage = JSON.parse(text); // Assume no burner is active - let activeAddress = null; + let activeAddress: string | null = null; // Iterate over the pasted burners to find the active one for (const [address, burner] of Object.entries(burners)) { diff --git a/packages/react/package.json b/packages/react/package.json index 5f9e408c..a8e4be97 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -13,7 +13,8 @@ "license": "MIT", "peerDependencies": { "react": "^18.2.0", - "starknet": "^5.19.0" + "starknet": "^5.24.3", + "type-fest": "^2.14.0" }, "exports": { ".": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a7ecea1..0d06af75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,9 @@ importers: tsup: specifier: ^8.0.1 version: 8.0.1(typescript@5.3.3) + typedoc: + specifier: ^0.25.4 + version: 0.25.4(typescript@5.3.3) packages/core: dependencies: @@ -4556,6 +4559,13 @@ packages: engines: { node: ">=12" } dev: true + /ansi-sequence-parser@1.1.1: + resolution: + { + integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==, + } + dev: true + /ansi-styles@3.2.1: resolution: { @@ -8470,6 +8480,13 @@ packages: engines: { node: ">=12" } dev: true + /lunr@2.3.9: + resolution: + { + integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==, + } + dev: true + /magic-string@0.30.5: resolution: { @@ -8587,6 +8604,15 @@ packages: engines: { node: ">=8" } dev: true + /marked@4.3.0: + resolution: + { + integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==, + } + engines: { node: ">= 12" } + hasBin: true + dev: true + /mathjs@12.2.0: resolution: { @@ -10523,6 +10549,18 @@ packages: } engines: { node: ">=8" } + /shiki@0.14.7: + resolution: + { + integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==, + } + dependencies: + ansi-sequence-parser: 1.1.1 + jsonc-parser: 3.2.0 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + dev: true + /siginfo@2.0.0: resolution: { @@ -11383,6 +11421,23 @@ packages: } dev: true + /typedoc@0.25.4(typescript@5.3.3): + resolution: + { + integrity: sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==, + } + engines: { node: ">= 16" } + hasBin: true + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x + dependencies: + lunr: 2.3.9 + marked: 4.3.0 + minimatch: 9.0.3 + shiki: 0.14.7 + typescript: 5.3.3 + dev: true + /typescript@4.9.5: resolution: { @@ -11757,6 +11812,20 @@ packages: - terser dev: true + /vscode-oniguruma@1.7.0: + resolution: + { + integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==, + } + dev: true + + /vscode-textmate@8.0.0: + resolution: + { + integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==, + } + dev: true + /walker@1.0.8: resolution: { diff --git a/readme.md b/readme.md index ed3f3865..56a6164f 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@
- +

@@ -26,8 +26,6 @@ **Dojo is a community driven open-source, Provable Game Engine, providing a comprehensive toolkit for building verifiable games and autonomous worlds.** -Here's a more refined and structured version: - --- ## Dojo Engine Packages Monorepo diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..c4e7d102 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "jsx": "react-jsx" /* Specify what JSX code is generated. */, + "experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */, + + /* Modules */ + "module": "ESNext" /* Specify what module code is generated. */, + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + "baseUrl": "./src" /* Specify the base directory to resolve non-relative module names. */, + + /* Emit */ + "noEmit": true /* Disable emitting files from a compilation. */, + + /* Interop Constraints */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */, + + /* Completeness */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */, + "resolveJsonModule": true, + "allowImportingTsExtensions": true, + "noImplicitAny": false + }, + "include": ["./packages"], + "exclude": [ + "node_modules", + "./node_modules", + "./node_modules/*", + "./node_modules/@types/node/index.d.ts" + ] +} diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..7643203f --- /dev/null +++ b/typedoc.json @@ -0,0 +1,27 @@ +{ + "plugin": ["typedoc-material-theme", "typedoc-plugin-coverage"], + "themeColor": "#cb9820", + "$schema": "https://typedoc.org/schema.json", + "name": "dojo.js docs", + "entryPoints": [ + "./packages/core/src/index.ts", + "./packages/react/src/index.ts", + "./packages/create-burner/src/index.ts", + "./packages/utils/src/index.ts", + "./packages/torii-client/src/index.ts" + ], + "sort": ["source-order"], + "media": "media", + "categorizeByGroup": false, + "searchCategoryBoosts": { + "Component": 2, + "Model": 1.2 + }, + "searchGroupBoosts": { + "Classes": 1.5 + }, + "navigationLinks": { + "Docs": "https://dojoengine.github.io/dojo.js", + "GitHub": "https://github.com/dojoengine/dojo.js" + } +}