shopify-cli 1.14.0 → 2.0.0
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 -1
- data/.github/CONTRIBUTING.md +7 -7
- data/.github/DESIGN.md +3 -3
- data/.github/workflows/build.yml +1 -1
- data/.gitignore +3 -0
- data/.rubocop.yml +3 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +35 -29
- data/Gemfile +4 -0
- data/Gemfile.lock +32 -0
- data/LICENSE +4 -1
- data/README.md +92 -26
- data/RELEASING.md +29 -7
- data/Rakefile +2 -2
- data/SECURITY.md +1 -1
- data/bin/load_shopify.rb +1 -1
- data/bin/shopify +3 -3
- data/dev.yml +1 -1
- data/docs/app/node/index.md +1 -1
- data/docs/app/rails/index.md +1 -1
- data/docs/core/index.md +1 -1
- data/docs/getting-started/index.md +1 -1
- data/docs/getting-started/install/index.md +1 -1
- data/docs/getting-started/migrate/index.md +1 -1
- data/docs/getting-started/uninstall/index.md +1 -1
- data/docs/getting-started/upgrade/index.md +1 -1
- data/docs/help/start-app/index.md +1 -1
- data/docs/index.md +1 -1
- data/ext/shopify-cli/extconf.rb +17 -5
- data/install.sh +1 -1
- data/lib/docgen/index_template.md.erb +2 -2
- data/lib/graphql/all_orgs_with_extensions.graphql +37 -0
- data/lib/graphql/find_organization.graphql +2 -1
- data/lib/project_types/extension/cli.rb +18 -15
- data/lib/project_types/extension/commands/build.rb +4 -5
- data/lib/project_types/extension/commands/connect.rb +35 -0
- data/lib/project_types/extension/commands/create.rb +12 -16
- data/lib/project_types/extension/commands/extension_command.rb +2 -2
- data/lib/project_types/extension/commands/info.rb +86 -0
- data/lib/project_types/extension/commands/push.rb +8 -7
- data/lib/project_types/extension/commands/register.rb +4 -5
- data/lib/project_types/extension/commands/serve.rb +5 -8
- data/lib/project_types/extension/commands/tunnel.rb +3 -1
- data/lib/project_types/extension/errors.rb +9 -0
- data/lib/project_types/extension/extension_project.rb +5 -0
- data/lib/project_types/extension/features/argo.rb +6 -6
- data/lib/project_types/extension/features/argo_runtime.rb +22 -66
- data/lib/project_types/extension/features/argo_serve.rb +25 -18
- data/lib/project_types/extension/forms/connect.rb +42 -0
- data/lib/project_types/extension/forms/questions/ask_name.rb +14 -6
- data/lib/project_types/extension/forms/questions/ask_registration.rb +51 -0
- data/lib/project_types/extension/messages/messages.rb +75 -11
- data/lib/project_types/extension/models/specification.rb +1 -0
- data/lib/project_types/extension/models/specification_handlers/{checkout_argo_extension.rb → checkout_ui_extension.rb} +3 -1
- data/lib/project_types/extension/models/specification_handlers/default.rb +13 -3
- data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +86 -0
- data/lib/project_types/extension/models/specifications.rb +1 -0
- data/lib/project_types/extension/tasks/configure_features.rb +6 -7
- data/lib/project_types/extension/tasks/configure_options.rb +20 -0
- data/lib/project_types/extension/tasks/get_extensions.rb +32 -0
- data/lib/project_types/node/cli.rb +9 -21
- data/lib/project_types/node/commands/connect.rb +8 -2
- data/lib/project_types/node/commands/create.rb +9 -5
- data/lib/project_types/node/commands/deploy.rb +15 -5
- data/lib/project_types/node/commands/deploy/heroku.rb +29 -29
- data/lib/project_types/node/commands/generate.rb +4 -2
- data/lib/project_types/node/commands/open.rb +4 -2
- data/lib/project_types/node/commands/serve.rb +3 -2
- data/lib/project_types/node/commands/tunnel.rb +4 -2
- data/lib/project_types/node/messages/messages.rb +46 -89
- data/lib/project_types/rails/cli.rb +9 -21
- data/lib/project_types/rails/commands/connect.rb +8 -2
- data/lib/project_types/rails/commands/create.rb +10 -6
- data/lib/project_types/rails/commands/deploy.rb +15 -5
- data/lib/project_types/rails/commands/deploy/heroku.rb +84 -82
- data/lib/project_types/rails/commands/generate.rb +15 -5
- data/lib/project_types/rails/commands/generate/webhook.rb +28 -26
- data/lib/project_types/rails/commands/open.rb +4 -2
- data/lib/project_types/rails/commands/serve.rb +3 -2
- data/lib/project_types/rails/commands/tunnel.rb +4 -2
- data/lib/project_types/rails/messages/messages.rb +54 -101
- data/lib/project_types/script/cli.rb +5 -7
- data/lib/project_types/script/commands/create.rb +3 -1
- data/lib/project_types/script/commands/push.rb +4 -2
- data/lib/project_types/script/messages/messages.rb +52 -45
- data/lib/project_types/script/ui/error_handler.rb +2 -2
- data/lib/project_types/theme/cli.rb +15 -27
- data/lib/project_types/theme/commands/check.rb +33 -0
- data/lib/project_types/theme/commands/delete.rb +64 -0
- data/lib/project_types/theme/commands/language_server.rb +16 -0
- data/lib/project_types/theme/commands/package.rb +55 -0
- data/lib/project_types/theme/commands/publish.rb +43 -0
- data/lib/project_types/theme/commands/pull.rb +51 -0
- data/lib/project_types/theme/commands/push.rb +58 -32
- data/lib/project_types/theme/commands/serve.rb +7 -17
- data/lib/project_types/theme/forms/confirm_store.rb +15 -0
- data/lib/project_types/theme/forms/select.rb +59 -0
- data/lib/project_types/theme/messages/messages.rb +110 -106
- data/lib/project_types/theme/ui/sync_progress_bar.rb +20 -0
- data/lib/shopify-cli/admin_api.rb +53 -38
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +6 -14
- data/lib/shopify-cli/admin_api/schema.rb +1 -10
- data/lib/shopify-cli/api.rb +29 -14
- data/lib/shopify-cli/command.rb +15 -3
- data/lib/shopify-cli/commands.rb +7 -2
- data/lib/shopify-cli/commands/help.rb +2 -29
- data/lib/shopify-cli/commands/login.rb +95 -0
- data/lib/shopify-cli/commands/logout.rb +24 -8
- data/lib/shopify-cli/commands/populate.rb +23 -0
- data/lib/{project_types/node → shopify-cli}/commands/populate/customer.rb +2 -8
- data/lib/{project_types/node → shopify-cli}/commands/populate/draft_order.rb +2 -2
- data/lib/{project_types/node → shopify-cli}/commands/populate/product.rb +2 -8
- data/lib/shopify-cli/commands/store.rb +15 -0
- data/lib/shopify-cli/commands/switch.rb +39 -0
- data/lib/shopify-cli/commands/system.rb +12 -0
- data/lib/shopify-cli/commands/whoami.rb +28 -0
- data/lib/shopify-cli/connect.rb +32 -0
- data/lib/shopify-cli/context.rb +52 -4
- data/lib/shopify-cli/core/entry_point.rb +3 -22
- data/lib/shopify-cli/db.rb +4 -4
- data/lib/shopify-cli/http_request.rb +10 -0
- data/lib/shopify-cli/identity_auth.rb +282 -0
- data/lib/shopify-cli/{oauth → identity_auth}/servlet.rb +11 -12
- data/lib/shopify-cli/messages/messages.rb +132 -39
- data/lib/shopify-cli/partners_api.rb +21 -44
- data/lib/shopify-cli/partners_api/organizations.rb +8 -0
- data/lib/shopify-cli/project_commands.rb +16 -0
- data/lib/shopify-cli/project_type.rb +0 -31
- data/lib/shopify-cli/shopifolk.rb +8 -11
- data/lib/shopify-cli/sub_command.rb +1 -0
- data/lib/shopify-cli/tasks.rb +3 -0
- data/lib/shopify-cli/tasks/confirm_store.rb +18 -0
- data/lib/shopify-cli/tasks/create_api_client.rb +2 -2
- data/lib/shopify-cli/tasks/ensure_authenticated.rb +13 -0
- data/lib/shopify-cli/tasks/ensure_loopback_url.rb +1 -1
- data/lib/shopify-cli/tasks/ensure_project_type.rb +12 -0
- data/lib/shopify-cli/tasks/select_org_and_shop.rb +0 -3
- data/lib/shopify-cli/theme/dev_server.rb +98 -0
- data/lib/shopify-cli/theme/dev_server/certificate_manager.rb +79 -0
- data/lib/shopify-cli/theme/dev_server/header_hash.rb +94 -0
- data/lib/shopify-cli/theme/dev_server/hot-reload.js +93 -0
- data/lib/shopify-cli/theme/dev_server/hot_reload.rb +76 -0
- data/lib/shopify-cli/theme/dev_server/local_assets.rb +87 -0
- data/lib/shopify-cli/theme/dev_server/proxy.rb +205 -0
- data/lib/shopify-cli/theme/dev_server/sse.rb +75 -0
- data/lib/shopify-cli/theme/dev_server/watcher.rb +59 -0
- data/lib/shopify-cli/theme/dev_server/web_server.rb +140 -0
- data/lib/shopify-cli/theme/development_theme.rb +69 -0
- data/lib/shopify-cli/theme/file.rb +112 -0
- data/lib/shopify-cli/theme/ignore_filter.rb +109 -0
- data/lib/shopify-cli/theme/mime_type.rb +34 -0
- data/lib/shopify-cli/theme/syncer.rb +328 -0
- data/lib/shopify-cli/theme/theme.rb +204 -0
- data/lib/shopify-cli/version.rb +1 -1
- data/lib/shopify_cli.rb +18 -11
- data/shopify-cli.gemspec +12 -5
- data/shopify.fish +1 -1
- data/shopify.sh +1 -1
- metadata +88 -34
- data/.github/workflows/release.yml +0 -59
- data/lib/project_types/extension/features/argo_serve_options.rb +0 -42
- data/lib/project_types/node/commands/populate.rb +0 -23
- data/lib/project_types/rails/commands/populate.rb +0 -23
- data/lib/project_types/rails/commands/populate/customer.rb +0 -31
- data/lib/project_types/rails/commands/populate/draft_order.rb +0 -28
- data/lib/project_types/rails/commands/populate/product.rb +0 -30
- data/lib/project_types/theme/commands/connect.rb +0 -54
- data/lib/project_types/theme/commands/create.rb +0 -48
- data/lib/project_types/theme/commands/deploy.rb +0 -38
- data/lib/project_types/theme/commands/generate.rb +0 -20
- data/lib/project_types/theme/commands/generate/env.rb +0 -79
- data/lib/project_types/theme/forms/connect.rb +0 -34
- data/lib/project_types/theme/forms/create.rb +0 -22
- data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +0 -78
- data/lib/project_types/theme/themekit.rb +0 -113
- data/lib/shopify-cli/commands/connect.rb +0 -64
- data/lib/shopify-cli/commands/create.rb +0 -50
- data/lib/shopify-cli/oauth.rb +0 -198
data/RELEASING.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
|
|
4
4
|
|
|
5
|
-
1. Make sure you're on the most recent `
|
|
5
|
+
1. Make sure you're on the most recent `main`
|
|
6
6
|
```
|
|
7
|
-
$ git checkout
|
|
7
|
+
$ git checkout main
|
|
8
8
|
$ git pull
|
|
9
9
|
```
|
|
10
10
|
|
|
@@ -31,11 +31,33 @@
|
|
|
31
31
|
|
|
32
32
|
1. Deploy using Shipit
|
|
33
33
|
|
|
34
|
-
1.
|
|
35
|
-
|
|
34
|
+
1. Update your `main` branch to the latest version
|
|
35
|
+
```
|
|
36
|
+
$ git checkout main
|
|
37
|
+
$ git pull
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
1. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
|
|
41
|
+
```
|
|
42
|
+
$ rake package
|
|
43
|
+
```
|
|
44
|
+
This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
1. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
|
|
47
|
+
* create a branch named `release_X_Y_Z_of_shopify-cli`
|
|
48
|
+
* update the brew formula in `shopify-cli.rb` with the generated formula in `packaging/builds/X.Y.Z/` in the `Shopify/shopify-cli` repo (from the `rake package` step above)
|
|
49
|
+
* commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
|
|
50
|
+
* when PR is approved, merge into main branch
|
|
40
51
|
|
|
52
|
+
1. Go to [releases](https://github.com/Shopify/shopify-cli/releases) page of `Shopify/shopify-cli` repo and create a new release:
|
|
53
|
+
* use the tag created by Shipit (should be "vX.Y.Z")
|
|
54
|
+
* release title = "Version X.Y.Z"
|
|
55
|
+
* description should be
|
|
56
|
+
```
|
|
57
|
+
Release of version X.Y.Z of Shopify CLI
|
|
41
58
|
|
|
59
|
+
Please refer to [CHANGELOG](https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md) for details.
|
|
60
|
+
```
|
|
61
|
+
* upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
|
|
62
|
+
* if it's a pre-release version, select the "This is a pre-release" checkbox
|
|
63
|
+
* and click "Publish release".
|
data/Rakefile
CHANGED
|
@@ -20,7 +20,7 @@ task :console do
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
namespace :rdoc do
|
|
23
|
-
repo = "https://github.com/Shopify/shopify-
|
|
23
|
+
repo = "https://github.com/Shopify/shopify-cli.wiki.git"
|
|
24
24
|
intermediate = "markdown_intermediate"
|
|
25
25
|
file_to_doc = [
|
|
26
26
|
"lib/shopify-cli/admin_api.rb",
|
|
@@ -29,6 +29,7 @@ namespace :rdoc do
|
|
|
29
29
|
"lib/shopify-cli/git.rb",
|
|
30
30
|
"lib/shopify-cli/heroku.rb",
|
|
31
31
|
"lib/shopify-cli/js_deps.rb",
|
|
32
|
+
"lib/shopify-cli/lazy_delegator.rb",
|
|
32
33
|
"lib/shopify-cli/method_object.rb",
|
|
33
34
|
"lib/shopify-cli/partners_api.rb",
|
|
34
35
|
"lib/shopify-cli/process_supervision.rb",
|
|
@@ -36,7 +37,6 @@ namespace :rdoc do
|
|
|
36
37
|
"lib/shopify-cli/result.rb",
|
|
37
38
|
"lib/shopify-cli/transform_data_structure.rb",
|
|
38
39
|
"lib/shopify-cli/tunnel.rb",
|
|
39
|
-
"lib/shopify-cli/lazy_delegator.rb",
|
|
40
40
|
]
|
|
41
41
|
|
|
42
42
|
task all: [:markdown, :wiki, :cleanup]
|
data/SECURITY.md
CHANGED
data/bin/load_shopify.rb
CHANGED
data/bin/shopify
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
module Kernel
|
|
4
4
|
# make an alias of the original require
|
|
@@ -12,7 +12,7 @@ module Kernel
|
|
|
12
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
|
-
STDERR.puts "[Note] You cannot use gems with Shopify
|
|
15
|
+
STDERR.puts "[Note] You cannot use gems with Shopify CLI."
|
|
16
16
|
STDERR.puts "[LoadError] #{e.message}"
|
|
17
17
|
if ENV["DEBUG"]
|
|
18
18
|
STDERR.puts e.backtrace
|
|
@@ -21,7 +21,7 @@ module Kernel
|
|
|
21
21
|
STDERR.puts " They are disabled."
|
|
22
22
|
STDERR.puts " Please don't modify the CLI locally."
|
|
23
23
|
STDERR.puts " If you would like to contribute to the CLI project, please refer to"
|
|
24
|
-
STDERR.puts " https://github.com/Shopify/shopify-
|
|
24
|
+
STDERR.puts " https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md"
|
|
25
25
|
STDERR.puts "\n"
|
|
26
26
|
raise
|
|
27
27
|
end
|
data/dev.yml
CHANGED
data/docs/app/node/index.md
CHANGED
data/docs/app/rails/index.md
CHANGED
data/docs/core/index.md
CHANGED
data/docs/index.md
CHANGED
data/ext/shopify-cli/extconf.rb
CHANGED
|
@@ -4,11 +4,23 @@ require "fileutils"
|
|
|
4
4
|
gem = File.expand_path("../../../", __FILE__)
|
|
5
5
|
exe = File.join(gem, "bin", "shopify")
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# `--skip-cli-build` will be passed from the brew `shopify-cli.rb` formula, so
|
|
8
|
+
# as to prevent this extension builder doing the script and sym-link creation;
|
|
9
|
+
# the brew install process takes care of these itself - see
|
|
10
|
+
# https://github.com/Shopify/homebrew-shopify/shopify-cli.rb
|
|
11
|
+
if ARGV && ARGV[0]&.match(/skip-cli-build/)
|
|
12
|
+
makefile_content = <<~MAKEFILE
|
|
13
|
+
.PHONY: clean
|
|
14
|
+
|
|
15
|
+
clean: ;
|
|
16
|
+
|
|
17
|
+
install: ;
|
|
18
|
+
MAKEFILE
|
|
19
|
+
elsif RUBY_PLATFORM.match(/mswin|mingw|cygwin/)
|
|
8
20
|
bat_path = File.dirname(RbConfig.ruby)
|
|
9
21
|
bat = "#{bat_path}\\shopify.bat"
|
|
10
22
|
|
|
11
|
-
script_content = "#{RbConfig.ruby}
|
|
23
|
+
script_content = "#{RbConfig.ruby} -I '#{gem}' '#{exe}' %*"
|
|
12
24
|
|
|
13
25
|
FileUtils.mkdir_p(bat_path)
|
|
14
26
|
makefile_content = <<~MAKEFILE
|
|
@@ -27,7 +39,7 @@ else
|
|
|
27
39
|
|
|
28
40
|
script_content = <<~SCRIPT
|
|
29
41
|
#!/usr/bin/env bash
|
|
30
|
-
#{RbConfig.ruby}
|
|
42
|
+
#{RbConfig.ruby} -I #{gem} #{exe} $@
|
|
31
43
|
SCRIPT
|
|
32
44
|
|
|
33
45
|
File.write(script, script_content)
|
|
@@ -35,10 +47,10 @@ else
|
|
|
35
47
|
|
|
36
48
|
makefile_content = <<~MAKEFILE
|
|
37
49
|
.PHONY: clean install
|
|
38
|
-
|
|
50
|
+
|
|
39
51
|
clean:
|
|
40
52
|
\t@sudo rm -f #{symlink}
|
|
41
|
-
|
|
53
|
+
|
|
42
54
|
install: clean
|
|
43
55
|
\t@sudo ln -s #{script} #{symlink}
|
|
44
56
|
MAKEFILE
|
data/install.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# shellcheck shell=sh disable=1012,1001
|
|
2
2
|
\cat << 'EOF'
|
|
3
|
-
This install method for Shopify
|
|
3
|
+
This install method for Shopify CLI is no longer supported.
|
|
4
4
|
|
|
5
5
|
Please visit this page for complete instructions:
|
|
6
6
|
https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
The Shopify
|
|
1
|
+
The Shopify CLI has a set of core APIs that simplify the process of extending its functionality.
|
|
2
2
|
|
|
3
3
|
<%- classes.each do |method| -%>
|
|
4
|
-
- [<%= method.title %>](https://github.com/Shopify/shopify-
|
|
4
|
+
- [<%= method.title %>](https://github.com/Shopify/shopify-cli/wiki/<%= method.filename %>)
|
|
5
5
|
<%- end -%>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
query AllOrgs ($type: String) {
|
|
2
|
+
organizations {
|
|
3
|
+
nodes {
|
|
4
|
+
id
|
|
5
|
+
businessName
|
|
6
|
+
website
|
|
7
|
+
apps(first: 500) {
|
|
8
|
+
nodes {
|
|
9
|
+
id
|
|
10
|
+
title
|
|
11
|
+
apiKey
|
|
12
|
+
apiSecretKeys{
|
|
13
|
+
secret
|
|
14
|
+
}
|
|
15
|
+
appType
|
|
16
|
+
extensionRegistrations(specificationIdentifier: $type) {
|
|
17
|
+
id
|
|
18
|
+
type
|
|
19
|
+
uuid
|
|
20
|
+
title
|
|
21
|
+
draftVersion {
|
|
22
|
+
registrationId
|
|
23
|
+
context
|
|
24
|
+
lastUserInteractionAt
|
|
25
|
+
location
|
|
26
|
+
validationErrors { field message }
|
|
27
|
+
|
|
28
|
+
id
|
|
29
|
+
uuid
|
|
30
|
+
versionTag
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -5,14 +5,6 @@ module Extension
|
|
|
5
5
|
|
|
6
6
|
class Project < ShopifyCli::ProjectType
|
|
7
7
|
hidden_feature
|
|
8
|
-
title("App Extension")
|
|
9
|
-
creator("Extension::Commands::Create")
|
|
10
|
-
|
|
11
|
-
register_command("Extension::Commands::Build", "build")
|
|
12
|
-
register_command("Extension::Commands::Register", "register")
|
|
13
|
-
register_command("Extension::Commands::Push", "push")
|
|
14
|
-
register_command("Extension::Commands::Serve", "serve")
|
|
15
|
-
register_command("Extension::Commands::Tunnel", "tunnel")
|
|
16
8
|
|
|
17
9
|
require Project.project_filepath("messages/messages")
|
|
18
10
|
require Project.project_filepath("messages/message_loading")
|
|
@@ -20,15 +12,20 @@ module Extension
|
|
|
20
12
|
register_messages(Extension::Messages::MessageLoading.load)
|
|
21
13
|
end
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
class Command < ShopifyCli::ProjectCommands
|
|
16
|
+
hidden_feature
|
|
24
17
|
autoload :ExtensionCommand, Project.project_filepath("commands/extension_command")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
|
|
19
|
+
subcommand :Create, "create", Project.project_filepath("commands/create")
|
|
20
|
+
subcommand :Register, "register", Project.project_filepath("commands/register")
|
|
21
|
+
subcommand :Info, "info", Project.project_filepath("commands/info")
|
|
22
|
+
subcommand :Connect, "connect", Project.project_filepath("commands/connect")
|
|
23
|
+
subcommand :Build, "build", Project.project_filepath("commands/build")
|
|
24
|
+
subcommand :Serve, "serve", Project.project_filepath("commands/serve")
|
|
25
|
+
subcommand :Push, "push", Project.project_filepath("commands/push")
|
|
26
|
+
subcommand :Tunnel, "tunnel", Project.project_filepath("commands/tunnel")
|
|
31
27
|
end
|
|
28
|
+
ShopifyCli::Commands.register("Extension::Command", "extension")
|
|
32
29
|
|
|
33
30
|
module Tasks
|
|
34
31
|
autoload :UserErrors, Project.project_filepath("tasks/user_errors")
|
|
@@ -38,8 +35,10 @@ module Extension
|
|
|
38
35
|
autoload :UpdateDraft, Project.project_filepath("tasks/update_draft")
|
|
39
36
|
autoload :FetchSpecifications, Project.project_filepath("tasks/fetch_specifications")
|
|
40
37
|
autoload :ConfigureFeatures, Project.project_filepath("tasks/configure_features")
|
|
38
|
+
autoload :ConfigureOptions, Project.project_filepath("tasks/configure_options")
|
|
41
39
|
autoload :ChooseNextAvailablePort, Project.project_filepath("tasks/choose_next_available_port")
|
|
42
40
|
autoload :FindNpmPackages, Project.project_filepath("tasks/find_npm_packages")
|
|
41
|
+
autoload :GetExtensions, Project.project_filepath("tasks/get_extensions")
|
|
43
42
|
|
|
44
43
|
module Converters
|
|
45
44
|
autoload :RegistrationConverter, Project.project_filepath("tasks/converters/registration_converter")
|
|
@@ -54,10 +53,12 @@ module Extension
|
|
|
54
53
|
autoload :AskApp, Project.project_filepath("forms/questions/ask_app")
|
|
55
54
|
autoload :AskName, Project.project_filepath("forms/questions/ask_name")
|
|
56
55
|
autoload :AskType, Project.project_filepath("forms/questions/ask_type")
|
|
56
|
+
autoload :AskRegistration, Project.project_filepath("forms/questions/ask_registration")
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
autoload :Create, Project.project_filepath("forms/create")
|
|
60
60
|
autoload :Register, Project.project_filepath("forms/register")
|
|
61
|
+
autoload :Connect, Project.project_filepath("forms/connect")
|
|
61
62
|
end
|
|
62
63
|
|
|
63
64
|
module Features
|
|
@@ -75,6 +76,7 @@ module Extension
|
|
|
75
76
|
module Models
|
|
76
77
|
module SpecificationHandlers
|
|
77
78
|
autoload :Default, Project.project_filepath("models/specification_handlers/default")
|
|
79
|
+
autoload :CheckoutArgoExtension, Project.project_filepath("models/specification_handlers/checkout_ui_extension")
|
|
78
80
|
end
|
|
79
81
|
|
|
80
82
|
autoload :App, Project.project_filepath("models/app")
|
|
@@ -89,4 +91,5 @@ module Extension
|
|
|
89
91
|
|
|
90
92
|
autoload :ExtensionProjectKeys, Project.project_filepath("extension_project_keys")
|
|
91
93
|
autoload :ExtensionProject, Project.project_filepath("extension_project")
|
|
94
|
+
autoload :Errors, Project.project_filepath("errors")
|
|
92
95
|
end
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
require "shopify_cli"
|
|
3
3
|
|
|
4
4
|
module Extension
|
|
5
|
-
|
|
5
|
+
class Command
|
|
6
6
|
class Build < ExtensionCommand
|
|
7
7
|
hidden_feature
|
|
8
8
|
|
|
9
|
+
prerequisite_task ensure_project_type: :extension
|
|
10
|
+
|
|
9
11
|
YARN_BUILD_COMMAND = %w(build)
|
|
10
12
|
NPM_BUILD_COMMAND = %w(run-script build)
|
|
11
13
|
|
|
@@ -19,10 +21,7 @@ module Extension
|
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
def self.help
|
|
22
|
-
|
|
23
|
-
Build your extension to prepare for deployment.
|
|
24
|
-
Usage: {{command:#{ShopifyCli::TOOL_NAME} build}}
|
|
25
|
-
HELP
|
|
24
|
+
ShopifyCli::Context.new.message("build.help", ShopifyCli::TOOL_NAME)
|
|
26
25
|
end
|
|
27
26
|
end
|
|
28
27
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Extension
|
|
3
|
+
class Command
|
|
4
|
+
class Connect < ExtensionCommand
|
|
5
|
+
prerequisite_task :ensure_authenticated
|
|
6
|
+
|
|
7
|
+
def call(args, _)
|
|
8
|
+
with_connect_form(args) do |form|
|
|
9
|
+
ExtensionProject.write_env_file(
|
|
10
|
+
context: @ctx,
|
|
11
|
+
api_key: form.app.api_key,
|
|
12
|
+
api_secret: form.app.secret,
|
|
13
|
+
registration_id: form.registration.id,
|
|
14
|
+
registration_uuid: form.registration.uuid,
|
|
15
|
+
title: form.registration.title
|
|
16
|
+
)
|
|
17
|
+
@ctx.done(@ctx.message("connect.connected", form.app.title, form.registration.title))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.help
|
|
22
|
+
ShopifyCli::Context.new.message("connect.help", ShopifyCli::TOOL_NAME, ShopifyCli::TOOL_NAME)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def with_connect_form(args)
|
|
28
|
+
form = Forms::Connect.ask(@ctx, args, { type: specification_handler.identifier.downcase })
|
|
29
|
+
return @ctx.puts(self.class.help) if form.nil?
|
|
30
|
+
|
|
31
|
+
yield form
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|