Skip to content

Commit 041a1fd

Browse files
eedorenkoCopilotgithub-advanced-security[bot]
authored
feat(extension): hve core vs code extension (#149)
## Description Add VS Code extension packaging structure to enable publishing HVE Core as a marketplace extension. Creates a dedicated `extension/` folder with VS Code-specific configuration while keeping the repository structure clean through automated build scripts. ## Type of Change Select all that apply: **Code & Documentation:** - [ ] Bug fix (non-breaking change fixing an issue) - [x] New feature (non-breaking change adding functionality) - [ ] Breaking change (fix or feature causing existing functionality to change) - [x] Documentation update **Infrastructure & Configuration:** - [ ] GitHub Actions workflow - [ ] Linting configuration (markdown, PowerShell, etc.) - [ ] Security configuration - [ ] DevContainer configuration - [ ] Dependency update **AI Artifacts:** - [ ] Reviewed contribution with `prompt-builder` chatmode and addressed all feedback - [ ] Copilot instructions (`.github/instructions/*.instructions.md`) - [ ] Copilot prompt (`.github/prompts/*.prompt.md`) - [ ] Copilot chatmode (`.github/chatmodes/*.chatmode.md`) **Other:** - [x] Script/automation (`.ps1`, `.sh`, `.py`) - [x] Other (please describe): VS Code extension packaging configuration ## Testing - [x] Verified extension packaging works with `npm run package:extension` - [x] Confirmed `.vscodeignore` properly excludes/includes intended files - [x] Tested temporary copy/cleanup workflow functions correctly - [x] Validated extension-specific `package.json` contains all chat agents, prompts, and instructions ## Checklist ### Required Checks - [x] Documentation is updated (if applicable) - [x] Files follow existing naming conventions - [x] Changes are backwards compatible (if applicable) ### AI Artifact Contributions <!-- If contributing a chatmode, prompt, or instruction, complete these checks --> - [ ] Used `prompt-builder` chatmode to review contribution - [ ] Addressed all feedback from `prompt-builder` review - [ ] Verified contribution follows common standards and type-specific requirements ### Required Automated Checks The following validation commands must pass before merging: - [x] Markdown linting: `npm run lint:md` - [x] Spell checking: `npm run spell-check` - [x] Frontmatter validation: `npm run lint:frontmatter` - [x] Link validation: `npm run lint:md-links` - [x] PowerShell analysis: `npm run lint:ps` ## Security Considerations - [x] This PR does not contain any sensitive or NDA information - [x] Any new dependencies have been reviewed for security issues - [x] Security-related scripts follow the principle of least privilege ## Additional Notes ### Key Implementation Details - **Clean Build Process**: Uses temporary copy/cleanup approach to avoid permanent file duplication - **Selective Packaging**: `.vscodeignore` excludes non-essential files (workflows, issue templates, etc.) - **Automated Scripts**: Root `package.json` includes `package:extension` and `publish:extension` commands - **Extension-Specific Config**: Dedicated `package.json` with all 15 chat agents, 10 prompts, and 16 instruction files - **Documentation**: Comprehensive packaging guide with manual and automated workflows ### Files Added/Modified - `extension/package.json` - Extension manifest with VS Code configuration - `extension/.vscodeignore` - Controls extension packaging inclusion/exclusion - `extension/README.md` - User-facing extension documentation - `extension/PACKAGING.md` - Developer packaging guide - Root `package.json` - Added extension packaging scripts - Root `.gitignore` - Added extension build artifact exclusions This enables publishing HVE Core to the VS Code marketplace while maintaining clean repository structure. --------- Signed-off-by: Eugene Fedorenko <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent cbaa4a9 commit 041a1fd

19 files changed

Lines changed: 1838 additions & 51 deletions

.cspell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@
6767
"kata",
6868
"katas",
6969
"learning",
70+
"pullrequest",
7071
"SARIF",
7172
"Segoe",
73+
"streamlit",
74+
"Streamlit",
75+
"vscodeignore",
7276
"πρᾶξις"
7377
]
7478
}

