Skip to content

Commit 732a159

Browse files
committed
docs: update README
1 parent dc5deb8 commit 732a159

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Required environment variables:
2626
- `VSCE_PAT` - VS Code Marketplace personal access token
2727
- `OVSX_PAT` - OpenVSX registry personal access token
2828

29-
For local development, follow the vsce and ovsx documentation to set up personal access tokens. For CI/CD, add these as GitHub repository `secrets` or skip specific platforms.
29+
For local development, follow the [Visual Studio Marketplace](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token) and [Open VSX Registry](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions#1-create-an-access-token) documentation to set up personal access tokens. For CI/CD, add these as GitHub repository `secrets` or skip specific platforms.
3030

3131
## GitHub Actions Integration
3232

@@ -77,7 +77,7 @@ jobs:
7777
# Publish extension to all platforms
7878
# Or you can skip publishing to specific platforms in CI and run npx vsxpub locally without configuring secrets
7979
- name: Publish Extension
80-
run: npx vsxpub
80+
run: npx vsxpub --no-dependencies
8181
env:
8282
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8383
VSCE_PAT: ${{secrets.VSCE_PAT}}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"url": "https://github.com/jinghaihan/vsxpub/issues"
1616
},
1717
"keywords": [
18-
"cli",
18+
"vscode",
1919
"vscode-extensions",
20+
"vsx",
2021
"publish"
2122
],
2223
"exports": {

src/cli.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ try {
3939
const skipOvsx = !config.include.includes('ovsx')
4040

4141
if (skipGit && skipVsce && skipOvsx) {
42-
console.error(c.red('No platforms to publish to.'))
42+
console.error(c.red('Please specify at least one platform to publish to.'))
4343
process.exit(1)
4444
}
4545

@@ -100,7 +100,7 @@ async function execCommand(cmd: string, args: string[], config: PublishOptions)
100100

101101
async function createPackage(config: PublishOptions) {
102102
const args = normalizeArgs(['vsce', 'package'], config)
103-
return await tryExec({
103+
return await executeWithFeedback({
104104
config,
105105
message: 'Creating .vsix package...',
106106
successMessage: 'Created .vsix package.',
@@ -116,11 +116,11 @@ async function createPackage(config: PublishOptions) {
116116

117117
async function publishToVsce(vsix: string, config: PublishOptions) {
118118
const exec = async (args: string[]) => {
119-
return await tryExec({
119+
return await executeWithFeedback({
120120
config,
121-
message: 'Publishing to vsce...',
122-
successMessage: 'Published to vsce.',
123-
errorMessage: 'Failed to publish to vsce.',
121+
message: 'Publishing to visual studio code marketplace...',
122+
successMessage: 'Published to visual studio code marketplace.',
123+
errorMessage: 'Failed to publish to visual studio code marketplace.',
124124
fn: async () => {
125125
await execCommand('npx', args, config)
126126
},
@@ -140,12 +140,11 @@ async function publishToVsce(vsix: string, config: PublishOptions) {
140140

141141
async function publishToOvsx(vsix: string, config: PublishOptions) {
142142
const args = normalizeArgs(['ovsx', 'publish', vsix], config)
143-
144-
return await tryExec({
143+
return await executeWithFeedback({
145144
config,
146-
message: 'Publishing to ovsx...',
147-
successMessage: 'Published to ovsx.',
148-
errorMessage: 'Failed to publish to ovsx.',
145+
message: 'Publishing to open vsx registry...',
146+
successMessage: 'Published to open vsx registry.',
147+
errorMessage: 'Failed to publish to open vsx registry.',
149148
fn: async () => {
150149
await execCommand('npx', args, config)
151150
},
@@ -157,11 +156,11 @@ async function publishToOvsx(vsix: string, config: PublishOptions) {
157156

158157
async function publishToGit(vsix: string, config: PublishOptions) {
159158
const args = ['release', 'upload', config.tag, vsix, '--repo', config.repo, '--clobber']
160-
return await tryExec({
159+
return await executeWithFeedback({
161160
config,
162-
message: 'Uploading .vsix to release page...',
163-
successMessage: 'Uploaded .vsix to release page.',
164-
errorMessage: 'Failed to upload .vsix to release page. Please ensure the release page has been created.',
161+
message: 'Uploading .vsix to github release page...',
162+
successMessage: 'Uploaded .vsix to github release page.',
163+
errorMessage: 'Failed to upload, please ensure the github release page has been created.',
165164
fn: async () => {
166165
await execCommand('gh', args, config)
167166
},
@@ -172,13 +171,14 @@ async function publishToGit(vsix: string, config: PublishOptions) {
172171
}
173172

174173
function normalizeArgs(args: string[], options: PublishOptions) {
175-
if (!options.dependencies)
174+
if (!options.dependencies) {
176175
args.push('--no-dependencies')
176+
}
177177

178178
return args
179179
}
180180

181-
async function tryExec(options: {
181+
async function executeWithFeedback(options: {
182182
config: PublishOptions
183183
message: string
184184
successMessage: string

0 commit comments

Comments
 (0)