Skip to content

feat: template#454

Open
skywardboundd wants to merge 20 commits into
mainfrom
template
Open

feat: template#454
skywardboundd wants to merge 20 commits into
mainfrom
template

Conversation

@skywardboundd

@skywardboundd skywardboundd commented Jun 9, 2026

Copy link
Copy Markdown

origin in #445

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced the create-ton-appkit command to scaffold new TON AppKit projects with interactive or non-interactive setup, template selection, overwrite control, and project configuration updates.
    • Added a React template with wallet connect UI, tabbed views (balance, jettons, NFTs, swap, staking), periodic balance refresh, and a working TON Connect manifest placeholder.
  • Documentation

    • Added guides for using the CLI and configuring template environment variables.
  • Tests / CI

    • Added cross-platform smoke tests for scaffolded apps and release automation for publishing.

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-minter Error Error Jun 15, 2026 1:20am
kit-demo-wallet Error Error Jun 15, 2026 1:20am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3aa1341c-5f14-49bd-998d-b8cd1e578b1b

📥 Commits

Reviewing files that changed from the base of the PR and between d134f03 and fb1b0c6.

📒 Files selected for processing (1)
  • packages/create-ton-appkit/template-react/src/App.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/create-ton-appkit/template-react/src/App.css

📝 Walkthrough

Walkthrough

A new create-ton-appkit CLI package is introduced that scaffolds TON AppKit projects from a React template. The CLI handles interactive/non-interactive prompts, copies template files, and rewrites project metadata. A companion React template with AppKit-wired components (balance, jettons, NFTs, swap, staking) is included. CI workflows for cross-platform matrix testing and conditional npm publishing are added alongside workspace and ESLint configuration updates.

Changes

Create-AppKit CLI and Scaffolding System

