mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
chore: add publish script to vscode (#216)
This commit is contained in:
parent
86ed94e0c6
commit
d8a78298f3
4 changed files with 63 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ dist/
|
||||||
.vercel
|
.vercel
|
||||||
_site/
|
_site/
|
||||||
*.log
|
*.log
|
||||||
|
package-lock.json
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
},
|
},
|
||||||
"version": "0.4.2",
|
"version": "0.4.2",
|
||||||
"author": "Astro",
|
"author": "Astro",
|
||||||
"publisher": "astro-build",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"publisher": "astro-build",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"vscode:prepublish": "yarn build",
|
"vscode:publish": "node ./scripts/publish.mjs",
|
||||||
"build": "astro-scripts build 'src/index.ts'",
|
"build": "astro-scripts build 'src/index.ts'",
|
||||||
"dev": "astro-scripts dev 'src/index.ts'"
|
"dev": "astro-scripts dev 'src/index.ts'"
|
||||||
},
|
},
|
||||||
|
@ -24,14 +24,15 @@
|
||||||
"onLanguage:astro"
|
"onLanguage:astro"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro-languageserver": "0.4.0"
|
"astro-languageserver": "file:../astro-languageserver"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vscode-html-languageservice": "^3.0.3",
|
"@types/vscode": "^1.52.0",
|
||||||
|
"astro-scripts": "file:../../scripts",
|
||||||
|
"execa": "^5.0.0",
|
||||||
"vscode-emmet-helper": "2.1.2",
|
"vscode-emmet-helper": "2.1.2",
|
||||||
"vscode-languageclient": "~7.0.0",
|
"vscode-html-languageservice": "^3.0.3",
|
||||||
"astro-scripts": "0.0.1",
|
"vscode-languageclient": "~7.0.0"
|
||||||
"@types/vscode": "^1.52.0"
|
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
41
tools/astro-vscode/scripts/publish.mjs
Normal file
41
tools/astro-vscode/scripts/publish.mjs
Normal file
|
@ -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();
|
15
yarn.lock
15
yarn.lock
|
@ -2087,7 +2087,7 @@ are-we-there-yet@~1.1.2:
|
||||||
|
|
||||||
arg@^5.0.0:
|
arg@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.0"
|
||||||
resolved "https://registry.npmjs.org/arg/-/arg-5.0.0.tgz"
|
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.0.tgz#a20e2bb5710e82950a516b3f933fee5ed478be90"
|
||||||
integrity sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ==
|
integrity sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ==
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^1.0.7:
|
||||||
|
@ -2216,6 +2216,17 @@ astral-regex@^2.0.0:
|
||||||
resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz"
|
resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz"
|
||||||
integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==
|
integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==
|
||||||
|
|
||||||
|
"astro-languageserver@file:tools/astro-languageserver":
|
||||||
|
version "0.4.0"
|
||||||
|
|
||||||
|
"astro-scripts@file:scripts":
|
||||||
|
version "0.0.1"
|
||||||
|
dependencies:
|
||||||
|
arg "^5.0.0"
|
||||||
|
esbuild "^0.11.16"
|
||||||
|
globby "^11.0.3"
|
||||||
|
tar "^6.1.0"
|
||||||
|
|
||||||
async-each-series@0.1.1:
|
async-each-series@0.1.1:
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
resolved "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz"
|
resolved "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz"
|
||||||
|
@ -4467,7 +4478,7 @@ execa@^0.7.0:
|
||||||
|
|
||||||
execa@^5.0.0:
|
execa@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.0"
|
||||||
resolved "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz"
|
resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376"
|
||||||
integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==
|
integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-spawn "^7.0.3"
|
cross-spawn "^7.0.3"
|
||||||
|
|
Loading…
Reference in a new issue