Skip to content

Commit

Permalink
Bundle ms-python.debugpy in build (#2595)
Browse files Browse the repository at this point in the history
* add debugpy to product.json

* swtich service url for other platforms

* one more /

* send correct serviceurl through download stream

* add compiled js?

* aggressive formatOnSave strikes again
  • Loading branch information
isabelizimm authored Apr 18, 2024
1 parent bc297ee commit 25dfb00
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 6 deletions.
6 changes: 4 additions & 2 deletions build/lib/builtInExtensions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions build/lib/builtInExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export interface IExtensionDefinition {
flags: string;
};
publisherDisplayName: string;
// --- Start Positron ---
multiPlatformServiceUrl?: string;
// --- End Positron ---
};
}

Expand Down Expand Up @@ -70,8 +73,10 @@ function isUpToDate(extension: IExtensionDefinition): boolean {
}

function getExtensionDownloadStream(extension: IExtensionDefinition) {
const galleryServiceUrl = productjson.extensionsGallery?.serviceUrl;
return (galleryServiceUrl ? ext.fromMarketplace(galleryServiceUrl, extension) : ext.fromGithub(extension))
// --- Start Positron ---
const url = extension.metadata.multiPlatformServiceUrl || productjson.extensionsGallery?.serviceUrl;
return (url ? ext.fromMarketplace(url, extension) : ext.fromGithub(extension))
// --- End Positron ---
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`));
}

Expand Down
25 changes: 24 additions & 1 deletion build/lib/extensions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion build/lib/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,30 @@ export function fromMarketplace(serviceUrl: string, { name: extensionName, versi
const json = require('gulp-json-editor') as typeof import('gulp-json-editor');

const [publisher, name] = extensionName.split('.');
const url = `${serviceUrl}/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
// --- Start Positron ---
let url: string;

if (metadata.multiPlatformServiceUrl) {
let platformDownload: string;
switch (process.platform) {
case 'darwin':
platformDownload = 'darwin-arm64';
break;
case 'win32':
platformDownload = 'win32-x64';
break;
case 'linux':
platformDownload = 'linux-x64';
break;
default:
throw new Error('Unsupported platform');
};
url = `${serviceUrl}/${publisher}/${name}/${platformDownload}/${version}/file/${extensionName}-${version}@${platformDownload}.vsix`

} else {
url = `${serviceUrl}/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
}
// --- End Positron ---

fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');

Expand Down
16 changes: 16 additions & 0 deletions product.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@
},
"publisherDisplayName": "ms-python"
}
},
{
"name": "ms-python.debugpy",
"version": "2024.2.0",
"repo": "https://github.com/microsoft/vscode-python-debugger",
"metadata": {
"id": "4bd5d2c9-9d65-401a-b0b2-7498d9f17615",
"publisherId": {
"publisherId": "998b010b-e2af-44a5-a6cd-0b5fd3b9b6f8",
"publisherName": "ms-python",
"displayName": "Python Debugger",
"flags": "verified"
},
"publisherDisplayName": "ms-python",
"multiPlatformServiceUrl": "https://open-vsx.org/api"
}
}
],
"extensionsGallery": {
Expand Down

0 comments on commit 25dfb00

Please sign in to comment.