Class: Extension::Commands::Serve
- Inherits:
-
ExtensionCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCli::Command
- ExtensionCommand
- Extension::Commands::Serve
- Defined in:
- lib/project_types/extension/commands/serve.rb
Constant Summary collapse
- YARN_SERVE_COMMAND =
%w(server)
- NPM_SERVE_COMMAND =
%w(run-script server)
Instance Attribute Summary
Attributes inherited from ShopifyCli::Command
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ExtensionCommand
Methods inherited from ShopifyCli::Command
call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry
Methods included from ShopifyCli::Feature::Set
Constructor Details
This class inherits a constructor from ShopifyCli::Command
Class Method Details
.help ⇒ Object
16 17 18 19 20 21 |
# File 'lib/project_types/extension/commands/serve.rb', line 16 def self.help <<~HELP Serve your extension in a local simulator for development. Usage: {{command:#{ShopifyCli::TOOL_NAME} serve}} HELP end |
Instance Method Details
#call(_args, _command_name) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/project_types/extension/commands/serve.rb', line 9 def call(_args, _command_name) CLI::UI::Frame.open(@ctx.('serve.frame_title')) do success = ShopifyCli::JsSystem.call(@ctx, yarn: YARN_SERVE_COMMAND, npm: NPM_SERVE_COMMAND) @ctx.abort(@ctx.('serve.serve_failure_message')) unless success end end |