Advanced Salesforce DevOps toolkit for package operations, deployments, testing, and changelog management - 100% standalone, no SF CLI or Salesforce extensions required!
Note: The animated demos in this README may not display properly in VS Code's markdown preview. For the best viewing experience, please view this README on GitHub or install the "Markdown Preview Enhanced" extension in VS Code.
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Packageforce"
- Click Install
- Go to Releases
- Download the latest
.vsixfile - In VS Code, open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run "Extensions: Install from VSIX..."
- Select the downloaded file
# Clone the repository
git clone https://github.com/Rocko1204/packageforce.git
cd packageforce
# Install dependencies
npm install
# Build and package
npm run package
# Install the VSIX
code --install-extension packageforce-*.vsix- Open any
sfdx-project.jsonfile to see inline actions for each package:- π Deploy Package: Deploy a package to your selected org
- π Scan Package: Run PMD code analysis with custom rules support
- π Find Duplicates: Detect duplicate code between package and entire repository
- π§ͺ Test Package: Run all test classes in the package with code coverage
- Find the Packageforce Packages view in the Explorer sidebar
- Shows all packages from your
sfdx-project.jsonwith package type indicators:- π Unlocked packages (have packageAliases entry)
- ποΈ Data packages (type: "data")
- π Diff packages (type: "diff")
- π¦ Source packages (default)
- Click any package to see available actions
- Quick actions available in the toolbar:
- Search packages with quick pick
- Update changelog from staged files
- Scan staged files (global action)
- Refresh package list
- Deploy packages directly from VS Code without SF CLI
- Support for multiple deployment modes:
- Package Only: Deploy just the selected package
- With Dependencies: Deploy package and all its dependencies
- Validate Only: Run a check-only deployment to validate changes
- Advanced Options: Configure test levels and specific test classes
- Smart org selection:
- Use default org from config
- Select specific org by alias or username
- Automatic fallback to first available org
- Real-time deployment progress tracking
- Detailed error reporting with component-level failure details
- Support for all Salesforce metadata types
- Find duplicate code across your entire repository
- Cross-package duplicate detection highlights code that should be shared
- Configurable sensitivity levels:
- Large Duplicates (500+ tokens): Major code blocks
- Medium Duplicates (200+ tokens): Significant methods or classes
- Small Duplicates (100+ tokens): Smaller code patterns
- Custom Settings: Fine-tune token count and matching options
- Smart exclusions:
- Automatically excludes test classes
- Detects @isTest annotations
- Filters test files by naming patterns
- Advanced matching options:
- Exact match for identical code
- Ignore variable names for similar logic
- Ignore literals for pattern matching
- Results visualization:
- VS Code diagnostics integration
- Cross-package duplicates shown as errors
- Internal duplicates shown as warnings
- Export reports in multiple formats
- Run all test classes in a package without requiring SF CLI
- Direct Salesforce API integration for test execution
- Two execution modes:
- Asynchronous (Default): Queue tests and poll for results
- Synchronous: Wait for immediate results
- Uses MetadataResolver to automatically find test classes
- Detects test classes by @isTest annotation
- Shows detailed test results with:
- Pass/fail status for each test method
- Code coverage percentage per class with line details
- Overall package coverage with 75% threshold indicator
- Full stack traces for failed tests
- Progress updates during async execution
- Beautiful output formatting in dedicated output channel
- Update package changelogs from staged Git files
- Automatically detects which packages have changes
- Interactive prompts for:
- Change type (Feature/Fix)
- Work item reference (e.g., JIRA ticket)
- Change description
- Breaking changes detection
- Updates:
- Package versions in
sfdx-project.json - README files with changelog tables
- Stages all updated files for commit
- Package versions in
- Integrated PMD code analyzer for Apex, Visualforce, and Lightning
- Automatic PMD installation (no manual setup required)
- PMD 7.x Compatible: Updated rules for latest PMD version
- Custom rule support:
- Place custom rules in
.pmd/directory - XML-based rule configuration
- Priority-based filtering
- Place custom rules in
- Multiple scan modes:
- Quick scan with essential rules
- Full scan with all rules
- Custom scan with selected rulesets
- Custom rules scan from workspace
- Global Scan Actions:
- Scan staged files from toolbar (not package-specific)
- Scans all analyzable file types:
- Apex (.cls, .trigger)
- Visualforce (.page, .component)
- Lightning Web Components (.js, .html in /lwc/)
- Aura Components (.cmp, .evt, .app)
- Metadata files (.object-meta.xml, .field-meta.xml, etc.)
- Automatically applies custom rules for metadata validation
- Export scan results:
- HTML reports with detailed findings
- CSV for spreadsheet analysis
- JSON for tool integration
- Markdown for documentation
- VS Code integration:
- Results shown in Problems panel
- Click to navigate to violations
- Detailed violation descriptions
All commands are available in the Command Palette (Cmd+Shift+P / Ctrl+Shift+P):
Packageforce: Test Extension- Verify the extension is workingPackageforce: Find Package- Search and navigate to packagesPackageforce: Update Changelog- Update changelogs from staged filesPackageforce: Scan Staged Files- Run PMD analysis on all staged files
- VS Code 1.95.0 or higher
- Salesforce DX project with
sfdx-project.json - Git repository for changelog features
- Authenticated Salesforce org (no SF CLI required)
- Open a Salesforce DX project in VS Code
- The extension activates automatically
- Open
sfdx-project.jsonto see CodeLens actions - Look for "SFDX Packages" in the Explorer sidebar
- Stage some changes and run the changelog command from the toolbar
- Copy the
.pmd/folder to your Salesforce project root - Run scan on a package from CodeLens or Package Explorer
- Select "Scan with Custom Rules" option
- Review violations in the Problems panel
Example custom rules included:
- Missing Data Factory: Detects direct record instantiation in tests (CRITICAL)
- Empty Object Description: Flags objects without descriptions (HIGH)
- Empty Field Description: Flags fields without descriptions or help text (HIGH)
- Test Data Factory Pattern: Validates factory method implementations
- Performance Rules: Operations with limits in loops (PMD 7.x)
- Security Rules: CRUD and sharing violations
- Uses PMD's Copy-Paste Detector (CPD) to find duplicate code
- Compares package code against entire repository
- Multiple sensitivity levels:
- Quick Check: 100+ tokens (larger duplicates)
- Standard Check: 75+ tokens
- Deep Check: 50+ tokens (smaller duplicates)
- Custom: Configure your own threshold
- Matching options:
- Exact match
- Ignore variable names
- Ignore literals (strings/numbers)
- Ignore both (most flexible)
- Results shown in:
- VS Code Problems panel with navigation
- Detailed output channel
- Exportable reports (HTML, CSV, JSON, Markdown)
- Look in the Explorer sidebar (where file tree is shown)
- The view should appear under a section called "Packageforce Packages"
- Try refreshing VS Code or reloading the window
- Make sure you have staged files in Git
- Check the VS Code output panel for errors
- Try the "Simple Changelog Test" command first - if this works but the full command doesn't, it's a known issue with complex quick picks
- The extension now uses simplified string-based quick picks to avoid this issue
Configure Packageforce in VS Code settings:
{
// Path to PMD installation (optional - will auto-download if not set)
"packageforce.pmd.path": "/path/to/pmd",
// Custom PMD rules directory (defaults to .pmd/)
"packageforce.pmd.customRulesPath": ".pmd/",
// Java executable path
"packageforce.pmd.javaPath": "java",
// Show scan results in Problems panel
"packageforce.scan.showDiagnostics": true,
// Minimum priority for violations (1-5)
"packageforce.scan.minimumPriority": 3
}This extension uses settings from your sfdx-project.json file:
{
"plugins": {
"eon-sfdx": {
"enableReadmeGeneration": true,
"workItemFilter": "JIRA-\\d+",
"workItemUrl": "https://jira.example.com/browse/"
}
}
}We welcome contributions! Please see our Contributing Guide for details on:
- How to submit issues
- How to submit pull requests
- Development setup
- Code style guidelines
Initial release with:
- CodeLens provider for sfdx-project.json
- Package Explorer view
- Changelog management from staged files
- Custom deployment service
- PMD 7.x compatible code scanning
- Global scan staged files action
- Test execution without SF CLI
This project is licensed under the MIT License - see the LICENSE file for details.





