Skip to content

Commit

Permalink
workflow: remote-version script for version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Mar 2, 2019
1 parent a7829ec commit 7557262
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions scripts/remote-version.js
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 7557262

Please sign in to comment.