-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat(cli): improvements and external commands #4314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit
Hold shift + click to select a range
8ae12cb
add with-commands fixture
galvez 7fccbbb
add local.exists / local.get
galvez 75014bb
add local.hash()
galvez 27cc1fa
lint
galvez eccb5ec
changed signatures
galvez 6d17aec
add commands test suite
galvez ef67e28
lint
galvez 87d7826
lint
galvez 6a95419
test fix
galvez 45c37c0
fix imports
galvez 9973192
fixes
galvez 3405a75
fix fixture
galvez 56b10f3
lint
galvez 10a8589
simplify getLocalCommands
galvez 33dde9b
lint
galvez 660a511
fix
galvez bf63d7a
test tweak
galvez 7b88c1a
ongoing work on run command
galvez fabf1cd
ongoing work on run command (2)
galvez b7690b4
ongoing work on run command (3)
galvez 5db8b64
ongoing work on run command (4)
galvez 97d5f38
ongoing work on run command (5)
galvez 195b10e
ongoing work on run command (6)
galvez c4a619b
ongoing work on run command (7)
galvez 2c3d432
lint
galvez ae79ffd
add NuxtCommand.list
galvez 5625ca9
lint
galvez 2472b0c
lint
galvez 92e17a1
lint
galvez d09baee
tweaks
galvez 19fa70c
lint
galvez 3955785
fix
galvez 29b7ec3
add run export
galvez 57654fd
fix type error
galvez 4e39088
fix ensure()
galvez 0f95838
fix argv
galvez 1037212
lint
galvez 45508bb
simplify ensure()
galvez b8a23b0
rm unknown-calls-default-method test
galvez 5192d30
test fixes
galvez 11ed63f
move setup back to run
galvez 39ad245
move setup back to run
galvez 95ed08b
fix
galvez 79540e3
fix
galvez b5992eb
lint
galvez 6c02795
fix env
galvez 84008ec
updated list commands
galvez 022e7bf
updated list commands
galvez 9491021
updated list commands
galvez 4866f1c
don't display custom cmds str if none found
galvez f6ab7fb
don't display custom cmds str if none found
galvez 829c8ce
lint
galvez 6af3831
Merge branch 'dev' of github.com:nuxt/nuxt.js into feat/custom-commands
galvez 78e436e
fix conflicts
galvez d96eeec
latest dev
galvez 1d9d287
remove run() cmd
galvez 7312915
check PATH for command in ensure()
galvez c8beb28
pass subCommand to ensure()
galvez f3afba0
Split ensure/ensureExternal
galvez b4528d8
run() tweaks
galvez f0865bc
remove commands folder check in load()
galvez c5490bf
linting
galvez e8067f1
unused subCommand
galvez 07cd422
return if custom
galvez c97e8b9
linting
galvez b1a60e6
updated fixture
galvez 6ecab58
lint
galvez 0dc33f1
lint
galvez 03811fb
simplify cmd running
galvez 5ee7ab9
lint
galvez 42edc9a
Merge branch 'dev' of github.com:nuxt/nuxt.js into feat/custom-commands
galvez 2486e4c
Merge branch 'dev' of github.com:nuxt/nuxt.js into feat/custom-commands
galvez bd74936
add bin field to fixture package.json
galvez dd72175
updated test cmd package
galvez 87f9ed2
debugging ensureExternal
galvez ccaa2bf
change to execSync with stdio configured
galvez 3eab37d
debugging ensureExternal (2)
galvez f592c24
find nuxt command position
galvez b44c9c9
lint
galvez 7bfc3d8
debugging test
galvez 7686626
lint
galvez 5c90b0b
fix test
galvez af1f8f0
tweak ensureExternal
galvez aa8e0a7
prevent early exit
galvez 586064f
fix: return value of cmd.run()
pi0 fbe5122
feat: add argv utils
pi0 ff78b62
use execa
pi0 851de25
export getCommand method for internal commands
pi0 b811d47
remove external logic from command.js
pi0 7c78f96
rewrite run.js to support external commands
pi0 b499bf4
update tests
pi0 7dda9a2
add --help, --version for help
pi0 ad8b600
feat: default command
pi0 63cbcc5
improve command/run integration
pi0 c6572a6
rm unused import
galvez 32e64a2
fix: return instead of process.exit for showVersion, showHelp
pi0 ccd5c91
fix: update tets for version and help
pi0 e78dc9f
refactor argv passing
pi0 f4abbe1
update command tests
pi0 415b830
fix test
pi0 87921d2
fix lint error
pi0 fc395ac
move process.exit to nuxt bin only
pi0 2048fa7
revert adding new argv utils
pi0 c527ab5
revert adding default command
pi0 059ebe3
update tests
pi0 051d0fd
reduce usage of process.argv
pi0 53f96d0
imrpove run.js
pi0 b285708
fix: clone _argv
pi0 032c049
fix lint error
pi0 1979422
don't mutate argv
pi0 2e0eb4e
update help.js
pi0 591b268
fix: default value for argv
pi0 8eef22b
refactor commands
pi0 ef915b2
remove extra imports
pi0 7facc75
remove extra process.exit mock restore calls
pi0 1378643
remove getArgv in flavor of argv getter
pi0 0da937c
minimist supports aliases!
pi0 d6a5ac0
:cry
pi0 fb5821b
Merge branch 'dev' into feat/custom-commands
pi0 b99db50
test: add cli/run tests
pi0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
add with-commands fixture
- Loading branch information
commit 8ae12cbcc49c4c282d18f1652ac6010f255c17a2
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import consola from 'consola' | ||
|
||
export default { | ||
name: 'my-custom-command', | ||
description: 'My Custom Command', | ||
usage: 'my-custom-command <foobar>', | ||
options: { | ||
foobar: { | ||
alias: 'fb', | ||
type: 'string', | ||
description: 'Simple test string' | ||
} | ||
}, | ||
async run(cmd) { | ||
try { | ||
const argv = cmd.getArgv() | ||
consola.info('argv: ', argv) | ||
process.exit(0) | ||
} catch (err) { | ||
consola.fatal(err) | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.