Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ Guidance for Claude Code when working with the dtvem codebase.
2. **Write tests** - All new/refactored code requires comprehensive unit tests
3. **Cross-platform** - All features must work on Windows, macOS, and Linux
4. **Conventional commits** - Format: `type(scope): description`
5. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files
6. **Run validation before commits** - Run `npm run check` (format, lint, test) before committing and pushing

5. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
6. **Pull Requests** - Use the conventional commit format for PR titles as you do for commits
7. **Run validation before commits** - Run `npm run check` (format, lint, test) before committing and pushing
8. **Working an issue** - When working an issue, always create a new branch from an updated main branch
9. **Branch Names** - Always use the conventional commit `type` from the issue title as the first prefix, and the `scope` as the second, then a very short description, example `feat/ci/integration-tests`
---

## Quick Reference
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/generate-changelog.yml'
- '.github/workflows/preview-changelog.yml'
- '.github/workflows/contributors.yml'
- '.github/workflows/integration-test*.yml'
- '.idea/**'
- '.claude/**'
- '.gitignore'
Expand All @@ -32,6 +33,7 @@ on:
- '.github/workflows/generate-changelog.yml'
- '.github/workflows/preview-changelog.yml'
- '.github/workflows/contributors.yml'
- '.github/workflows/integration-test*.yml'
- '.idea/**'
- '.claude/**'
- '.gitignore'
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/integration-test-migrate-node-macos-fnm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Integration Tests - Migrate Node.js from fnm (macOS)

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
migrate:
name: Node.js from fnm (macOS)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Build dtvem
run: |
go build -v -ldflags="-s -w" -o dist/dtvem ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim

- name: Initialize dtvem
run: ./dist/dtvem init --yes

- name: Add dtvem to PATH
run: |
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH

- name: "Install fnm"
run: |
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
echo "$HOME/.local/share/fnm" >> $GITHUB_PATH

- name: "Install Node.js 20.18.0 via fnm"
run: |
export PATH="$HOME/.local/share/fnm:$PATH"
eval "$(fnm env --shell bash)"
fnm install 20.18.0
fnm use 20.18.0
echo "fnm Node.js installed at: $(which node)"
node --version

- name: "Migrate fnm Node.js to dtvem"
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\nn\n" | ./dist/dtvem migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list node

- name: "Verify migrated version"
run: |
./dist/dtvem list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
echo "SUCCESS: Node.js 20.18.0 was migrated from fnm"

- name: Generate summary
if: always()
run: |
echo "## Node.js Migration from fnm (macOS)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** fnm" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
68 changes: 68 additions & 0 deletions .github/workflows/integration-test-migrate-node-macos-system.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Integration Tests - Migrate Node.js from System (macOS)

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
migrate:
name: Node.js from System (macOS)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Build dtvem
run: |
go build -v -ldflags="-s -w" -o dist/dtvem ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim

- name: Initialize dtvem
run: ./dist/dtvem init --yes

- name: Add dtvem to PATH
run: |
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH

- name: "Install Node.js 18.x via Homebrew"
run: |
brew install node@18
brew link --overwrite node@18
echo "System Node.js installed at: $(which node)"
node --version

- name: "Migrate system Node.js to dtvem"
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\n" | ./dist/dtvem migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list node

- name: "Verify migrated version"
run: |
./dist/dtvem list node | grep -E "18\." || (echo "ERROR: Expected Node.js 18.x to be migrated" && exit 1)
echo "SUCCESS: Node.js 18.x was migrated from system"

- name: Generate summary
if: always()
run: |
echo "## Node.js Migration from System (macOS)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** Homebrew" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 18.x" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
71 changes: 71 additions & 0 deletions .github/workflows/integration-test-migrate-node-ubuntu-nvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Integration Tests - Migrate Node.js from nvm (Ubuntu)

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
migrate:
name: Node.js from nvm (Ubuntu)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Build dtvem
run: |
go build -v -ldflags="-s -w" -o dist/dtvem ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim

- name: Initialize dtvem
run: ./dist/dtvem init --yes

- name: Add dtvem to PATH
run: |
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH

- name: "Install Node.js 20.18.0 via nvm"
run: |
# nvm is preinstalled on Ubuntu runners
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20.18.0
nvm use 20.18.0
echo "nvm Node.js installed at: $(which node)"
node --version

- name: "Migrate nvm Node.js to dtvem"
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\nn\n" | ./dist/dtvem migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list node

- name: "Verify migrated version"
run: |
./dist/dtvem list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
echo "SUCCESS: Node.js 20.18.0 was migrated from nvm"

- name: Generate summary
if: always()
run: |
echo "## Node.js Migration from nvm (Ubuntu)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** nvm" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
69 changes: 69 additions & 0 deletions .github/workflows/integration-test-migrate-node-ubuntu-system.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Integration Tests - Migrate Node.js from System (Ubuntu)

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
migrate:
name: Node.js from System (Ubuntu)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true

- name: Build dtvem
run: |
go build -v -ldflags="-s -w" -o dist/dtvem ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim

- name: Initialize dtvem
run: ./dist/dtvem init --yes

- name: Add dtvem to PATH
run: |
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH

- name: "Install Node.js 18.x via apt (NodeSource)"
run: |
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
echo "System Node.js installed at: $(which node)"
node --version

- name: "Migrate system Node.js to dtvem"
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\n" | ./dist/dtvem migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list node

- name: "Verify migrated version"
run: |
# Check that we have a version starting with 18
./dist/dtvem list node | grep -E "18\." || (echo "ERROR: Expected Node.js 18.x to be migrated" && exit 1)
echo "SUCCESS: Node.js 18.x was migrated from system"

- name: Generate summary
if: always()
run: |
echo "## Node.js Migration from System (Ubuntu)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** apt (NodeSource)" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 18.x" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Loading