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

class ShopifyCli::JsDeps

Paulo Margarido edited this page May 26, 2020 · 4 revisions

ShopifyCli::JsDeps ensures that all JavaScript dependencies are installed for projects.

Class Methods

install

install(ctx, verbose = false) Proxy to instance method ShopifyCli::JsDeps.new.install.

Parameters

  • ctx: running context from your command
  • verbose: whether to run the installation tools in silent mode

Example

ShopifyCli::JsDeps.install(ctx)
see source

# File lib/shopify-cli/js_deps.rb, line 23
def self.install(ctx, verbose = false)
  new(ctx: ctx).install(verbose)
end

Instance Methods

install

install(verbose = false) Installs all of a project's JavaScript dependencies using Yarn or NPM, based on the project's settings.

Parameters

  • verbose: whether to run the installation tools in silent mode

Example

# context is the running context for the command
ShopifyCli::JsDeps.new(context).install(true)
see source

# File lib/shopify-cli/js_deps.rb, line 38
def install(verbose = false)
  CLI::UI::Frame.open(ctx.message('core.js_deps.installing', yarn? ? 'yarn' : 'npm')) do
    yarn? ? yarn(verbose) : npm(verbose)
  end
  ctx.done(ctx.message('core.js_deps.installed'))
end

Includes

  • SmartProperties
Clone this wiki locally