Sha256: 601bf0a8d405b37e7ffdda045493ae73f62e71fe6f021246feacfeea113f904c

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

def highlight(message)
  "\u001b[1m\u001b[37m#{message}\u001b[39m\u001b[22m"
end

module SewingKit
  module Webpack
    # Raised if the node sewing-kit isn't installed/runnable.
    class NodeSewingKitNotRunnable < StandardError
      def initialize(mode, cause = nil)
        env_message = if 'development' == mode
          "Try `yarn add --dev @shopify/sewing-kit`"
        else
          "\nIf this is a container build, try:\n" \
          "  - Adding #{highlight('https://github.com/heroku/heroku-buildpack-nodejs')} to your " \
          "#{highlight('.buildpacks')} file\n" \
          "  - Adding #{highlight('YARN_PRODUCTION=false')} to your pipeline's environment variables\n" \
        end

        super(
          "sewing-kit is not runnable.\n" \
          "#{env_message}\n" +
          (cause ? "Original error #{cause}" : '')
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sewing_kit-0.27.3 lib/sewing_kit/webpack/webpack.rb