Skip to content

fix(create-sei): align CLI and generated docs (PLT-844) - #333

Open
alexander-sei wants to merge 1 commit into
mainfrom
alexanderh/plt-844-sei-jscreate-sei-documented-n-flag-doesnt-exist-bad-post
Open

fix(create-sei): align CLI and generated docs (PLT-844)#333
alexander-sei wants to merge 1 commit into
mainfrom
alexanderh/plt-844-sei-jscreate-sei-documented-n-flag-doesnt-exist-bad-post

Conversation

@alexander-sei

Copy link
Copy Markdown
Contributor

Summary

  • support the documented -n shorthand for generated app names
  • update the generated README to match the Bun workflow, current file layout, and mainnet default
  • replace the dead Bank precompile URL with the current Sei docs and add a patch changeset

Addresses PLT-844.

Test plan

  • bun test --isolate packages/create-sei/src
  • bun run --filter @sei-js/create-sei build
  • bun run typecheck
  • bunx biome check packages/create-sei/src/main.ts packages/create-sei/src/main.test.ts
  • Verify the updated documentation links resolve

Made with Cursor

Keep the documented shorthand usable and ensure scaffold guidance matches the generated app and current Sei docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.82%. Comparing base (5675fcf) to head (7856a28).

Additional details and impacted files
@@ Coverage Diff @@## main #333 +/- ##
=======================================
Coverage 83.82% 83.82% =======================================
Files 64 64 Lines 4390 4390 =======================================
Hits 3680 3680 Misses 710 710 
FlagCoverage Δ
mcp-server77.28% <ø> (ø)
precompiles100.00% <ø> (ø)
registry100.00% <ø> (ø)
sei-global-wallet100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seidroidseidroidBot 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.

A small, well-scoped docs/CLI alignment for @sei-js/create-sei: the -n shorthand now matches what packages/create-sei/README.md already advertises, the generated Next template README matches the actual file layout and mainnet default, the dead www.docs.sei.io/dev-interoperability/... Bank link is gone (no other instances remain in the tree), and a patch changeset is included. No blockers; a few doc-accuracy nits and one unverifiable docs URL worth confirming.

Findings: 0 blocking | 11 non-blocking | 6 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • Cursor's second-opinion pass (cursor-review.md) is empty — that review produced no output, so only Codex (no material issues found) and this pass covered the diff.
  • I could not resolve the new docs URLs from this environment (no outbound network access granted), so the PR's "Verify the updated documentation links resolve" step is unverified here. Everything else in the test plan is consistent with what's in the tree.
  • I verified the README's structural claims against the template: layout.tsx wraps children in Providers (Wagmi + RainbowKit + Mantine), page.tsx switches on useAccount().isConnected between Landing and Default, providers.tsx defaults to sei mainnet when NEXT_PUBLIC_CHAIN is unset, and globals.css imports Tailwind — all accurate. The removed references to src/app/components/Web3Provider.tsx and @sei-js/evm/viem were genuinely stale (neither exists in the template, and @sei-js/evm is not a template dependency), so those deletions are correct.
  • The rewritten README covers only bun install / bun run dev. The template's package.json has a prebuild hook that runs biome check ., so bun run build fails outright on unformatted user code — worth a one-line "Lint and build" section mentioning bun run check / check:fix so that failure isn't a surprise.
  • src/components/shell/shell.tsx is the app shell that wraps both the landing and connected views, but it is the one first-party component omitted from the "Project structure" list. Consider adding it for completeness.
  • 6 suggestion(s)/nit(s) flagged inline on specific lines.

<Text size="sm" c="gray.6">
Query total SEI supply using Sei's native{' '}
<Text component="a" href="https://www.docs.sei.io/dev-interoperability/precompiles/bank" target="_blank" c="orange" td="underline">
<Text component="a" href="https://docs.sei.io/evm/precompiles/cosmwasm-precompiles/bank" target="_blank" c="orange" td="underline">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] Replacing the dead www.docs.sei.io/dev-interoperability/precompiles/bank link is clearly right, but please confirm this specific path against the live docs — I have no outbound network access here, so I checked it against the repo instead.

