shopify-cli 1.3.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +2 -2
- data/.github/CONTRIBUTING.md +9 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +10 -1
- data/.github/workflows/release.yml +61 -0
- data/.github/workflows/triage.yml +22 -0
- data/.gitignore +0 -1
- data/.rubocop.yml +61 -8
- data/.rubocop_todo.yml +11 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +30 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +39 -37
- data/README.md +39 -7
- data/RELEASING.md +19 -29
- data/Rakefile +2 -0
- data/dev.yml +2 -2
- data/docs/_config.yml +1 -18
- data/docs/app/node/commands/index.md +2 -80
- data/docs/app/node/index.md +2 -33
- data/docs/app/rails/commands/index.md +2 -78
- data/docs/app/rails/index.md +2 -34
- data/docs/core/index.md +2 -84
- data/docs/getting-started/index.md +2 -25
- data/docs/getting-started/install/index.md +1 -118
- data/docs/getting-started/migrate/index.md +2 -94
- data/docs/getting-started/uninstall/index.md +2 -35
- data/docs/getting-started/upgrade/index.md +2 -39
- data/docs/help/start-app/index.md +2 -4
- data/docs/index.md +2 -24
- data/install.sh +1 -1
- data/lib/project_types/extension/cli.rb +21 -11
- data/lib/project_types/extension/commands/extension_command.rb +2 -2
- data/lib/project_types/extension/features/argo.rb +117 -0
- data/lib/project_types/extension/forms/create.rb +2 -2
- data/lib/project_types/extension/models/specification.rb +35 -0
- data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +19 -0
- data/lib/project_types/extension/models/specification_handlers/default.rb +67 -0
- data/lib/project_types/extension/models/specifications.rb +77 -0
- data/lib/project_types/extension/tasks/configure_features.rb +52 -0
- data/lib/project_types/extension/tasks/fetch_specifications.rb +38 -0
- data/lib/project_types/node/cli.rb +4 -1
- data/lib/project_types/node/commands/connect.rb +15 -0
- data/lib/project_types/node/commands/create.rb +10 -4
- data/lib/project_types/node/commands/generate.rb +2 -11
- data/lib/project_types/node/messages/messages.rb +16 -50
- data/lib/project_types/rails/cli.rb +4 -1
- data/lib/project_types/rails/commands/connect.rb +15 -0
- data/lib/project_types/rails/commands/create.rb +15 -12
- data/lib/project_types/rails/forms/create.rb +1 -1
- data/lib/project_types/rails/gem.rb +1 -1
- data/lib/project_types/rails/messages/messages.rb +8 -5
- data/lib/project_types/script/cli.rb +9 -5
- data/lib/project_types/script/commands/create.rb +6 -4
- data/lib/project_types/script/commands/enable.rb +12 -4
- data/lib/project_types/script/commands/push.rb +5 -13
- data/lib/project_types/script/config/extension_points.yml +17 -12
- data/lib/project_types/script/errors.rb +21 -0
- data/lib/project_types/script/forms/create.rb +26 -2
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +10 -1
- data/lib/project_types/script/layers/application/build_script.rb +18 -17
- data/lib/project_types/script/layers/application/create_script.rb +12 -10
- data/lib/project_types/script/layers/application/extension_points.rb +24 -0
- data/lib/project_types/script/layers/application/push_script.rb +18 -16
- data/lib/project_types/script/layers/domain/errors.rb +7 -0
- data/lib/project_types/script/layers/domain/extension_point.rb +62 -7
- data/lib/project_types/script/layers/domain/metadata.rb +55 -0
- data/lib/project_types/script/layers/domain/push_package.rb +25 -6
- data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +17 -52
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +42 -11
- data/lib/project_types/script/layers/infrastructure/errors.rb +16 -0
- data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +10 -4
- data/lib/project_types/script/layers/infrastructure/project_creator.rb +2 -1
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +25 -13
- data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +72 -0
- data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +59 -0
- data/lib/project_types/script/layers/infrastructure/script_service.rb +9 -1
- data/lib/project_types/script/layers/infrastructure/task_runner.rb +4 -3
- data/lib/project_types/script/messages/messages.rb +55 -4
- data/lib/project_types/script/script_project.rb +25 -16
- data/lib/project_types/script/ui/error_handler.rb +59 -1
- data/lib/project_types/theme/cli.rb +40 -0
- data/lib/project_types/theme/commands/connect.rb +54 -0
- data/lib/project_types/theme/commands/create.rb +48 -0
- data/lib/project_types/theme/commands/deploy.rb +38 -0
- data/lib/project_types/theme/commands/generate.rb +20 -0
- data/lib/project_types/theme/commands/generate/env.rb +79 -0
- data/lib/project_types/theme/commands/push.rb +55 -0
- data/lib/project_types/theme/commands/serve.rb +31 -0
- data/lib/project_types/theme/forms/connect.rb +34 -0
- data/lib/project_types/theme/forms/create.rb +22 -0
- data/lib/project_types/theme/messages/messages.rb +147 -0
- data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +78 -0
- data/lib/project_types/theme/themekit.rb +113 -0
- data/lib/shopify-cli/admin_api.rb +42 -2
- data/lib/shopify-cli/api.rb +34 -33
- data/lib/shopify-cli/commands/config.rb +24 -0
- data/lib/shopify-cli/commands/connect.rb +32 -15
- data/lib/shopify-cli/commands/system.rb +10 -1
- data/lib/shopify-cli/context.rb +23 -2
- data/lib/shopify-cli/core/entry_point.rb +1 -1
- data/lib/shopify-cli/core/monorail.rb +6 -4
- data/lib/shopify-cli/feature.rb +0 -2
- data/lib/shopify-cli/http_request.rb +27 -0
- data/lib/shopify-cli/js_deps.rb +1 -1
- data/lib/shopify-cli/messages/messages.rb +31 -7
- data/lib/shopify-cli/method_object.rb +104 -0
- data/lib/shopify-cli/partners_api.rb +25 -3
- data/lib/shopify-cli/process_supervision.rb +1 -1
- data/lib/shopify-cli/project.rb +12 -8
- data/lib/shopify-cli/project_type.rb +18 -2
- data/lib/shopify-cli/resolve_constant.rb +25 -0
- data/lib/shopify-cli/result.rb +432 -0
- data/lib/shopify-cli/shopifolk.rb +87 -0
- data/lib/shopify-cli/task.rb +8 -0
- data/lib/shopify-cli/tasks/create_api_client.rb +13 -2
- data/lib/shopify-cli/tasks/ensure_env.rb +3 -0
- data/lib/shopify-cli/tasks/select_org_and_shop.rb +10 -5
- data/lib/shopify-cli/tunnel.rb +8 -2
- data/lib/shopify-cli/version.rb +1 -1
- data/lib/shopify_cli.rb +5 -1
- data/shopify.fish +1 -1
- data/shopify.sh +1 -1
- data/vendor/deps/cli-kit/REVISION +1 -1
- data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +2 -2
- data/vendor/deps/cli-kit/lib/cli/kit/system.rb +3 -3
- data/vendor/deps/cli-ui/REVISION +1 -1
- data/vendor/deps/cli-ui/lib/cli/ui.rb +26 -22
- data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +4 -6
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +3 -3
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb +8 -9
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +1 -1
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui/printer.rb +15 -3
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +4 -11
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +3 -5
- data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +10 -10
- data/vendor/deps/cli-ui/lib/cli/ui/version.rb +1 -1
- data/vendor/deps/cli-ui/lib/cli/ui/wrap.rb +56 -0
- data/vendor/deps/webrick/.gitignore +9 -0
- data/vendor/deps/webrick/Gemfile +3 -0
- data/vendor/deps/webrick/LICENSE.txt +22 -0
- data/vendor/deps/webrick/README.md +61 -0
- data/vendor/deps/webrick/Rakefile +10 -0
- data/vendor/deps/webrick/lib/webrick.rb +232 -0
- data/vendor/deps/webrick/lib/webrick/accesslog.rb +157 -0
- data/vendor/deps/webrick/lib/webrick/cgi.rb +313 -0
- data/vendor/deps/webrick/lib/webrick/compat.rb +36 -0
- data/vendor/deps/webrick/lib/webrick/config.rb +158 -0
- data/vendor/deps/webrick/lib/webrick/cookie.rb +172 -0
- data/vendor/deps/webrick/lib/webrick/htmlutils.rb +30 -0
- data/vendor/deps/webrick/lib/webrick/httpauth.rb +96 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/authenticator.rb +117 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/basicauth.rb +116 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/digestauth.rb +395 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htdigest.rb +132 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htgroup.rb +97 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/htpasswd.rb +158 -0
- data/vendor/deps/webrick/lib/webrick/httpauth/userdb.rb +53 -0
- data/vendor/deps/webrick/lib/webrick/httpproxy.rb +354 -0
- data/vendor/deps/webrick/lib/webrick/httprequest.rb +636 -0
- data/vendor/deps/webrick/lib/webrick/httpresponse.rb +564 -0
- data/vendor/deps/webrick/lib/webrick/https.rb +152 -0
- data/vendor/deps/webrick/lib/webrick/httpserver.rb +294 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet.rb +23 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/abstract.rb +152 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb +47 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/cgihandler.rb +126 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/erbhandler.rb +88 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/filehandler.rb +552 -0
- data/vendor/deps/webrick/lib/webrick/httpservlet/prochandler.rb +47 -0
- data/vendor/deps/webrick/lib/webrick/httpstatus.rb +194 -0
- data/vendor/deps/webrick/lib/webrick/httputils.rb +512 -0
- data/vendor/deps/webrick/lib/webrick/httpversion.rb +76 -0
- data/vendor/deps/webrick/lib/webrick/log.rb +156 -0
- data/vendor/deps/webrick/lib/webrick/server.rb +381 -0
- data/vendor/deps/webrick/lib/webrick/ssl.rb +215 -0
- data/vendor/deps/webrick/lib/webrick/utils.rb +265 -0
- data/vendor/deps/webrick/lib/webrick/version.rb +18 -0
- data/vendor/deps/webrick/webrick.gemspec +74 -0
- metadata +77 -27
- data/docs/Gemfile +0 -5
- data/docs/Gemfile.lock +0 -258
- data/docs/_data/nav.yml +0 -35
- data/docs/_includes/footer.html +0 -15
- data/docs/_includes/head.html +0 -19
- data/docs/_includes/sidebar_nav.html +0 -22
- data/docs/_includes/toc.html +0 -112
- data/docs/_layouts/default.html +0 -79
- data/docs/css/docs.css +0 -157
- data/docs/images/header.png +0 -0
- data/docs/installing-ruby.md +0 -28
- data/lib/project_types/extension/features/argo/admin.rb +0 -20
- data/lib/project_types/extension/features/argo/base.rb +0 -129
- data/lib/project_types/extension/features/argo/checkout.rb +0 -20
- data/lib/project_types/extension/models/type.rb +0 -81
- data/lib/project_types/extension/models/types/checkout_post_purchase.rb +0 -23
- data/lib/project_types/extension/models/types/product_subscription.rb +0 -24
- data/lib/project_types/node/commands/generate/billing.rb +0 -39
- data/lib/project_types/node/commands/generate/page.rb +0 -59
- data/lib/project_types/node/commands/generate/webhook.rb +0 -37
- data/lib/project_types/script/layers/domain/script.rb +0 -18
- data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +0 -38
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +0 -59
- data/lib/project_types/script/templates/ts/as-pect.config.js +0 -27
- data/lib/project_types/script/templates/ts/as-pect.d.ts +0 -1
@@ -0,0 +1,87 @@
|
|
1
|
+
module ShopifyCli
|
2
|
+
##
|
3
|
+
# ShopifyCli::Shopifolk contains the logic to determine if the user appears to be a Shopify staff
|
4
|
+
#
|
5
|
+
# The Shopifolk Feature flag will persist between runs so if the flag is enabled or disabled,
|
6
|
+
# it will still be in that same state until the next class invocation.
|
7
|
+
class Shopifolk
|
8
|
+
GCLOUD_CONFIG_FILE = File.expand_path('~/.config/gcloud/configurations/config_default')
|
9
|
+
DEV_PATH = '/opt/dev'
|
10
|
+
SECTION = 'core'
|
11
|
+
FEATURE_NAME = 'shopifolk'
|
12
|
+
|
13
|
+
class << self
|
14
|
+
attr_writer :acting_as_shopify_organization
|
15
|
+
|
16
|
+
##
|
17
|
+
# will return if the user appears to be a Shopify employee, based on several heuristics
|
18
|
+
#
|
19
|
+
# #### Returns
|
20
|
+
#
|
21
|
+
# * `is_shopifolk` - returns true if the user is a Shopify Employee
|
22
|
+
#
|
23
|
+
# #### Example
|
24
|
+
#
|
25
|
+
# ShopifyCli::Shopifolk.check
|
26
|
+
#
|
27
|
+
def check
|
28
|
+
return false unless ShopifyCli::Config.get_bool('shopifolk-beta', 'enabled')
|
29
|
+
|
30
|
+
ShopifyCli::Shopifolk.new.shopifolk?
|
31
|
+
end
|
32
|
+
|
33
|
+
def act_as_shopify_organization
|
34
|
+
@acting_as_shopify_organization = true
|
35
|
+
end
|
36
|
+
|
37
|
+
def acting_as_shopify_organization?
|
38
|
+
!!@acting_as_shopify_organization || (Project.has_current? && Project.current.config['shopify_organization'])
|
39
|
+
end
|
40
|
+
|
41
|
+
def reset
|
42
|
+
@acting_as_shopify_organization = nil
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# will return if the user is a Shopify employee
|
48
|
+
#
|
49
|
+
# #### Returns
|
50
|
+
#
|
51
|
+
# * `is_shopifolk` - returns true if the user has `dev` installed and
|
52
|
+
# a valid google cloud config file with email ending in "@shopify.com"
|
53
|
+
#
|
54
|
+
def shopifolk?
|
55
|
+
return false unless ShopifyCli::Config.get_bool('shopifolk-beta', 'enabled')
|
56
|
+
return true if Feature.enabled?(FEATURE_NAME)
|
57
|
+
|
58
|
+
if shopifolk_by_gcloud? && shopifolk_by_dev?
|
59
|
+
ShopifyCli::Feature.enable(FEATURE_NAME)
|
60
|
+
true
|
61
|
+
else
|
62
|
+
ShopifyCli::Feature.disable(FEATURE_NAME)
|
63
|
+
false
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def shopifolk_by_gcloud?
|
70
|
+
ini&.dig("[#{SECTION}]", 'account')&.match?(/@shopify.com\z/)
|
71
|
+
end
|
72
|
+
|
73
|
+
def shopifolk_by_dev?
|
74
|
+
File.exist?("#{DEV_PATH}/bin/dev") && File.exist?("#{DEV_PATH}/.shopify-build")
|
75
|
+
end
|
76
|
+
|
77
|
+
def ini
|
78
|
+
@ini ||= begin
|
79
|
+
if File.exist?(GCLOUD_CONFIG_FILE)
|
80
|
+
CLI::Kit::Ini
|
81
|
+
.new(GCLOUD_CONFIG_FILE, default_section: "[#{SECTION}]", convert_types: false)
|
82
|
+
.tap(&:parse).ini
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
data/lib/shopify-cli/task.rb
CHANGED
@@ -6,5 +6,13 @@ module ShopifyCli
|
|
6
6
|
task = new
|
7
7
|
task.call(*args, **kwargs)
|
8
8
|
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def wants_to_run_against_shopify_org?
|
13
|
+
@ctx.puts(@ctx.message('core.tasks.select_org_and_shop.identified_as_shopify'))
|
14
|
+
message = @ctx.message('core.tasks.select_org_and_shop.first_party')
|
15
|
+
CLI::UI::Prompt.confirm(message, default: false)
|
16
|
+
end
|
9
17
|
end
|
10
18
|
end
|
@@ -17,12 +17,23 @@ module ShopifyCli
|
|
17
17
|
redir: [OAuth::REDIRECT_HOST]
|
18
18
|
)
|
19
19
|
|
20
|
-
|
20
|
+
unless resp
|
21
|
+
ctx.abort("Error - empty response")
|
22
|
+
end
|
23
|
+
|
24
|
+
errors = resp.dig("errors")
|
25
|
+
if !errors.nil? && errors.any?
|
26
|
+
ctx.abort(errors.map { |err| "#{err['field']} #{err['message']}" }.join(", "))
|
27
|
+
end
|
28
|
+
|
29
|
+
user_errors = resp.dig("data", "appCreate", "userErrors")
|
21
30
|
if !user_errors.nil? && user_errors.any?
|
22
31
|
ctx.abort(user_errors.map { |err| "#{err['field']} #{err['message']}" }.join(", "))
|
23
32
|
end
|
24
33
|
|
25
|
-
resp
|
34
|
+
ShopifyCli::Core::Monorail.metadata[:api_key] = resp.dig("data", "appCreate", "app", "apiKey")
|
35
|
+
|
36
|
+
resp.dig("data", "appCreate", "app")
|
26
37
|
end
|
27
38
|
end
|
28
39
|
end
|
@@ -22,6 +22,9 @@ module ShopifyCli
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def fetch_org
|
25
|
+
if Shopifolk.check && wants_to_run_against_shopify_org?
|
26
|
+
Shopifolk.act_as_shopify_organization
|
27
|
+
end
|
25
28
|
orgs = PartnersAPI::Organizations.fetch_with_app(@ctx)
|
26
29
|
org_id = if orgs.count == 1
|
27
30
|
orgs.first["id"]
|
@@ -8,18 +8,23 @@ module ShopifyCli
|
|
8
8
|
def call(ctx, organization_id: nil, shop_domain: nil)
|
9
9
|
@ctx = ctx
|
10
10
|
return response(organization_id.to_i, shop_domain) unless organization_id.nil? || shop_domain.nil?
|
11
|
+
if Shopifolk.check && wants_to_run_against_shopify_org?
|
12
|
+
Shopifolk.act_as_shopify_organization
|
13
|
+
end
|
11
14
|
org = get_organization(organization_id)
|
12
|
-
|
15
|
+
unless Shopifolk.acting_as_shopify_organization?
|
16
|
+
shop_domain ||= get_shop_domain(org)
|
17
|
+
end
|
18
|
+
ShopifyCli::Core::Monorail.metadata[:organization_id] = org["id"].to_i
|
13
19
|
response(org["id"].to_i, shop_domain)
|
14
20
|
end
|
15
21
|
|
16
22
|
private
|
17
23
|
|
18
24
|
def response(organization_id, shop_domain)
|
19
|
-
{
|
20
|
-
|
21
|
-
|
22
|
-
}
|
25
|
+
result = { organization_id: organization_id }
|
26
|
+
result[:shop_domain] = shop_domain if shop_domain
|
27
|
+
result
|
23
28
|
end
|
24
29
|
|
25
30
|
def organizations
|
data/lib/shopify-cli/tunnel.rb
CHANGED
@@ -123,7 +123,8 @@ module ShopifyCli
|
|
123
123
|
private
|
124
124
|
|
125
125
|
def install(ctx)
|
126
|
-
|
126
|
+
ngrok = "ngrok#{ctx.executable_file_extension}"
|
127
|
+
return if File.exist?(File.join(ShopifyCli.cache_dir, ngrok))
|
127
128
|
check_prereq_command(ctx, 'curl')
|
128
129
|
check_prereq_command(ctx, ctx.linux? ? 'unzip' : 'tar')
|
129
130
|
spinner = CLI::UI::SpinGroup.new
|
@@ -141,6 +142,11 @@ module ShopifyCli
|
|
141
142
|
ctx.rm(zip_dest)
|
142
143
|
end
|
143
144
|
spinner.wait
|
145
|
+
|
146
|
+
# final check to see if ngrok is accessible
|
147
|
+
unless File.exist?(File.join(ShopifyCli.cache_dir, ngrok))
|
148
|
+
ctx.abort(ctx.message('core.tunnel.error.ngrok', ngrok, ShopifyCli.cache_dir))
|
149
|
+
end
|
144
150
|
end
|
145
151
|
|
146
152
|
def fetch_url(ctx, log_path)
|
@@ -210,7 +216,7 @@ module ShopifyCli
|
|
210
216
|
end
|
211
217
|
|
212
218
|
def parse_account
|
213
|
-
account, timeout, _ = @log.match(/AccountName:(
|
219
|
+
account, timeout, _ = @log.match(/AccountName:(.*)\s+SessionDuration:([\d]+) PlanName/)&.captures
|
214
220
|
@account = account&.empty? ? nil : account
|
215
221
|
@timeout = timeout&.empty? ? 0 : timeout.to_i
|
216
222
|
end
|
data/lib/shopify-cli/version.rb
CHANGED
data/lib/shopify_cli.rb
CHANGED
@@ -15,7 +15,7 @@ ENV['PATH'] = ENV['PATH'].split(':').select { |p| p.start_with?('/', '~') }.join
|
|
15
15
|
vendor_path = File.expand_path("../../vendor/lib", __FILE__)
|
16
16
|
$LOAD_PATH.unshift(vendor_path) unless $LOAD_PATH.include?(vendor_path)
|
17
17
|
|
18
|
-
deps = %w(cli-ui cli-kit smart_properties)
|
18
|
+
deps = %w(cli-ui cli-kit smart_properties webrick)
|
19
19
|
deps.each do |dep|
|
20
20
|
vendor_path = File.expand_path("../../vendor/deps/#{dep}/lib", __FILE__)
|
21
21
|
$LOAD_PATH.unshift(vendor_path) unless $LOAD_PATH.include?(vendor_path)
|
@@ -108,6 +108,7 @@ module ShopifyCli
|
|
108
108
|
autoload :Heroku, 'shopify-cli/heroku'
|
109
109
|
autoload :JsDeps, 'shopify-cli/js_deps'
|
110
110
|
autoload :JsSystem, 'shopify-cli/js_system'
|
111
|
+
autoload :MethodObject, 'shopify-cli/method_object'
|
111
112
|
autoload :Log, 'shopify-cli/log'
|
112
113
|
autoload :OAuth, 'shopify-cli/oauth'
|
113
114
|
autoload :Options, 'shopify-cli/options'
|
@@ -115,7 +116,10 @@ module ShopifyCli
|
|
115
116
|
autoload :ProcessSupervision, 'shopify-cli/process_supervision'
|
116
117
|
autoload :Project, 'shopify-cli/project'
|
117
118
|
autoload :ProjectType, 'shopify-cli/project_type'
|
119
|
+
autoload :ResolveConstant, 'shopify-cli/resolve_constant'
|
118
120
|
autoload :Resources, 'shopify-cli/resources'
|
121
|
+
autoload :Result, 'shopify-cli/result'
|
122
|
+
autoload :Shopifolk, 'shopify-cli/shopifolk'
|
119
123
|
autoload :SubCommand, 'shopify-cli/sub_command'
|
120
124
|
autoload :Task, 'shopify-cli/task'
|
121
125
|
autoload :Tasks, 'shopify-cli/tasks'
|
data/shopify.fish
CHANGED
@@ -7,6 +7,6 @@ if [ $status != "0" ]
|
|
7
7
|
echo "This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
|
8
8
|
|
9
9
|
Please visit this page for complete instructions:
|
10
|
-
https://shopify.
|
10
|
+
https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
|
11
11
|
"
|
12
12
|
end
|
data/shopify.sh
CHANGED
@@ -6,6 +6,6 @@ if [ "$?" != "0" ]; then
|
|
6
6
|
echo "This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
|
7
7
|
|
8
8
|
Please visit this page for complete instructions:
|
9
|
-
https://shopify.
|
9
|
+
https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
|
10
10
|
"
|
11
11
|
fi
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6eadd6c7f7fc9217008c2cfb0bc3101cb6cf3b41
|
@@ -61,7 +61,7 @@ module CLI
|
|
61
61
|
#
|
62
62
|
# @param msg [String] the message to log
|
63
63
|
def debug(msg)
|
64
|
-
$stdout.puts CLI::UI.fmt(msg) if
|
64
|
+
$stdout.puts CLI::UI.fmt(msg) if debug?
|
65
65
|
@debug_logger.debug(format_debug(msg))
|
66
66
|
end
|
67
67
|
|
@@ -73,7 +73,7 @@ module CLI
|
|
73
73
|
"[#{CLI::UI::StdoutRouter.current_id[:id]}] #{msg}"
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
76
|
+
def debug?
|
77
77
|
val = ENV[@env_debug_name]
|
78
78
|
val && val != '0' && val != ''
|
79
79
|
end
|
@@ -94,11 +94,11 @@ module CLI
|
|
94
94
|
delegate_open3(*a, sudo: sudo, env: env, method: :popen2, **kwargs, &block)
|
95
95
|
end
|
96
96
|
|
97
|
-
def popen2e(*a, sudo: false, env: ENV, **kwargs)
|
97
|
+
def popen2e(*a, sudo: false, env: ENV, **kwargs, &block)
|
98
98
|
delegate_open3(*a, sudo: sudo, env: env, method: :popen2e, **kwargs, &block)
|
99
99
|
end
|
100
100
|
|
101
|
-
def popen3(*a, sudo: false, env: ENV, **kwargs)
|
101
|
+
def popen3(*a, sudo: false, env: ENV, **kwargs, &block)
|
102
102
|
delegate_open3(*a, sudo: sudo, env: env, method: :popen3, **kwargs, &block)
|
103
103
|
end
|
104
104
|
|
@@ -112,7 +112,7 @@ module CLI
|
|
112
112
|
# - `**kwargs`: additional keyword arguments to pass to Process.spawn
|
113
113
|
#
|
114
114
|
# #### Returns
|
115
|
-
# - `status`:
|
115
|
+
# - `status`: The `Process:Status` result for the command execution
|
116
116
|
#
|
117
117
|
# #### Usage
|
118
118
|
# `stat = CLI::Kit::System.system('ls', 'a_folder')`
|
data/vendor/deps/cli-ui/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
168ce68b31d8436b2b222d6f063e5c7225785bd4
|
@@ -1,18 +1,19 @@
|
|
1
1
|
module CLI
|
2
2
|
module UI
|
3
|
-
autoload :ANSI,
|
4
|
-
autoload :Glyph,
|
5
|
-
autoload :Color,
|
6
|
-
autoload :Frame,
|
7
|
-
autoload :OS,
|
8
|
-
autoload :Printer,
|
9
|
-
autoload :Progress,
|
10
|
-
autoload :Prompt,
|
11
|
-
autoload :Terminal,
|
12
|
-
autoload :Truncater,
|
13
|
-
autoload :Formatter,
|
14
|
-
autoload :Spinner,
|
15
|
-
autoload :Widgets,
|
3
|
+
autoload :ANSI, 'cli/ui/ansi'
|
4
|
+
autoload :Glyph, 'cli/ui/glyph'
|
5
|
+
autoload :Color, 'cli/ui/color'
|
6
|
+
autoload :Frame, 'cli/ui/frame'
|
7
|
+
autoload :OS, 'cli/ui/os'
|
8
|
+
autoload :Printer, 'cli/ui/printer'
|
9
|
+
autoload :Progress, 'cli/ui/progress'
|
10
|
+
autoload :Prompt, 'cli/ui/prompt'
|
11
|
+
autoload :Terminal, 'cli/ui/terminal'
|
12
|
+
autoload :Truncater, 'cli/ui/truncater'
|
13
|
+
autoload :Formatter, 'cli/ui/formatter'
|
14
|
+
autoload :Spinner, 'cli/ui/spinner'
|
15
|
+
autoload :Widgets, 'cli/ui/widgets'
|
16
|
+
autoload :Wrap, 'cli/ui/wrap'
|
16
17
|
|
17
18
|
# Convenience accessor to +CLI::UI::Spinner::SpinGroup+
|
18
19
|
SpinGroup = Spinner::SpinGroup
|
@@ -29,7 +30,7 @@ module CLI
|
|
29
30
|
end
|
30
31
|
|
31
32
|
# Color resolution using +CLI::UI::Color.lookup+
|
32
|
-
# Will lookup using +Color.lookup+
|
33
|
+
# Will lookup using +Color.lookup+ unless it's already a CLI::UI::Color (or nil)
|
33
34
|
#
|
34
35
|
# ==== Attributes
|
35
36
|
#
|
@@ -37,26 +38,25 @@ module CLI
|
|
37
38
|
#
|
38
39
|
def self.resolve_color(input)
|
39
40
|
case input
|
40
|
-
when
|
41
|
-
CLI::UI::Color.lookup(input)
|
42
|
-
else
|
41
|
+
when CLI::UI::Color, nil
|
43
42
|
input
|
43
|
+
else
|
44
|
+
CLI::UI::Color.lookup(input)
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
48
|
# Frame style resolution using +CLI::UI::Frame::FrameStyle.lookup+.
|
48
|
-
# Will lookup using +FrameStyle.lookup+
|
49
|
-
# we assume it's a valid FrameStyle
|
49
|
+
# Will lookup using +FrameStyle.lookup+ unless it's already a CLI::UI::Frame::FrameStyle(or nil)
|
50
50
|
#
|
51
51
|
# ==== Attributes
|
52
52
|
#
|
53
53
|
# * +input+ - frame style to resolve
|
54
54
|
def self.resolve_style(input)
|
55
55
|
case input
|
56
|
-
when
|
57
|
-
CLI::UI::Frame::FrameStyle.lookup(input)
|
58
|
-
else
|
56
|
+
when CLI::UI::Frame::FrameStyle, nil
|
59
57
|
input
|
58
|
+
else
|
59
|
+
CLI::UI::Frame::FrameStyle.lookup(input)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -114,6 +114,10 @@ module CLI
|
|
114
114
|
CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
115
115
|
end
|
116
116
|
|
117
|
+
def self.wrap(input)
|
118
|
+
CLI::UI::Wrap.new(input).wrap
|
119
|
+
end
|
120
|
+
|
117
121
|
# Convenience Method for +CLI::UI::Printer.puts+
|
118
122
|
#
|
119
123
|
# ==== Attributes
|
@@ -21,6 +21,8 @@ module CLI
|
|
21
21
|
when 0x200d # zero-width joiner
|
22
22
|
zwj = true
|
23
23
|
acc
|
24
|
+
when "\n"
|
25
|
+
acc
|
24
26
|
else
|
25
27
|
acc + 1
|
26
28
|
end
|
@@ -138,17 +140,13 @@ module CLI
|
|
138
140
|
# Move to the next line
|
139
141
|
#
|
140
142
|
def self.next_line
|
141
|
-
|
142
|
-
cmd += control('1', 'D') if CLI::UI::OS.current.shift_cursor_on_line_reset?
|
143
|
-
cmd
|
143
|
+
cursor_down + cursor_horizontal_absolute
|
144
144
|
end
|
145
145
|
|
146
146
|
# Move to the previous line
|
147
147
|
#
|
148
148
|
def self.previous_line
|
149
|
-
|
150
|
-
cmd += control('1', 'D') if CLI::UI::OS.current.shift_cursor_on_line_reset?
|
151
|
-
cmd
|
149
|
+
cursor_up + cursor_horizontal_absolute
|
152
150
|
end
|
153
151
|
|
154
152
|
def self.clear_to_end_of_line
|
@@ -90,7 +90,7 @@ module CLI
|
|
90
90
|
|
91
91
|
t_start = Time.now
|
92
92
|
CLI::UI.raw do
|
93
|
-
print
|
93
|
+
print(prefix.chop)
|
94
94
|
puts frame_style.open(text, color: color)
|
95
95
|
end
|
96
96
|
FrameStack.push(color: color, style: frame_style)
|
@@ -153,7 +153,7 @@ module CLI
|
|
153
153
|
frame_style = CLI::UI.resolve_style(frame_style) || fs_item.frame_style
|
154
154
|
|
155
155
|
CLI::UI.raw do
|
156
|
-
print
|
156
|
+
print(prefix.chop)
|
157
157
|
puts frame_style.divider(text, color: color)
|
158
158
|
end
|
159
159
|
|
@@ -197,7 +197,7 @@ module CLI
|
|
197
197
|
end
|
198
198
|
|
199
199
|
CLI::UI.raw do
|
200
|
-
print
|
200
|
+
print(prefix.chop)
|
201
201
|
puts frame_style.close(text, color: color, **kwargs)
|
202
202
|
end
|
203
203
|
end
|