.github/prompts/pull-request.prompt.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ You WILL ALWAYS preserve template structure and formatting.
3434
* **If `pr-reference.xml` is NOT provided**:
3535
* Use `git fetch {{remote}} {{branch}}` determined from `${input:branch:origin/main}`, to update the remote branch to build a correct pull request.
3636
* **MANDATORY**: You MUST create `pr-reference.xml` using the repository scripts—select the command that matches your host environment. Do not use any other commands to gather git status or diffs.
37-
* **Unix-like shells**: Use `./scripts/dev-tools/pr-ref-gen.sh`.
37+
* **Script Location**: Scripts may be available locally at `./scripts/dev-tools/` OR bundled in a VS Code extension. Check local path first, then fall back to extension:
38+
* **Local path**: `./scripts/dev-tools/pr-ref-gen.sh` or `./scripts/dev-tools/Generate-PrReference.ps1`
39+
* **Extension path** (if local not found): `~/.vscode/extensions/ise-hve-essentials.hve-core-*/scripts/dev-tools/`
40+
* **Locate from extension** (cross-platform):
41+
42+
```bash
43+
# Find PowerShell script
44+
pwsh -c '$SCRIPT = Get-ChildItem -Path "$HOME/.vscode/extensions" -Filter "Generate-PrReference.ps1" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName; Write-Host "Found: $SCRIPT"'
45+
46+
# Find shell script
47+
find ~/.vscode/extensions -name "pr-ref-gen.sh" 2>/dev/null | head -1
48+
```
49+
50+
* **Unix-like shells**: Use `./scripts/dev-tools/pr-ref-gen.sh` (or extension path if local not available).
3851
* Default: `./scripts/dev-tools/pr-ref-gen.sh`.
3952
* If `${input:excludeMarkdown}` is true: `./scripts/dev-tools/pr-ref-gen.sh --no-md-diff` (excludes markdown).
4053
* If a different base branch is specified via `${input:branch}`: `./scripts/dev-tools/pr-ref-gen.sh --no-md-diff --base-branch ${input:branch}` (adjust markdown inclusion as needed).
41-
* **Windows PowerShell hosts**: Use `pwsh -File ./scripts/dev-tools/Generate-PrReference.ps1`.
54+
* **Windows PowerShell hosts**: Use `pwsh -File ./scripts/dev-tools/Generate-PrReference.ps1` (or extension path if local not available).
4255
* Default: `pwsh -File ./scripts/dev-tools/Generate-PrReference.ps1`.
4356
* If `${input:excludeMarkdown}` is true: `pwsh -File ./scripts/dev-tools/Generate-PrReference.ps1 -ExcludeMarkdownDiff` (excludes markdown).
4457
* If a different base branch is specified via `${input:branch}`: `pwsh -File ./scripts/dev-tools/Generate-PrReference.ps1 -ExcludeMarkdownDiff -BaseBranch ${input:branch}` (adjust markdown inclusion as needed).
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Package Extension
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: 'Full version to use (e.g., 1.0.0 or empty to use package.json)'
8+
required: false
9+
type: string
10+
default: ''
11+
dev-patch-number:
12+
description: 'Dev patch number to append (creates version like 1.0.0-dev.123)'
13+
required: false
14+
type: string
15+
default: ''
16+
use-changelog:
17+
description: 'Whether to download and use changelog artifact'
18+
required: false
19+
type: boolean
20+
default: false
21+
outputs:
22+
version:
23+
description: 'Version that was packaged'
24+
value: ${{ jobs.package.outputs.version }}
25+
vsix-file:
26+
description: 'Path to the packaged VSIX file'
27+
value: ${{ jobs.package.outputs.vsix-file }}
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
package:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
version: ${{ steps.package.outputs.version }}
37+
vsix-file: ${{ steps.package.outputs.vsix-file }}
38+
steps:
39+
- name: Harden Runner
40+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
41+
with:
42+
egress-policy: audit
43+
44+
- name: Checkout code
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
persist-credentials: false
48+
49+
- name: Setup Node.js
50+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
51+
with:
52+
node-version: '20'
53+
54+
- name: Install dependencies
55+
run: npm install -g @vscode/vsce
56+
57+
- name: Setup PowerShell
58+
shell: pwsh
59+
run: |
60+
Write-Host "PowerShell version: $($PSVersionTable.PSVersion)"
61+
62+
- name: Download changelog artifact
63+
if: inputs.use-changelog
64+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
65+
with:
66+
name: changelog
67+
path: ./
68+
continue-on-error: true
69+
70+
- name: Package extension
71+
id: package
72+
shell: pwsh
73+
run: |
74+
$version = "${{ inputs.version }}".Trim()
75+
$devPatch = "${{ inputs.dev-patch-number }}".Trim()
76+
77+
Write-Host "📦 Packaging extension..."
78+
79+
$arguments = @()
80+
81+
if ($version) {
82+
$arguments += '-Version'
83+
$arguments += $version
84+
}
85+
86+
if ($devPatch) {
87+
$arguments += '-DevPatchNumber'
88+
$arguments += $devPatch
89+
}
90+
91+
if (Test-Path "./CHANGELOG.md") {
92+
$arguments += '-ChangelogPath'
93+
$arguments += "./CHANGELOG.md"
94+
}
95+
96+
./scripts/extension/Package-Extension.ps1 @arguments
97+
98+
- name: Upload VSIX artifact
99+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
100+
with:
101+
name: extension-vsix
102+
path: extension/*.vsix
103+
retention-days: 30
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Publish Extension
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (leave empty to use package.json version)'
10+
required: false
11+
type: string
12+
default: ''
13+
dry-run:
14+
description: 'Dry run (package only, do not publish)'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
permissions:
20+
contents: read
21+
id-token: write
22+
23+
jobs:
24+
prepare-changelog:
25+
name: Prepare Changelog
26+
runs-on: ubuntu-latest
27+
outputs:
28+
changelog-path: ${{ steps.create-changelog.outputs.path }}
29+
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
32+
with:
33+
egress-policy: audit
34+
35+
- name: Checkout code
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
with:
38+
persist-credentials: false
39+
40+
- name: Create changelog file
41+
id: create-changelog
42+
run: |
43+
if [ "${{ github.event_name }}" == "release" ]; then
44+
cat > CHANGELOG.md << 'EOF'
45+
${{ github.event.release.body }}
46+
EOF
47+
echo "path=CHANGELOG.md" >> $GITHUB_OUTPUT
48+
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
49+
echo "path=" >> $GITHUB_OUTPUT
50+
else
51+
echo "path=" >> $GITHUB_OUTPUT
52+
fi
53+
54+
- name: Upload changelog
55+
if: steps.create-changelog.outputs.path != ''
56+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
57+
with:
58+
name: changelog
59+
path: CHANGELOG.md
60+
retention-days: 1
61+
62+
normalize-version:
63+
name: Normalize Version
64+
runs-on: ubuntu-latest
65+
outputs:
66+
version: ${{ steps.normalize.outputs.version }}
67+
steps:
68+
- name: Harden Runner
69+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
70+
with:
71+
egress-policy: audit
72+
73+
- name: Normalize version string
74+
id: normalize
75+
run: |
76+
if [ "${{ github.event_name }}" == "release" ]; then
77+
VERSION="${{ github.event.release.tag_name }}"
78+
else
79+
VERSION="${{ inputs.version }}"
80+
fi
81+
# Strip leading 'v' if present
82+
VERSION="${VERSION#v}"
83+
echo "version=$VERSION" >> $GITHUB_OUTPUT
84+
85+
package:
86+
name: Package Extension
87+
needs: [prepare-changelog, normalize-version]
88+
uses: ./.github/workflows/extension-package.yml
89+
with:
90+
version: ${{ needs.normalize-version.outputs.version }}
91+
use-changelog: ${{ needs.prepare-changelog.outputs.changelog-path != '' }}
92+
permissions:
93+
contents: read
94+
95+
publish:
96+
name: Publish to Marketplace
97+
needs: [prepare-changelog, package]
98+
if: ${{ !inputs.dry-run }}
99+
runs-on: ubuntu-latest
100+
environment: marketplace
101+
steps:
102+
- name: Harden Runner
103+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
104+
with:
105+
egress-policy: audit
106+
107+
- name: Checkout code
108+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
109+
with:
110+
persist-credentials: false
111+
112+
- name: Azure Login (OIDC)
113+
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
114+
with:
115+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
116+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
117+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
118+
119+
- name: Setup Node.js
120+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
121+
with:
122+
node-version: '20'
123+
124+
- name: Install VSCE
125+
run: npm install -g @vscode/vsce
126+
127+
- name: Download VSIX artifact
128+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
129+
with:
130+
name: extension-vsix
131+
path: ./extension
132+
133+
- name: Publish to VS Code Marketplace
134+
run: |
135+
VSIX_FILE=$(ls -t extension/hve-core-*.vsix | head -1)
136+
echo "📦 Publishing: $VSIX_FILE"
137+
vsce publish --packagePath "$VSIX_FILE" --azure-credential
138+
139+
- name: Summary
140+
run: |
141+
echo "## 🎉 Extension Published Successfully" >> $GITHUB_STEP_SUMMARY
142+
echo "" >> $GITHUB_STEP_SUMMARY
143+
echo "**Version:** ${{ needs.package.outputs.version }}" >> $GITHUB_STEP_SUMMARY
144+
echo "**VSIX File:** ${{ needs.package.outputs.vsix-file }}" >> $GITHUB_STEP_SUMMARY
145+
echo "" >> $GITHUB_STEP_SUMMARY
146+
echo "View on [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ise-hve-essentials.hve-core)" >> $GITHUB_STEP_SUMMARY

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
78
workflow_dispatch:
89

910
# Minimal permissions for security
@@ -46,13 +47,27 @@ jobs:
4647
upload-sarif: true
4748
upload-artifact: true
4849

50+
extension-package:
51+
name: Package VS Code Extension
52+
needs:
53+
- spell-check
54+
- markdown-lint
55+
- table-format
56+
- dependency-pinning-scan
57+
uses: ./.github/workflows/extension-package.yml
58+
with:
59+
dev-patch-number: ${{ github.run_number }}
60+
permissions:
61+
contents: read
62+
4963
release-please:
5064
name: Release Please
5165
needs:
5266
- spell-check
5367
- markdown-lint
5468
- table-format
5569
- dependency-pinning-scan
70+
- extension-package
5671
runs-on: ubuntu-latest
5772
permissions:
5873
contents: write

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

6+
# macOS
7+
.DS_Store
8+
69
# User-specific files
710
*.rsuser
811
*.suo
@@ -412,6 +415,10 @@ FodyWeavers.xsd
412415
# Built Visual Studio Code Extensions
413416
*.vsix
414417

418+
# Extension build artifacts
419+
extension/LICENSE
420+
extension/CHANGELOG.md
421+
415422
# Windows Installer files from build outputs
416423
*.cab
417424
*.msi

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ HVE Core provides a unified set of optimized GitHub Copilot and Microsoft 365 Co
2525

2626
## Quick Start
2727

28-
### Automated Installation
28+
### VS Code Extension (Simplest)
2929

30-
**Recommended:** Use the buttons below to install the `hve-core-installer` agent in your project for fully automated setup:
30+
**Recommended for most users:** Install HVE Core directly from the VS Code Marketplace for zero-configuration setup:
31+
32+
[![Install from Marketplace](https://img.shields.io/badge/Install_from_Marketplace-007ACC?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=ise-hve-essentials.hve-core)
33+
34+
See [Extension Installation Guide](docs/getting-started/methods/extension.md) for details.
35+
36+
### Automated Custom Installation
37+
38+
For customization or team version control, use the `hve-core-installer` agent:
3139

3240
[![Install HVE Core](https://img.shields.io/badge/Install_HVE_Core-007ACC?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://aka.ms/install-hve-core) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://aka.ms/install-hve-core-insiders)
3341

@@ -49,11 +57,12 @@ The installer will:
4957

5058
For manual setup or alternative installation methods, see the [Getting Started Guide](docs/getting-started/README.md) which covers:
5159

60+
* [VS Code Extension](docs/getting-started/methods/extension.md) ⭐ - Marketplace install, zero config
61+
* [Multi-Root Workspace](docs/getting-started/methods/multi-root.md) - Cross-environment portability
62+
* [Submodule](docs/getting-started/methods/submodule.md) - Team version control
5263
* [Peer Clone](docs/getting-started/methods/peer-clone.md) - Local VS Code, solo developers
5364
* [Git-Ignored Clone](docs/getting-started/methods/git-ignored.md) - Devcontainer ephemeral setup
5465
* [Mounted Directory](docs/getting-started/methods/mounted.md) - Advanced container sharing
55-
* [Multi-Root Workspace](docs/getting-started/methods/multi-root.md) - Cross-environment portability
56-
* [Submodule](docs/getting-started/methods/submodule.md) - Team version control
5766
* [GitHub Codespaces](docs/getting-started/methods/codespaces.md) - Cloud development
5867

5968
### Prerequisites

0 commit comments

Comments
 (0)