Every other Sei precompile docs link in this repo uses a flat docs.sei.io/evm/precompiles/<slug> shape with no intermediate section segment:

  • packages/precompiles/src/precompiles/p256.ts:19docs.sei.io/evm/precompiles/p256-precompile
  • packages/precompiles/README.md:40docs.sei.io/evm/precompiles/example-usage
  • packages/mcp-server/src/tests/docs/server.test.ts:39docs.sei.io/evm/precompiles/example-usage

This is the only link that introduces a cosmwasm-precompiles/ segment, and Bank is a Cosmos-module precompile rather than a CosmWasm one, which makes that segment the part I'd double-check. If the page really does live under that path, no change needed — a dead link in a scaffolded template is worse than a slightly odd path.

const [stdout, stderr, exitCode] = await Promise.all([new Response(subprocess.stdout).text(), new Response(subprocess.stderr).text(), subprocess.exited]);

expect(exitCode).toBe(0);
expect(stderr).toBe('');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit]expect(stderr).toBe('') is a strict equality on a channel you don't control: any Bun/Node deprecation warning or resolver notice printed while loading commander/inquirer/boxen fails this test for reasons unrelated to the -n flag. expect(stderr).not.toContain('error'), or simply dropping this assertion (exitCode === 0 already covers the failure case), would be less brittle.


expect(exitCode).toBe(0);
expect(stderr).toBe('');
expect(stdout).toContain('-n, --name <name>');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] This asserts commander's rendered help string rather than the behaviour PLT-844 was actually about. It couples the test to commander's help formatting (a v13 upgrade that changes spacing or ordering breaks it while -n still works), and it wouldn't catch a regression where the flag parses but the short form is dropped.

A behavioural assertion would be a tighter guard — e.g. spawn app -n 'Invalid Name' in a temp cwd and assert the Invalid package name. message, which only prints when options.name was populated from -n and reached validateOptions, and which scaffolds nothing on the failure path.

Also worth an explicit timeout on this test: it spawns a fresh Bun process that transpiles src/main.ts and resolves three dependencies, and Bun's default 5s per-test timeout is not a lot of headroom on a cold CI runner.

## Network configuration

In addition, this app uses [RainbowKit](https://www.rainbowkit.com/docs/wallet-button) which provides wallet connect functionality out of the box.
The app connects to Sei mainnet when `NEXT_PUBLIC_CHAIN` is unset. To use Sei testnet, add this to `.env.local`:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] Accurate about the code path (providers.tsx falls through to sei mainnet when NEXT_PUBLIC_CHAIN is unset), but it doesn't mention the .env.example that ships alongside it — and that file sets NEXT_PUBLIC_CHAIN=testnet. A user who does the reflexive cp .env.example .env.local lands on testnet while the README tells them they're on mainnet. Worth naming .env.example here and saying it defaults to testnet, since that's exactly the kind of post-scaffold confusion this PR is fixing.

This repository uses helper methods from [@sei-js/evm/viem](https://github.com/sei-protocol/sei-js/tree/main/packages/evm/src/viem)
- `src/app/layout.tsx` wraps every route with the wallet and UI providers.
- `src/app/page.tsx` shows the landing page until a wallet connects, then shows the interactive examples.
- `src/components/providers/providers.tsx` configures Wagmi, RainbowKit, WalletConnect, and the selected Sei network.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] "configures Wagmi, RainbowKit, WalletConnect" overstates it a little — providers.tsx registers only metaMaskWallet in its connectorsForWallets list. WalletConnect is present only as the projectId that RainbowKit requires; there's no WalletConnect wallet a user can actually pick. Listing "Wagmi, RainbowKit, and the selected Sei network" and mentioning that MetaMask is the only wallet registered by default (with a pointer to where to add more) would match the file.

```

## Deploy on Vercel
You can also set `NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID` in `.env.local`. Without it, the template uses a placeholder project ID.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The placeholder is the literal string 'your-project-id' in providers.tsx, which is not a valid WalletConnect project ID — RainbowKit will make failing requests against it rather than degrade silently. Since this is a generated README, stating the consequence ("WalletConnect-based wallets won't connect until you set a real ID; the bundled MetaMask connector works without one") is more useful to the scaffold user than "uses a placeholder project ID."

Sign up for freeto 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.

2 participants

@alexander-sei@codecov-commenter