Skip to content

Contributing to ACME Portal

Thank you for your interest in contributing to the ACME Portal VS Code extension! This guide will help you get started with development and contributing.

Development Setup

Prerequisites

  • Node.js (version 18.x or 20.x)
  • npm (comes with Node.js)
  • VS Code (version 1.97.0 or later)
  • Git (for version control)

Getting Started

  1. Fork and Clone

    git clone https://github.com/your-username/acme-portal.git
    cd acme-portal
    

  2. Install Dependencies

    npm install
    

  3. Open in VS Code

    code .
    

Development Workflow

Running the Extension

  1. Press F5 in VS Code to launch the Extension Development Host
  2. This opens a new VS Code window with your extension loaded
  3. Make changes to the code and reload the window to test changes

Available Scripts

Command Description
npm run compile Compile TypeScript to JavaScript
npm run watch Watch for changes and auto-compile
npm run lint Run ESLint for code quality
npm run test Run the test suite
npm run package Build production bundle with webpack
npm run knip Check for unused dependencies

Debugging

  • Set breakpoints in your TypeScript code
  • Use the Debug Console in the Extension Development Host
  • Check the Output panel → "ACME Portal" for extension logs
  • Use the Developer Tools (Help → Toggle Developer Tools)

Code Style and Standards

ESLint Configuration

The project uses ESLint with TypeScript support. Run linting with:

npm run lint

Code Formatting

  • Use 2 spaces for indentation
  • Follow TypeScript best practices
  • Add JSDoc comments for public APIs
  • Use meaningful variable and function names

File Organization

src/
├── extension.ts          # Main extension entry point
├── flowTreeProvider.ts   # Tree view implementation
├── commands/            # Command implementations
├── models/             # Data models and interfaces
├── utils/              # Utility functions
└── test/               # Test files

Testing

Running Tests

npm run test

This runs tests in a headless VS Code environment using the @vscode/test-cli framework.

Writing Tests

  • Place test files in the src/test/ directory
  • Use the .test.ts suffix for test files
  • Follow the existing test patterns:
import * as assert from 'assert';
import * as vscode from 'vscode';

suite('Extension Test Suite', () => {
  test('Sample test', () => {
    assert.strictEqual([1, 2, 3].indexOf(5), -1);
    assert.strictEqual([1, 2, 3].indexOf(0), -1);
  });
});

Test Categories

  • Unit Tests: Test individual functions and classes
  • Integration Tests: Test extension commands and VS Code integration
  • End-to-End Tests: Test complete workflows

Contributing Guidelines

Before You Start

  1. Check existing issues for similar problems or features
  2. Open an issue to discuss major changes before implementing
  3. Make sure tests pass before submitting changes

Making Changes

  1. Create a Branch

    git checkout -b feature/your-feature-name
    

  2. Make Your Changes

  3. Write clean, well-documented code
  4. Add tests for new functionality
  5. Update documentation as needed

  6. Test Your Changes

    npm run lint
    npm run test
    npm run compile
    npm run check-release-notes  # Validate release notes entry
    

  7. Add Release Notes Entry

  8. Open CHANGELOG.md
  9. Add your change to the [Unreleased] section
  10. Format: - **Feature Name**: Description (#PR_NUMBER)
  11. See Release Notes Process below

  12. Commit Your Changes

    git add .
    git commit -m "feat: add your feature description"
    

Commit Message Format

We follow conventional commit format:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • refactor: - Code refactoring
  • test: - Test additions or changes
  • chore: - Maintenance tasks

Examples: - feat: add flow comparison command - fix: resolve tree view refresh issue - docs: update API reference

Pull Request Process

  1. Push Your Branch

    git push origin feature/your-feature-name
    

  2. Create Pull Request

  3. Use a descriptive title
  4. Fill out the PR template
  5. Reference related issues
  6. Add screenshots for UI changes

  7. Address Review Feedback

  8. Respond to comments
  9. Make requested changes
  10. Push updates to the same branch

Documentation

Updating Documentation

When making changes that affect users or developers:

  1. README.md: Update if installation or basic usage changes
  2. CHANGELOG.md: Add entries for all user-facing changes
  3. docs/: Update relevant documentation pages
  4. Code Comments: Add or update JSDoc comments

Documentation Style

  • Use clear, concise language
  • Include code examples where helpful
  • Keep screenshots up to date
  • Link to related documentation

Release Notes Process

Every pull request must include a release notes entry in CHANGELOG.md.

For complete guidelines, examples, and validation details, see the Release Notes Process in the main contributing guide.

Release Process

Version Management

We use semantic versioning (semver): - MAJOR.MINOR.PATCH - Increment MAJOR for breaking changes - Increment MINOR for new features - Increment PATCH for bug fixes

Automated Release Process

Releases are fully automated through GitHub Actions. No manual CHANGELOG.md editing required!

  1. Update Version

    npm version patch  # or minor/major
    

  2. Create and Push Tag

    git push origin main
    git push origin --tags
    

  3. Automated Workflow The release workflow automatically:

  4. Runs comprehensive tests across multiple platforms and VS Code versions
  5. Packages and validates the extension
  6. Extracts release notes from the [Unreleased] section in CHANGELOG.md
  7. Creates GitHub release with extracted release notes
  8. Publishes to VS Code Marketplace (when VSCE_PAT secret is configured)
  9. 🆕 Updates CHANGELOG.md by moving [Unreleased] content to new version section
  10. 🆕 Commits updated CHANGELOG.md back to the main branch

New Developer Experience

Before (manual process):

# Developers had to manually edit CHANGELOG.md
# 1. Move [Unreleased] content to version section
# 2. Clear [Unreleased] section
# 3. Commit changes
git add CHANGELOG.md
git commit -m "Update CHANGELOG for 1.2.3"
git tag v1.2.3
git push origin v1.2.3

After (automated process):

# Developers just create the tag - automation handles everything else
git tag v1.2.3
git push origin v1.2.3
# ✅ GitHub Actions automatically updates CHANGELOG.md and commits it back

This eliminates manual steps and reduces the chance of release documentation errors.

Getting Help

Resources

Community

  • GitHub Issues: For bugs and feature requests
  • GitHub Discussions: For questions and general discussion
  • Code Reviews: Learn from PR feedback and reviews

Development Tips

  1. Use VS Code's Extension Development Host for testing
  2. Check the Output panel for debugging information
  3. Use breakpoints liberally during development
  4. Test on different operating systems when possible
  5. Keep dependencies up to date but test thoroughly

Code of Conduct

Please note that this project follows a Code of Conduct. By participating, you are expected to:

  • Be respectful and inclusive
  • Welcome newcomers and help them learn
  • Focus on constructive feedback
  • Respect different viewpoints and experiences

Recognition

Contributors will be recognized in: - The CHANGELOG.md file - GitHub's contributor graph - Release notes for significant contributions

Thank you for contributing to ACME Portal! 🚀