summaryrefslogtreecommitdiff
path: root/tools/vscode/scripts/publish.mjs
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2021-06-16 13:20:29 -0500
committerGravatar GitHub <noreply@github.com> 2021-06-16 13:20:29 -0500
commit0dd278810e4353799c7239463f156b358ea30871 (patch)
tree964a62a13467950509b446ebeaa9b668e5874665 /tools/vscode/scripts/publish.mjs
parent382868abfc4b46a0c582ec4bf868719d4e87bbd2 (diff)
downloadastro-0dd278810e4353799c7239463f156b358ea30871.tar.gz
astro-0dd278810e4353799c7239463f156b358ea30871.tar.zst
astro-0dd278810e4353799c7239463f156b358ea30871.zip
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
Diffstat (limited to 'tools/vscode/scripts/publish.mjs')
-rw-r--r--tools/vscode/scripts/publish.mjs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/vscode/scripts/publish.mjs b/tools/vscode/scripts/publish.mjs
new file mode 100644
index 000000000..93a36e804
--- /dev/null
+++ b/tools/vscode/scripts/publish.mjs
@@ -0,0 +1,41 @@
+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();