Skip to content

Commit 7557262

Browse files
committed
workflow: remote-version script for version checking
1 parent a7829ec commit 7557262

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"bootstrap": "lerna bootstrap && yarn tsc",
1212
"boot": "node scripts/bootstrap.js",
13+
"remote-version": "node scripts/remote-version.js",
1314
"dev": "yarn tsc && yarn workspace docs dev",
1415
"build": "yarn tsc && yarn workspace docs build",
1516
"show-help": "yarn workspace docs show-help",

scripts/remote-version.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { join } = require('path')
2+
const { readdirSync } = require('fs')
3+
const chalk = require('chalk')
4+
const execa = require('execa')
5+
6+
const PRIVATE_PACKAGES = ['theme-vue', 'theme-blog', '.DS_Store']
7+
8+
const scopePackages = readdirSync(
9+
join(__dirname, '../packages/@vuepress')
10+
)
11+
.filter(n => !PRIVATE_PACKAGES.includes(n))
12+
.map(n => `@vuepress/${n}`)
13+
14+
async function log () {
15+
await Promise.all(['vuepress', ...scopePackages].map(async pkg => {
16+
const version = (await execa('npm', ['view', `${pkg}@next`, 'version'])).stdout.toString()
17+
console.log(`${pkg}: ${chalk.cyan(version)}`)
18+
}))
19+
}
20+
21+
log()

0 commit comments

Comments
 (0)