Skip to content

Commit

Permalink
Merge pull request #562 from idyll-lang/yargs
Browse files Browse the repository at this point in the history
update yargs
  • Loading branch information
mathisonian committed Jul 16, 2019
2 parents 43ac3aa + 3d2b30a commit 8610555
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 60 deletions.
46 changes: 27 additions & 19 deletions packages/idyll-cli/bin/cli.js
Expand Up @@ -2,26 +2,34 @@
const { getLocalIdyll } = require('./util');
const p = require('path');

const localIdyllPath = getLocalIdyll();
let localVersion;
let globalVersion;
if (localIdyllPath) {
try {
localVersion = require(localIdyllPath).getVersion();
} catch (e) {
localVersion = require(p.join(localIdyllPath, '..', '..', 'package.json'))
.version;
}
globalVersion = require('../package').version;
}

const versionString = localIdyllPath
? `
Using version ${localVersion} (installed in local directory).
Global version is ${globalVersion}.
`
: `
Using version ${globalVersion} (installed globally).
To install local dependencies in an Idyll project that
you've cloned from GitHub, run \`npm install\`.
`;

require('yargs')
.usage('Usage: idyll <command> [options]')
.commandDir('cmds')
.demandCommand()
.help()
.version(function() {
console.log('Global idyll version:', require('../package').version);
const localIdyllPath = getLocalIdyll();
if (localIdyllPath) {
try {
console.log(
'Local idyll version:',
require(localIdyllPath).getVersion()
);
} catch (e) {
console.log(
'Local idyll version:',
require(p.join(localIdyllPath, '..', '..', 'package.json')).version
);
}
}
return process.exit();
}).argv;
.version('version', 'Print the local and global versions', versionString)
.argv;
5 changes: 0 additions & 5 deletions packages/idyll-cli/bin/cmds/build.js
Expand Up @@ -43,11 +43,6 @@ exports.handler = argv => {
delete argv[key];
});

// delete undefined keys so Object.assign won't use them
Object.keys(argv).forEach(key => {
if (argv[key] === undefined) delete argv[key];
});

const defaults = {
components: ['components'],
static: 'static',
Expand Down
2 changes: 1 addition & 1 deletion packages/idyll-cli/package.json
Expand Up @@ -70,7 +70,7 @@
"uglify-js": "^2.8.22",
"update-notifier": "^2.5.0",
"url-join": "^4.0.0",
"yargs": "8.0.1"
"yargs": "^13.3.0"
},
"devDependencies": {
"jest": "20.0.4",
Expand Down
73 changes: 38 additions & 35 deletions yarn.lock
Expand Up @@ -282,7 +282,7 @@ ansi-styles@^2.2.1:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=

ansi-styles@^3.0.0, ansi-styles@^3.2.1:
ansi-styles@^3.0.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
Expand Down Expand Up @@ -2331,6 +2331,15 @@ cliui@^4.0.0:
strip-ansi "^4.0.0"
wrap-ansi "^2.0.0"

cliui@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==
dependencies:
string-width "^3.1.0"
strip-ansi "^5.2.0"
wrap-ansi "^5.1.0"

clone-response@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
Expand Down Expand Up @@ -3911,18 +3920,6 @@ es6-map@^0.1.3:
es6-symbol "~3.1.1"
event-emitter "~0.3.5"

es6-promise@^4.0.3:
version "4.2.8"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==

es6-promisify@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
dependencies:
es6-promise "^4.0.3"

es6-set@~0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
Expand Down Expand Up @@ -10308,7 +10305,7 @@ string-width@^1.0.1, string-width@^1.0.2:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^3.0.0:
string-width@^3.0.0, string-width@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
Expand Down Expand Up @@ -10371,7 +10368,7 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^5.1.0:
strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
Expand Down Expand Up @@ -11569,6 +11566,15 @@ wrap-ansi@^2.0.0:
string-width "^1.0.1"
strip-ansi "^3.0.1"

wrap-ansi@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09"
integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==
dependencies:
ansi-styles "^3.2.0"
string-width "^3.0.0"
strip-ansi "^5.0.0"

wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
Expand Down Expand Up @@ -11739,7 +11745,7 @@ yargs-parser@^11.1.1:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^13.0.0:
yargs-parser@^13.0.0, yargs-parser@^13.1.1:
version "13.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"
integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==
Expand Down Expand Up @@ -11840,25 +11846,6 @@ yargs@6.6.0:
y18n "^3.2.1"
yargs-parser "^4.2.0"

yargs@8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa"
integrity sha1-Qg73XoQMFFeoCtzKm8b6OEneUao=
dependencies:
camelcase "^4.1.0"
cliui "^3.2.0"
decamelize "^1.1.1"
get-caller-file "^1.0.1"
os-locale "^2.0.0"
read-pkg-up "^2.0.0"
require-directory "^2.1.1"
require-main-filename "^1.0.1"
set-blocking "^2.0.0"
string-width "^2.0.0"
which-module "^2.0.0"
y18n "^3.2.1"
yargs-parser "^7.0.0"

yargs@^10.0.3:
version "10.1.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5"
Expand Down Expand Up @@ -11895,6 +11882,22 @@ yargs@^12.0.1, yargs@^12.0.5:
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^11.1.1"

yargs@^13.3.0:
version "13.3.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83"
integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==
dependencies:
cliui "^5.0.0"
find-up "^3.0.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^3.0.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^13.1.1"

yargs@^7.0.2:
version "7.1.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"
Expand Down

0 comments on commit 8610555

Please sign in to comment.