shopify-cli 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/shopify.yml +0 -2
- data/.rubocop.yml +14 -14
- data/.rubocop_todo.yml +3 -3
- data/CHANGELOG.md +5 -0
- data/Dockerfile +1 -1
- data/Gemfile.lock +1 -1
- data/RELEASING.md +1 -1
- data/Rakefile +18 -18
- data/bin/shopify +3 -3
- data/lib/project_types/extension/cli.rb +3 -3
- data/lib/project_types/extension/commands/build.rb +2 -2
- data/lib/project_types/extension/commands/check.rb +2 -2
- data/lib/project_types/extension/commands/connect.rb +1 -1
- data/lib/project_types/extension/commands/create.rb +41 -23
- data/lib/project_types/extension/commands/extension_command.rb +1 -1
- data/lib/project_types/extension/commands/info.rb +1 -1
- data/lib/project_types/extension/commands/push.rb +1 -1
- data/lib/project_types/extension/commands/register.rb +2 -2
- data/lib/project_types/extension/commands/serve.rb +5 -5
- data/lib/project_types/extension/commands/tunnel.rb +6 -6
- data/lib/project_types/extension/extension_project.rb +4 -4
- data/lib/project_types/extension/features/argo.rb +2 -2
- data/lib/project_types/extension/features/argo_config.rb +5 -5
- data/lib/project_types/extension/features/argo_serve.rb +20 -6
- data/lib/project_types/extension/features/argo_setup.rb +1 -1
- data/lib/project_types/extension/features/argo_setup_step.rb +1 -1
- data/lib/project_types/extension/features/argo_setup_steps.rb +2 -2
- data/lib/project_types/extension/forms/connect.rb +2 -2
- data/lib/project_types/extension/forms/create.rb +2 -2
- data/lib/project_types/extension/forms/questions/ask_app.rb +2 -2
- data/lib/project_types/extension/forms/questions/ask_name.rb +1 -1
- data/lib/project_types/extension/forms/questions/ask_registration.rb +2 -2
- data/lib/project_types/extension/forms/questions/ask_template.rb +2 -2
- data/lib/project_types/extension/forms/questions/ask_type.rb +2 -2
- data/lib/project_types/extension/messages/message_loading.rb +2 -2
- data/lib/project_types/extension/models/development_server.rb +45 -6
- data/lib/project_types/extension/models/development_server_requirements.rb +22 -3
- data/lib/project_types/extension/models/lazy_specification_handler.rb +1 -1
- data/lib/project_types/extension/models/specification.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/default.rb +10 -2
- data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +1 -1
- data/lib/project_types/extension/models/specifications.rb +4 -4
- data/lib/project_types/extension/tasks/choose_next_available_port.rb +1 -1
- data/lib/project_types/extension/tasks/configure_features.rb +1 -1
- data/lib/project_types/extension/tasks/configure_options.rb +1 -1
- data/lib/project_types/extension/tasks/converters/product_converter.rb +1 -1
- data/lib/project_types/extension/tasks/create_extension.rb +2 -2
- data/lib/project_types/extension/tasks/fetch_specifications.rb +2 -2
- data/lib/project_types/extension/tasks/find_npm_packages.rb +3 -3
- data/lib/project_types/extension/tasks/get_app.rb +2 -2
- data/lib/project_types/extension/tasks/get_apps.rb +2 -2
- data/lib/project_types/extension/tasks/get_extensions.rb +2 -2
- data/lib/project_types/extension/tasks/get_product.rb +2 -2
- data/lib/project_types/extension/tasks/run_extension_command.rb +10 -3
- data/lib/project_types/extension/tasks/update_draft.rb +2 -2
- data/lib/project_types/node/cli.rb +3 -3
- data/lib/project_types/node/commands/connect.rb +4 -4
- data/lib/project_types/node/commands/create.rb +10 -10
- data/lib/project_types/node/commands/deploy/heroku.rb +4 -4
- data/lib/project_types/node/commands/deploy.rb +3 -3
- data/lib/project_types/node/commands/generate.rb +2 -2
- data/lib/project_types/node/commands/open.rb +3 -3
- data/lib/project_types/node/commands/serve.rb +7 -7
- data/lib/project_types/node/commands/tunnel.rb +6 -6
- data/lib/project_types/node/forms/create.rb +3 -3
- data/lib/project_types/php/cli.rb +27 -0
- data/lib/project_types/php/commands/connect.rb +19 -0
- data/lib/project_types/php/commands/create.rb +143 -0
- data/lib/project_types/php/commands/deploy/heroku.rb +129 -0
- data/lib/project_types/php/commands/deploy.rb +32 -0
- data/lib/project_types/php/commands/open.rb +16 -0
- data/lib/project_types/php/commands/serve.rb +51 -0
- data/lib/project_types/php/commands/tunnel.rb +37 -0
- data/lib/project_types/php/forms/create.rb +45 -0
- data/lib/project_types/php/messages/messages.rb +191 -0
- data/lib/project_types/rails/cli.rb +3 -3
- data/lib/project_types/rails/commands/connect.rb +4 -4
- data/lib/project_types/rails/commands/create.rb +12 -12
- data/lib/project_types/rails/commands/deploy/heroku.rb +4 -4
- data/lib/project_types/rails/commands/deploy.rb +3 -3
- data/lib/project_types/rails/commands/generate/webhook.rb +3 -3
- data/lib/project_types/rails/commands/generate.rb +3 -3
- data/lib/project_types/rails/commands/open.rb +3 -3
- data/lib/project_types/rails/commands/serve.rb +8 -8
- data/lib/project_types/rails/commands/tunnel.rb +6 -6
- data/lib/project_types/rails/forms/create.rb +3 -3
- data/lib/project_types/rails/gem.rb +1 -1
- data/lib/project_types/rails/ruby.rb +1 -1
- data/lib/project_types/script/cli.rb +11 -4
- data/lib/project_types/script/commands/create.rb +2 -2
- data/lib/project_types/script/commands/push.rb +2 -2
- data/lib/project_types/script/forms/create.rb +1 -1
- data/lib/project_types/script/layers/application/extension_points.rb +2 -2
- data/lib/project_types/script/layers/application/push_script.rb +4 -1
- data/lib/project_types/script/layers/domain/script_project.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/api_clients/partners_proxy_api_client.rb +55 -0
- data/lib/project_types/script/layers/infrastructure/api_clients/script_service_api_client.rb +35 -0
- data/lib/project_types/script/layers/infrastructure/command_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +5 -5
- data/lib/project_types/script/layers/infrastructure/script_service.rb +4 -8
- data/lib/project_types/script/layers/infrastructure/service_locator.rb +20 -0
- data/lib/project_types/script/tasks/ensure_env.rb +6 -6
- data/lib/project_types/script/ui/error_handler.rb +75 -75
- data/lib/project_types/script/ui/printing_spinner.rb +1 -1
- data/lib/project_types/theme/cli.rb +3 -3
- data/lib/project_types/theme/commands/check.rb +3 -3
- data/lib/project_types/theme/commands/delete.rb +7 -7
- data/lib/project_types/theme/commands/init.rb +3 -3
- data/lib/project_types/theme/commands/language_server.rb +2 -2
- data/lib/project_types/theme/commands/package.rb +2 -2
- data/lib/project_types/theme/commands/publish.rb +5 -5
- data/lib/project_types/theme/commands/pull.rb +9 -9
- data/lib/project_types/theme/commands/push.rb +12 -12
- data/lib/project_types/theme/commands/serve.rb +4 -4
- data/lib/project_types/theme/forms/confirm_store.rb +1 -1
- data/lib/project_types/theme/forms/select.rb +2 -2
- data/lib/{shopify-cli → shopify_cli}/admin_api/populate_resource_command.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/admin_api/schema.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/admin_api.rb +27 -27
- data/lib/{shopify-cli → shopify_cli}/api.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/command.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/commands/config.rb +14 -14
- data/lib/{shopify-cli → shopify_cli}/commands/help.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/commands/login.rb +7 -7
- data/lib/shopify_cli/commands/logout.rb +39 -0
- data/lib/{shopify-cli → shopify_cli}/commands/populate/customer.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/commands/populate/draft_order.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/commands/populate/product.rb +4 -4
- data/lib/shopify_cli/commands/populate.rb +23 -0
- data/lib/shopify_cli/commands/store.rb +15 -0
- data/lib/{shopify-cli → shopify_cli}/commands/switch.rb +5 -5
- data/lib/{shopify-cli → shopify_cli}/commands/system.rb +10 -10
- data/lib/shopify_cli/commands/version.rb +15 -0
- data/lib/{shopify-cli → shopify_cli}/commands/whoami.rb +7 -7
- data/lib/shopify_cli/commands.rb +34 -0
- data/lib/{shopify-cli → shopify_cli}/connect.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/constants.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/context.rb +6 -6
- data/lib/{shopify-cli → shopify_cli}/core/entry_point.rb +7 -7
- data/lib/{shopify-cli → shopify_cli}/core/executor.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/core/finalize.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/core/help_resolver.rb +2 -2
- data/lib/{shopify-cli → shopify_cli}/core/monorail.rb +8 -8
- data/lib/shopify_cli/core.rb +8 -0
- data/lib/{shopify-cli → shopify_cli}/db.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/environment.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/feature.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/form.rb +2 -2
- data/lib/{shopify-cli → shopify_cli}/git.rb +6 -6
- data/lib/{shopify-cli → shopify_cli}/helpers/haikunator.rb +1 -1
- data/lib/shopify_cli/helpers.rb +5 -0
- data/lib/{shopify-cli → shopify_cli}/heroku.rb +38 -13
- data/lib/{shopify-cli → shopify_cli}/http_request.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/identity_auth/servlet.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/identity_auth.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/js_deps.rb +7 -7
- data/lib/{shopify-cli → shopify_cli}/js_system.rb +10 -10
- data/lib/{shopify-cli → shopify_cli}/lazy_delegator.rb +2 -2
- data/lib/{shopify-cli → shopify_cli}/messages/messages.rb +17 -1
- data/lib/{shopify-cli → shopify_cli}/method_object.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/options.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/packager.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/partners_api/organizations.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/partners_api.rb +13 -13
- data/lib/shopify_cli/php_deps.rb +102 -0
- data/lib/{shopify-cli → shopify_cli}/process_supervision.rb +10 -8
- data/lib/{shopify-cli → shopify_cli}/project.rb +15 -15
- data/lib/{shopify-cli → shopify_cli}/project_commands.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/project_type.rb +5 -5
- data/lib/{shopify-cli → shopify_cli}/resolve_constant.rb +5 -5
- data/lib/{shopify-cli → shopify_cli}/resources/env_file.rb +1 -1
- data/lib/shopify_cli/resources.rb +5 -0
- data/lib/{shopify-cli → shopify_cli}/result.rb +11 -11
- data/lib/{shopify-cli → shopify_cli}/shopifolk.rb +6 -6
- data/lib/{shopify-cli → shopify_cli}/sub_command.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/task.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/tasks/confirm_store.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/tasks/create_api_client.rb +4 -4
- data/lib/shopify_cli/tasks/ensure_authenticated.rb +13 -0
- data/lib/{shopify-cli → shopify_cli}/tasks/ensure_dev_store.rb +5 -5
- data/lib/{shopify-cli → shopify_cli}/tasks/ensure_env.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/tasks/ensure_loopback_url.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/tasks/ensure_project_type.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/tasks/select_org_and_shop.rb +8 -8
- data/lib/{shopify-cli → shopify_cli}/tasks/update_dashboard_urls.rb +6 -6
- data/lib/{shopify-cli → shopify_cli}/tasks.rb +10 -10
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/certificate_manager.rb +5 -5
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/header_hash.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/hot-reload.js +0 -0
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/hot_reload.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/local_assets.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/proxy.rb +2 -2
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/sse.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/watcher.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server/web_server.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/dev_server.rb +3 -3
- data/lib/{shopify-cli → shopify_cli}/theme/development_theme.rb +9 -9
- data/lib/{shopify-cli → shopify_cli}/theme/file.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/ignore_filter.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/mime_type.rb +1 -1
- data/lib/{shopify-cli → shopify_cli}/theme/syncer.rb +6 -6
- data/lib/{shopify-cli → shopify_cli}/theme/theme.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/transform_data_structure.rb +4 -4
- data/lib/{shopify-cli → shopify_cli}/tunnel.rb +14 -14
- data/lib/shopify_cli/version.rb +3 -0
- data/lib/shopify_cli.rb +50 -49
- data/shopify-cli.gemspec +2 -2
- metadata +104 -91
- data/lib/project_types/script/layers/infrastructure/api_clients.rb +0 -89
- data/lib/shopify-cli/commands/logout.rb +0 -39
- data/lib/shopify-cli/commands/populate.rb +0 -23
- data/lib/shopify-cli/commands/store.rb +0 -15
- data/lib/shopify-cli/commands/version.rb +0 -15
- data/lib/shopify-cli/commands.rb +0 -34
- data/lib/shopify-cli/core.rb +0 -8
- data/lib/shopify-cli/helpers.rb +0 -5
- data/lib/shopify-cli/resources.rb +0 -5
- data/lib/shopify-cli/tasks/ensure_authenticated.rb +0 -13
- data/lib/shopify-cli/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60163978b05868670c0b5535cc49060ba5f55c9e127d6f97232970751caeb4d8
|
4
|
+
data.tar.gz: b3993bcef0bd4d5488f4b4d7f3e8b6f219a0322279159a512a12cc3986f2e63a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd65b86469afbc40117f58257840588dea0fd07141e899ac9273e0eee9da4bcaef119c4df14921777d3ae88932fd053771392154658704294b59afd9656b00f8
|
7
|
+
data.tar.gz: 2d199c2d96954b9d2c666fc4822f845f1a176115eb90a28078af42ceaf0cf691b3b2e21896485afe4c42b2ec43e7c5af576ba18a86188bf01a22f7ff32ffb8f0
|
@@ -25,7 +25,6 @@ jobs:
|
|
25
25
|
- macos-11
|
26
26
|
- ubuntu-20.04
|
27
27
|
- ubuntu-18.04
|
28
|
-
- ubuntu-16.04
|
29
28
|
steps:
|
30
29
|
- uses: actions/checkout@v2
|
31
30
|
- name: Set Git configuration
|
@@ -58,7 +57,6 @@ jobs:
|
|
58
57
|
- macos-11
|
59
58
|
- ubuntu-20.04
|
60
59
|
- ubuntu-18.04
|
61
|
-
- ubuntu-16.04
|
62
60
|
steps:
|
63
61
|
- uses: actions/checkout@v2
|
64
62
|
- name: Set Git configuration
|
data/.rubocop.yml
CHANGED
@@ -11,8 +11,8 @@ inherit_gem:
|
|
11
11
|
Minitest:
|
12
12
|
Enabled: true
|
13
13
|
Include:
|
14
|
-
-
|
15
|
-
-
|
14
|
+
- "**/test/**/*"
|
15
|
+
- "**/*_test.rb"
|
16
16
|
|
17
17
|
Minitest/AssertInDelta: # (new in 0.10)
|
18
18
|
Enabled: true
|
@@ -43,15 +43,15 @@ Minitest/UnspecifiedException: # (new in 0.10)
|
|
43
43
|
|
44
44
|
AllCops:
|
45
45
|
Exclude:
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
46
|
+
- "vendor/**/*"
|
47
|
+
- "docs/**/*"
|
48
|
+
- "packaging/**/*"
|
49
49
|
TargetRubyVersion: 2.4
|
50
50
|
|
51
51
|
Layout/EmptyLines:
|
52
52
|
Exclude:
|
53
53
|
# Need extra line so comment at top isnt registered to the Dev namespace
|
54
|
-
-
|
54
|
+
- "lib/dev/helpers/chruby_reset.rb"
|
55
55
|
|
56
56
|
Layout/EmptyLineBetweenDefs:
|
57
57
|
AllowAdjacentOneLineDefs: true
|
@@ -59,10 +59,10 @@ Layout/EmptyLineBetweenDefs:
|
|
59
59
|
# Changing this could effect the way the content is rendered.
|
60
60
|
Layout/HeredocIndentation:
|
61
61
|
Exclude:
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
62
|
+
- "lib/project_types/node/messages/messages.rb"
|
63
|
+
- "lib/project_types/rails/messages/messages.rb"
|
64
|
+
- "lib/project_types/script/messages/messages.rb"
|
65
|
+
- "lib/shopify_cli/messages/messages.rb"
|
66
66
|
|
67
67
|
# allow String.new to create mutable strings
|
68
68
|
Style/EmptyLiteral:
|
@@ -71,7 +71,7 @@ Style/EmptyLiteral:
|
|
71
71
|
# allow String.new to create mutable strings
|
72
72
|
Style/HashSyntax:
|
73
73
|
Exclude:
|
74
|
-
-
|
74
|
+
- "Rakefile"
|
75
75
|
|
76
76
|
# allow using %r{} for regexes
|
77
77
|
Style/RegexpLiteral:
|
@@ -97,6 +97,6 @@ Style/MethodCallWithArgsParentheses:
|
|
97
97
|
|
98
98
|
Layout/TrailingWhitespace:
|
99
99
|
Exclude:
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
100
|
+
- "ext/shopify-cli/extconf.rb" # unsure if safe to remove
|
101
|
+
- "lib/project_types/extension/messages/messages.rb" # unsure if safe to remove
|
102
|
+
- "test/project_types/extension/extension_test_helpers/stubs/argo_script.rb" # unsure if save to remove
|
data/.rubocop_todo.yml
CHANGED
@@ -14,11 +14,11 @@ Minitest/MultipleAssertions:
|
|
14
14
|
# Cop supports --auto-correct.
|
15
15
|
Style/PerlBackrefs:
|
16
16
|
Exclude:
|
17
|
-
-
|
17
|
+
- "lib/docgen/markdown.rb"
|
18
18
|
|
19
19
|
# Offense count: 2
|
20
20
|
# Cop supports --auto-correct.
|
21
21
|
Style/RedundantBegin:
|
22
22
|
Exclude:
|
23
|
-
-
|
24
|
-
-
|
23
|
+
- "lib/shopify_cli/shopifolk.rb"
|
24
|
+
- "test/shopify_cli/tunnel_test.rb"
|
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
@@ -13,7 +13,7 @@ WORKDIR /usr/src/app
|
|
13
13
|
|
14
14
|
COPY Gemfile Gemfile.lock ./
|
15
15
|
COPY shopify-cli.gemspec shopify-cli.gemspec
|
16
|
-
COPY lib/
|
16
|
+
COPY lib/shopify_cli/version.rb lib/shopify_cli/version.rb
|
17
17
|
COPY . .
|
18
18
|
|
19
19
|
RUN bundle install
|
data/Gemfile.lock
CHANGED
data/RELEASING.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
$ git checkout -b release_X_Y_Z
|
14
14
|
```
|
15
15
|
|
16
|
-
1. Update the version of Shopify CLI in `lib/
|
16
|
+
1. Update the version of Shopify CLI in `lib/shopify_cli/version.rb`
|
17
17
|
|
18
18
|
1. Update the version of Shopify CLI at the top of `Gemfile.lock` (failing to do so causes the CI build to fail)
|
19
19
|
|
data/Rakefile
CHANGED
@@ -51,20 +51,20 @@ namespace :rdoc do
|
|
51
51
|
repo = "https://github.com/Shopify/shopify-cli.wiki.git"
|
52
52
|
intermediate = "markdown_intermediate"
|
53
53
|
file_to_doc = [
|
54
|
-
"lib/
|
55
|
-
"lib/
|
56
|
-
"lib/
|
57
|
-
"lib/
|
58
|
-
"lib/
|
59
|
-
"lib/
|
60
|
-
"lib/
|
61
|
-
"lib/
|
62
|
-
"lib/
|
63
|
-
"lib/
|
64
|
-
"lib/
|
65
|
-
"lib/
|
66
|
-
"lib/
|
67
|
-
"lib/
|
54
|
+
"lib/shopify_cli/admin_api.rb",
|
55
|
+
"lib/shopify_cli/context.rb",
|
56
|
+
"lib/shopify_cli/db.rb",
|
57
|
+
"lib/shopify_cli/git.rb",
|
58
|
+
"lib/shopify_cli/heroku.rb",
|
59
|
+
"lib/shopify_cli/js_deps.rb",
|
60
|
+
"lib/shopify_cli/lazy_delegator.rb",
|
61
|
+
"lib/shopify_cli/method_object.rb",
|
62
|
+
"lib/shopify_cli/partners_api.rb",
|
63
|
+
"lib/shopify_cli/process_supervision.rb",
|
64
|
+
"lib/shopify_cli/project.rb",
|
65
|
+
"lib/shopify_cli/result.rb",
|
66
|
+
"lib/shopify_cli/transform_data_structure.rb",
|
67
|
+
"lib/shopify_cli/tunnel.rb",
|
68
68
|
]
|
69
69
|
|
70
70
|
task all: [:markdown, :wiki, :cleanup]
|
@@ -104,23 +104,23 @@ desc("Generate markdown documentation and update the wiki")
|
|
104
104
|
task(rdoc: "rdoc:all")
|
105
105
|
|
106
106
|
namespace :package do
|
107
|
-
require "
|
107
|
+
require "shopify_cli/packager"
|
108
108
|
|
109
109
|
task all: [:debian, :rpm, :homebrew]
|
110
110
|
|
111
111
|
desc("Builds a Debian package of the CLI")
|
112
112
|
task :debian do
|
113
|
-
|
113
|
+
ShopifyCLI::Packager.new.build_debian
|
114
114
|
end
|
115
115
|
|
116
116
|
desc("Builds an RPM package of the CLI")
|
117
117
|
task :rpm do
|
118
|
-
|
118
|
+
ShopifyCLI::Packager.new.build_rpm
|
119
119
|
end
|
120
120
|
|
121
121
|
desc("Builds a Homebrew package of the CLI")
|
122
122
|
task :homebrew do
|
123
|
-
|
123
|
+
ShopifyCLI::Packager.new.build_homebrew
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
data/bin/shopify
CHANGED
@@ -9,7 +9,7 @@ module Kernel
|
|
9
9
|
original_require(name)
|
10
10
|
rescue LoadError => e
|
11
11
|
# Special case for readline.so, which fails harmlessly on Windows
|
12
|
-
raise if (name == "readline.so") &&
|
12
|
+
raise if (name == "readline.so") && ShopifyCLI::Context.new.windows?
|
13
13
|
# Special case for psych (yaml), which rescues this itself
|
14
14
|
raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
|
15
15
|
STDERR.puts "[Note] You cannot use gems with Shopify CLI."
|
@@ -29,6 +29,6 @@ end
|
|
29
29
|
|
30
30
|
require_relative "./load_shopify"
|
31
31
|
|
32
|
-
exit(
|
33
|
-
|
32
|
+
exit(ShopifyCLI::ErrorHandler.call do
|
33
|
+
ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
|
34
34
|
end)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Extension
|
4
4
|
class PackageResolutionFailed < RuntimeError; end
|
5
5
|
|
6
|
-
class Project <
|
6
|
+
class Project < ShopifyCLI::ProjectType
|
7
7
|
hidden_feature
|
8
8
|
|
9
9
|
require Project.project_filepath("messages/messages")
|
@@ -12,7 +12,7 @@ module Extension
|
|
12
12
|
register_messages(Extension::Messages::MessageLoading.load)
|
13
13
|
end
|
14
14
|
|
15
|
-
class Command <
|
15
|
+
class Command < ShopifyCLI::ProjectCommands
|
16
16
|
hidden_feature
|
17
17
|
autoload :ExtensionCommand, Project.project_filepath("commands/extension_command")
|
18
18
|
|
@@ -26,7 +26,7 @@ module Extension
|
|
26
26
|
subcommand :Tunnel, "tunnel", Project.project_filepath("commands/tunnel")
|
27
27
|
subcommand :Check, "check", Project.project_filepath("commands/check")
|
28
28
|
end
|
29
|
-
|
29
|
+
ShopifyCLI::Commands.register("Extension::Command", "extension")
|
30
30
|
|
31
31
|
module Tasks
|
32
32
|
autoload :UserErrors, Project.project_filepath("tasks/user_errors")
|
@@ -18,7 +18,7 @@ module Extension
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.help
|
21
|
-
|
21
|
+
ShopifyCLI::Context.new.message("build.help", ShopifyCLI::TOOL_NAME)
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -40,7 +40,7 @@ module Extension
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def run_legacy_flow
|
43
|
-
system =
|
43
|
+
system = ShopifyCLI::JsSystem.new(ctx: @ctx)
|
44
44
|
|
45
45
|
CLI::UI::Frame.open(@ctx.message("build.frame_title", system.package_manager)) do
|
46
46
|
success = system.call(yarn: YARN_BUILD_COMMAND, npm: NPM_BUILD_COMMAND)
|
@@ -4,7 +4,7 @@ require "theme_check"
|
|
4
4
|
module Extension
|
5
5
|
class Command
|
6
6
|
class Check < ExtensionCommand
|
7
|
-
class CheckOptions <
|
7
|
+
class CheckOptions < ShopifyCLI::Options
|
8
8
|
def initialize(ctx, theme_check)
|
9
9
|
super()
|
10
10
|
@theme_check = theme_check
|
@@ -37,7 +37,7 @@ module Extension
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.help
|
40
|
-
|
40
|
+
ShopifyCLI::Context.message("check.help", ShopifyCLI::TOOL_NAME)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Extension
|
4
4
|
class Command
|
5
|
-
class Create <
|
5
|
+
class Create < ShopifyCLI::SubCommand
|
6
6
|
DEVELOPMENT_SERVER_SUPPORTED_TYPES = [
|
7
7
|
"checkout_ui_extension",
|
8
8
|
]
|
@@ -22,27 +22,15 @@ module Extension
|
|
22
22
|
@ctx.abort(message_for_extension["create.errors.directory_exists", form.directory_name])
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
ExtensionProject.write_env_file(
|
30
|
-
context: @ctx,
|
31
|
-
title: form.name,
|
32
|
-
api_key: form.app.api_key,
|
33
|
-
api_secret: form.app.secret
|
34
|
-
)
|
35
|
-
|
36
|
-
@ctx.puts(message_for_extension["create.ready_to_start", form.directory_name, form.name])
|
37
|
-
@ctx.puts(message_for_extension["create.learn_more", form.type.name])
|
38
|
-
else
|
39
|
-
@ctx.puts(message_for_extension["create.try_again"])
|
40
|
-
end
|
25
|
+
ShopifyCLI::Result.success(supports_development_server?(form.type.identifier))
|
26
|
+
.then { |supported| create_extension(supported, form) }
|
27
|
+
.then { notify_success(form, message_for_extension) }
|
28
|
+
.unwrap { |err| @ctx.puts(message_for_extension["create.try_again"]) unless err.nil? }
|
41
29
|
end
|
42
30
|
end
|
43
31
|
|
44
32
|
def self.help
|
45
|
-
@ctx.message("create.help",
|
33
|
+
@ctx.message("create.help", ShopifyCLI::TOOL_NAME)
|
46
34
|
end
|
47
35
|
|
48
36
|
private
|
@@ -55,22 +43,52 @@ module Extension
|
|
55
43
|
end
|
56
44
|
|
57
45
|
def supports_development_server?(type)
|
58
|
-
Models::DevelopmentServerRequirements.supported?(type
|
46
|
+
Models::DevelopmentServerRequirements.supported?(type)
|
59
47
|
end
|
60
48
|
|
61
|
-
def
|
49
|
+
def create_extension(supported, form)
|
50
|
+
if supported
|
51
|
+
use_new_create_flow(form)
|
52
|
+
else
|
53
|
+
use_legacy_flow(form)
|
54
|
+
end
|
55
|
+
ShopifyCLI::Result.success(nil)
|
56
|
+
end
|
57
|
+
|
58
|
+
def use_new_create_flow(form)
|
62
59
|
Tasks::RunExtensionCommand.new(
|
63
60
|
root_dir: form.directory_name,
|
64
61
|
template: form.template,
|
65
62
|
type: form.type.identifier.downcase,
|
66
63
|
command: "create"
|
67
64
|
).call
|
65
|
+
@ctx.chdir(form.directory_name)
|
66
|
+
write_env_file(form)
|
67
|
+
rescue => error
|
68
|
+
raise error
|
69
|
+
end
|
70
|
+
|
71
|
+
def use_legacy_flow(form)
|
72
|
+
if form.type.create(form.directory_name, @ctx, getting_started: options.flags[:getting_started])
|
73
|
+
write_env_file(form)
|
74
|
+
else
|
75
|
+
raise StandardError
|
76
|
+
end
|
77
|
+
end
|
68
78
|
|
79
|
+
def write_env_file(form)
|
80
|
+
ExtensionProject.write_cli_file(context: @ctx, type: form.type.identifier)
|
81
|
+
ExtensionProject.write_env_file(
|
82
|
+
context: @ctx,
|
83
|
+
title: form.name,
|
84
|
+
api_key: form.app.api_key,
|
85
|
+
api_secret: form.app.secret
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
def notify_success(form, msg)
|
69
90
|
@ctx.puts(msg["create.ready_to_start", form.directory_name, form.name])
|
70
91
|
@ctx.puts(msg["create.learn_more", form.type.name])
|
71
|
-
rescue => error
|
72
|
-
@ctx.debug(error)
|
73
|
-
@ctx.puts(msg["create.try_again"])
|
74
92
|
end
|
75
93
|
end
|
76
94
|
end
|
@@ -20,7 +20,7 @@ module Extension
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.help
|
23
|
-
|
23
|
+
ShopifyCLI::Context.new.message("register.help", ShopifyCLI::TOOL_NAME)
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
@@ -60,7 +60,7 @@ module Extension
|
|
60
60
|
|
61
61
|
def abort_not_registered
|
62
62
|
@ctx.puts(@ctx.message("register.confirm_abort"))
|
63
|
-
raise
|
63
|
+
raise ShopifyCLI::AbortSilent
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -29,7 +29,7 @@ module Extension
|
|
29
29
|
resource_url: options.flags[:resource_url]
|
30
30
|
)
|
31
31
|
|
32
|
-
|
32
|
+
ShopifyCLI::Result
|
33
33
|
.success(config)
|
34
34
|
.then(&method(:find_available_port))
|
35
35
|
.then(&method(:start_tunnel_if_required))
|
@@ -38,7 +38,7 @@ module Extension
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.help
|
41
|
-
|
41
|
+
ShopifyCLI::Context.new.message("serve.help", ShopifyCLI::TOOL_NAME)
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
@@ -66,12 +66,12 @@ module Extension
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def can_start_tunnel?(runtime_configuration)
|
69
|
-
return true if
|
70
|
-
|
69
|
+
return true if ShopifyCLI::Tunnel.urls.empty?
|
70
|
+
ShopifyCLI::Tunnel.running_on?(runtime_configuration.port)
|
71
71
|
end
|
72
72
|
|
73
73
|
def start_tunnel(runtime_configuration)
|
74
|
-
tunnel_url =
|
74
|
+
tunnel_url = ShopifyCLI::Tunnel.start(@ctx, port: runtime_configuration.port)
|
75
75
|
runtime_configuration.tap { |c| c.tunnel_url = tunnel_url }
|
76
76
|
end
|
77
77
|
|
@@ -21,25 +21,25 @@ module Extension
|
|
21
21
|
|
22
22
|
case subcommand
|
23
23
|
when AUTH_SUBCOMMAND then authorize(args)
|
24
|
-
when START_SUBCOMMAND then
|
25
|
-
when STOP_SUBCOMMAND then
|
24
|
+
when START_SUBCOMMAND then ShopifyCLI::Tunnel.start(@ctx, port: port)
|
25
|
+
when STOP_SUBCOMMAND then ShopifyCLI::Tunnel.stop(@ctx)
|
26
26
|
when STATUS_SUBCOMMAND then status
|
27
27
|
else @ctx.puts(self.class.help)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.help
|
32
|
-
|
32
|
+
ShopifyCLI::Context.message("tunnel.help", ShopifyCLI::TOOL_NAME)
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.extended_help
|
36
|
-
|
36
|
+
ShopifyCLI::Context.message("tunnel.extended_help", ShopifyCLI::TOOL_NAME, DEFAULT_PORT)
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
41
|
def status
|
42
|
-
tunnel_urls =
|
42
|
+
tunnel_urls = ShopifyCLI::Tunnel.urls
|
43
43
|
tunnel_url = tunnel_urls.find { |url| url.start_with?("https://") }
|
44
44
|
tunnel_url = tunnel_urls.first if tunnel_url.nil?
|
45
45
|
|
@@ -65,7 +65,7 @@ module Extension
|
|
65
65
|
@ctx.puts(@ctx.message("tunnel.missing_token"))
|
66
66
|
@ctx.puts("#{self.class.help}\n#{self.class.extended_help}")
|
67
67
|
else
|
68
|
-
|
68
|
+
ShopifyCLI::Tunnel.auth(@ctx, token)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -3,10 +3,10 @@ require "shopify_cli"
|
|
3
3
|
require "securerandom"
|
4
4
|
|
5
5
|
module Extension
|
6
|
-
class ExtensionProject <
|
6
|
+
class ExtensionProject < ShopifyCLI::Project
|
7
7
|
class << self
|
8
8
|
def write_cli_file(context:, type:)
|
9
|
-
|
9
|
+
ShopifyCLI::Project.write(
|
10
10
|
context,
|
11
11
|
project_type: :extension,
|
12
12
|
organization_id: nil,
|
@@ -42,7 +42,7 @@ module Extension
|
|
42
42
|
resource_url: nil,
|
43
43
|
shop: nil
|
44
44
|
)
|
45
|
-
|
45
|
+
ShopifyCLI::Resources::EnvFile.new(
|
46
46
|
api_key: api_key,
|
47
47
|
secret: api_secret,
|
48
48
|
shop: shop,
|
@@ -134,7 +134,7 @@ module Extension
|
|
134
134
|
|
135
135
|
def validate_env_present
|
136
136
|
return if env
|
137
|
-
raise
|
137
|
+
raise ShopifyCLI::Abort, "Missing .env file. Run `shopify extension connect` to generate an .env file."
|
138
138
|
end
|
139
139
|
|
140
140
|
def integer?(value)
|
@@ -24,7 +24,7 @@ module Extension
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def config(context)
|
27
|
-
js_system =
|
27
|
+
js_system = ShopifyCLI::JsSystem.new(ctx: context)
|
28
28
|
if js_system.package_manager == "yarn"
|
29
29
|
run_yarn_install(context, js_system)
|
30
30
|
run_yarn_run_script(context, js_system)
|
@@ -42,7 +42,7 @@ module Extension
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def renderer_package(context)
|
45
|
-
js_system =
|
45
|
+
js_system = ShopifyCLI::JsSystem.new(ctx: context)
|
46
46
|
Tasks::FindNpmPackages
|
47
47
|
.exactly_one_of(renderer_package_name, js_system: js_system)
|
48
48
|
.unwrap { |err| raise err }
|
@@ -21,7 +21,7 @@ module Extension
|
|
21
21
|
return {} if config.nil?
|
22
22
|
|
23
23
|
unless config.is_a?(Hash)
|
24
|
-
raise
|
24
|
+
raise ShopifyCLI::Abort, ShopifyCLI::Context.message("core.yaml.error.not_hash", CONFIG_FILE_NAME)
|
25
25
|
end
|
26
26
|
|
27
27
|
config.transform_keys!(&:to_sym)
|
@@ -30,8 +30,8 @@ module Extension
|
|
30
30
|
config
|
31
31
|
rescue Psych::SyntaxError => e
|
32
32
|
raise(
|
33
|
-
|
34
|
-
|
33
|
+
ShopifyCLI::Abort,
|
34
|
+
ShopifyCLI::Context.message("core.yaml.error.invalid", CONFIG_FILE_NAME, e.message)
|
35
35
|
)
|
36
36
|
end
|
37
37
|
end
|
@@ -45,8 +45,8 @@ module Extension
|
|
45
45
|
|
46
46
|
unless unpermitted_keys.empty?
|
47
47
|
raise(
|
48
|
-
|
49
|
-
|
48
|
+
ShopifyCLI::Abort,
|
49
|
+
ShopifyCLI::Context.message(
|
50
50
|
"features.argo.config.unpermitted_keys",
|
51
51
|
CONFIG_FILE_NAME,
|
52
52
|
unpermitted_keys.map { |k| "\n- #{k}" }.join
|