Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]

permissions:
contents: read

jobs:
validate:
name: Validate & Package
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools/vscode-project-launcher

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: tools/vscode-project-launcher/package.json

- name: Install dependencies
run: npm install

- name: Validate extension.js syntax
run: node --check extension.js

- name: Package VSIX
run: npx @vscode/vsce package --no-dependencies

- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vsix-package
path: tools/vscode-project-launcher/*.vsix
retention-days: 7
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: Package & Release
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: tools/vscode-project-launcher

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: tools/vscode-project-launcher/package.json

- name: Install dependencies
run: npm install

- name: Validate extension.js syntax
run: node --check extension.js

- name: Package VSIX
run: npx @vscode/vsce package --no-dependencies

- name: Upload VSIX to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: tools/vscode-project-launcher/*.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85 changes: 85 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Publishing Guide

This document covers the minimal setup required before publishing the **Project Launcher** extension for the first time.

---

## Repository Setup

1. **Create a new GitHub repository** (if extracting from a monorepo):
- Repository name: `vscode-project-launcher` (or your preferred name)
- Visibility: Public (required for the VS Code Marketplace free tier)
- Copy the contents of `tools/vscode-project-launcher/` to the root of the new repo
- Copy `.github/workflows/` to the new repo

2. **Set the correct publisher** in `package.json`:
```json
"publisher": "your-publisher-id"
```
The publisher ID must match the publisher you create on the VS Code Marketplace.

---

## VS Code Marketplace Setup

1. Go to <https://marketplace.visualstudio.com/manage> and sign in with a Microsoft account.
2. Click **Create publisher** and fill in the form.
3. Note your **Publisher ID** — set it in `package.json`.

---

## Personal Access Token (PAT)

The release workflow uses `GITHUB_TOKEN` (automatically provided by GitHub Actions) to upload the VSIX to a GitHub Release.

To **publish directly to the VS Code Marketplace** (optional), you need an Azure DevOps PAT:

1. Go to <https://dev.azure.com> → **User settings** → **Personal access tokens**.
2. Create a new token with **Marketplace → Manage** scope.
3. Add it as a repository secret named `VSCE_PAT` in **Settings → Secrets and variables → Actions**.
4. Add the following step to `release.yml` (after packaging):

```yaml
- name: Publish to VS Code Marketplace
run: npx @vscode/vsce publish --pat ${{ secrets.VSCE_PAT }}
```

---

## First Release

1. Ensure `package.json` has the correct `version`, `publisher`, `name`, and `displayName`.
2. Push a version tag to trigger the release workflow:

```bash
git tag v0.1.0
git push origin v0.1.0
```

3. The workflow will:
- Validate `extension.js`
- Package a `.vsix` file
- Attach it to the GitHub Release created for the tag

4. Download the `.vsix` from the GitHub Release and install it locally via:
**Extensions → Install from VSIX…**

---

## Required Secrets Summary

| Secret | Required | Purpose |
|--------|----------|---------|
| `GITHUB_TOKEN` | Automatic | Upload VSIX to GitHub Release |
| `VSCE_PAT` | Optional | Publish to VS Code Marketplace |

---

## Checklist Before First Publish

- [ ] `package.json` `publisher` field set to your Marketplace publisher ID
- [ ] `package.json` `version` is correct (e.g. `0.1.0`)
- [ ] `package.json` `repository` field points to your GitHub repo URL
- [ ] Extension tested locally with `F5` in the Extension Development Host
- [ ] `.vsix` packaged and installed via **Install from VSIX** and smoke-tested
- [ ] `VSCE_PAT` secret added (if publishing to Marketplace)
103 changes: 102 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,103 @@
# Project-Launcher-for-vscode
# Project Launcher for VS Code

Project Launcher is a lightweight VS Code extension for teams and solo developers who want one-click task control without paid task dashboards.

It adds a dedicated sidebar control panel, an activity log, an output channel, and status bar buttons by reusing normal workspace tasks from `.vscode/tasks.json`.

---

## Features

- **Dedicated Activity Bar container** with a Control Panel view
- **Separate Activity view** with recent task events
- **Output channel** for start, stop, restart, and healthcheck logs
- **Start, Stop, and Restart controls** in both sidebar and status bar
- **Optional Health control**
- **Guided setup menu** instead of a raw three-step task picker flow
- **Quick Setup** that auto-detects likely start, stop, and health tasks
- **Clickable configured task bindings** in the sidebar for direct editing
- Reuses existing workspace tasks instead of introducing a custom process model
- Stops running tasks through the VS Code Task API when possible
- Workspace-level configuration so the same extension can be reused across many similar repositories
- Quick command to bind task labels without editing JSON manually

---

## Commands

| Command | Description |
|---------|-------------|
| `Project Launcher: Start` | Run the configured start task |
| `Project Launcher: Stop` | Terminate the running task or run the stop task |
| `Project Launcher: Restart` | Stop, wait, then start again |
| `Project Launcher: Run Healthcheck` | Run the configured health task |
| `Project Launcher: Launcher Setup` | Guided three-step task picker |
| `Project Launcher: Quick Setup` | Auto-detect and apply start/stop/health tasks |
| `Project Launcher: Refresh` | Refresh the Control Panel sidebar |
| `Project Launcher: Show Output` | Open the Project Launcher output channel |
| `Project Launcher: Clear Activity` | Clear the Activity sidebar log |
| `Project Launcher: Configure Task Labels` | Interactively bind task labels |

---

## Install From VSIX

The packaged VSIX can be installed via:

> **Extensions: Install from VSIX…**

---

## Recommended Workspace Configuration

```json
{
"projectLauncher.startTaskLabel": "Dev: start local app",
"projectLauncher.stopTaskLabel": "Dev: stop local app",
"projectLauncher.healthTaskLabel": "Dev: healthcheck"
}
```

You can also run **Project Launcher: Configure Task Labels** and select the task labels interactively.

---

## Settings

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `projectLauncher.startTaskLabel` | string | `""` | Task label executed by Start |
| `projectLauncher.stopTaskLabel` | string | `""` | Task label executed by Stop when there is no running execution to terminate directly |
| `projectLauncher.healthTaskLabel` | string | `""` | Optional task label for the Health command/button |
| `projectLauncher.showStatusBar` | boolean | `true` | Show or hide all launcher buttons in the status bar |
| `projectLauncher.showHealthButton` | boolean | `true` | Show the Health button when a health task is configured |
| `projectLauncher.preventDuplicateStart` | boolean | `true` | Avoid launching the same start task twice |
| `projectLauncher.restartDelayMs` | number | `1000` | Delay in milliseconds between stop and start during restart |
| `projectLauncher.activityItemLimit` | number | `50` | Maximum number of recent entries in the Activity sidebar view |

---

## Development

To run the extension in an Extension Development Host:

1. Open `tools/vscode-project-launcher` in VS Code.
2. Press **F5**.

To package a new VSIX:

```bash
cd tools/vscode-project-launcher
npx @vscode/vsce package
```

---

## Release Flow

This repository includes a release-ready GitHub Actions setup:

- **`.github/workflows/ci.yml`** — validates `extension.js` and packages a VSIX on pushes and pull requests
- **`.github/workflows/release.yml`** — packages the VSIX on version tags and uploads it to the GitHub Release

See [PUBLISHING.md](./PUBLISHING.md) for the minimal repository and secret setup required before first publication.
3 changes: 3 additions & 0 deletions tools/vscode-project-launcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
*.vsix
package-lock.json
5 changes: 5 additions & 0 deletions tools/vscode-project-launcher/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/**
node_modules/**
*.vsix
.vscodeignore
package-lock.json
21 changes: 21 additions & 0 deletions tools/vscode-project-launcher/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Project Launcher Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading