workflow: remote-version script for version checking

This commit is contained in:
ULIVZ
2019-03-03 03:19:15 +08:00
parent a7829ec205
commit 75572620bb
2 changed files with 22 additions and 0 deletions
+1
View File
@@ -10,6 +10,7 @@
"scripts": {
"bootstrap": "lerna bootstrap && yarn tsc",
"boot": "node scripts/bootstrap.js",
"remote-version": "node scripts/remote-version.js",
"dev": "yarn tsc && yarn workspace docs dev",
"build": "yarn tsc && yarn workspace docs build",
"show-help": "yarn workspace docs show-help",
+21
View File
@@ -0,0 +1,21 @@
const { join } = require('path')
const { readdirSync } = require('fs')
const chalk = require('chalk')
const execa = require('execa')
const PRIVATE_PACKAGES = ['theme-vue', 'theme-blog', '.DS_Store']
const scopePackages = readdirSync(
join(__dirname, '../packages/@vuepress')
)
.filter(n => !PRIVATE_PACKAGES.includes(n))
.map(n => `@vuepress/${n}`)
async function log () {
await Promise.all(['vuepress', ...scopePackages].map(async pkg => {
const version = (await execa('npm', ['view', `${pkg}@next`, 'version'])).stdout.toString()
console.log(`${pkg}: ${chalk.cyan(version)}`)
}))
}
log()