Package.json Manager
A comprehensive Visual Studio Code extension for managing and visualizing package.json files.
Features
1. Visual Editor for package.json files
- Edit package details (name, version, description, etc.) with a user-friendly interface
- Manage dependencies and dev dependencies visually
- Add, edit, and remove npm scripts
2. Dependency Management
- Search and install npm packages directly from the editor
- Update dependency versions easily
- View detailed package information
- Move between dependencies and dev dependencies with a single click
3. Dependency Visualization
- Interactive graph visualization of your project dependencies
- Filter by dependency type (regular or dev dependencies)
- Search for specific dependencies in the graph
- View detailed package information by clicking on a dependency node
4. Script Management
- Add, edit, and delete npm scripts
- Execute scripts directly from the interface
- Quick access to common scripts
Usage
Opening the Visual Editor
- Open a package.json file in VS Code
- Click on the "Open in Package.json Manager" button in the editor toolbar
- Alternatively, right-click on a package.json file in the Explorer and select "Open in Package.json Manager"
Viewing Dependency Graph
- In the Package.json Manager, navigate to the "Dependencies" tab
- Click the "View Dependency Graph" button
- Alternatively, use the command palette (Ctrl+Shift+P) and search for "Show Dependency Graph"
Managing Dependencies
- Navigate to the "Dependencies" tab in the Package.json Manager
- Click "Add Dependency" to search and install new packages
- Use the filter controls to switch between regular and dev dependencies
- Click the "Edit" button next to a dependency to update its version or change its type
- Click the "Remove" button to delete a dependency
Managing Scripts
- Navigate to the "Scripts" tab in the Package.json Manager
- Add, edit, or delete npm scripts using the provided controls
- Click the "Run" button next to a script to execute it in the integrated terminal
Requirements
- Visual Studio Code version 1.60.0 or higher
- Node.js and npm installed on your system
Extension Settings
This extension contributes the following settings:
packageJsonManager.enableAutomaticVisualEditing : Enable/disable automatic opening of package.json files in visual editor
packageJsonManager.showDependencyGraphButton : Show/hide dependency graph button in editor title
Known Issues
- Deep dependency resolution in the visualization graph is limited to direct dependencies
Release Notes
1.0.0
Initial release of Package.json Manager
Development
Setup
- Clone the repository
- Run
npm install
- Run
npm run watch for development
- Press F5 to launch the extension in debug mode
Building
Run npm run package to create a VSIX file for distribution
CI/CD Pipeline
This project uses GitHub Actions for continuous integration and deployment:
- Pull Requests: Automatically build and test the extension
- Main Branch: Build, test, and create artifacts
- Tags: Publish to VS Code Marketplace and create GitHub releases
Creating a Release
To create a new release:
- Make sure you're on the
main branch with a clean working directory
- Run the release script with the desired version bump type:
./scripts/release.sh [patch|minor|major]
- Edit the CHANGELOG.md file to describe your changes (will open automatically)
- Push the changes and tag:
git push origin main
git push origin v<new-version>
- The GitHub Actions workflow will automatically:
- Build and test the extension
- Create a GitHub Release with the VSIX file attached
- Publish the extension to the VS Code Marketplace
Note: You need to have a Personal Access Token (PAT) with the proper permissions set as the VSCE_PAT secret in your GitHub repository.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
| |