Ver código fonte

feat(1.97): add new extension endpoint (#2214)

Baptiste Augrain 6 meses atrás
pai
commit
0a2efd96eb
2 arquivos alterados com 7 adições e 5 exclusões
  1. 6 4
      patches/merge-user-product.patch
  2. 1 1
      prepare_vscode.sh

+ 6 - 4
patches/merge-user-product.patch

@@ -1,5 +1,5 @@
 diff --git a/src/main.ts b/src/main.ts
-index ff9a5e8..2135d00 100644
+index 1504375..6bba7b8 100644
 --- a/src/main.ts
 +++ b/src/main.ts
 @@ -8,2 +8,3 @@ import * as fs from 'original-fs';
@@ -30,12 +30,12 @@ index ff9a5e8..2135d00 100644
 +	resolveUserProduct();
  
 diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
-index 1a2a619..9bf5ac0 100644
+index 1a2a619..e0da4ea 100644
 --- a/src/vs/platform/product/common/product.ts
 +++ b/src/vs/platform/product/common/product.ts
-@@ -29,2 +29,36 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
+@@ -29,2 +29,38 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  
-+	const { serviceUrl, searchUrl, itemUrl, controlUrl } = product.extensionsGallery || {};
++	const { serviceUrl, searchUrl, itemUrl, controlUrl, extensionUrlTemplate, resourceUrlTemplate } = product.extensionsGallery || {};
 +
 +	Object.assign(product, {
 +		extensionsGallery: {
@@ -43,6 +43,8 @@ index 1a2a619..9bf5ac0 100644
 +			searchUrl: env['VSCODE_GALLERY_SEARCH_URL'] || searchUrl,
 +			itemUrl: env['VSCODE_GALLERY_ITEM_URL'] || itemUrl,
 +			controlUrl: env['VSCODE_GALLERY_CONTROL_URL'] || controlUrl,
++			extensionUrlTemplate: env['VSCODE_GALLERY_EXTENSION_URL_TEMPLATE'] || extensionUrlTemplate,
++			resourceUrlTemplate: env['VSCODE_GALLERY_RESOURCE_URL_TEMPLATE'] || resourceUrlTemplate,
 +		}
 +	});
 +

+ 1 - 1
prepare_vscode.sh

@@ -115,7 +115,7 @@ 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"}'
+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"}'
 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"