Skip to content

Test CLI tool and starter apps - #19

Merged
MiguelsPizza merged 7 commits into
mainfrom
claude/test-cli-starter-apps-011CUvmC6SW2kRvsSULeZgBQ
Nov 8, 2025
Merged

Test CLI tool and starter apps#19
MiguelsPizza merged 7 commits into
mainfrom
claude/test-cli-starter-apps-011CUvmC6SW2kRvsSULeZgBQ

Conversation

@MiguelsPizza

Copy link
Copy Markdown
Contributor
  • Replace zod catalog reference with explicit version ^3.25.1
  • Add missing @types/node dependency to devDependencies

The React template is meant to be scaffolded via create-webmcp-app outside the monorepo, so it cannot use pnpm catalog references. These changes ensure the template works correctly when copied to a new project directory.

Tested:

  • pnpm install: ✅
  • pnpm typecheck: ✅
  • pnpm lint: ✅
  • pnpm build: ✅

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test addition/improvement

Related Issues

Fixes #
Related to #

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

Test Commands Run

pnpm typecheck  # ✓ Passed
pnpm lint       # ✓ Passed
pnpm build      # ✓ Passed
pnpm test       # ✓ Passed - E2E tests run locally

Manual Testing

  • Tested in development mode (pnpm dev)
  • Tested production build (pnpm build && preview)
  • Tested on mobile/tablet (if UI changes)
  • Tested WebMCP integration (if applicable)
  • Tested MCP tool execution (if applicable)

Screenshots

Checklist

  • My code follows the style guidelines in CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • I have run E2E tests locally (pnpm test) and they pass
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

None

Additional Notes

- Replace zod catalog reference with explicit version ^3.25.1
- Add missing @types/node dependency to devDependencies

The React template is meant to be scaffolded via create-webmcp-app
outside the monorepo, so it cannot use pnpm catalog references.
These changes ensure the template works correctly when copied to a
new project directory.

Tested:
- pnpm install: ✅
- pnpm typecheck: ✅
- pnpm lint: ✅
- pnpm build: ✅
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 8, 2025

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
mcp-ui-with-webmcp-my-mcp-server a8632d1 Nov 08 2025, 05:37 PM

Both template READMEs now include a "Testing WebMCP Tools" section
that explains how to test registered tools using the MCP-B Chrome
extension. This provides a quick way to debug and verify WebMCP
tools without setting up a full chat UI.

Testing instructions:
1. Start dev server (pnpm dev)
2. Visit localhost URL in Chrome
3. Open MCP-B extension
4. Test registered tools directly

Both templates follow CONTRIBUTING.md standards:
- ✅ Type Safety: Proper TypeScript, no `any` types
- ✅ Single Source of Truth: No duplication
- ✅ Modularity: Small, focused functions
- ✅ Code Cleanliness: JSDoc on all public APIs
The lockfile was out of sync with templates/react/package.json after
adding @types/node and changing zod from catalog reference to explicit
version. This caused CI to fail with frozen-lockfile error.

Changes in lockfile:
- Add @types/node@^24.9.2 to React template
- Update zod specifier from 'catalog:' to '^3.25.1'

Verified locally:
✅ pnpm install succeeds
✅ pnpm check passes (lint + typecheck)
✅ All templates build and typecheck successfully
The CLI needs to bundle templates when published to npm. Added build
step to copy templates into the package and clean them of build
artifacts.

Changes:
- Add copy-templates script that copies templates and removes:
  - node_modules directories
  - dist directories
  - .turbo cache directories
  - tsconfig.tsbuildinfo files
  - worker-configuration.d.ts files
- Update build script to run copy-templates before tsc
- Add templates/ and *.tgz to .gitignore

Template path resolution:
- Development mode: looks for templates at ../../templates/
- Published mode: looks for templates at ../templates/ (bundled)

Tested:
✅ pnpm pack creates clean tarball with templates
✅ Vanilla template from package: install, typecheck pass
✅ React template from package: install, typecheck, build pass
✅ Templates are ~50 files each instead of 500+ with node_modules

Ready for npm publish via: pnpm publish
Templates now live with the CLI instead of at repo root, simplifying
the build process and making the package structure clearer.

**Benefits:**
✅ No complex copy-templates script needed
✅ Simple build process (just `tsc`)
✅ Templates version-controlled with CLI
✅ Clearer ownership - templates belong to CLI
✅ Package structure matches standard CLIs (create-vite, etc.)

**Changes:**

1. **Moved templates:**
   - From: `templates/` (repo root)
   - To: `apps/create-webmcp-app/templates/`

2. **Updated CLI code (src/index.ts):**
   - Simplified template path resolution
   - Removed dual-mode logic (repo vs published)
   - Now always: `join(__dirname, '..', 'templates', templateType)`

3. **Simplified build (package.json):**
   - Removed complex copy-templates script
   - Build is now just: `tsc`

4. **Updated .gitignore:**
   - No longer ignore templates/ directory
   - Only ignore generated files in templates

5. **Updated pnpm-workspace.yaml:**
   - Removed `templates/*` from packages
   - Templates are now part of create-webmcp-app package

**Tested:**
✅ pnpm pack creates clean tarball
✅ React template: install, typecheck, build all pass
✅ Package size remains small (no node_modules)

The CLI is already interactive using @clack/prompts with:
- Project path input
- Template selection (Vanilla/React)
- Optional dependency installation
The workspace now has 1 fewer package (templates/* removed from
workspace, now part of create-webmcp-app), so the lockfile needs
to reflect this change.
Ensure CLI package follows CONTRIBUTING.md standards by adding
quality check scripts and eslint dependencies.

**Added:**
- `pnpm lint` - ESLint with TypeScript support
- `pnpm typecheck` - Type checking without build
- ESLint dependencies (@eslint/js, eslint, typescript-eslint, globals)

**Already compliant with CONTRIBUTING.md:**
✅ Type Safety: Interface types, explicit parameters, no `any`
✅ Single Source of Truth: No duplication, config in one place
✅ Modularity: Small focused functions (main, copyTemplate)
✅ Code Cleanliness: JSDoc on all public APIs with @param/@example

**Verified:**
- pnpm typecheck: ✅ passes
- pnpm lint: ✅ passes
@MiguelsPizza
MiguelsPizza merged commit d45e862 into main Nov 8, 2025
4 checks passed
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.

2 participants