Layer / File(s) Summary
GitHub Actions matrix test workflow
.github/workflows/create_ton_appkit_test.yml
Adds a cross-platform (Ubuntu/macOS/Windows × npm/pnpm/yarn/bun) matrix workflow that builds and packs create-ton-appkit, scaffolds a React project, installs dependencies, builds it, and smoke-tests the preview server via HTTP.
GitHub Actions conditional release workflow
.github/workflows/release_create_ton_appkit.yml
Manual dispatch workflow on the release branch that builds the package, derives an npm dist-tag from the version string, checks npm for the exact version, and publishes only when missing.
Workspace and root configuration updates
package.json, eslint.config.js
Adds a template dev script, extends clean to remove template node_modules, and adds an ESLint ignore glob for template-*/**.
CLI package metadata, packaging, and license
packages/create-ton-appkit/package.json, packages/create-ton-appkit/tsconfig.json, packages/create-ton-appkit/LICENSE, packages/create-ton-appkit/README.md, packages/create-ton-appkit/.npmignore
Establishes the CLI package: ESM manifest with create-ton-appkit binary, TypeScript config emitting to dist, MIT license, packaging exclusions, and user-facing README.
CLI entrypoint and scaffolding implementation
packages/create-ton-appkit/src/index.ts
Full CLI implementation: mri-based argument parsing, @clack/prompts interactive prompts, directory conflict resolution, recursive template file copy, post-copy rewrites of package.json, index.html, and tonconnect-manifest.json, package-manager detection, and next-step output.
React template build tooling and config
packages/create-ton-appkit/template-react/package.json, packages/create-ton-appkit/template-react/tsconfig*.json, packages/create-ton-appkit/template-react/vite.config.ts
Template package manifest with TON AppKit/React 19/Vite dependencies, TypeScript project references (tsconfig.app.json, tsconfig.node.json), and Vite + React plugin config.
Template entry, env, manifest, gitignore, and README
packages/create-ton-appkit/template-react/index.html, packages/create-ton-appkit/template-react/_env, packages/create-ton-appkit/template-react/public/tonconnect-manifest.json, packages/create-ton-appkit/template-react/_gitignore, packages/create-ton-appkit/template-react/README.md
HTML shell with #root mount, .env placeholder for Toncenter API key and manifest URL, TonConnect manifest with example values, .gitignore template, and template README covering features, env vars, and src layout.
AppKit initialization and providers
packages/create-ton-appkit/template-react/src/appKit.ts, packages/create-ton-appkit/template-react/src/Providers.tsx
Exports configured AppKit with mainnet Toncenter client, TonConnect connector, and Omniston/DeDust/Tonstakers providers. Providers wraps children in QueryClientProvider and AppKitProvider.
App root, Header, and bootstrap
packages/create-ton-appkit/template-react/src/App.tsx, packages/create-ton-appkit/template-react/src/components/Header.tsx, packages/create-ton-appkit/template-react/src/main.tsx, packages/create-ton-appkit/template-react/src/polyfills.ts
App/AppContent render a tab-driven layout (Balance, Jettons, NFTs, Swap, Staking) or connect-wallet empty state. Header embeds TonConnectButton. main.tsx bootstraps in StrictMode after importing Buffer polyfill.
Asset and feature card components
packages/create-ton-appkit/template-react/src/components/BalanceCard.tsx, packages/create-ton-appkit/template-react/src/components/JettonsCard.tsx, packages/create-ton-appkit/template-react/src/components/NftsCard.tsx, packages/create-ton-appkit/template-react/src/components/SwapCard.tsx, packages/create-ton-appkit/template-react/src/components/StakingCard.tsx, packages/create-ton-appkit/template-react/src/utils/format.ts
Five card components integrate AppKit hooks and widgets with loading/empty/populated states. BalanceCard and JettonsCard use 15s refetch intervals; SwapCard configures GRAM↔USD₮ tokens; NftsCard displays grid; StakingCard embeds widget. formatAmount formats numeric strings for en-US display with precision caps.
Global and component stylesheets
packages/create-ton-appkit/template-react/src/index.css, packages/create-ton-appkit/template-react/src/App.css
index.css sets global reset and CSS variable typography. App.css defines full component layout: container, header, tabs, cards, NFT grid, and jetton row grid with logo/fallback styles.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(100, 149, 237, 0.5)
    Note over User,FS: CLI Scaffolding
    participant User
    participant CLI as create-ton-appkit CLI
    participant FS as FileSystem
    User->>CLI: create-ton-appkit my-app --template react --app-url https://example.com
    CLI->>CLI: parse args (mri), detect package manager from npm_config_user_agent
    CLI->>User: interactive prompts for missing project name / template / app URL
    CLI->>FS: resolve target dir, check for conflicts, optionally empty dir
    CLI->>FS: copy template-react/** into target dir
    CLI->>FS: rewrite package.json name, index.html title, tonconnect-manifest.json
    CLI->>User: print cd + install + dev next steps
  end
  rect rgba(144, 238, 144, 0.5)
    Note over ReactApp,Toncenter: Runtime AppKit flow
    participant ReactApp as App (React)
    participant AppKitProvider
    participant Toncenter
    ReactApp->>AppKitProvider: render Providers (QueryClientProvider + AppKitProvider)
    AppKitProvider->>Toncenter: initialize AppKit with mainnet Toncenter client + TonConnect connector
    AppKitProvider->>AppKitProvider: register Omniston, DeDust, Tonstakers providers
    ReactApp->>AppKitProvider: useAddress / useBalance / useJettons / useNfts
    AppKitProvider->>Toncenter: fetch balance, jettons, NFTs (refetchInterval 15s)
    Toncenter-->>ReactApp: data for BalanceCard, JettonsCard, NftsCard
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 A scaffold of hops, a template anew,
With create-ton-appkit we're ready to brew!
Swap widgets and jettons, NFT grids galore,
The bunny has packaged it up to the core.
pnpm create appkit — off you go, build some more! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'feat: template' is too vague and generic, failing to convey the specific purpose of this substantial changeset introducing a create-ton-appkit scaffolding tool with templates and CI workflows. Use a more descriptive title such as 'feat: add create-ton-appkit CLI tool with React template' or 'feat: introduce create-ton-appkit scaffolding package with npm publishing and testing workflows' to clearly summarize the main contribution.
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch template

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Alejandbel
Alejandbel previously approved these changes Jun 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (3)
pnpm-workspace.yaml (1)

41-43: 💤 Low value

Hardcoded alpha version exclusions will require manual maintenance.

The minimumReleaseAgeExclude list contains specific alpha versions (1.0.0-alpha.4). As these packages evolve to alpha.5, alpha.6, etc., this list will need manual updates. Stale entries may accumulate, and new alpha versions won't be automatically excluded if needed during development.

Consider whether:

  1. A wildcard pattern could exclude all alpha versions of these packages (if pnpm supports it)
  2. These exclusions are temporary and can be removed once stable versions are released
  3. A comment should be added explaining when/how to maintain this list
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm-workspace.yaml` around lines 41 - 43, The hardcoded entries in
minimumReleaseAgeExclude for '`@ton/appkit-react`@1.0.0-alpha.4',
'`@ton/appkit`@1.0.0-alpha.4', and '`@ton/walletkit`@1.0.0-alpha.4' will require
manual updates as alpha versions change; replace the exact-version exclusions
with a wildcard/semver pattern that excludes all alpha releases for those
packages (e.g., an alpha wildcard for '`@ton/appkit-react`', '`@ton/appkit`', and
'`@ton/walletkit`') if pnpm supports it, or else remove the temporary exclusions
and add a clear comment indicating these are temporary and should be
revisited/removed once stable releases are available; verify pnpm pattern syntax
before changing minimumReleaseAgeExclude to ensure the new rule matches all
alpha versions.
.github/workflows/create-ton-appkit-test.yml (2)

104-107: ⚡ Quick win

Consider adding explicit server readiness verification after the wait loop.

The current wait loop polls for up to 30 seconds but doesn't explicitly verify that the server is responsive when the loop completes. If the server never starts, the script silently continues to the validation curl commands, which will fail with potentially unclear error messages.

🔍 Suggested improvement for clearer failure diagnostics
  for _ in $(seq 1 30); do
    curl -sSf http://localhost:4173 >/dev/null 2>&1 && break
    sleep 1
  done
+
+ # Verify server is actually responsive
+ if ! curl -sSf http://localhost:4173 >/dev/null 2>&1; then
+   echo "::error::Preview server failed to start within 30 seconds"
+   kill "$SERVER_PID" 2>/dev/null || true
+   cat preview.log || true
+   exit 1
+ fi

  STATUS=0
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/create-ton-appkit-test.yml around lines 104 - 107, The
wait loop that repeatedly runs curl (the for ... seq 1 30 loop which calls curl
-sSf http://localhost:4173) can exit silently without the server being ready;
after that loop, add an explicit readiness check that verifies curl succeeded
and if not print a clear error message and exit non‑zero (e.g., log "Server did
not start on http://localhost:4173 after 30s" and exit 1) so subsequent
validation commands do not run when the server isn't responsive.

113-118: ⚡ Quick win

Bundle extraction pattern may be fragile across template changes.

The regex /assets/[^"]+\.js with head -1 assumes a specific Vite output structure. If the template's build configuration changes (e.g., multiple entry points, different asset naming, or HTML structure modifications), this pattern may fail silently or extract the wrong bundle.

📝 Suggested improvements

Option 1: Add a comment documenting the assumption:

  # 2) the JS bundle the shell references is actually reachable
+ # Assumes Vite output structure with /assets/*.js pattern
  BUNDLE="$(curl -sSf http://localhost:4173 | grep -oE '/assets/[^"]+\.js' | head -1)"

Option 2: Make the check more robust:

  # 2) the JS bundle the shell references is actually reachable
- BUNDLE="$(curl -sSf http://localhost:4173 | grep -oE '/assets/[^"]+\.js' | head -1)"
+ BUNDLE="$(curl -sSf http://localhost:4173 | grep -oE 'src="(/assets/[^"]+\.js)"' | sed 's/.*src="//;s/".*//' | head -1)"
  if [ -n "$BUNDLE" ]; then
    curl -sSf "http://localhost:4173$BUNDLE" >/dev/null || STATUS=1
  else
