shopify-cli 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +13 -13
- data/bin/load_shopify.rb +3 -1
- data/bin/shopify +2 -0
- data/docs/Gemfile.lock +23 -13
- data/docs/getting-started/install/index.md +37 -1
- data/docs/getting-started/migrate/index.md +34 -1
- data/ext/shopify-cli/extconf.rb +40 -20
- data/lib/project_types/extension/cli.rb +1 -1
- data/lib/project_types/extension/commands/build.rb +1 -1
- data/lib/project_types/extension/models/type.rb +1 -0
- data/lib/project_types/extension/tasks/create_extension.rb +1 -1
- data/lib/project_types/extension/tasks/get_app.rb +1 -1
- data/lib/project_types/extension/tasks/update_draft.rb +1 -1
- data/lib/project_types/node/commands/create.rb +4 -4
- data/lib/project_types/node/commands/deploy/heroku.rb +6 -1
- data/lib/project_types/node/commands/generate/billing.rb +6 -5
- data/lib/project_types/node/commands/generate/page.rb +8 -5
- data/lib/project_types/node/commands/generate/webhook.rb +4 -1
- data/lib/project_types/node/messages/messages.rb +3 -2
- data/lib/project_types/rails/cli.rb +0 -1
- data/lib/project_types/rails/commands/create.rb +52 -4
- data/lib/project_types/rails/commands/generate.rb +1 -0
- data/lib/project_types/rails/commands/generate/webhook.rb +3 -2
- data/lib/project_types/rails/commands/serve.rb +6 -2
- data/lib/project_types/rails/gem.rb +61 -6
- data/lib/project_types/rails/messages/messages.rb +29 -13
- data/lib/project_types/script/cli.rb +2 -3
- data/lib/project_types/script/commands/create.rb +5 -9
- data/lib/project_types/script/commands/disable.rb +4 -15
- data/lib/project_types/script/commands/enable.rb +37 -13
- data/lib/project_types/script/commands/push.rb +8 -13
- data/lib/project_types/script/config/extension_points.yml +9 -3
- data/lib/project_types/script/errors.rb +8 -0
- data/lib/project_types/script/forms/create.rb +1 -1
- data/lib/project_types/script/layers/application/create_script.rb +7 -6
- data/lib/project_types/script/layers/application/disable_script.rb +9 -7
- data/lib/project_types/script/layers/application/enable_script.rb +11 -9
- data/lib/project_types/script/layers/application/push_script.rb +6 -4
- data/lib/project_types/script/layers/domain/errors.rb +2 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/errors.rb +2 -0
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_service.rb +2 -0
- data/lib/project_types/script/messages/messages.rb +25 -31
- data/lib/project_types/script/script_project.rb +8 -4
- data/lib/project_types/script/templates/ts/as-pect.config.js +6 -0
- data/lib/project_types/script/ui/error_handler.rb +8 -0
- data/lib/project_types/script/ui/printing_spinner.rb +75 -0
- data/lib/rubygems_plugin.rb +18 -10
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +1 -1
- data/lib/shopify-cli/admin_api/schema.rb +20 -8
- data/lib/shopify-cli/command.rb +14 -11
- data/lib/shopify-cli/commands.rb +1 -0
- data/lib/shopify-cli/commands/config.rb +44 -0
- data/lib/shopify-cli/commands/connect.rb +8 -69
- data/lib/shopify-cli/commands/create.rb +2 -2
- data/lib/shopify-cli/commands/help.rb +1 -1
- data/lib/shopify-cli/commands/system.rb +22 -13
- data/lib/shopify-cli/context.rb +38 -1
- data/lib/shopify-cli/core.rb +0 -1
- data/lib/shopify-cli/core/entry_point.rb +1 -1
- data/lib/shopify-cli/core/executor.rb +3 -5
- data/lib/shopify-cli/core/monorail.rb +1 -1
- data/lib/shopify-cli/db.rb +1 -1
- data/lib/shopify-cli/feature.rb +97 -0
- data/lib/shopify-cli/heroku.rb +21 -5
- data/lib/shopify-cli/js_deps.rb +2 -2
- data/lib/shopify-cli/js_system.rb +2 -2
- data/lib/shopify-cli/messages/messages.rb +37 -12
- data/lib/shopify-cli/partners_api/organizations.rb +7 -7
- data/lib/shopify-cli/process_supervision.rb +60 -21
- data/lib/shopify-cli/project.rb +14 -6
- data/lib/shopify-cli/project_type.rb +5 -7
- data/lib/shopify-cli/sub_command.rb +1 -0
- data/lib/shopify-cli/task.rb +2 -2
- data/lib/shopify-cli/tasks.rb +11 -4
- data/lib/shopify-cli/tasks/ensure_env.rb +72 -16
- data/lib/shopify-cli/tasks/update_dashboard_urls.rb +4 -3
- data/lib/shopify-cli/tunnel.rb +44 -14
- data/lib/shopify-cli/version.rb +1 -1
- data/lib/shopify_cli.rb +36 -9
- data/shopify-cli.gemspec +4 -1
- data/vendor/deps/cli-kit/REVISION +1 -1
- data/vendor/deps/cli-kit/lib/cli/kit.rb +1 -1
- data/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +2 -2
- data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +12 -6
- data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +9 -11
- data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +8 -2
- data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +7 -7
- data/vendor/deps/cli-kit/lib/cli/kit/system.rb +48 -17
- data/vendor/deps/cli-ui/REVISION +1 -1
- data/vendor/deps/cli-ui/lib/cli/ui.rb +5 -4
- data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +9 -3
- data/vendor/deps/cli-ui/lib/cli/ui/color.rb +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +3 -2
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb +13 -5
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +29 -2
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +21 -10
- data/vendor/deps/cli-ui/lib/cli/ui/os.rb +63 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +11 -2
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +3 -3
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +6 -8
- data/vendor/deps/cli-ui/lib/cli/ui/widgets.rb +2 -0
- data/vendor/gen/lib/gen.rb +39 -0
- data/vendor/gen/lib/gen/commands.rb +18 -0
- data/vendor/gen/lib/gen/commands/help.rb +20 -0
- data/vendor/gen/lib/gen/commands/new.rb +21 -0
- data/vendor/gen/lib/gen/entry_point.rb +10 -0
- data/vendor/gen/lib/gen/generator.rb +165 -0
- data/vendor/gen/template/.gitignore +2 -0
- data/vendor/gen/template/Gemfile +10 -0
- data/vendor/gen/template/README.md +1 -0
- data/vendor/gen/template/bin/testunit +23 -0
- data/vendor/gen/template/bin/update-deps +97 -0
- data/vendor/gen/template/dev-gems.yml +3 -0
- data/vendor/gen/template/dev-vendor.yml +4 -0
- data/vendor/gen/template/exe/__app__-gems +17 -0
- data/vendor/gen/template/exe/__app__-vendor +18 -0
- data/vendor/gen/template/lib/__app__.rb +33 -0
- data/vendor/gen/template/lib/__app__/commands.rb +18 -0
- data/vendor/gen/template/lib/__app__/commands/example.rb +19 -0
- data/vendor/gen/template/lib/__app__/commands/help.rb +21 -0
- data/vendor/gen/template/lib/__app__/entry_point.rb +10 -0
- data/vendor/gen/template/test/example_test.rb +17 -0
- data/vendor/gen/template/test/test_helper.rb +22 -0
- metadata +28 -6
- data/Vagrantfile +0 -17
- data/lib/project_types/script/forms/enable.rb +0 -24
- data/lib/project_types/script/forms/push.rb +0 -19
- data/lib/project_types/script/forms/script_form.rb +0 -66
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Script
|
4
|
-
module Forms
|
5
|
-
class Push < ScriptForm
|
6
|
-
flag_arguments :api_key, :force
|
7
|
-
|
8
|
-
def ask
|
9
|
-
self.api_key ||= ask_api_key
|
10
|
-
end
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def ask_api_key
|
15
|
-
ask_app_api_key(organization['apps'])
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Script
|
4
|
-
module Forms
|
5
|
-
class ScriptForm < ShopifyCli::Form
|
6
|
-
protected
|
7
|
-
|
8
|
-
def organization
|
9
|
-
@organization ||= ask_organization
|
10
|
-
end
|
11
|
-
|
12
|
-
def organizations
|
13
|
-
return @organizations if defined?(@organizations)
|
14
|
-
ctx.puts(ctx.message('script.forms.script_form.fetching_organizations'))
|
15
|
-
@organizations = ShopifyCli::PartnersAPI::Organizations.fetch_with_app(ctx)
|
16
|
-
end
|
17
|
-
|
18
|
-
def ask_app_api_key(apps, message: ctx.message('script.forms.script_form.ask_app_api_key_default'))
|
19
|
-
if apps.count == 0
|
20
|
-
raise Errors::NoExistingAppsError
|
21
|
-
elsif apps.count == 1
|
22
|
-
ctx.puts(ctx.message(
|
23
|
-
'script.forms.script_form.using_app',
|
24
|
-
title: apps.first['title'],
|
25
|
-
api_key: apps.first['apiKey']
|
26
|
-
))
|
27
|
-
apps.first["apiKey"]
|
28
|
-
else
|
29
|
-
CLI::UI::Prompt.ask(message) do |handler|
|
30
|
-
apps.each { |app| handler.option(app["title"]) { app["apiKey"] } }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def ask_organization
|
36
|
-
if organizations.count == 0
|
37
|
-
raise Errors::NoExistingOrganizationsError
|
38
|
-
elsif organizations.count == 1
|
39
|
-
org = organizations.first
|
40
|
-
ctx.puts(ctx.message('script.forms.script_form.using_organization',
|
41
|
-
ctx.message('core.partners_api.org_name_and_id', org['businessName'], org['id'])))
|
42
|
-
org
|
43
|
-
else
|
44
|
-
org_id = CLI::UI::Prompt.ask(ctx.message('script.forms.script_form.select_organization')) do |handler|
|
45
|
-
organizations.each do |o|
|
46
|
-
handler.option(ctx.message('core.partners_api.org_name_and_id', o['businessName'], o['id'])) { o['id'] }
|
47
|
-
end
|
48
|
-
end
|
49
|
-
organizations.find { |o| o['id'] == org_id }
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def ask_shop_domain(organization, message: ctx.message('script.forms.script_form.ask_shop_domain_default'))
|
54
|
-
if organization['stores'].count == 0
|
55
|
-
raise Errors::NoExistingStoresError, organization['id']
|
56
|
-
elsif organization['stores'].count == 1
|
57
|
-
domain = organization['stores'].first['shopDomain']
|
58
|
-
ctx.puts(ctx.message('script.forms.script_form.using_development_store', domain: domain))
|
59
|
-
domain
|
60
|
-
else
|
61
|
-
CLI::UI::Prompt.ask(message, options: organization["stores"].map { |s| s["shopDomain"] })
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|