astro/tools/vscode/scripts/publish.mjs
Nate Moore 0dd278810e
Fix VS Code extension (#467)
* chore: astro-languageserver => @astrojs/language-server

* chore: astro-vscode => vscode

* chore: move devDeps to deps

* chore: bump language-server to 0.5.0-next.0

* chore: remove astro-docs

* chore: update changelog

* fix: expose `astro-ls` bin

* fix: vscode extension

* chore: update changelog
2021-06-16 13:20:29 -05:00

41 lines
859 B
JavaScript

import { promises as fs } from 'fs';
import { fileURLToPath } from 'url';
import execa from 'execa';
/** Copies `astro-languageserver` to our file */
async function publish() {
const p0 = execa('yarn', ['lerna', 'run', 'build', '--scope', 'astro-vscode', '--scope', 'astro-languageserver'], { all: true });
p0.all.setEncoding('utf8');
for await (const chunk of p0.all) {
console.log(chunk);
if (/lerna success/g.test(chunk)) {
break;
}
if (/ERROR/g.test(chunk)) {
process.exit(1);
}
}
await execa('npm', ['install']);
const p1 = execa('vsce', ['publish'], { all: true });
p1.all.setEncoding('utf8');
for await (const chunk of p1.all) {
console.log(chunk);
if (/DONE/g.test(chunk)) {
break;
}
if (/ERROR/g.test(chunk)) {
process.exit(1);
}
}
p1.kill();
}
publish();