21 Commits

Author SHA1 Message Date
Rob Di Marco 63ad2d205c ATXP-260: Switch demo to single server and use npm run (#8)
* Fix git divergent branches error in demo update

Replace git pull with fetch + reset --hard to avoid divergent branch conflicts.
This ensures the demo repository always matches the remote exactly, discarding
any local changes that might have been made during demo usage.

* Refactor demo to use single port instead of frontend/backend ports

- Replace frontendPort and backendPort with single port parameter
- Update CLI args to use --port/-p instead of --frontend-port/--backend-port
- Default port changed to 8017 (previously backend port)
- Simplify .env file creation to single root .env instead of separate files
- Update environment variables and browser opening to use single port
- Aligns with new architecture of unified server handling both frontend and backend

* Remove .env file creation logic from demo

The demo server no longer needs .env files as it will use environment
variables passed directly through the spawn process. This simplifies
the demo setup and aligns with the unified server architecture.
v1.0.5
2025-09-10 10:00:55 -04:00
GitHub Action 1fa5382709 bump version to 1.0.4 [skip ci] 2025-09-10 00:13:06 +00:00
Rob Di Marco 8488d4dbd7 Put registry-url back in v1.0.4 2025-09-09 19:41:03 -04:00
Rob Di Marco e5d1a81f52 Ran npm pkg fix 2025-09-09 19:39:33 -04:00
Rob Di Marco f12990c805 Ran npm pkg fix 2025-09-09 19:39:22 -04:00
Rob Di Marco c33c0c07e3 Get rid of scope for publishing 2025-09-09 19:37:44 -04:00
Rob Di Marco e758befb90 Tweak workflow to correctly update dependency 2025-09-09 19:31:16 -04:00
Rob Di Marco 4289116f4b Run the demo application in production mode 2025-09-09 19:23:58 -04:00
Rob Di Marco 16d22a36d7 Add separate frontend and backend port configuration for demo command (#7)
* Add separate frontend and backend port configuration for demo command

Implement ATXP-243: Allow users to specify separate frontend and backend ports
when running the demo, replacing the single --port option with more granular control.

## Changes Made

### Command Line Interface
- Replace `--port, -p` with `--frontend-port, --fp` and `--backend-port, --bp`
- Update default ports: frontend 3000, backend 3001 (matching atxp-express-example defaults)
- Maintain backward compatibility by using sensible defaults

### Updated Documentation
- Comprehensive help text with new port options and examples
- Clear usage examples showing frontend/backend port combinations
- Updated default port information throughout

## Implementation Details

The demo command now:
1. Parses separate frontend/backend port arguments
2. Creates appropriate .env files in the cloned repository
3. Passes environment variables to the demo process
4. Uses frontend port for browser opening and user messaging

This integrates seamlessly with the atxp-express-example repository's existing
port configuration system implemented in PR #6.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update default ports to maintain backward compatibility

- Frontend port: 8016 (original default, maintains backward compatibility)
- Backend port: 8017 (one number higher as requested)
- Updated help documentation with new default port values
- Verified .env file generation works correctly with new defaults

This preserves existing user expectations while providing the requested
port separation functionality.

* Fix backend port configuration issue

Remove global PORT environment variable that was overriding backend .env file.
Now each service (frontend/backend) reads its PORT from its own .env file,
allowing them to run on separate ports correctly.

Fixes issue where backend was running on frontend port instead of backend port,
causing ECONNREFUSED errors in the proxy connection.

Verified fix: Backend=8017, Frontend=8016, proxy connections working.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 18:02:48 -04:00
Rob Di Marco ec9b09e784 Improve CLI error handling for unrecognized commands (#6)
Show full help information when user enters an unrecognized command instead
of just displaying a brief error message. This provides better UX by letting
users immediately see available commands without needing to run help separately.
2025-09-09 17:23:19 -04:00
Rob Di Marco 680b23b82d Optimize git operations to only clone main branch with shallow history (#5)
- Use shallow clone (--depth 1) to download only the latest commit
- Add --single-branch flag to avoid downloading other branches
- Explicitly target main branch with --branch main
- Optimize git pull to maintain shallow history during updates
- Add comprehensive tests documenting git optimization parameters

This reduces data transfer and improves clone performance for both demo and create commands.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 15:52:36 -04:00
Rob Di Marco d1dc63a794 Add dependency checks with helpful error messages (#4)
- Add dependency checking utility for git and npm
- Check dependencies before running demo and create commands
- Show friendly error messages with installation instructions
- Add tests for dependency checking functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 15:25:53 -04:00
Rob Di Marco 68cf60a9e6 Change demo repo to atxp-express-example (#3)
- Update DEMO_REPO_URL in run-demo.ts from agent-demo to atxp-express-example
- Update template URL in create-project.ts to use the new repository
2025-09-09 14:04:24 -04:00
Rob Di Marco 724821fe97 Add configurable port and directory options for demo command (#2)
- Move argument parsing from run-demo.ts to index.ts for better separation of concerns
- Add --port/-p option to specify custom demo port (default: 8016)
- Add --dir/-d option to specify custom demo directory (default: ~/.cache/atxp/demo)
- Refactor runDemo() to accept DemoOptions parameter for type safety
- Update all helper functions to use passed parameters instead of global state
- Add comprehensive documentation in help text and README files
- Support path resolution for relative directory paths

New usage examples:
- npx atxp demo --port 3000
- npx atxp demo --dir ./my-demo
- npx atxp demo --port 9000 --dir ~/projects/demo --verbose

Resolves port conflicts and allows flexible demo installation locations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 13:43:48 -04:00
Rob Di Marco 4310dfb6ad Documentation update 2025-09-09 12:58:31 -04:00
Rob Di Marco 9af85f5479 Show help by default instead of running demo (#1)
- Add comprehensive help module with usage information
- Update CLI to show help when no command is provided
- Require explicit 'demo' command to run the demo
- Add support for help, --help, -h flags
- Improve error handling for unknown commands

Fixes: https://linear.app/novellum/issue/ATXP-240/running-npx-atxp-should-print-out-help

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 12:56:58 -04:00
Rob Di Marco 8b576eb5bb Get tests working 2025-09-09 12:38:36 -04:00
Rob Di Marco 0939d87016 Get linting wokring 2025-09-09 12:20:04 -04:00
Rob Di Marco 37b50042f4 Add test/release workflows 2025-09-09 12:17:07 -04:00
Rob Di Marco 6c1f7dcf59 Fix lint issues 2025-09-09 12:10:46 -04:00
Rob Di Marco b064145293 Moved https://github.com/atxp-dev/sdk/pull/29 into its own repository v1.0.3 2025-09-09 12:09:19 -04:00