-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.vsix packaging] Generate a .vsix for all built-ins
This commit does a bit of massaging so that "vsce" will accept to package the built-ins we build onto a .vsix file. To generate it: $> cd <repo root>/vscode-builtin-extensions $> yarn package The resulting .vsix file will be saved in the repo root Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
- Loading branch information
1 parent
124eea7
commit f7dd9c2
Showing
5 changed files
with
585 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
|
||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.