Conversation
still need to check package script - but this should be finished part of #18220
- additionally added repository management scripts to quickly initiate git repositories for node modules + the ability to apply a change dependency installation to all affected submodules
|
FYI - Added the ability to automatically manage C++/C# node modules using scripts. This document explains how to manage all C++ and C# projects in the Vortex solution, including native Node.js modules and .NET libraries that have their own Git repositories. OverviewThe Vortex project includes multiple types of projects maintained as separate repositories: Core .NET Projects
FOMOD Installer (.NET Libraries)
Native C++ Addon Projects
Gamebryo Extension C++ Projects
Quick Start0. Convert npm Packages to Git Repositories (First Time Only)When modules are installed via npm/yarn, they need to be converted to Git repositories: # See what would be converted
yarn modules:convert-dry
# Convert all C++ projects to Git repositories
node scripts/convert-to-git.js convert cpp
# Or convert all Git repositories at once
yarn modules:convert1. Project OverviewGet a complete overview of all projects: # Show project summary and statistics
yarn modules:summary
# Check status of all projects
yarn modules:status
# Check only C++ projects
yarn modules:cpp
# Check only C# projects
yarn modules:csharp2. Repository SetupSet up Git remotes for all repositories: # Setup all Git repositories
yarn modules:setup
# Setup only Nexus-Mods repositories (skip third-party)
node scripts/manage-node-modules.js setup-remotes nexus3. Targeted WorkflowsWork with specific project types: # Complete workflow for C++ projects only
node scripts/manage-node-modules.js workflow "Add missing header files to Visual Studio projects" cpp
# Commit changes to C# projects only
node scripts/manage-node-modules.js commit "Update .NET 9 dependencies" csharp
# Create branch for Nexus-Mods repositories only
node scripts/manage-node-modules.js create-branch "fix-build-issues" nexusRepository Conversion ProcessWhy Conversion is NeededWhen you install Vortex dependencies with Conversion ProcessThe conversion process:
Step-by-Step Conversion1. Preview Changes# See what would be converted for C++ projects
node scripts/convert-to-git.js dry-run cpp
# See all projects that would be converted
yarn modules:convert-dry2. Convert Projects# Convert C++ projects only (recommended first step)
node scripts/convert-to-git.js convert cpp
# Convert C# projects
node scripts/convert-to-git.js convert csharp
# Convert all Git repositories at once
yarn modules:convert
# Convert only Nexus-Mods repositories (exclude third-party)
node scripts/convert-to-git.js convert nexus3. Verify Conversion# Check that projects are now Git repositories
yarn modules:status
# Should now show Git status instead of "Not a Git repository"Conversion ExamplesExample 1: Convert All C++ Projects# 1. Preview what will be converted
node scripts/convert-to-git.js dry-run cpp
# 2. Convert C++ projects
node scripts/convert-to-git.js convert cpp
# 3. Verify conversion worked
yarn modules:cpp
# 4. Now you can use Git operations
node scripts/manage-node-modules.js workflow "Add missing header files" cppExample 2: Convert Only Nexus-Mods Projects# 1. Convert only Nexus-Mods repositories (exclude third-party)
node scripts/convert-to-git.js convert nexus
# 2. Setup Git remotes
node scripts/manage-node-modules.js setup-remotes nexus
# 3. Use normal Git workflow
node scripts/manage-node-modules.js workflow "Vortex integration updates" nexusWhat Gets Converted
Safety Features
After ConversionOnce converted, you can use all repository management features: # Full Git workflow now works
yarn modules:workflow "Your changes"
# Targeted operations work
node scripts/manage-node-modules.js commit "Fix header files" cpp
# All Git operations available
yarn modules:status # Shows Git status
yarn modules:setup # Sets up remotesTroubleshooting ConversionIf Conversion Fails# Check what failed
yarn modules:status
# Manual cleanup if needed
rm -rf node_modules/package-name
yarn install # Reinstalls npm version
# Try converting individual modules
node scripts/convert-to-git.js convert cppBuild Issues After Conversion# Rebuild native modules
cd node_modules/module-name
npm run rebuild
# Or rebuild all
yarn installDetailed UsageProject FiltersAll commands support filtering by project type:
Available CommandsProject Overview# Complete project summary with statistics
node scripts/manage-node-modules.js summary
# Status of all projects
node scripts/manage-node-modules.js status [filter]
# Status of specific project types
yarn modules:cpp # C++ projects only
yarn modules:csharp # C# projects onlyRepository Conversion# Convert npm packages to Git repositories
node scripts/convert-to-git.js convert [filter]
# Dry run to see what would be converted
node scripts/convert-to-git.js dry-run [filter]
# Using yarn shortcuts
yarn modules:convert-dry # See what would be converted
yarn modules:convert # Convert all Git repositoriesRepository Management# Setup Git remotes
node scripts/manage-node-modules.js setup-remotes [filter]
# Create feature branch
node scripts/manage-node-modules.js create-branch "branch-name" [filter]
# Delete branch (safe delete - fails if unmerged)
node scripts/manage-node-modules.js delete-branch "branch-name" [filter]
# Force delete branch (deletes even if unmerged)
node scripts/manage-node-modules.js delete-branch "branch-name" [filter] --force
# Delete local and remote branch
node scripts/manage-node-modules.js delete-branch "branch-name" [filter] --force --remote
# Commit changes
node scripts/manage-node-modules.js commit "commit message" [filter]
# Push changes
node scripts/manage-node-modules.js push [branch-name] [filter]
# Generate PR links
node scripts/manage-node-modules.js pr-links "branch-name" [filter]Complete Workflows# Complete workflow (branch + commit + push + PR links)
node scripts/manage-node-modules.js workflow "commit message" [filter]
# Using yarn shortcuts
yarn modules:workflow "Your commit message"Example WorkflowsScenario 1: Header Files Fix (C++ Projects Only)# 1. Check current status of C++ projects
yarn modules:cpp
# 2. Complete workflow for C++ projects only
node scripts/manage-node-modules.js workflow "Add missing header files to Visual Studio projects" cpp
# 3. Result: Creates branches, commits, and pushes to all C++ project repositoriesScenario 2: FOMOD Installer Updates (C# Only)# 1. Create branch for C# projects
node scripts/manage-node-modules.js create-branch "update-dotnet9" csharp
# 2. Make your changes to FOMOD installer projects
# (Edit files in node_modules/fomod-installer/)
# 3. Commit and push C# changes only
node scripts/manage-node-modules.js commit "Update to .NET 9 compatibility" csharp
node scripts/manage-node-modules.js push csharp
# 4. Generate PR links for C# projects
node scripts/manage-node-modules.js pr-links "update-dotnet9" csharpScenario 3: Nexus-Mods Repositories Only# 1. Work only with Nexus-Mods repositories (exclude third-party)
node scripts/manage-node-modules.js status nexus
# 2. Create branch for Nexus-Mods repos only
node scripts/manage-node-modules.js create-branch "vortex-integration-fix" nexus
# 3. Complete workflow for Nexus-Mods repositories
node scripts/manage-node-modules.js workflow "Integrate with Vortex solution" nexusScenario 4: All Projects Workflow# 1. Show complete project overview
yarn modules:summary
# 2. Check status of all projects
yarn modules:status
# 3. Complete workflow for all Git repositories
yarn modules:workflow "Update Visual Studio integration"Project DetailsGit Repository Mapping
Visual Studio IntegrationAll projects are included in
Changes to Yarn Script Reference# Conversion (first-time setup)
yarn modules:convert-dry # Preview conversion changes
yarn modules:convert # Convert npm packages to Git repos
# Quick status checks
yarn modules:status # All projects
yarn modules:cpp # C++ projects only
yarn modules:csharp # C# projects only
yarn modules:summary # Project overview
# Repository management
yarn modules:setup # Setup Git remotes
yarn modules:workflow # Complete workflow
yarn modules:commit # Commit changes
yarn modules:push # Push changesAdvanced UsageCustom Filters# Multiple operations with specific filters
node scripts/manage-node-modules.js create-branch "feature-x" nexus
node scripts/manage-node-modules.js commit "Add feature X" nexus
node scripts/manage-node-modules.js push nexus
# Check third-party dependencies
node scripts/manage-node-modules.js status third-partyBranch ManagementThe repository management system provides comprehensive branch operations: Creating Branches# Create branch across all Git repositories
yarn modules:create-branch "feature-name"
# Create branch for specific project types
node scripts/manage-node-modules.js create-branch "cpp-fixes" cpp
node scripts/manage-node-modules.js create-branch "csharp-updates" csharpDeleting Branches# Safe delete (fails if branch has unmerged changes)
yarn modules:delete-branch "old-feature"
# Safe delete for specific project types
node scripts/manage-node-modules.js delete-branch "deprecated-feature" cpp
# Force delete branch (even with unmerged changes)
node scripts/manage-node-modules.js delete-branch "experimental-branch" git --force
# Delete both local and remote branches
node scripts/manage-node-modules.js delete-branch "feature-branch" git --force --remote
# Delete only from specific repositories
node scripts/manage-node-modules.js delete-branch "test-branch" nexus --forceBranch Deletion Options
Branch Management Workflow# 1. Create feature branch
yarn modules:create-branch "new-feature"
# 2. Work on changes and commit
yarn modules:commit "Implement new feature"
# 3. Push changes
yarn modules:push
# 4. After feature is merged, clean up
yarn modules:delete-branch "new-feature" --force --remoteTesting with Feature BranchesWhen developing changes across multiple repositories, you'll want to test them together. The branch updater script makes this easy: Update Dependencies to Use Feature Branches# Scan workspace to see which package.json files contain managed dependencies
yarn modules:scan-deps
# Update all dependencies to use your feature branch
yarn modules:update-branch my-feature-branch
# Or use the script directly
node scripts/update-package-branches.js update my-feature-branch
# Update only specific modules
yarn modules:update-branch fix-headers bsatk esptk
# Preview what would be updated (dry run)
node scripts/update-package-branches.js generate my-feature-branchTesting Workflow
Branch Management Commands# Show current branches for all Git repositories
yarn modules:show-branches
# Show only C++ project branches
yarn modules:show-branches cpp
# Reinstall dependencies after changes
yarn modules:reinstallSafety Features
Example: Testing Header File Changes# 1. Create and push changes to repositories
yarn modules:workflow "Add missing header files" cpp
# 2. Update dependencies to use your feature branches
yarn modules:update-branch add-missing-headers
# 3. Rebuild with the new dependencies
yarn modules:reinstall
yarn build
# 4. Test the application
yarn start
# 5. When testing is complete, restore original dependencies
yarn modules:restore-deps
yarn modules:reinstallImportant NotesProject Types
Branch Strategy
Integration Benefits
This system provides comprehensive management for all C++ and C# projects in the Vortex ecosystem, enabling efficient development and contribution workflows across multiple repositories. |
closes #18220
closes #17240