Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
feat: update current command (#392)
Browse files Browse the repository at this point in the history
* Revert "wip: scaffolding babel node"

This reverts commit 1fdaad0.

* chore: make build-watch

* feat: update current command output

* chore: make build-watch

* chore: dynamic import node babel

* test: current command

* Revert "test: current command"

This reverts commit c7cde7c.

* test: add basic sanity for current

* test: add basic sanity for current
  • Loading branch information
Emmanuel Ogbizi authored May 17, 2019
1 parent 1fdaad0 commit 8ba8c5b
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 66 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ help:
echo $(JEST)
@echo "--------------------- Useful Commands for Development ----------------------"
@echo "make help - show tasks you can run"
@echo "make install-watch - runs install, and watches code for local development"
@echo "make build - builds a bundle with development settings"
@echo "make build-watch - builds and watches code for local development"
@echo "make install-watch - runs install, and build-watch"
@echo "----------------------- Other Commands -------------------------"
@echo "make install - runs a set of scripts to ensure your environment is ready"
@echo "make lint - runs eslint"
Expand Down Expand Up @@ -65,7 +66,6 @@ install-local:
install-watch: node_modules
scripts/install-watch.sh


# ---- Webpack ----

.PHONY: build-production
Expand All @@ -76,6 +76,9 @@ build-production: node_modules_production node_modules clean_webpack_build
build: node_modules clean_webpack_build
$(WEBPACK) --config webpack/webpack.config.dev.js

.PHONY: build-watch
build-watch: node_modules clean_webpack_build
$(WEBPACK) --config webpack/webpack.config.dev.js --watch

# -------------- Linting --------------

Expand Down Expand Up @@ -152,3 +155,6 @@ clean_node_modules:
.PHONY: clean_webpack_build
clean_webpack_build:
rm -rf ${BUILD_DIR}

.PHONY: clean
clean: clean_node_modules clean_webpack_build
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
"devDependencies": {
"@babel/core": "^7.3.3",
"@babel/node": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@tophat/eslint-config": "^0.1.4",
"all-contributors-cli": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int_trap() {
trap int_trap INT

# Start Webpack in watch mode
./node_modules/.bin/webpack --progress --config webpack/webpack.config.dev.js --watch
make build-watch

# Clean up and recover
restore_file "yvm.sh"
Expand Down
14 changes: 9 additions & 5 deletions src/commands/current.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { getRcFileVersion, getVersionInUse } from 'util/version'
import log from 'util/log'
import { getYarnPathEntries, isYvmPath } from 'util/path'
import { NOT_AVAILABLE, SYSTEM } from 'util/alias'
import { getRcFileVersion, getVersionInUse } from 'util/version'

export const current = async ({ shell } = {}) => {
const versionInUse = await getVersionInUse()
const [maybeYvmYarn] = getYarnPathEntries(shell)
log.info(`yarn: ${maybeYvmYarn || 'none'}`)
const isYvmYarn = isYvmPath(maybeYvmYarn)
const yarnVersion = isYvmYarn ? versionInUse : SYSTEM
log.capturable(yarnVersion || NOT_AVAILABLE)

if (!versionInUse) {
log('Sorry, yarn is NOT installed.')
return 1
}
const [maybeYvmYarn] = getYarnPathEntries(shell)
log.info(`yarn exec: ${maybeYvmYarn}`)
if (!isYvmPath(maybeYvmYarn)) {
if (!isYvmYarn) {
log('Yarn was NOT installed by yvm')
return 2
}
log(`Currently on yarn version ${versionInUse}`)
const rcVersion = getRcFileVersion()
if (rcVersion !== null) {
if (versionInUse === rcVersion) {
Expand Down
8 changes: 8 additions & 0 deletions test/scripts/yvm.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ if test $status -eq 0
else
fail "yvm uninstall default failed"
end

testing "yvm current command"
set test4_output (yvm current)
if test "$test4_output" = "1.13.0"
pass
else
fail "yvm current command failed: $test4_output"
end
8 changes: 8 additions & 0 deletions test/scripts/yvm.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ if [[ $? -eq 0 ]]; then
else
fail "yvm uninstall default failed"
fi

testing "yvm current command"
test4_output=$(yvm current)
if [[ $test4_output == "1.13.0" ]]; then
pass
else
fail "yvm current command failed: $test4_output"
fi
58 changes: 1 addition & 57 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,6 @@
esutils "^2.0.2"
js-tokens "^4.0.0"

"@babel/node@^7.2.2":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.2.2.tgz#1557dd23545b38d7b1d030a9c0e8fb225dbf70ab"
integrity sha512-jPqgTycE26uFsuWpLika9Ohz9dmLQHWjOnMNxBOjYb1HXO+eLKxEr5FfKSXH/tBvFwwaw+pzke3gagnurGOfCA==
dependencies:
"@babel/polyfill" "^7.0.0"
"@babel/register" "^7.0.0"
commander "^2.8.1"
lodash "^4.17.10"
v8flags "^3.1.1"

"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3", "@babel/parser@^7.3.3":
version "7.3.3"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.3.tgz#092d450db02bdb6ccb1ca8ffd47d8774a91aef87"
Expand Down Expand Up @@ -521,14 +510,6 @@
"@babel/helper-regex" "^7.0.0"
regexpu-core "^4.1.3"

"@babel/polyfill@^7.0.0":
version "7.4.3"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.4.3.tgz#332dc6f57b718017c3a8b37b4eea8aa6eeac1187"
integrity sha512-rkv8WIvJshA5Ev8iNMGgz5WZkRtgtiPexiT7w5qevGTuT7ZBfM3de9ox1y9JR5/OXb/sWGBbWlHNa7vQKqku3Q==
dependencies:
core-js "^2.6.5"
regenerator-runtime "^0.13.2"

"@babel/polyfill@^7.2.5":
version "7.2.5"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d"
Expand Down Expand Up @@ -586,18 +567,6 @@
js-levenshtein "^1.1.3"
semver "^5.3.0"

"@babel/register@^7.0.0":
version "7.4.0"
resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.4.0.tgz#d9d0a621db268fb14200f2685a4f8924c822404c"
integrity sha512-ekziebXBnS/7V6xk8sBfLSSD6YZuy6P29igBtR6OL/tswKdxOV+Yqq0nzICMguVYtGRZYUCGpfGV8J9Za2iBdw==
dependencies:
core-js "^3.0.0"
find-cache-dir "^2.0.0"
lodash "^4.17.11"
mkdirp "^0.5.1"
pirates "^4.0.0"
source-map-support "^0.5.9"

"@babel/[email protected]":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0.tgz#adeb78fedfc855aa05bc041640f3f6f98e85424c"
Expand Down Expand Up @@ -2375,16 +2344,11 @@ copy-webpack-plugin@^5.0.0:
serialize-javascript "^1.4.0"
webpack-log "^2.0.0"

core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7, core-js@^2.6.5:
core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7:
version "2.6.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==

core-js@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738"
integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==

[email protected], core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
Expand Down Expand Up @@ -7853,11 +7817,6 @@ regenerator-runtime@^0.12.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==

regenerator-runtime@^0.13.2:
version "0.13.2"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447"
integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==

regenerator-transform@^0.13.3:
version "0.13.4"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb"
Expand Down Expand Up @@ -8495,14 +8454,6 @@ source-map-support@^0.5.6, source-map-support@~0.5.9:
buffer-from "^1.0.0"
source-map "^0.6.0"

source-map-support@^0.5.9:
version "0.5.11"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.11.tgz#efac2ce0800355d026326a0ca23e162aeac9a4e2"
integrity sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"

source-map-url@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
Expand Down Expand Up @@ -9433,13 +9384,6 @@ v8-compile-cache@^2.0.2:
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c"
integrity sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==

v8flags@^3.1.1:
version "3.1.2"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.2.tgz#fc5cd0c227428181e6c29b2992e4f8f1da5e0c9f"
integrity sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==
dependencies:
homedir-polyfill "^1.0.1"

validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
Expand Down

0 comments on commit 8ba8c5b

Please sign in to comment.