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

[WIP] Vsix packaging - Generate a .vsix for all built-ins #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion browser-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "browser-app",
"version": "0.0.0",
"dependencies": {
"vscode-builtin-extensions": "0.0.0"
"vscode-builtin-extensions": "0.0.0",
"@theia/plugin-ext-vscode": "next"
},
"devDependencies": {
"@theia/cli": "next"
Expand Down
3 changes: 2 additions & 1 deletion electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "electron-app",
"version": "0.0.0",
"dependencies": {
"vscode-builtin-extensions": "0.0.0"
"vscode-builtin-extensions": "0.0.0",
"@theia/plugin-ext-vscode": "next"
},
"devDependencies": {
"@theia/cli": "next",
Expand Down
58 changes: 58 additions & 0 deletions src/package-vsix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Package built-in VS Code extensions in a .vsix extension pack
*/
// @ts-check
const fs = require('fs');
const os = require('os');
const yargs = require('yargs');
const archiver = require('archiver');
const { theiaExtension, extensions, run, vscode } = require('./paths.js');

let version = '0.2.1';

(async () => {
// const result = [];
const packMembers = [];

const pckPath = theiaExtension('package.json');
// if (!fs.existsSync(pckPath)) {
// continue;
// }
const extpackpckContent = fs.readFileSync(pckPath, 'utf-8');
const pck = JSON.parse(extpackpckContent);


for (const extension of await fs.readdirSync(extensions())) {
if (extension.startsWith('ms-vscode')) {
// skip marketplace extensions
continue;
}
const pckPath = extensions(extension, 'package.json');
if (!fs.existsSync(pckPath)) {
continue;
}
const originalContent = fs.readFileSync(pckPath, 'utf-8');
const extpck = JSON.parse(originalContent);

packMembers.push(`${extpck.publisher}.${extpck.name}`);
}
pck.extensionPack = packMembers;

// console.log(packMembers.join(os.EOL));

try {
fs.writeFileSync(pckPath, JSON.stringify(pck, undefined, 2), 'utf-8');
console.log('pwd: ' + await run('pwd', []));
await run('yarn', ['package']);
// result.push(pck.name + ': sucessfully published');
} catch (e) {
// result.push(pck.name + ': failed to publish');
if (e) {
console.error(e)
};
} finally {
// fs.writeFileSync(pckPath, originalContent, 'utf-8');
}


})();
19 changes: 14 additions & 5 deletions vscode-builtin-extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"name": "vscode-builtin-extensions",
"publisher": "theia-ide",
"engines": {
"vscode": "^1.33.0"
},
"keywords": [
"theia-extension"
],
Expand All @@ -9,18 +13,23 @@
"src",
"extensions"
],
"dependencies": {
"@theia/plugin-ext-vscode": "next"
},
"dependencies": {},
"devDependencies": {
"rimraf": "latest",
"typescript": "latest"
"typescript": "latest",
"inversify": "^5.0.1",
"vsce": "1.70.0"
},
"repository": {
"type": "git",
"url": "https://github.com/theia-ide/vscode-builtin-extensions.git"
},
"scripts": {
"prepare": "yarn run clean && yarn run build",
"clean": "rimraf lib",
"build": "tsc",
"watch": "tsc -w"
"watch": "tsc -w",
"package": "vsce package -o ../"
},
"theiaExtensions": [
{
Expand Down
Loading