shopify-cli 2.3.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/shopify.yml +104 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +14 -14
- data/.rubocop_todo.yml +3 -3
- data/CHANGELOG.md +26 -0
- data/CONTRIBUTING.md +23 -0
- data/Dockerfile +17 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +67 -24
- data/README.md +1 -1
- data/RELEASING.md +1 -1
- data/Rakefile +75 -18
- data/bin/console +11 -0
- data/bin/shopify +17 -4
- data/dev.yml +14 -1
- data/ext/shopify-cli/extconf.rb +2 -0
- data/ext/shopify-extensions/extconf.rb +21 -0
- data/ext/shopify-extensions/shopify_extensions.rb +152 -0
- data/ext/shopify-extensions/version +1 -0
- data/lib/project_types/extension/cli.rb +19 -3
- data/lib/project_types/extension/commands/build.rb +32 -3
- 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 +59 -16
- 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 +3 -3
- data/lib/project_types/extension/features/argo_config.rb +5 -5
- data/lib/project_types/extension/features/argo_serve.rb +21 -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 +6 -3
- 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 +44 -0
- 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/messages/messages.rb +3 -0
- data/lib/project_types/extension/models/development_server.rb +78 -0
- data/lib/project_types/extension/models/development_server_requirements.rb +35 -0
- data/lib/project_types/extension/models/lazy_specification_handler.rb +1 -1
- data/lib/project_types/extension/models/server_config/base.rb +31 -0
- data/lib/project_types/extension/models/server_config/development.rb +23 -0
- data/lib/project_types/extension/models/server_config/development_entries.rb +38 -0
- data/lib/project_types/extension/models/server_config/development_renderer.rb +30 -0
- data/lib/project_types/extension/models/server_config/extension.rb +35 -0
- data/lib/project_types/extension/models/server_config/root.rb +18 -0
- data/lib/project_types/extension/models/server_config/user.rb +10 -0
- data/lib/project_types/extension/models/specification.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/default.rb +14 -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 +2 -2
- 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/converters/server_config_converter.rb +31 -0
- 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 +5 -5
- 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/load_server_config.rb +23 -0
- data/lib/project_types/extension/tasks/run_extension_command.rb +81 -0
- 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 -14
- 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 +15 -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/node/messages/messages.rb +3 -0
- 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 -16
- 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 +16 -6
- data/lib/project_types/script/commands/create.rb +4 -2
- data/lib/project_types/script/commands/push.rb +2 -2
- data/lib/project_types/script/config/extension_points.yml +30 -29
- data/lib/project_types/script/forms/create.rb +1 -1
- data/lib/project_types/script/layers/application/create_script.rb +32 -12
- data/lib/project_types/script/layers/application/extension_points.rb +4 -4
- data/lib/project_types/script/layers/application/push_script.rb +13 -1
- data/lib/project_types/script/layers/domain/extension_point.rb +13 -45
- data/lib/project_types/script/layers/domain/push_package.rb +0 -12
- 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 +57 -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/errors.rb +5 -0
- data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +10 -90
- data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +76 -11
- data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +33 -0
- data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +105 -0
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +6 -6
- data/lib/project_types/script/layers/infrastructure/script_service.rb +25 -144
- data/lib/project_types/script/layers/infrastructure/script_uploader.rb +27 -0
- data/lib/project_types/script/layers/infrastructure/service_locator.rb +20 -0
- data/lib/project_types/script/messages/messages.rb +4 -0
- data/lib/project_types/script/tasks/ensure_env.rb +7 -7
- data/lib/project_types/script/ui/error_handler.rb +84 -76
- 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 +12 -8
- data/lib/shopify_cli/command/app_sub_command.rb +16 -0
- 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/constants.rb +54 -0
- 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 +8 -4
- 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/environment.rb +91 -0
- data/lib/shopify_cli/exception_reporter/permission_controller.rb +54 -0
- data/lib/shopify_cli/exception_reporter.rb +55 -0
- 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 +38 -8
- 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 +24 -31
- 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 +44 -2
- data/lib/{shopify-cli → shopify_cli}/method_object.rb +15 -8
- data/lib/shopify_cli/migrator/migration.rb +27 -0
- data/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +13 -0
- data/lib/shopify_cli/migrator.rb +48 -0
- 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 +16 -40
- 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 +5 -6
- 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/theme/development_theme.rb +83 -0
- 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 +61 -50
- data/shopify-cli.gemspec +13 -5
- data/utilities/docker.rb +47 -0
- data/utilities/utilities.rb +5 -0
- metadata +155 -97
- data/.github/workflows/build.yml +0 -28
- data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +0 -73
- data/lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb +0 -60
- 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/theme/development_theme.rb +0 -69
- data/lib/shopify-cli/version.rb +0 -3
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PHP
|
|
4
|
+
module Messages
|
|
5
|
+
MESSAGES = {
|
|
6
|
+
php: {
|
|
7
|
+
help: <<~HELP,
|
|
8
|
+
Suite of commands for developing PHP apps with Laravel. See {{command:%1$s php <command> --help}} for usage of each command.
|
|
9
|
+
Usage: {{command:%1$s php [ %2$s ]}}
|
|
10
|
+
HELP
|
|
11
|
+
|
|
12
|
+
connect: {
|
|
13
|
+
connected: "Project now connected to {{green:%s}}",
|
|
14
|
+
help: <<~HELP,
|
|
15
|
+
{{command:%s php connect}}: Connects an existing PHP app to Shopify CLI. Creates a config file.
|
|
16
|
+
Usage: {{command:%s php connect}}
|
|
17
|
+
HELP
|
|
18
|
+
production_warning: <<~MESSAGE,
|
|
19
|
+
{{yellow:! Warning: if you have connected to an {{bold:app in production}}, running {{command:serve}} may update the app URL and cause an outage.
|
|
20
|
+
MESSAGE
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
create: {
|
|
24
|
+
help: <<~HELP,
|
|
25
|
+
{{command:%s create php}}: Creates an embedded PHP app.
|
|
26
|
+
Usage: {{command:%s create php}}
|
|
27
|
+
Options:
|
|
28
|
+
{{command:--name=NAME}} App name. Any string.
|
|
29
|
+
{{command:--organization-id=ID}} Partner organization ID. Must be an existing organization.
|
|
30
|
+
{{command:--shop-domain=MYSHOPIFYDOMAIN}} Development store URL. Must be an existing development store.
|
|
31
|
+
{{command:--type=APPTYPE}} Whether this app is public or custom.
|
|
32
|
+
{{command:--verbose}} Output verbose information when installing dependencies.
|
|
33
|
+
HELP
|
|
34
|
+
|
|
35
|
+
error: {
|
|
36
|
+
php_required: <<~VERSION,
|
|
37
|
+
PHP is required to create an app project. For installation instructions, visit:
|
|
38
|
+
{{underline:https://www.php.net/manual/en/install.php}}
|
|
39
|
+
VERSION
|
|
40
|
+
php_version_failure: <<~VERSION,
|
|
41
|
+
Failed to get the current PHP version. Please make sure it is installed as per the instructions at:
|
|
42
|
+
{{underline:https://www.php.net/manual/en/install.php.}}
|
|
43
|
+
VERSION
|
|
44
|
+
php_version_too_low: "Your PHP version is too low. Please use version %s or higher.",
|
|
45
|
+
composer_required: <<~COMPOSER,
|
|
46
|
+
Composer is required to create an app project. Download at:
|
|
47
|
+
{{underline:https://getcomposer.org/download/}}
|
|
48
|
+
COMPOSER
|
|
49
|
+
npm_required: "npm is required to create an app project. Download at https://www.npmjs.com/get-npm.",
|
|
50
|
+
npm_version_failure: "Failed to get the current npm version. Please make sure it is installed as per " \
|
|
51
|
+
"the instructions at https://www.npmjs.com/get-npm.",
|
|
52
|
+
app_setup: "Failed to set up the app",
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
php_version: "PHP %s",
|
|
56
|
+
npm_version: "npm %s",
|
|
57
|
+
app_setting_up: "Setting up app…",
|
|
58
|
+
app_set_up: "App is now set up",
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
open: {
|
|
62
|
+
help: <<~HELP,
|
|
63
|
+
Open your local development app in the default browser.
|
|
64
|
+
Usage: {{command:%s open}}
|
|
65
|
+
HELP
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
deploy: {
|
|
69
|
+
help: <<~HELP,
|
|
70
|
+
Deploy the current PHP project to a hosting service. Heroku ({{underline:https://www.heroku.com}}) is currently the only option, but more will be added in the future.
|
|
71
|
+
Usage: {{command:%s deploy [ heroku ]}}
|
|
72
|
+
HELP
|
|
73
|
+
|
|
74
|
+
extended_help: <<~HELP,
|
|
75
|
+
{{bold:Subcommands:}}
|
|
76
|
+
{{cyan:heroku}}: Deploys the current PHP project to Heroku.
|
|
77
|
+
Usage: {{command:%s deploy heroku}}
|
|
78
|
+
HELP
|
|
79
|
+
|
|
80
|
+
heroku: {
|
|
81
|
+
help: <<~HELP,
|
|
82
|
+
Deploy the current PHP project to Heroku
|
|
83
|
+
Usage: {{command:%s deploy heroku}}
|
|
84
|
+
HELP
|
|
85
|
+
|
|
86
|
+
error: {
|
|
87
|
+
generate_app_key: "Failed to generate Laravel APP_KEY",
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
downloading: "Downloading Heroku CLI…",
|
|
91
|
+
downloaded: "Downloaded Heroku CLI",
|
|
92
|
+
installing: "Installing Heroku CLI…",
|
|
93
|
+
installing_windows: "Running Heroku CLI install wizard…",
|
|
94
|
+
installed: "Installed Heroku CLI",
|
|
95
|
+
authenticating: "Authenticating with Heroku…",
|
|
96
|
+
authenticated: "{{v}} Authenticated with Heroku",
|
|
97
|
+
authenticated_with_account: "{{v}} Authenticated with Heroku as `%s`",
|
|
98
|
+
deploying: "Deploying to Heroku…",
|
|
99
|
+
deployed: "Deployed to Heroku",
|
|
100
|
+
post_deploy: <<~DEPLOYED,
|
|
101
|
+
{{v}} Deployed to Heroku, you can access your app at {{green:%s}}
|
|
102
|
+
|
|
103
|
+
If you're deploying this app for the first time, make sure to set up your database and your app's environment at {{bold:App dashboard -> Settings -> Config Vars}}.
|
|
104
|
+
|
|
105
|
+
When setting your config vars, don't forget to set up your database and the appropriate Laravel values for it, particularly {{bold:DB_CONNECTION and DB_DATABASE}}.
|
|
106
|
+
DEPLOYED
|
|
107
|
+
git: {
|
|
108
|
+
checking: "Checking git repo…",
|
|
109
|
+
initialized: "Git repo initialized",
|
|
110
|
+
what_branch: "What branch would you like to deploy?",
|
|
111
|
+
branch_selected: "{{v}} Git branch `%s` selected for deploy",
|
|
112
|
+
},
|
|
113
|
+
app: {
|
|
114
|
+
no_apps_found: "No existing Heroku app found. What would you like to do?",
|
|
115
|
+
name: "What is your Heroku app’s name?",
|
|
116
|
+
select: "Specify an existing Heroku app",
|
|
117
|
+
selecting: "Selecting Heroku app `%s`…",
|
|
118
|
+
selected: "{{v}} Heroku app `%s` selected",
|
|
119
|
+
create: "Create a new Heroku app",
|
|
120
|
+
creating: "Creating new Heroku app…",
|
|
121
|
+
created: "{{v}} New Heroku app created",
|
|
122
|
+
setting_configs: "Setting Shopify app configs…",
|
|
123
|
+
configs_set: "{{v}} Shopify app configs set",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
serve: {
|
|
129
|
+
help: <<~HELP,
|
|
130
|
+
Start a local development PHP server for your project, as well as a public ngrok tunnel to your localhost.
|
|
131
|
+
Usage: {{command:%s serve}}
|
|
132
|
+
HELP
|
|
133
|
+
extended_help: <<~HELP,
|
|
134
|
+
{{bold:Options:}}
|
|
135
|
+
{{cyan:--host=HOST}}: Bypass running tunnel and use custom host. HOST must be HTTPS url.
|
|
136
|
+
HELP
|
|
137
|
+
|
|
138
|
+
error: {
|
|
139
|
+
host_must_be_https: "HOST must be a HTTPS url.",
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
open_info: <<~MESSAGE,
|
|
143
|
+
{{*}} To install and start using your app, open this URL in your browser:
|
|
144
|
+
{{green:%s}}
|
|
145
|
+
MESSAGE
|
|
146
|
+
running_server: "Running server…",
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
tunnel: {
|
|
150
|
+
help: <<~HELP,
|
|
151
|
+
Start or stop an http tunnel to your local development app using ngrok.
|
|
152
|
+
Usage: {{command:%s tunnel [ auth | start | stop ]}}
|
|
153
|
+
HELP
|
|
154
|
+
extended_help: <<~HELP,
|
|
155
|
+
{{bold:Subcommands:}}
|
|
156
|
+
|
|
157
|
+
{{cyan:auth}}: Writes an ngrok auth token to ~/.ngrok2/ngrok.yml to connect with an ngrok account. Visit https://dashboard.ngrok.com/signup to sign up.
|
|
158
|
+
Usage: {{command:%1$s tunnel auth <token>}}
|
|
159
|
+
|
|
160
|
+
{{cyan:start}}: Starts an ngrok tunnel, will print the URL for an existing tunnel if already running.
|
|
161
|
+
Usage: {{command:%1$s tunnel start}}
|
|
162
|
+
|
|
163
|
+
{{cyan:stop}}: Stops the ngrok tunnel.
|
|
164
|
+
Usage: {{command:%1$s tunnel stop}}
|
|
165
|
+
|
|
166
|
+
HELP
|
|
167
|
+
|
|
168
|
+
error: {
|
|
169
|
+
token_argument_missing: "{{x}} {{red:auth requires a token argument}}\n\n",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
forms: {
|
|
174
|
+
create: {
|
|
175
|
+
error: {
|
|
176
|
+
invalid_app_name: "App name cannot contain 'Shopify'",
|
|
177
|
+
invalid_app_type: "Invalid app type %s",
|
|
178
|
+
},
|
|
179
|
+
app_name: "App name",
|
|
180
|
+
app_type: {
|
|
181
|
+
select: "What type of app are you building?",
|
|
182
|
+
select_public: "Public: An app built for a wide merchant audience.",
|
|
183
|
+
select_custom: "Custom: An app custom built for a single client.",
|
|
184
|
+
selected: "App type {{green:%s}}",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}.freeze
|
|
190
|
+
end
|
|
191
|
+
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module Rails
|
|
3
|
-
class Project <
|
|
3
|
+
class Project < ShopifyCLI::ProjectType
|
|
4
4
|
require Project.project_filepath("messages/messages")
|
|
5
5
|
register_messages(Rails::Messages::MESSAGES)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
# define/autoload project specific Commands
|
|
9
|
-
class Command <
|
|
9
|
+
class Command < ShopifyCLI::ProjectCommands
|
|
10
10
|
subcommand :Connect, "connect", Project.project_filepath("commands/connect")
|
|
11
11
|
subcommand :Create, "create", Project.project_filepath("commands/create")
|
|
12
12
|
subcommand :Deploy, "deploy", Project.project_filepath("commands/deploy")
|
|
@@ -15,7 +15,7 @@ module Rails
|
|
|
15
15
|
subcommand :Serve, "serve", Project.project_filepath("commands/serve")
|
|
16
16
|
subcommand :Tunnel, "tunnel", Project.project_filepath("commands/tunnel")
|
|
17
17
|
end
|
|
18
|
-
|
|
18
|
+
ShopifyCLI::Commands.register("Rails::Command", "rails")
|
|
19
19
|
|
|
20
20
|
# define/autoload project specific Tasks
|
|
21
21
|
module Tasks
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module Rails
|
|
3
3
|
class Command
|
|
4
|
-
class Connect <
|
|
4
|
+
class Connect < ShopifyCLI::SubCommand
|
|
5
5
|
prerequisite_task ensure_project_type: :rails
|
|
6
6
|
|
|
7
7
|
def call(*)
|
|
8
|
-
if
|
|
8
|
+
if ShopifyCLI::Project.has_current? && ShopifyCLI::Project.current.env
|
|
9
9
|
@ctx.puts(@ctx.message("rails.connect.production_warning"))
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
app =
|
|
12
|
+
app = ShopifyCLI::Connect.new(@ctx).default_connect("rails")
|
|
13
13
|
@ctx.done(@ctx.message("rails.connect.connected", app))
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.help
|
|
17
|
-
|
|
17
|
+
ShopifyCLI::Context.message("rails.connect.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module Rails
|
|
3
3
|
class Command
|
|
4
|
-
class Create <
|
|
4
|
+
class Create < ShopifyCLI::SubCommand
|
|
5
5
|
prerequisite_task :ensure_authenticated
|
|
6
6
|
|
|
7
7
|
USER_AGENT_CODE = <<~USERAGENT
|
|
@@ -43,37 +43,37 @@ module Rails
|
|
|
43
43
|
|
|
44
44
|
build(form.name, form.db)
|
|
45
45
|
set_custom_ua
|
|
46
|
-
|
|
46
|
+
ShopifyCLI::Project.write(
|
|
47
47
|
@ctx,
|
|
48
48
|
project_type: "rails",
|
|
49
49
|
organization_id: form.organization_id,
|
|
50
50
|
)
|
|
51
51
|
|
|
52
|
-
api_client =
|
|
52
|
+
api_client = ShopifyCLI::Tasks::CreateApiClient.call(
|
|
53
53
|
@ctx,
|
|
54
54
|
org_id: form.organization_id,
|
|
55
55
|
title: form.title,
|
|
56
56
|
type: form.type,
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
ShopifyCLI::Resources::EnvFile.new(
|
|
60
60
|
api_key: api_client["apiKey"],
|
|
61
61
|
secret: api_client["apiSecretKeys"].first["secret"],
|
|
62
62
|
shop: form.shop_domain,
|
|
63
63
|
scopes: "write_products,write_customers,write_draft_orders",
|
|
64
64
|
).write(@ctx)
|
|
65
65
|
|
|
66
|
-
partners_url =
|
|
66
|
+
partners_url = ShopifyCLI::PartnersAPI.partners_url_for(form.organization_id, api_client["id"])
|
|
67
67
|
|
|
68
68
|
@ctx.puts(@ctx.message("apps.create.info.created", form.title, partners_url))
|
|
69
|
-
@ctx.puts(@ctx.message("apps.create.info.serve", form.name,
|
|
70
|
-
unless
|
|
69
|
+
@ctx.puts(@ctx.message("apps.create.info.serve", form.name, ShopifyCLI::TOOL_NAME, "rails"))
|
|
70
|
+
unless ShopifyCLI::Shopifolk.acting_as_shopify_organization?
|
|
71
71
|
@ctx.puts(@ctx.message("apps.create.info.install", partners_url, form.title))
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def self.help
|
|
76
|
-
|
|
76
|
+
ShopifyCLI::Context.message("rails.create.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
private
|
|
@@ -84,7 +84,7 @@ module Rails
|
|
|
84
84
|
@ctx.abort(@ctx.message("rails.create.error.node_required")) unless @ctx.windows?
|
|
85
85
|
@ctx.puts("{{x}} {{red:" + @ctx.message("rails.create.error.node_required") + "}}")
|
|
86
86
|
@ctx.puts(@ctx.message("rails.create.info.open_new_shell", "node"))
|
|
87
|
-
raise
|
|
87
|
+
raise ShopifyCLI::AbortSilent
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
version, stat = @ctx.capture2e("node", "-v")
|
|
@@ -93,7 +93,7 @@ module Rails
|
|
|
93
93
|
# execution stops above if not Windows
|
|
94
94
|
@ctx.puts("{{x}} {{red:" + @ctx.message("rails.create.error.node_version_failure") + "}}")
|
|
95
95
|
@ctx.puts(@ctx.message("rails.create.info.open_new_shell", "node"))
|
|
96
|
-
raise
|
|
96
|
+
raise ShopifyCLI::AbortSilent
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
@ctx.done(@ctx.message("rails.create.node_version", version))
|
|
@@ -105,7 +105,7 @@ module Rails
|
|
|
105
105
|
@ctx.abort(@ctx.message("rails.create.error.yarn_required")) unless @ctx.windows?
|
|
106
106
|
@ctx.puts("{{x}} {{red:" + @ctx.message("rails.create.error.yarn_required") + "}}")
|
|
107
107
|
@ctx.puts(@ctx.message("rails.create.info.open_new_shell", "yarn"))
|
|
108
|
-
raise
|
|
108
|
+
raise ShopifyCLI::AbortSilent
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
version, stat = @ctx.capture2e("yarn", "-v")
|
|
@@ -113,7 +113,7 @@ module Rails
|
|
|
113
113
|
@ctx.abort(@ctx.message("rails.create.error.yarn_version_failure")) unless @ctx.windows?
|
|
114
114
|
@ctx.puts("{{x}} {{red:" + @ctx.message("rails.create.error.yarn_version_failure") + "}}")
|
|
115
115
|
@ctx.puts(@ctx.message("rails.create.info.open_new_shell", "yarn"))
|
|
116
|
-
raise
|
|
116
|
+
raise ShopifyCLI::AbortSilent
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
@ctx.done(@ctx.message("rails.create.yarn_version", version))
|
|
@@ -178,10 +178,6 @@ module Rails
|
|
|
178
178
|
def install_gem(name, version = nil)
|
|
179
179
|
Gem.install(@ctx, name, version)
|
|
180
180
|
end
|
|
181
|
-
|
|
182
|
-
def local_debug?
|
|
183
|
-
@ctx.getenv(ShopifyCli::PartnersAPI::LOCAL_DEBUG)
|
|
184
|
-
end
|
|
185
181
|
end
|
|
186
182
|
end
|
|
187
183
|
end
|
|
@@ -9,7 +9,7 @@ module Rails
|
|
|
9
9
|
DB_CHECK_CMD = 'bundle exec rails runner "puts ActiveRecord::Base.connection.adapter_name.downcase"'
|
|
10
10
|
|
|
11
11
|
def help
|
|
12
|
-
|
|
12
|
+
ShopifyCLI::Context.message("rails.deploy.heroku.help", ShopifyCLI::TOOL_NAME)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def start(ctx)
|
|
@@ -23,7 +23,7 @@ module Rails
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
spin_group = CLI::UI::SpinGroup.new
|
|
26
|
-
heroku_service =
|
|
26
|
+
heroku_service = ShopifyCLI::Heroku.new(ctx)
|
|
27
27
|
|
|
28
28
|
spin_group.add(ctx.message("rails.deploy.heroku.downloading")) do |spinner|
|
|
29
29
|
heroku_service.download
|
|
@@ -36,7 +36,7 @@ module Rails
|
|
|
36
36
|
spinner.update_title(ctx.message("rails.deploy.heroku.installed"))
|
|
37
37
|
end
|
|
38
38
|
spin_group.add(ctx.message("rails.deploy.heroku.git.checking")) do |spinner|
|
|
39
|
-
|
|
39
|
+
ShopifyCLI::Git.init(ctx)
|
|
40
40
|
spinner.update_title(ctx.message("rails.deploy.heroku.git.initialized"))
|
|
41
41
|
end
|
|
42
42
|
spin_group.wait
|
|
@@ -78,7 +78,7 @@ module Rails
|
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
branches =
|
|
81
|
+
branches = ShopifyCLI::Git.branches(ctx)
|
|
82
82
|
if branches.length == 1
|
|
83
83
|
branch_to_deploy = branches[0]
|
|
84
84
|
ctx.puts(ctx.message("rails.deploy.heroku.git.branch_selected", branch_to_deploy))
|
|
@@ -3,7 +3,7 @@ require "shopify_cli"
|
|
|
3
3
|
|
|
4
4
|
module Rails
|
|
5
5
|
class Command
|
|
6
|
-
class Deploy <
|
|
6
|
+
class Deploy < ShopifyCLI::SubCommand
|
|
7
7
|
prerequisite_task ensure_project_type: :rails
|
|
8
8
|
|
|
9
9
|
autoload :Heroku, Project.project_filepath("commands/deploy/heroku")
|
|
@@ -21,11 +21,11 @@ module Rails
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.help
|
|
24
|
-
|
|
24
|
+
ShopifyCLI::Context.message("rails.deploy.help", ShopifyCLI::TOOL_NAME)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def self.extended_help
|
|
28
|
-
|
|
28
|
+
ShopifyCLI::Context.message("rails.deploy.extended_help", ShopifyCLI::TOOL_NAME)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -7,7 +7,7 @@ module Rails
|
|
|
7
7
|
class << self
|
|
8
8
|
def start(ctx, args)
|
|
9
9
|
selected_type = args.first
|
|
10
|
-
schema =
|
|
10
|
+
schema = ShopifyCLI::AdminAPI::Schema.get(ctx)
|
|
11
11
|
webhooks = schema.get_names_from_type("WebhookSubscriptionTopic")
|
|
12
12
|
unless selected_type && webhooks.include?(selected_type)
|
|
13
13
|
selected_type = CLI::UI::Prompt.ask(ctx.message("rails.generate.webhook.select")) do |handler|
|
|
@@ -25,12 +25,12 @@ module Rails
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def help
|
|
28
|
-
|
|
28
|
+
ShopifyCLI::Context.message("rails.generate.webhook.help", ShopifyCLI::TOOL_NAME)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def generate_command(selected_type, ctx)
|
|
32
32
|
parts = selected_type.downcase.split("_")
|
|
33
|
-
host =
|
|
33
|
+
host = ShopifyCLI::Project.current.env.host
|
|
34
34
|
selected_type = parts[0..-2].join("_") + "/" + parts[-1]
|
|
35
35
|
command = ctx.windows? ? "ruby bin\\rails" : "bin/rails"
|
|
36
36
|
"#{command} g shopify_app:add_webhook -t #{selected_type} -a #{host}/webhooks/#{selected_type.downcase}"
|
|
@@ -3,7 +3,7 @@ require "shopify_cli"
|
|
|
3
3
|
|
|
4
4
|
module Rails
|
|
5
5
|
class Command
|
|
6
|
-
class Generate <
|
|
6
|
+
class Generate < ShopifyCLI::SubCommand
|
|
7
7
|
prerequisite_task ensure_project_type: :rails
|
|
8
8
|
|
|
9
9
|
autoload :Webhook, Project.project_filepath("commands/generate/webhook")
|
|
@@ -21,7 +21,7 @@ module Rails
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.help
|
|
24
|
-
|
|
24
|
+
ShopifyCLI::Context.message("rails.generate.help", ShopifyCLI::TOOL_NAME)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def self.extended_help
|
|
@@ -34,7 +34,7 @@ module Rails
|
|
|
34
34
|
end
|
|
35
35
|
extended_help += "\n"
|
|
36
36
|
end
|
|
37
|
-
extended_help +=
|
|
37
|
+
extended_help += ShopifyCLI::Context.message("rails.generate.extended_help", ShopifyCLI::TOOL_NAME)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def self.run_generate(script, name, ctx)
|
|
@@ -2,16 +2,16 @@ require "shopify_cli"
|
|
|
2
2
|
|
|
3
3
|
module Rails
|
|
4
4
|
class Command
|
|
5
|
-
class Open <
|
|
5
|
+
class Open < ShopifyCLI::SubCommand
|
|
6
6
|
prerequisite_task ensure_project_type: :rails
|
|
7
7
|
|
|
8
8
|
def call(*)
|
|
9
|
-
project =
|
|
9
|
+
project = ShopifyCLI::Project.current
|
|
10
10
|
@ctx.open_url!("#{project.env.host}/login?shop=#{project.env.shop}")
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def self.help
|
|
14
|
-
|
|
14
|
+
ShopifyCLI::Context.message("rails.open.help", ShopifyCLI::TOOL_NAME)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
module Rails
|
|
3
3
|
class Command
|
|
4
|
-
class Serve <
|
|
4
|
+
class Serve < ShopifyCLI::SubCommand
|
|
5
5
|
prerequisite_task ensure_project_type: :rails
|
|
6
6
|
prerequisite_task :ensure_env, :ensure_dev_store
|
|
7
7
|
|
|
@@ -12,11 +12,11 @@ module Rails
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def call(*)
|
|
15
|
-
project =
|
|
16
|
-
url = options.flags[:host] ||
|
|
15
|
+
project = ShopifyCLI::Project.current
|
|
16
|
+
url = options.flags[:host] || ShopifyCLI::Tunnel.start(@ctx)
|
|
17
17
|
@ctx.abort(@ctx.message("rails.serve.error.host_must_be_https")) if url.match(/^https/i).nil?
|
|
18
18
|
project.env.update(@ctx, :host, url)
|
|
19
|
-
|
|
19
|
+
ShopifyCLI::Tasks::UpdateDashboardURLS.call(
|
|
20
20
|
@ctx,
|
|
21
21
|
url: url,
|
|
22
22
|
callback_url: "/auth/shopify/callback",
|
|
@@ -28,9 +28,9 @@ module Rails
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
CLI::UI::Frame.open(@ctx.message("rails.serve.running_server")) do
|
|
31
|
-
env =
|
|
31
|
+
env = ShopifyCLI::Project.current.env.to_h
|
|
32
32
|
env.delete("HOST")
|
|
33
|
-
env["PORT"] =
|
|
33
|
+
env["PORT"] = ShopifyCLI::Tunnel::PORT.to_s
|
|
34
34
|
env["GEM_PATH"] = Gem.gem_path(@ctx)
|
|
35
35
|
if @ctx.windows?
|
|
36
36
|
@ctx.system("ruby bin\\rails server", env: env)
|
|
@@ -41,11 +41,11 @@ module Rails
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def self.help
|
|
44
|
-
|
|
44
|
+
ShopifyCLI::Context.message("rails.serve.help", ShopifyCLI::TOOL_NAME)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def self.extended_help
|
|
48
|
-
|
|
48
|
+
ShopifyCLI::Context.message("rails.serve.extended_help", ShopifyCLI::TOOL_NAME)
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -4,7 +4,7 @@ require "shopify_cli"
|
|
|
4
4
|
|
|
5
5
|
module Rails
|
|
6
6
|
class Command
|
|
7
|
-
class Tunnel <
|
|
7
|
+
class Tunnel < ShopifyCLI::SubCommand
|
|
8
8
|
# subcommands :auth, :start, :stop
|
|
9
9
|
|
|
10
10
|
prerequisite_task ensure_project_type: :rails
|
|
@@ -18,23 +18,23 @@ module Rails
|
|
|
18
18
|
@ctx.puts(@ctx.message("rails.tunnel.error.token_argument_missing"))
|
|
19
19
|
@ctx.puts("#{self.class.help}\n#{self.class.extended_help}")
|
|
20
20
|
else
|
|
21
|
-
|
|
21
|
+
ShopifyCLI::Tunnel.auth(@ctx, token)
|
|
22
22
|
end
|
|
23
23
|
when "start"
|
|
24
|
-
|
|
24
|
+
ShopifyCLI::Tunnel.start(@ctx)
|
|
25
25
|
when "stop"
|
|
26
|
-
|
|
26
|
+
ShopifyCLI::Tunnel.stop(@ctx)
|
|
27
27
|
else
|
|
28
28
|
@ctx.puts(self.class.help)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def self.help
|
|
33
|
-
|
|
33
|
+
ShopifyCLI::Context.message("rails.tunnel.help", ShopifyCLI::TOOL_NAME)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def self.extended_help
|
|
37
|
-
|
|
37
|
+
ShopifyCLI::Context.message("rails.tunnel.extended_help", ShopifyCLI::TOOL_NAME)
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
|
@@ -2,7 +2,7 @@ require "uri"
|
|
|
2
2
|
|
|
3
3
|
module Rails
|
|
4
4
|
module Forms
|
|
5
|
-
class Create <
|
|
5
|
+
class Create < ShopifyCLI::Form
|
|
6
6
|
attr_accessor :name
|
|
7
7
|
flag_arguments :title, :organization_id, :shop_domain, :type, :db
|
|
8
8
|
VALID_DB_TYPES = ["sqlite3",
|
|
@@ -22,7 +22,7 @@ module Rails
|
|
|
22
22
|
self.title ||= CLI::UI::Prompt.ask(ctx.message("rails.forms.create.app_name"))
|
|
23
23
|
self.name = format_name
|
|
24
24
|
self.type = ask_type
|
|
25
|
-
res =
|
|
25
|
+
res = ShopifyCLI::Tasks::SelectOrgAndShop.call(ctx, organization_id: organization_id, shop_domain: shop_domain)
|
|
26
26
|
self.organization_id = res[:organization_id]
|
|
27
27
|
self.shop_domain = res[:shop_domain]
|
|
28
28
|
self.db = ask_db
|
|
@@ -48,7 +48,7 @@ module Rails
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
unless
|
|
51
|
+
unless ShopifyCLI::Tasks::CreateApiClient::VALID_APP_TYPES.include?(type)
|
|
52
52
|
ctx.abort(ctx.message("rails.forms.create.error.invalid_app_type", type))
|
|
53
53
|
end
|
|
54
54
|
ctx.puts(ctx.message("rails.forms.create.app_type.selected", type))
|
|
@@ -5,7 +5,7 @@ module Rails
|
|
|
5
5
|
class Gem
|
|
6
6
|
include SmartProperties
|
|
7
7
|
|
|
8
|
-
property :ctx, accepts:
|
|
8
|
+
property :ctx, accepts: ShopifyCLI::Context, required: true
|
|
9
9
|
property :name, converts: :to_s, required: true
|
|
10
10
|
property :version, converts: :to_s
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Script
|
|
4
|
-
class Project <
|
|
4
|
+
class Project < ShopifyCLI::ProjectType
|
|
5
5
|
hidden_feature(feature_set: :script_project)
|
|
6
6
|
|
|
7
7
|
require Project.project_filepath("messages/messages")
|
|
@@ -9,12 +9,12 @@ module Script
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
# define/autoload project specific Commands
|
|
12
|
-
class Command <
|
|
12
|
+
class Command < ShopifyCLI::ProjectCommands
|
|
13
13
|
hidden_feature(feature_set: :script_project)
|
|
14
14
|
subcommand :Create, "create", Project.project_filepath("commands/create")
|
|
15
15
|
subcommand :Push, "push", Project.project_filepath("commands/push")
|
|
16
16
|
end
|
|
17
|
-
|
|
17
|
+
ShopifyCLI::Commands.register("Script::Command", "script")
|
|
18
18
|
|
|
19
19
|
# define/autoload project specific Forms
|
|
20
20
|
module Forms
|
|
@@ -51,6 +51,8 @@ module Script
|
|
|
51
51
|
autoload :ExtensionPointRepository, Project.project_filepath("layers/infrastructure/extension_point_repository")
|
|
52
52
|
autoload :ScriptProjectRepository, Project.project_filepath("layers/infrastructure/script_project_repository")
|
|
53
53
|
autoload :ScriptService, Project.project_filepath("layers/infrastructure/script_service")
|
|
54
|
+
autoload :ScriptUploader, Project.project_filepath("layers/infrastructure/script_uploader")
|
|
55
|
+
autoload :ServiceLocator, Project.project_filepath("layers/infrastructure/service_locator")
|
|
54
56
|
|
|
55
57
|
module Languages
|
|
56
58
|
autoload :AssemblyScriptProjectCreator,
|
|
@@ -58,10 +60,18 @@ module Script
|
|
|
58
60
|
autoload :AssemblyScriptTaskRunner,
|
|
59
61
|
Project.project_filepath("layers/infrastructure/languages/assemblyscript_task_runner")
|
|
60
62
|
autoload :ProjectCreator, Project.project_filepath("layers/infrastructure/languages/project_creator")
|
|
61
|
-
autoload :RustProjectCreator,
|
|
62
|
-
Project.project_filepath("layers/infrastructure/languages/rust_project_creator.rb")
|
|
63
|
-
autoload :RustTaskRunner, Project.project_filepath("layers/infrastructure/languages/rust_task_runner")
|
|
64
63
|
autoload :TaskRunner, Project.project_filepath("layers/infrastructure/languages/task_runner")
|
|
64
|
+
autoload :TypeScriptProjectCreator,
|
|
65
|
+
Project.project_filepath("layers/infrastructure/languages/typescript_project_creator.rb")
|
|
66
|
+
autoload :TypeScriptTaskRunner,
|
|
67
|
+
Project.project_filepath("layers/infrastructure/languages/typescript_task_runner.rb")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
module ApiClients
|
|
71
|
+
autoload :PartnersProxyApiClient,
|
|
72
|
+
Project.project_filepath("layers/infrastructure/api_clients/partners_proxy_api_client")
|
|
73
|
+
autoload :ScriptServiceApiClient,
|
|
74
|
+
Project.project_filepath("layers/infrastructure/api_clients/script_service_api_client")
|
|
65
75
|
end
|
|
66
76
|
end
|
|
67
77
|
end
|