diff --git a/build/hygiene.ts b/build/hygiene.ts index 86cf3b17346d9..e7c44a569a353 100644 --- a/build/hygiene.ts +++ b/build/hygiene.ts @@ -92,9 +92,14 @@ export function hygiene(some: NodeJS.ReadWriteStream | string[] | undefined, run const productJson = es.through(function (file: VinylFile) { const product = JSON.parse(file.contents!.toString('utf8')); + // Block Microsoft Marketplace (and other non-OSS galleries) in product.json. + // Open VSX is allowed — see https://github.com/eclipse-openvsx/openvsx/wiki/Using-Open-VSX-in-VS-Code if (product.extensionsGallery) { - console.error(`product.json: Contains 'extensionsGallery'`); - errorCount++; + const serviceUrl = String(product.extensionsGallery.serviceUrl ?? ''); + if (!/^https:\/\/open-vsx\.org(\/|$)/.test(serviceUrl)) { + console.error(`product.json: Contains 'extensionsGallery' (only https://open-vsx.org is allowed)`); + errorCount++; + } } this.emit('data', file); diff --git a/product.json b/product.json index f3f91db9fabb2..9cad8d336299e 100644 --- a/product.json +++ b/product.json @@ -37,6 +37,15 @@ "urlProtocol": "code-oss", "agentsTelemetryAppName": "agents", "webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/", + "extensionsGallery": { + "serviceUrl": "https://open-vsx.org/vscode/gallery", + "itemUrl": "https://open-vsx.org/vscode/item", + "resourceUrlTemplate": "https://open-vsx.org/vscode/unpkg/{publisher}/{name}/{version}/{path}", + "extensionUrlTemplate": "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest" + }, + "linkProtectionTrustedDomains": [ + "https://open-vsx.org" + ], "builtInExtensions": [ { "name": "ms-vscode.js-debug-companion", diff --git a/screenshots/code-oss-after-dismiss.png b/screenshots/code-oss-after-dismiss.png new file mode 100644 index 0000000000000..a2af74504706b Binary files /dev/null and b/screenshots/code-oss-after-dismiss.png differ diff --git a/screenshots/code-oss-final.png b/screenshots/code-oss-final.png new file mode 100644 index 0000000000000..72b9df7c9d5f2 Binary files /dev/null and b/screenshots/code-oss-final.png differ diff --git a/screenshots/code-oss-ui.png b/screenshots/code-oss-ui.png new file mode 100644 index 0000000000000..01a1f63c5e026 Binary files /dev/null and b/screenshots/code-oss-ui.png differ diff --git a/screenshots/openvsx-search.png b/screenshots/openvsx-search.png new file mode 100644 index 0000000000000..493728ec4d97b Binary files /dev/null and b/screenshots/openvsx-search.png differ diff --git a/screenshots/openvsx-search2.png b/screenshots/openvsx-search2.png new file mode 100644 index 0000000000000..e66a5b73103a4 Binary files /dev/null and b/screenshots/openvsx-search2.png differ diff --git a/screenshots/recommended-zero.png b/screenshots/recommended-zero.png new file mode 100644 index 0000000000000..2568224f7ba56 Binary files /dev/null and b/screenshots/recommended-zero.png differ