Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split web extensions #103838

Merged
merged 2 commits into from Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions build/lib/extensions.js
Expand Up @@ -205,10 +205,11 @@ const excludedDesktopExtensions = excludedCommonExtensions.concat([
]);
const excludedWebExtensions = excludedCommonExtensions.concat([]);
const marketplaceWebExtensions = [
'ms-vscode.references-view',
'ms-vscode.github-browser'
'ms-vscode.references-view'
];
const builtInExtensions = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions;
const productJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
const builtInExtensions = productJson.builtInExtensions;
const webBuiltInExtensions = productJson.webBuiltInExtensions;
/**
* Loosely based on `getExtensionKind` from `src/vs/workbench/services/extensions/common/extensionsUtil.ts`
*/
Expand Down Expand Up @@ -248,8 +249,10 @@ function packageLocalExtensionsStream(forWeb) {
}
exports.packageLocalExtensionsStream = packageLocalExtensionsStream;
function packageMarketplaceExtensionsStream(forWeb) {
const marketplaceExtensionsDescriptions = (builtInExtensions
.filter(({ name }) => (forWeb ? marketplaceWebExtensions.indexOf(name) >= 0 : true)));
const marketplaceExtensionsDescriptions = [
...builtInExtensions.filter(({ name }) => (forWeb ? marketplaceWebExtensions.indexOf(name) >= 0 : true)),
...(forWeb ? webBuiltInExtensions : [])
];
const marketplaceExtensionsStream = minifyExtensionResources(es.merge(...marketplaceExtensionsDescriptions
.map(extension => {
const input = fromMarketplace(extension.name, extension.version, extension.metadata)
Expand Down
15 changes: 8 additions & 7 deletions build/lib/extensions.ts
Expand Up @@ -240,8 +240,7 @@ const excludedWebExtensions = excludedCommonExtensions.concat([
]);

const marketplaceWebExtensions = [
'ms-vscode.references-view',
'ms-vscode.github-browser'
'ms-vscode.references-view'
];

interface IBuiltInExtension {
Expand All @@ -251,7 +250,9 @@ interface IBuiltInExtension {
metadata: any;
}

const builtInExtensions: IBuiltInExtension[] = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions;
const productJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
const builtInExtensions: IBuiltInExtension[] = productJson.builtInExtensions;
const webBuiltInExtensions: IBuiltInExtension[] = productJson.webBuiltInExtensions;

type ExtensionKind = 'ui' | 'workspace' | 'web';
interface IExtensionManifest {
Expand Down Expand Up @@ -308,10 +309,10 @@ export function packageLocalExtensionsStream(forWeb: boolean): Stream {
}

export function packageMarketplaceExtensionsStream(forWeb: boolean): Stream {
const marketplaceExtensionsDescriptions = (
builtInExtensions
.filter(({ name }) => (forWeb ? marketplaceWebExtensions.indexOf(name) >= 0 : true))
);
const marketplaceExtensionsDescriptions = [
...builtInExtensions.filter(({ name }) => (forWeb ? marketplaceWebExtensions.indexOf(name) >= 0 : true)),
...(forWeb ? webBuiltInExtensions : [])
];
const marketplaceExtensionsStream = minifyExtensionResources(
es.merge(
...marketplaceExtensionsDescriptions
Expand Down
4 changes: 3 additions & 1 deletion product.json
Expand Up @@ -118,7 +118,9 @@
},
"publisherDisplayName": "Microsoft"
}
},
}
],
"webBuiltInExtensions": [
{
"name": "ms-vscode.github-browser",
"version": "0.0.1",
Expand Down