Skip to content

Latest commit

 

History

History
226 lines (158 loc) · 5.13 KB

File metadata and controls

226 lines (158 loc) · 5.13 KB

Publishing to VS Code Marketplace

This guide will walk you through publishing PolyForm to the Visual Studio Code Extension Marketplace.

Prerequisites

  1. Microsoft Account: You need a Microsoft account to create a publisher
  2. Azure DevOps Organization: Required for publishing
  3. Personal Access Token (PAT): For authentication

Step 1: Install vsce (VS Code Extension Manager)

npm install -g @vscode/vsce

Step 2: Create a Publisher

Option A: Via Web Interface

  1. Go to Visual Studio Marketplace Publisher Management
  2. Sign in with your Microsoft account
  3. Click Create Publisher
  4. Fill in the details:
    • Publisher ID: hridesh-net (must match package.json)
    • Display Name: Your name or organization
    • Description: Brief description of your publisher profile

Option B: Via Command Line

vsce create-publisher hridesh-net

Step 3: Get a Personal Access Token (PAT)

  1. Go to Azure DevOps
  2. Sign in with the same Microsoft account
  3. Click on User Settings (top right) → Personal Access Tokens
  4. Click + New Token
  5. Configure the token:
    • Name: vsce-polyform
    • Organization: All accessible organizations
    • Expiration: Custom (set to 1 year or more)
    • Scopes: Select MarketplaceManage
  6. Click Create and copy the token (you won't see it again!)

Step 4: Login to vsce

vsce login hridesh-net

When prompted, paste your Personal Access Token.

Step 5: Prepare for Publishing

Update package.json

Ensure your package.json has all required fields (already done):

  • name
  • displayName
  • description
  • version
  • publisher
  • repository
  • icon
  • categories
  • keywords

Add an Icon

  1. Save the generated icon as icon.png in the root directory
  2. Ensure it's 512x512px or larger
  3. PNG format with transparency

Create a LICENSE file

# If you haven't already
touch LICENSE

Add MIT License content (or your preferred license).

Update README

Ensure README.md has:

  • Clear description
  • Screenshots/GIFs
  • Installation instructions
  • Usage examples

Step 6: Package the Extension

# This creates a .vsix file
vsce package

This will create polyform-0.1.0.vsix (or your current version).

Test the Package Locally

code --install-extension polyform-0.1.0.vsix

Step 7: Publish to Marketplace

First-time Publish

vsce publish

This will:

  1. Package your extension
  2. Upload it to the marketplace
  3. Make it available for installation

Update Existing Extension

When you make changes:

  1. Update the version in package.json:

    "version": "0.1.1"  // Increment version
  2. Publish the update:

    # Patch version (0.1.0 → 0.1.1)
    vsce publish patch
    
    # Minor version (0.1.0 → 0.2.0)
    vsce publish minor
    
    # Major version (0.1.0 → 1.0.0)
    vsce publish major

Step 8: Verify Publication

  1. Go to VS Code Marketplace
  2. Search for "PolyForm"
  3. Verify your extension appears with correct:
    • Icon
    • Description
    • Screenshots
    • Installation instructions

Post-Publication

Monitor Analytics

Update Extension

When you push updates:

  1. Commit changes to git
  2. Update version in package.json
  3. Run vsce publish patch/minor/major
  4. Tag the release in git:
    git tag v0.1.1
    git push origin v0.1.1

Troubleshooting

"Publisher not found"

Make sure the publisher field in package.json matches your publisher ID exactly.

"Missing README"

Ensure README.md exists in the root directory.

"Icon not found"

Verify icon.png exists and is referenced correctly in package.json.

"Invalid version"

Follow semantic versioning: MAJOR.MINOR.PATCH (e.g., 0.1.0, 1.0.0)

Useful Commands

# Package without publishing
vsce package

# Publish with specific version
vsce publish 0.2.0

# Unpublish (use with caution!)
vsce unpublish hridesh-net.polyform

# Show extension info
vsce show hridesh-net.polyform

# List all your published extensions
vsce ls hridesh-net

Best Practices

  1. Semantic Versioning: Follow semver (MAJOR.MINOR.PATCH)
  2. Changelog: Maintain a CHANGELOG.md file
  3. Testing: Test thoroughly before publishing
  4. Screenshots: Add high-quality screenshots to README
  5. Keywords: Use relevant keywords for discoverability
  6. Documentation: Keep README and docs up to date
  7. License: Always include a LICENSE file

Resources


Ready to publish? Run vsce publish and share PolyForm with the world! 🚀