fix: gallery (#2506)

This commit is contained in:
Baptiste Augrain
2025-09-12 12:18:47 +02:00
committed by GitHub
parent 284d83b24e
commit cde9fd233a
3 changed files with 46 additions and 14 deletions

View File

@@ -31,22 +31,11 @@ index deba4c4..1b41bde 100644
+ resolveUserProduct();
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 5a6c171..0cb5e20 100644
index 5a6c171..275cbcf 100644
--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -31,2 +31,36 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
@@ -31,2 +31,25 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
+ const { serviceUrl, controlUrl, extensionUrlTemplate, resourceUrlTemplate } = product.extensionsGallery || {};
+
+ Object.assign(product, {
+ extensionsGallery: {
+ serviceUrl: env['VSCODE_GALLERY_SERVICE_URL'] || serviceUrl,
+ controlUrl: env['VSCODE_GALLERY_CONTROL_URL'] || controlUrl,
+ extensionUrlTemplate: env['VSCODE_GALLERY_EXTENSION_URL_TEMPLATE'] || extensionUrlTemplate,
+ resourceUrlTemplate: env['VSCODE_GALLERY_RESOURCE_URL_TEMPLATE'] || resourceUrlTemplate,
+ }
+ });
+
+ // Merge user-customized product.json
+ try {
+ const merge = (...objects: any[]) =>

42
patches/fix-gallery.patch Normal file
View File

@@ -0,0 +1,42 @@
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 3954823..f8026cd 100644
--- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts
@@ -112,2 +112,4 @@ export interface IProductConfiguration {
readonly accessSKUs?: string[];
+ readonly itemUrl: string;
+ readonly latestUrlTemplate?: string;
};
diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryManifestService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryManifestService.ts
index 658219e..d1bf7a9 100644
--- a/src/vs/platform/extensionManagement/common/extensionGalleryManifestService.ts
+++ b/src/vs/platform/extensionManagement/common/extensionGalleryManifestService.ts
@@ -19,2 +19,3 @@ type ExtensionGalleryConfig = {
readonly nlsBaseUrl: string;
+ readonly latestUrlTemplate?: string;
};
@@ -49,3 +50,3 @@ export class ExtensionGalleryManifestService extends Disposable implements IExte
{
- id: `${extensionsGallery.serviceUrl}/vscode/{publisher}/{name}/latest`,
+ id: extensionsGallery.latestUrlTemplate ?? `${extensionsGallery.serviceUrl}/vscode/{publisher}/{name}/latest`,
type: ExtensionGalleryResourceType.ExtensionLatestVersionUri
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 5a6c171..112b31b 100644
--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -31,2 +31,15 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
+ const { serviceUrl, controlUrl, itemUrl, latestUrlTemplate, extensionUrlTemplate, resourceUrlTemplate } = product.extensionsGallery || {};
+
+ Object.assign(product, {
+ extensionsGallery: {
+ serviceUrl: env['VSCODE_GALLERY_SERVICE_URL'] || serviceUrl,
+ controlUrl: env['VSCODE_GALLERY_CONTROL_URL'] || controlUrl,
+ itemUrl: env['VSCODE_GALLERY_ITEM_URL'] || itemUrl,
+ latestUrlTemplate: env['VSCODE_GALLERY_LATEST_URL_TEMPLATE'] || latestUrlTemplate,
+ extensionUrlTemplate: env['VSCODE_GALLERY_EXTENSION_URL_TEMPLATE'] || extensionUrlTemplate,
+ resourceUrlTemplate: env['VSCODE_GALLERY_RESOURCE_URL_TEMPLATE'] || resourceUrlTemplate,
+ }
+ });
+
// Running out of sources

View File

@@ -116,7 +116,8 @@ cp product.json{,.bak}
setpath "product" "checksumFailMoreInfoUrl" "https://go.microsoft.com/fwlink/?LinkId=828886"
setpath "product" "documentationUrl" "https://go.microsoft.com/fwlink/?LinkID=533484#vscode"
setpath_json "product" "extensionsGallery" '{"serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item", "extensionUrlTemplate": "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest", "controlUrl": "https://raw.githubusercontent.com/EclipseFdn/publish-extensions/refs/heads/master/extension-control/extensions.json"}'
setpath_json "product" "extensionsGallery" '{"serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item", "latestUrlTemplate": "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest", "controlUrl": "https://raw.githubusercontent.com/EclipseFdn/publish-extensions/refs/heads/master/extension-control/extensions.json"}'
setpath "product" "introductoryVideosUrl" "https://go.microsoft.com/fwlink/?linkid=832146"
setpath "product" "keyboardShortcutsUrlLinux" "https://go.microsoft.com/fwlink/?linkid=832144"
setpath "product" "keyboardShortcutsUrlMac" "https://go.microsoft.com/fwlink/?linkid=832143"