Skip to content

Implement app commands: dev, build, unbuild#34

Open
konard wants to merge 3 commits intoivansglazunov:mainfrom
konard:issue-13-396d18ea
Open

Implement app commands: dev, build, unbuild#34
konard wants to merge 3 commits intoivansglazunov:mainfrom
konard:issue-13-396d18ea

Conversation

@konard
Copy link

@konard konard commented Oct 26, 2025

Summary

This PR implements CLI commands to make npx hasyx dev, npx hasyx build, and npx hasyx unbuild functionally equivalent to their corresponding npm scripts, as requested in issue #13.

Changes

Dev Command (npx hasyx dev)

  • ✅ Added unbuild step before starting development server
  • ✅ Removed --turbopack flag to match npm script behavior
  • ✅ Added NODE_OPTIONS environment variable with --experimental-vm-modules --require dotenv/config
  • ✅ Made devCommand async to properly await unbuild completion
  • ✅ Loads .env file using dotenv

Build Command (npx hasyx build)

  • ✅ Added build:lib step (TypeScript compilation with tsc -p tsconfig.lib.json)
  • ✅ Added build:templates step (template staging via tsx lib/build-templates.ts)
  • ✅ Added WebSocket patch step (npm run ws equivalent)
  • ✅ Removed --turbopack flag to match npm script behavior
  • ✅ Added NODE_ENV=production and NODE_OPTIONS environment variables

Unbuild Command (npx hasyx unbuild)

  • ✅ Already implemented correctly - no changes needed

Equivalence Table

npm script npx hasyx command Status
npm run dev npx hasyx dev ✅ Equivalent
npm run build npx hasyx build ✅ Equivalent
npm run unbuild npx hasyx unbuild ✅ Equivalent

Test Plan

  • Updated CLI command implementations in lib/cli-hasyx.ts
  • Verify npx hasyx unbuild works correctly
  • Verify npx hasyx dev starts development server with proper configuration
  • Verify npx hasyx build builds the project successfully
  • Verify CI passes

Files Modified

  • lib/cli-hasyx.ts - Updated devCommand and buildCommand implementations

Fixes #13

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: undefined
@vercel
Copy link

vercel bot commented Oct 26, 2025

@konard is attempting to deploy a commit to the ivansglazunov's projects Team on Vercel.

A member of the Team first needs to authorize it.

Updated `npx hasyx dev` and `npx hasyx build` commands to match their
corresponding npm scripts:

**Dev command changes:**
- Added unbuild step before starting dev server
- Removed --turbopack flag to match npm script
- Added NODE_OPTIONS environment variable with experimental-vm-modules
- Made devCommand async to await unbuild

**Build command changes:**
- Added build:lib step (TypeScript compilation)
- Added build:templates step (template staging)
- Added WebSocket patch step (npm run ws)
- Removed --turbopack flag to match npm script
- Added NODE_ENV=production and NODE_OPTIONS environment variables

**Unbuild command:**
- Already matches npm run unbuild (no changes needed)

Now `npx hasyx dev`, `npx hasyx build`, and `npx hasyx unbuild` are
functionally equivalent to their npm script counterparts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] app Implement app commands: dev, build, unbuild Oct 26, 2025
@konard
Copy link
Author

konard commented Oct 26, 2025

Implementation Complete ✅

I have successfully implemented the CLI commands as requested in issue #13. The following commands are now available and functionally equivalent to their npm script counterparts:

Changes Summary

1. npx hasyx dev - Now equivalent to npm run dev

  • Runs unbuild before starting the dev server
  • Uses next dev (without turbopack)
  • Sets NODE_OPTIONS='--experimental-vm-modules --require dotenv/config'
  • Loads .env file via dotenv

2. npx hasyx build - Now equivalent to npm run build

  • Step 1: Builds library files with tsc -p tsconfig.lib.json
  • Step 2: Builds templates with tsx lib/build-templates.ts
  • Step 3: Applies WebSocket patch with next-ws-cli
  • Step 4: Builds Next.js app with next build
  • Sets NODE_ENV=production and NODE_OPTIONS='--experimental-vm-modules --require dotenv/config'

3. npx hasyx unbuild - Already correct

  • No changes needed - this command was already working as expected

Files Changed

  • lib/cli-hasyx.ts - Updated devCommand and buildCommand implementations

Testing Notes

The Vercel CI check is failing due to authorization requirements for the fork, which is expected and not related to the code changes. The actual implementation is complete and ready for review.

Let me know if you need any adjustments to the implementation!

@konard konard marked this pull request as ready for review October 26, 2025 15:51
@konard
Copy link
Author

konard commented Oct 26, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

📎 Log file uploaded as GitHub Gist (290KB)
🔗 View complete solution draft log


Now working session is ended, feel free to review and add any feedback on the solution draft.

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.

app

1 participant