Skip to content

Commit d824459

Browse files
authored
Add alpha msg to CLI and add OS version with blitz -v (#211)
(patch)
1 parent 5da2eae commit d824459

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

packages/blitz/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@blitzjs/cli": "0.6.0-canary.0",
4242
"@blitzjs/core": "0.5.2-alpha",
4343
"@blitzjs/server": "0.6.0-canary.0",
44+
"os-name": "3.1.0",
4445
"pkg-dir": "4.2.0",
4546
"resolve-from": "5.0.0",
4647
"resolve-global": "1.0.0"

packages/blitz/src/bin/cli.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import * as path from 'path'
33
const resolveGlobal = require('resolve-global')
44
const resolveFrom = require('resolve-from')
55
const pkgDir = require('pkg-dir')
6+
const chalk = require('chalk')
7+
8+
console.log(
9+
chalk.yellow(
10+
`You are using alpha software - if you have any problems, please open an issue here:
11+
https://github.com/blitz-js/blitz/issues/new/choose
12+
Also, this CLI may be slow as it's not yet optimized for speed`,
13+
),
14+
)
615

716
let usageType: 'local' | 'monorepo' | 'global' | 'global-linked'
817

@@ -47,7 +56,8 @@ if (options._.length === 0 && (options.v || options.version)) {
4756
console.log('debug:', usageType)
4857
console.log('debug: pkgPath:', pkgPath, '\n')
4958
try {
50-
console.log(`env: ${process.platform}-${process.arch} node-${process.version}`)
59+
const osName = require('os-name')
60+
console.log(`${osName()} ${process.platform}-${process.arch} node-${process.version}\n`)
5161

5262
let globalInstallPath
5363
let localButGlobalLinked = usageType === 'local' && fs.existsSync(globalLinkedCLIPkgPath)

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10161,7 +10161,7 @@ os-homedir@^1.0.0, os-homedir@^1.0.1:
1016110161
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
1016210162
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
1016310163

10164-
os-name@^3.1.0:
10164+
os-name@3.1.0, os-name@^3.1.0:
1016510165
version "3.1.0"
1016610166
resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801"
1016710167
integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==

0 commit comments

Comments
 (0)