+   echo "::warning::Could not extract JS bundle URL from HTML"
    STATUS=1
  fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/create-ton-appkit-test.yml around lines 113 - 118, The
bundle-extraction regex is brittle; update the BUNDLE assignment (the line
setting BUNDLE via curl | grep | head) to robustly parse script src attributes
and prefer module entry scripts (e.g., use grep/sed/awk to match
<script[^>]+type=["']module["'][^>]+src=["']([^"']+\.js)["'] first, then fall
back to any script src that ends with .js), and ensure the subsequent curl check
still uses the resolved BUNDLE variable; alternatively add a concise comment
above the BUNDLE/STATUS logic documenting the assumption about Vite output and
why the regex is used. Ensure you reference and modify the BUNDLE assignment and
the STATUS fallback logic so failures are detected reliably.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release_create_ton_appkit.yml:
- Around line 70-78: The "Publish create-ton-appkit" workflow step runs pnpm
publish but doesn't set the required npm auth token; update that step (the one
running the pnpm publish command) to export NODE_AUTH_TOKEN from a repository
secret (e.g. set NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} in the step's env) so
the setup-node/registry-url authentication works and pnpm publish can
authenticate successfully.
- Around line 3-6: Remove the unsupported branches filter under the
workflow_dispatch trigger and add a runtime branch guard at the start of the
workflow: keep workflow_dispatch as the trigger, then add an initial validation
step (e.g., in the first job) that inspects github.ref / github.ref_name (or
GITHUB_REF) and fails or exits unless the branch is "release" so the workflow
only proceeds when run on the intended branch; reference the workflow_dispatch
trigger and the initial job/step that performs the branch check.

In `@packages/create-ton-appkit/README.md`:
- Around line 7-18: The README's example commands use the wrong package name
("appkit"); update the commands so they reference the actual package
"ton-appkit": change "pnpm create appkit" to "pnpm create ton-appkit", change
"npm create appkit" to "npm create ton-appkit", and change "yarn create appkit"
to "yarn create ton-appkit"; keep the direct invocations "npx create-ton-appkit"
and "bunx create-ton-appkit" as they already reference the correct package form.

In `@packages/create-ton-appkit/template-react/eslint.config.js`:
- Around line 8-22: Replace the default export with a named export: change the
default export of the result of defineConfig(...) to a named export (e.g.,
eslintConfig) so consumers import { eslintConfig } instead of default; update
the export declaration that currently reads "export default defineConfig([...])"
to a named export "export const eslintConfig = defineConfig([...])" and ensure
any internal/consumer imports reference eslintConfig.

In `@packages/create-ton-appkit/template-react/src/main.tsx`:
- Around line 8-12: The current call to
createRoot(document.getElementById('root')!) uses a non-null assertion and can
crash if the root element is missing; replace the assertion with an explicit
null check: retrieve the element via document.getElementById('root'), if it is
null log/throw a clear error (or return early) with a helpful message, otherwise
pass the element to createRoot(...). Update the bootstrap around createRoot(...)
/ StrictMode / <App /> to use this guard so the app fails fast with a readable
message instead of a runtime exception.

---

Nitpick comments:
In @.github/workflows/create-ton-appkit-test.yml:
- Around line 104-107: The wait loop that repeatedly runs curl (the for ... seq
1 30 loop which calls curl -sSf http://localhost:4173) can exit silently without
the server being ready; after that loop, add an explicit readiness check that
verifies curl succeeded and if not print a clear error message and exit non‑zero
(e.g., log "Server did not start on http://localhost:4173 after 30s" and exit 1)
so subsequent validation commands do not run when the server isn't responsive.
- Around line 113-118: The bundle-extraction regex is brittle; update the BUNDLE
assignment (the line setting BUNDLE via curl | grep | head) to robustly parse
script src attributes and prefer module entry scripts (e.g., use grep/sed/awk to
match <script[^>]+type=["']module["'][^>]+src=["']([^"']+\.js)["'] first, then
fall back to any script src that ends with .js), and ensure the subsequent curl
check still uses the resolved BUNDLE variable; alternatively add a concise
comment above the BUNDLE/STATUS logic documenting the assumption about Vite
output and why the regex is used. Ensure you reference and modify the BUNDLE
assignment and the STATUS fallback logic so failures are detected reliably.

In `@pnpm-workspace.yaml`:
- Around line 41-43: The hardcoded entries in minimumReleaseAgeExclude for
'`@ton/appkit-react`@1.0.0-alpha.4', '`@ton/appkit`@1.0.0-alpha.4', and
'`@ton/walletkit`@1.0.0-alpha.4' will require manual updates as alpha versions
change; replace the exact-version exclusions with a wildcard/semver pattern that
excludes all alpha releases for those packages (e.g., an alpha wildcard for
'`@ton/appkit-react`', '`@ton/appkit`', and '`@ton/walletkit`') if pnpm supports it,
or else remove the temporary exclusions and add a clear comment indicating these
are temporary and should be revisited/removed once stable releases are
available; verify pnpm pattern syntax before changing minimumReleaseAgeExclude
to ensure the new rule matches all alpha versions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 324bda38-35fa-4510-a51f-d3cec52e6fc7

📥 Commits

Reviewing files that changed from the base of the PR and between d2129c8 and 24d6db0.

⛔ Files ignored due to path filters (2)
  • packages/create-ton-appkit/template-react/public/favicon.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (36)
  • .github/workflows/create-ton-appkit-test.yml
  • .github/workflows/release_create_ton_appkit.yml
  • eslint.config.js
  • package.json
  • packages/create-ton-appkit/.npmignore
  • packages/create-ton-appkit/LICENSE
  • packages/create-ton-appkit/README.md
  • packages/create-ton-appkit/package.json
  • packages/create-ton-appkit/src/index.ts
  • packages/create-ton-appkit/template-react/README.md
  • packages/create-ton-appkit/template-react/_env
  • packages/create-ton-appkit/template-react/_gitignore
  • packages/create-ton-appkit/template-react/eslint.config.js
  • packages/create-ton-appkit/template-react/index.html
  • packages/create-ton-appkit/template-react/package.json
  • packages/create-ton-appkit/template-react/public/tonconnect-manifest.json
  • packages/create-ton-appkit/template-react/src/App.css
  • packages/create-ton-appkit/template-react/src/App.tsx
  • packages/create-ton-appkit/template-react/src/Providers.tsx
  • packages/create-ton-appkit/template-react/src/appKit.ts
  • packages/create-ton-appkit/template-react/src/components/BalanceCard.tsx
  • packages/create-ton-appkit/template-react/src/components/Header.tsx
  • packages/create-ton-appkit/template-react/src/components/JettonsCard.tsx
  • packages/create-ton-appkit/template-react/src/components/NftsCard.tsx
  • packages/create-ton-appkit/template-react/src/components/StakingCard.tsx
  • packages/create-ton-appkit/template-react/src/components/SwapCard.tsx
  • packages/create-ton-appkit/template-react/src/index.css
  • packages/create-ton-appkit/template-react/src/main.tsx
  • packages/create-ton-appkit/template-react/src/polyfills.ts
  • packages/create-ton-appkit/template-react/src/utils/format.ts
  • packages/create-ton-appkit/template-react/tsconfig.app.json
  • packages/create-ton-appkit/template-react/tsconfig.json
  • packages/create-ton-appkit/template-react/tsconfig.node.json
  • packages/create-ton-appkit/template-react/vite.config.ts
  • packages/create-ton-appkit/tsconfig.json
  • pnpm-workspace.yaml

Comment thread .github/workflows/release_create_ton_appkit.yml
Comment thread .github/workflows/release_create_ton_appkit.yml
Comment thread packages/create-ton-appkit/README.md
Comment thread packages/create-ton-appkit/template-react/eslint.config.js Outdated
Comment thread packages/create-ton-appkit/template-react/src/main.tsx
@skywardboundd skywardboundd mentioned this pull request Jun 12, 2026
Comment thread packages/create-ton-appkit/template-react/package.json Outdated
Comment thread packages/create-ton-appkit/template-react/README.md Outdated
Comment thread packages/create-ton-appkit/template-react/README.md Outdated
Comment thread packages/create-ton-appkit/template-react/README.md Outdated
Comment thread packages/create-ton-appkit/template-react/README.md Outdated
Comment thread packages/create-ton-appkit/template-react/src/components/BalanceCard.tsx Outdated
Comment thread packages/create-ton-appkit/template-react/src/components/JettonsCard.tsx Outdated
Comment thread packages/create-ton-appkit/template-react/src/components/NftsCard.tsx Outdated
Comment thread packages/create-ton-appkit/template-react/src/components/SwapCard.tsx Outdated
Comment thread pnpm-workspace.yaml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
packages/create-ton-appkit/template-react/src/Providers.tsx (1)

9-17: 💤 Low value

QueryClient created outside component causes shared state across instances.

The QueryClient is instantiated at module scope, meaning all Providers component instances share the same client. This is typically correct for a single root provider but can cause issues if Providers is instantiated multiple times (e.g., in tests or nested apps). Consider documenting this assumption or moving instantiation inside if multiple instances are expected.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/create-ton-appkit/template-react/src/Providers.tsx` around lines 9 -
17, The queryClient constant is instantiated at module scope outside the
Providers component, which causes all instances of the Providers component to
share the same QueryClient. Either add a clear comment above the queryClient
initialization explaining that this is intentional and that the QueryClient is
shared across all Providers instances (suitable if there is only one root
provider), or move the queryClient instantiation inside the Providers component
body so each instance gets its own QueryClient (suitable if Providers may be
instantiated multiple times, such as in tests or nested applications). Choose
the approach that matches your application's architecture and expected usage
patterns.
packages/create-ton-appkit/template-react/src/App.tsx (1)

33-59: The tab approach adequately mitigates rate limits; routing migration is unnecessary.

The current tab implementation reduces API requests compared to rendering all widgets simultaneously—only the active component mounts and executes API calls. Additionally, React Query is available for caching and request deduplication, providing further rate-limit protection. Adding a routing library would introduce unnecessary complexity for a minimal template; the tab-based approach is a reasonable solution for the current scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/create-ton-appkit/template-react/src/App.tsx` around lines 33 - 59,
The current tab-based implementation using activeTab state management is
appropriate and does not require changes. The tabs with role="tab" and
corresponding tabpanel with role="tabpanel" adequately reduce API requests by
only rendering the ActiveComponent for the selected tab, and React Query can
provide additional caching if needed. No migration to a routing library is
necessary for this template scope.
.github/workflows/create_ton_appkit_test.yml (1)

40-42: ⚡ Quick win

Consider pinning the yarn version for CI reproducibility.

Installing yarn globally without a version pin can lead to inconsistent behavior if yarn releases breaking changes. For test stability, consider:

- run: npm install -g yarn
+ run: npm install -g yarn@4

Or use corepack (built into Node.js 22) to manage yarn:

- name: Set up Yarn
  if: matrix.pm == 'yarn'
- run: npm install -g yarn
+ run: corepack enable && corepack prepare yarn@stable --activate
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/create_ton_appkit_test.yml around lines 40 - 42, The yarn
installation step in the "Set up Yarn" job (where matrix.pm == 'yarn') currently
installs yarn globally without pinning a specific version, which can cause CI
inconsistencies. Modify the run command to either pin an explicit yarn version
by specifying it in the npm install command (e.g., npm install -g
yarn@specific.version), or replace it with corepack enable to use Node.js's
built-in package manager management feature. Choose the approach that best
aligns with your project's Node.js version support and dependency management
strategy.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/create-ton-appkit/template-react/src/App.css`:
- Around line 44-63: The `.tab-btn` selector removes the default browser focus
ring but provides no custom focus indicator for keyboard users. Add a
`.tab-btn:focus-visible` rule that applies a visible focus indicator such as an
outline or box-shadow to ensure keyboard users can see which tab button has
focus when navigating with the Tab key. This will restore keyboard accessibility
for the tab navigation component.

In `@packages/create-ton-appkit/template-react/src/components/BalanceCard.tsx`:
- Around line 11-12: The condition `balance !== undefined` in the balanceText
assignment does not exclude null values, allowing null to be passed to
formatAmount() which coerces it to 0 and displays as "0 GRAM" instead of the
empty placeholder. Update the condition to check for both null and undefined
(using `balance != null` or `balance !== null && balance !== undefined`) to
ensure that when balance is null, it renders as the empty placeholder "—"
instead of "0 GRAM".

In `@packages/create-ton-appkit/template-react/src/utils/format.ts`:
- Around line 5-8: The toLocaleString call in the token balance formatter
includes maximumSignificantDigits: 4, which causes inappropriate rounding of
large integer amounts based on their magnitude (e.g., 12345 becomes 12350). This
is unsuitable for financial balance display. Remove the
maximumSignificantDigits: 4 line from the options object and rely only on
maximumFractionDigits to control decimal precision consistently, which will
preserve integer values while controlling only decimal places.

---

Nitpick comments:
In @.github/workflows/create_ton_appkit_test.yml:
- Around line 40-42: The yarn installation step in the "Set up Yarn" job (where
matrix.pm == 'yarn') currently installs yarn globally without pinning a specific
version, which can cause CI inconsistencies. Modify the run command to either
pin an explicit yarn version by specifying it in the npm install command (e.g.,
npm install -g yarn@specific.version), or replace it with corepack enable to use
Node.js's built-in package manager management feature. Choose the approach that
best aligns with your project's Node.js version support and dependency
management strategy.

In `@packages/create-ton-appkit/template-react/src/App.tsx`:
- Around line 33-59: The current tab-based implementation using activeTab state
management is appropriate and does not require changes. The tabs with role="tab"
and corresponding tabpanel with role="tabpanel" adequately reduce API requests
by only rendering the ActiveComponent for the selected tab, and React Query can
provide additional caching if needed. No migration to a routing library is
necessary for this template scope.

In `@packages/create-ton-appkit/template-react/src/Providers.tsx`:
- Around line 9-17: The queryClient constant is instantiated at module scope
outside the Providers component, which causes all instances of the Providers
component to share the same QueryClient. Either add a clear comment above the
queryClient initialization explaining that this is intentional and that the
QueryClient is shared across all Providers instances (suitable if there is only
one root provider), or move the queryClient instantiation inside the Providers
component body so each instance gets its own QueryClient (suitable if Providers
may be instantiated multiple times, such as in tests or nested applications).
Choose the approach that matches your application's architecture and expected
usage patterns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74147169-dc49-4fe1-b006-05832e970460

📥 Commits

Reviewing files that changed from the base of the PR and between 68dc11d and e2facd9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • .github/workflows/create_ton_appkit_test.yml
  • packages/create-ton-appkit/template-react/README.md
  • packages/create-ton-appkit/template-react/_env
  • packages/create-ton-appkit/template-react/package.json
  • packages/create-ton-appkit/template-react/src/App.css
  • packages/create-ton-appkit/template-react/src/App.tsx
  • packages/create-ton-appkit/template-react/src/Providers.tsx
  • packages/create-ton-appkit/template-react/src/appKit.ts
  • packages/create-ton-appkit/template-react/src/components/BalanceCard.tsx
  • packages/create-ton-appkit/template-react/src/components/JettonsCard.tsx
  • packages/create-ton-appkit/template-react/src/components/NftsCard.tsx
  • packages/create-ton-appkit/template-react/src/components/StakingCard.tsx
  • packages/create-ton-appkit/template-react/src/components/SwapCard.tsx
  • packages/create-ton-appkit/template-react/src/utils/format.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/create-ton-appkit/template-react/_env
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/create-ton-appkit/template-react/README.md

Comment thread packages/create-ton-appkit/template-react/src/App.css
Comment thread packages/create-ton-appkit/template-react/src/utils/format.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants