Skip to content

Commit fa0f242

Browse files
authored
ci: generate marketplace README for packaging (#62)
1 parent 6c9adbb commit fa0f242

4 files changed

Lines changed: 51 additions & 7 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
source_path="${1:-README.md}"
5+
output_path="${2:-dist/README.marketplace.md}"
6+
7+
mkdir -p "$(dirname "$output_path")"
8+
9+
awk '
10+
/<!-- marketplace-readme:remove-start -->/ {
11+
if (removing) {
12+
print "Nested marketplace-readme remove block." > "/dev/stderr"
13+
exit 1
14+
}
15+
removing = 1
16+
removed += 1
17+
next
18+
}
19+
20+
/<!-- marketplace-readme:remove-end -->/ {
21+
if (!removing) {
22+
print "Unexpected marketplace-readme remove end marker." > "/dev/stderr"
23+
exit 1
24+
}
25+
removing = 0
26+
next
27+
}
28+
29+
!removing {
30+
print
31+
}
32+
33+
END {
34+
if (removing) {
35+
print "Unclosed marketplace-readme remove block." > "/dev/stderr"
36+
exit 1
37+
}
38+
if (removed != 1) {
39+
printf "Expected 1 marketplace-readme remove block, found %d.\n", removed > "/dev/stderr"
40+
exit 1
41+
}
42+
}
43+
' "$source_path" > "$output_path"

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode/**
2+
README.md
23
src/**
34
out/**/*.map
45
out/**/*.d.ts
@@ -18,4 +19,3 @@ package-lock.json
1819
.env*
1920
!.env.example
2021
vscode.proposed.languageModelThinkingPart.d.ts
21-

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<h1 align="center">DeepSeek V4 for Copilot Chat</h1>
22

33
<p align="center">
4+
<!-- marketplace-readme:remove-start -->
45
<a href="https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot"><img src="https://img.shields.io/badge/VS%20Code%20Marketplace-Install-007ACC?logo=visualstudiocode&logoColor=white&style=for-the-badge" alt="Install from VS Code Marketplace"></a>
56
<a href="https://open-vsx.org/extension/Vizards/deepseek-v4-for-copilot"><img src="https://img.shields.io/badge/Open%20VSX-Install-6A4FB6?style=for-the-badge" alt="Install from Open VSX"></a>
67
<br/>
8+
<!-- marketplace-readme:remove-end -->
79
<img src="https://img.shields.io/github/v/release/Vizards/deepseek-v4-for-copilot?style=for-the-badge&label=Version" alt="Version" />
810
<img src="https://vsmarketplacebadges.dev/installs-short/Vizards.deepseek-v4-for-copilot.svg?style=for-the-badge" alt="Installs" />
911
</p>
@@ -67,10 +69,10 @@ Pure VS Code API + Node.js built-ins. No Python, no Docker, no local proxy serve
6769

6870
### Installation
6971

70-
Choose the install path that matches your editor:
72+
Install from the registry used by your editor:
7173

72-
1. **VS Code Marketplace** — install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot).
73-
2. **Open VSX** — install from [Open VSX](https://open-vsx.org/extension/Vizards/deepseek-v4-for-copilot). If your VS Code build does not use Open VSX, follow the [Open VSX in VS Code guide](https://github.com/eclipse-openvsx/openvsx/wiki/Using-Open-VSX-in-VS-Code) to configure the registry.
74+
1. **Microsoft VS Code** — install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot).
75+
2. **Editors that use Open VSX** — install from [Open VSX](https://open-vsx.org/extension/Vizards/deepseek-v4-for-copilot).
7476

7577
### Usage
7678

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,13 @@
157157
},
158158
"scripts": {
159159
"clean": "node -e \"require('node:fs').rmSync('out', { recursive: true, force: true, maxRetries: process.platform === 'win32' ? 10 : 0 })\"",
160-
"vscode:prepublish": "npm run compile",
160+
"vscode:prepublish": "bash .github/scripts/prepare-marketplace-readme.sh && npm run compile",
161161
"compile": "npm run clean && tsc -p ./",
162162
"watch": "npm run clean && tsc -watch -p ./",
163163
"lint": "oxlint",
164164
"format": "oxfmt --write src/",
165165
"format:check": "oxfmt --check src/",
166-
"package": "vsce package -o dist/",
167-
"publish": "vsce publish",
166+
"package": "vsce package --readme-path dist/README.marketplace.md -o dist/",
168167
"login": "vsce login Vizards"
169168
},
170169
"devDependencies": {

0 commit comments

Comments
 (0)