shopify-cli 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +12 -12
  4. data/Rakefile +32 -30
  5. data/bin/load_shopify.rb +6 -6
  6. data/bin/shopify +2 -2
  7. data/ext/shopify-cli/extconf.rb +7 -7
  8. data/lib/docgen/markdown.rb +11 -11
  9. data/lib/{project_types/extension/graphql → graphql}/get_app_by_api_key.graphql +0 -0
  10. data/lib/project_types/extension/cli.rb +52 -45
  11. data/lib/project_types/extension/commands/build.rb +3 -3
  12. data/lib/project_types/extension/commands/create.rb +16 -9
  13. data/lib/project_types/extension/commands/extension_command.rb +8 -5
  14. data/lib/project_types/extension/commands/push.rb +8 -8
  15. data/lib/project_types/extension/commands/register.rb +19 -30
  16. data/lib/project_types/extension/commands/serve.rb +2 -2
  17. data/lib/project_types/extension/commands/tunnel.rb +12 -12
  18. data/lib/project_types/extension/extension_project.rb +4 -4
  19. data/lib/project_types/extension/extension_project_keys.rb +4 -4
  20. data/lib/project_types/extension/features/argo.rb +13 -13
  21. data/lib/project_types/extension/features/argo_config.rb +5 -5
  22. data/lib/project_types/extension/features/argo_dependencies.rb +5 -5
  23. data/lib/project_types/extension/features/argo_setup.rb +2 -2
  24. data/lib/project_types/extension/features/argo_setup_steps.rb +4 -4
  25. data/lib/project_types/extension/forms/create.rb +28 -34
  26. data/lib/project_types/extension/forms/questions/ask_app.rb +53 -0
  27. data/lib/project_types/extension/forms/questions/ask_name.rb +40 -0
  28. data/lib/project_types/extension/forms/questions/ask_type.rb +36 -0
  29. data/lib/project_types/extension/messages/messages.rb +53 -52
  30. data/lib/project_types/extension/models/lazy_specification_handler.rb +12 -0
  31. data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
  32. data/lib/project_types/extension/models/specification_handlers/default.rb +2 -2
  33. data/lib/project_types/extension/models/specifications.rb +3 -3
  34. data/lib/project_types/extension/tasks/configure_features.rb +4 -4
  35. data/lib/project_types/extension/tasks/converters/app_converter.rb +6 -6
  36. data/lib/project_types/extension/tasks/converters/registration_converter.rb +6 -6
  37. data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +4 -4
  38. data/lib/project_types/extension/tasks/converters/version_converter.rb +7 -7
  39. data/lib/project_types/extension/tasks/create_extension.rb +4 -4
  40. data/lib/project_types/extension/tasks/fetch_specifications.rb +4 -4
  41. data/lib/project_types/extension/tasks/get_app.rb +4 -4
  42. data/lib/project_types/extension/tasks/get_apps.rb +3 -3
  43. data/lib/project_types/extension/tasks/update_draft.rb +4 -4
  44. data/lib/project_types/extension/tasks/user_errors.rb +4 -4
  45. data/lib/project_types/node/cli.rb +19 -19
  46. data/lib/project_types/node/commands/connect.rb +3 -3
  47. data/lib/project_types/node/commands/create.rb +40 -38
  48. data/lib/project_types/node/commands/deploy.rb +4 -4
  49. data/lib/project_types/node/commands/deploy/heroku.rb +24 -24
  50. data/lib/project_types/node/commands/generate.rb +8 -8
  51. data/lib/project_types/node/commands/open.rb +2 -2
  52. data/lib/project_types/node/commands/populate.rb +6 -6
  53. data/lib/project_types/node/commands/populate/customer.rb +5 -5
  54. data/lib/project_types/node/commands/populate/draft_order.rb +5 -5
  55. data/lib/project_types/node/commands/populate/product.rb +5 -5
  56. data/lib/project_types/node/commands/serve.rb +9 -9
  57. data/lib/project_types/node/commands/tunnel.rb +7 -7
  58. data/lib/project_types/node/forms/create.rb +7 -7
  59. data/lib/project_types/node/messages/messages.rb +3 -3
  60. data/lib/project_types/rails/cli.rb +21 -21
  61. data/lib/project_types/rails/commands/connect.rb +3 -3
  62. data/lib/project_types/rails/commands/create.rb +51 -48
  63. data/lib/project_types/rails/commands/deploy.rb +4 -4
  64. data/lib/project_types/rails/commands/deploy/heroku.rb +30 -30
  65. data/lib/project_types/rails/commands/generate.rb +7 -7
  66. data/lib/project_types/rails/commands/generate/webhook.rb +6 -6
  67. data/lib/project_types/rails/commands/open.rb +2 -2
  68. data/lib/project_types/rails/commands/populate.rb +6 -6
  69. data/lib/project_types/rails/commands/populate/customer.rb +5 -5
  70. data/lib/project_types/rails/commands/populate/draft_order.rb +5 -5
  71. data/lib/project_types/rails/commands/populate/product.rb +5 -5
  72. data/lib/project_types/rails/commands/serve.rb +11 -11
  73. data/lib/project_types/rails/commands/tunnel.rb +7 -7
  74. data/lib/project_types/rails/forms/create.rb +23 -23
  75. data/lib/project_types/rails/gem.rb +23 -23
  76. data/lib/project_types/rails/messages/messages.rb +4 -4
  77. data/lib/project_types/rails/ruby.rb +2 -2
  78. data/lib/project_types/script/cli.rb +40 -40
  79. data/lib/project_types/script/commands/create.rb +9 -8
  80. data/lib/project_types/script/commands/disable.rb +3 -3
  81. data/lib/project_types/script/commands/enable.rb +9 -7
  82. data/lib/project_types/script/commands/push.rb +5 -4
  83. data/lib/project_types/script/errors.rb +17 -0
  84. data/lib/project_types/script/forms/create.rb +5 -5
  85. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +2 -0
  86. data/lib/project_types/script/layers/application/build_script.rb +6 -8
  87. data/lib/project_types/script/layers/application/create_script.rb +2 -2
  88. data/lib/project_types/script/layers/application/disable_script.rb +2 -2
  89. data/lib/project_types/script/layers/application/enable_script.rb +2 -2
  90. data/lib/project_types/script/layers/application/project_dependencies.rb +4 -4
  91. data/lib/project_types/script/layers/application/push_script.rb +4 -12
  92. data/lib/project_types/script/layers/domain/push_package.rb +5 -1
  93. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +3 -3
  94. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +10 -10
  95. data/lib/project_types/script/layers/infrastructure/errors.rb +1 -1
  96. data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +2 -2
  97. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +12 -17
  98. data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +4 -4
  99. data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +1 -1
  100. data/lib/project_types/script/layers/infrastructure/script_service.rb +18 -16
  101. data/lib/project_types/script/messages/messages.rb +14 -8
  102. data/lib/project_types/script/script_project.rb +27 -5
  103. data/lib/project_types/script/ui/error_handler.rb +80 -68
  104. data/lib/project_types/script/ui/printing_spinner.rb +1 -1
  105. data/lib/project_types/script/ui/strict_spinner.rb +1 -1
  106. data/lib/project_types/theme/cli.rb +19 -19
  107. data/lib/project_types/theme/commands/connect.rb +12 -12
  108. data/lib/project_types/theme/commands/create.rb +11 -11
  109. data/lib/project_types/theme/commands/deploy.rb +8 -8
  110. data/lib/project_types/theme/commands/generate.rb +3 -3
  111. data/lib/project_types/theme/commands/generate/env.rb +15 -15
  112. data/lib/project_types/theme/commands/push.rb +15 -15
  113. data/lib/project_types/theme/commands/serve.rb +5 -5
  114. data/lib/project_types/theme/forms/connect.rb +4 -4
  115. data/lib/project_types/theme/forms/create.rb +5 -5
  116. data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +22 -22
  117. data/lib/project_types/theme/themekit.rb +15 -15
  118. data/lib/rubygems_plugin.rb +3 -3
  119. data/lib/shopify-cli/admin_api.rb +11 -11
  120. data/lib/shopify-cli/admin_api/populate_resource_command.rb +17 -17
  121. data/lib/shopify-cli/admin_api/schema.rb +3 -3
  122. data/lib/shopify-cli/api.rb +10 -10
  123. data/lib/shopify-cli/command.rb +1 -1
  124. data/lib/shopify-cli/commands.rb +9 -9
  125. data/lib/shopify-cli/commands/config.rb +28 -52
  126. data/lib/shopify-cli/commands/connect.rb +10 -10
  127. data/lib/shopify-cli/commands/create.rb +5 -5
  128. data/lib/shopify-cli/commands/help.rb +6 -6
  129. data/lib/shopify-cli/commands/logout.rb +3 -3
  130. data/lib/shopify-cli/commands/system.rb +32 -32
  131. data/lib/shopify-cli/commands/version.rb +2 -2
  132. data/lib/shopify-cli/context.rb +23 -23
  133. data/lib/shopify-cli/core.rb +4 -4
  134. data/lib/shopify-cli/core/entry_point.rb +5 -5
  135. data/lib/shopify-cli/core/executor.rb +1 -1
  136. data/lib/shopify-cli/core/help_resolver.rb +2 -2
  137. data/lib/shopify-cli/core/monorail.rb +16 -16
  138. data/lib/shopify-cli/db.rb +2 -2
  139. data/lib/shopify-cli/feature.rb +1 -1
  140. data/lib/shopify-cli/form.rb +1 -1
  141. data/lib/shopify-cli/git.rb +17 -17
  142. data/lib/shopify-cli/helpers.rb +1 -1
  143. data/lib/shopify-cli/helpers/haikunator.rb +1 -1
  144. data/lib/shopify-cli/heroku.rb +28 -28
  145. data/lib/shopify-cli/http_request.rb +2 -2
  146. data/lib/shopify-cli/js_deps.rb +12 -12
  147. data/lib/shopify-cli/js_system.rb +5 -5
  148. data/lib/shopify-cli/lazy_delegator.rb +55 -0
  149. data/lib/shopify-cli/messages/messages.rb +4 -14
  150. data/lib/shopify-cli/oauth.rb +25 -25
  151. data/lib/shopify-cli/oauth/servlet.rb +9 -9
  152. data/lib/shopify-cli/options.rb +3 -3
  153. data/lib/shopify-cli/packager.rb +24 -24
  154. data/lib/shopify-cli/partners_api.rb +16 -16
  155. data/lib/shopify-cli/partners_api/organizations.rb +10 -10
  156. data/lib/shopify-cli/process_supervision.rb +7 -7
  157. data/lib/shopify-cli/project.rb +16 -16
  158. data/lib/shopify-cli/project_type.rb +3 -3
  159. data/lib/shopify-cli/resources.rb +1 -1
  160. data/lib/shopify-cli/resources/env_file.rb +9 -9
  161. data/lib/shopify-cli/result.rb +8 -8
  162. data/lib/shopify-cli/shopifolk.rb +6 -9
  163. data/lib/shopify-cli/sub_command.rb +1 -1
  164. data/lib/shopify-cli/task.rb +3 -3
  165. data/lib/shopify-cli/tasks.rb +7 -7
  166. data/lib/shopify-cli/tasks/create_api_client.rb +5 -5
  167. data/lib/shopify-cli/tasks/ensure_dev_store.rb +11 -11
  168. data/lib/shopify-cli/tasks/ensure_env.rb +15 -15
  169. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +4 -4
  170. data/lib/shopify-cli/tasks/select_org_and_shop.rb +19 -19
  171. data/lib/shopify-cli/tasks/update_dashboard_urls.rb +10 -10
  172. data/lib/shopify-cli/transform_data_structure.rb +86 -0
  173. data/lib/shopify-cli/tunnel.rb +30 -30
  174. data/lib/shopify-cli/version.rb +1 -1
  175. data/lib/shopify_cli.rb +56 -54
  176. data/shopify-cli.gemspec +6 -6
  177. data/vendor/gen/template/bin/update-deps +9 -9
  178. metadata +9 -4
  179. data/lib/project_types/extension/forms/register.rb +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51b21780f8f46054f92124110152a903c94a6215436b73b5dce40c8ad7b072cc
4
- data.tar.gz: 2884ba67316188cd05ae6b8cd3e7927a7dc8d99936fd328eed6a2480452eec4b
3
+ metadata.gz: 718e73fd7541d075d7caf66c078dfe9ba3723299aa4fc668164dda9953c5dc7f
4
+ data.tar.gz: 116ed7d69bca5345c7120b9ca5e53172afe3bebaceb0a0539a2d128ebab6235f
5
5
  SHA512:
6
- metadata.gz: 8e1f3f1911ab79b7dc725236249219a0f5aff3703ed82f243cf2235621e1e45aef7c77e2fd06c2360a436c7601d344e4e01f0795eff53d519a2a992079825847
7
- data.tar.gz: cc1c2de1b2bc5f624c0e249d4b7b8f0a58bd72ab164e02914b9ace0d6d542bbc6aa8d3a67387ce45060aa5fcc44ef5aed5fc4bed2ce8a67bb53bd7d65c03f608
6
+ metadata.gz: 11d8373057ed9d845c71863ba6443a47949a8c4e3c9d281b731638f0a1326be30076c94d38ee2d99a02a3779b4eaabd2a04b656306e4f1cd157888b483fe5946
7
+ data.tar.gz: 866966d912d1d65731619afe68fe37c9679852fd41a1e7c0b1eecc80a6182d505e06f0c5608f98ff7b53b8dde52d136ce6ac5e3b037282f62458086df2fabb52
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Unreleased
2
2
  ------
3
3
 
4
+ Version 1.7.0
5
+ -----
6
+ * [#1075](https://github.com/Shopify/shopify-app-cli/pull/1075): Add support for kebab-case flags
7
+
4
8
  Version 1.6.0
5
9
  -----
6
10
  * [#1049](https://github.com/Shopify/shopify-app-cli/pull/1049): Add schema versioning support to the script project type
data/Gemfile CHANGED
@@ -5,19 +5,19 @@ source "https://rubygems.org"
5
5
  # They are all for CI and tests
6
6
  # `dev` uses no gems
7
7
  group :development, :test do
8
- gem 'rake'
9
- gem 'pry-byebug'
10
- gem 'byebug'
11
- gem 'rubocop-shopify', require: false
12
- gem 'rubocop-minitest', require: false
8
+ gem "rake"
9
+ gem "pry-byebug"
10
+ gem "byebug"
11
+ gem "rubocop-shopify", require: false
12
+ gem "rubocop-minitest", require: false
13
13
  end
14
14
 
15
15
  group :test do
16
- gem 'mocha', require: false
17
- gem 'minitest', '>= 5.0.0', require: false
18
- gem 'minitest-reporters', require: false
19
- gem 'minitest-fail-fast', require: false
20
- gem 'fakefs', '>= 1.0', require: false
21
- gem 'webmock', require: false
22
- gem 'timecop', require: false
16
+ gem "mocha", require: false
17
+ gem "minitest", ">= 5.0.0", require: false
18
+ gem "minitest-reporters", require: false
19
+ gem "minitest-fail-fast", require: false
20
+ gem "fakefs", ">= 1.0", require: false
21
+ gem "webmock", require: false
22
+ gem "timecop", require: false
23
23
  end
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
- require_relative 'bin/load_shopify'
2
- require 'rake/testtask'
3
- require 'rubocop/rake_task'
4
- require 'bundler/gem_tasks'
1
+ require_relative "bin/load_shopify"
2
+ require "rake/testtask"
3
+ require "rubocop/rake_task"
4
+ require "bundler/gem_tasks"
5
5
 
6
6
  Rake::TestTask.new do |t|
7
7
  t.libs += %w(test)
8
- t.test_files = FileList['test/**/*_test.rb']
8
+ t.test_files = FileList["test/**/*_test.rb"]
9
9
  t.verbose = false
10
10
  t.warning = false
11
11
  end
@@ -16,35 +16,37 @@ task(default: [:test, :rubocop])
16
16
 
17
17
  desc("Start up irb with cli loaded")
18
18
  task :console do
19
- exec('irb', '-r', './bin/load_shopify.rb', '-r', 'byebug')
19
+ exec("irb", "-r", "./bin/load_shopify.rb", "-r", "byebug")
20
20
  end
21
21
 
22
22
  namespace :rdoc do
23
- repo = 'https://github.com/Shopify/shopify-app-cli.wiki.git'
24
- intermediate = 'markdown_intermediate'
23
+ repo = "https://github.com/Shopify/shopify-app-cli.wiki.git"
24
+ intermediate = "markdown_intermediate"
25
25
  file_to_doc = [
26
- 'lib/shopify-cli/admin_api.rb',
27
- 'lib/shopify-cli/context.rb',
28
- 'lib/shopify-cli/db.rb',
29
- 'lib/shopify-cli/git.rb',
30
- 'lib/shopify-cli/heroku.rb',
31
- 'lib/shopify-cli/js_deps.rb',
32
- 'lib/shopify-cli/method_object.rb',
33
- 'lib/shopify-cli/partners_api.rb',
34
- 'lib/shopify-cli/process_supervision.rb',
35
- 'lib/shopify-cli/project.rb',
36
- 'lib/shopify-cli/result.rb',
37
- 'lib/shopify-cli/tunnel.rb',
26
+ "lib/shopify-cli/admin_api.rb",
27
+ "lib/shopify-cli/context.rb",
28
+ "lib/shopify-cli/db.rb",
29
+ "lib/shopify-cli/git.rb",
30
+ "lib/shopify-cli/heroku.rb",
31
+ "lib/shopify-cli/js_deps.rb",
32
+ "lib/shopify-cli/method_object.rb",
33
+ "lib/shopify-cli/partners_api.rb",
34
+ "lib/shopify-cli/process_supervision.rb",
35
+ "lib/shopify-cli/project.rb",
36
+ "lib/shopify-cli/result.rb",
37
+ "lib/shopify-cli/transform_data_structure.rb",
38
+ "lib/shopify-cli/tunnel.rb",
39
+ "lib/shopify-cli/lazy_delegator.rb",
38
40
  ]
39
41
 
40
42
  task all: [:markdown, :wiki, :cleanup]
41
43
 
42
44
  desc("Generate markdown files from rdoc comments")
43
45
  task :markdown do
44
- require 'rdoc/rdoc'
45
- require 'docgen/markdown'
46
+ require "rdoc/rdoc"
47
+ require "docgen/markdown"
46
48
  options = RDoc::Options.new
47
- options.setup_generator('markdown')
49
+ options.setup_generator("markdown")
48
50
  options.op_dir = intermediate
49
51
  options.files = file_to_doc
50
52
  RDoc::RDoc.new.document(options)
@@ -52,14 +54,14 @@ namespace :rdoc do
52
54
 
53
55
  desc("Copy markdown documentation to the wiki and commit them")
54
56
  task :wiki do
55
- require 'tmpdir'
57
+ require "tmpdir"
56
58
  Dir.mktmpdir do |temp_dir|
57
59
  system("git clone --depth=1 #{repo} #{temp_dir}")
58
- FileUtils.cp(Dir[File.join(intermediate, '*.md')], temp_dir)
60
+ FileUtils.cp(Dir[File.join(intermediate, "*.md")], temp_dir)
59
61
  Dir.chdir(temp_dir) do
60
- system('git add --all')
62
+ system("git add --all")
61
63
  system('git commit -am "auto doc update"')
62
- system('git push')
64
+ system("git push")
63
65
  end
64
66
  end
65
67
  end
@@ -71,10 +73,10 @@ namespace :rdoc do
71
73
  end
72
74
 
73
75
  desc("Generate markdown documentation and update the wiki")
74
- task(rdoc: 'rdoc:all')
76
+ task(rdoc: "rdoc:all")
75
77
 
76
78
  namespace :package do
77
- require 'shopify-cli/packager'
79
+ require "shopify-cli/packager"
78
80
 
79
81
  task all: [:debian, :rpm, :homebrew]
80
82
 
@@ -95,4 +97,4 @@ namespace :package do
95
97
  end
96
98
 
97
99
  desc("Builds all distribution packages of the CLI")
98
- task(package: 'package:all')
100
+ task(package: "package:all")
data/bin/load_shopify.rb CHANGED
@@ -3,20 +3,20 @@
3
3
  lib_path = File.expand_path("../../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
5
5
 
6
- ENV['SHELLPID'] ||= Process.ppid.to_s
7
- ENV['USER_PWD'] ||= Dir.pwd
6
+ ENV["SHELLPID"] ||= Process.ppid.to_s
7
+ ENV["USER_PWD"] ||= Dir.pwd
8
8
 
9
9
  # Prune non-absolute paths from PATH to prevent non-deterministic behavior
10
10
  # i.e. If user has "." or "./bin" in their PATH
11
11
  # Note that this logic is duplicated in lib/shopify.rb
12
- ENV['PATH'] = ENV['PATH'].split(File::PATH_SEPARATOR).select do |p|
13
- p.start_with?('/', '~', /[A-Z]:\\/)
12
+ ENV["PATH"] = ENV["PATH"].split(File::PATH_SEPARATOR).select do |p|
13
+ p.start_with?("/", "~", /[A-Z]:\\/)
14
14
  end.join(File::PATH_SEPARATOR)
15
15
 
16
16
  $original_env = ENV.to_hash
17
17
 
18
- require 'shopify_cli'
18
+ require "shopify_cli"
19
19
 
20
- if ENV['PRINT_LOADED_FEATURES']
20
+ if ENV["PRINT_LOADED_FEATURES"]
21
21
  puts $LOADED_FEATURES
22
22
  end
data/bin/shopify CHANGED
@@ -14,7 +14,7 @@ module Kernel
14
14
  raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
15
15
  STDERR.puts "[Note] You cannot use gems with Shopify App CLI."
16
16
  STDERR.puts "[LoadError] #{e.message}"
17
- if ENV['DEBUG']
17
+ if ENV["DEBUG"]
18
18
  STDERR.puts e.backtrace
19
19
  STDERR.puts "\n"
20
20
  end
@@ -27,7 +27,7 @@ module Kernel
27
27
  end
28
28
  end
29
29
 
30
- require_relative './load_shopify'
30
+ require_relative "./load_shopify"
31
31
 
32
32
  exit(ShopifyCli::ErrorHandler.call do
33
33
  ShopifyCli::Core::EntryPoint.call(ARGV.dup)
@@ -1,8 +1,8 @@
1
- require 'rbconfig'
2
- require 'fileutils'
1
+ require "rbconfig"
2
+ require "fileutils"
3
3
 
4
- gem = File.expand_path('../../../', __FILE__)
5
- exe = File.join(gem, 'bin', 'shopify')
4
+ gem = File.expand_path("../../../", __FILE__)
5
+ exe = File.join(gem, "bin", "shopify")
6
6
 
7
7
  if RUBY_PLATFORM.match(/mingw32/)
8
8
  bat_path = File.dirname(RbConfig.ruby)
@@ -22,8 +22,8 @@ if RUBY_PLATFORM.match(/mingw32/)
22
22
  \t echo "#{script_content}">> "#{bat}"
23
23
  MAKEFILE
24
24
  else
25
- script = exe + '.sh'
26
- symlink = '/usr/local/bin/shopify'
25
+ script = exe + ".sh"
26
+ symlink = "/usr/local/bin/shopify"
27
27
 
28
28
  script_content = <<~SCRIPT
29
29
  #!/usr/bin/env bash
@@ -44,4 +44,4 @@ else
44
44
  MAKEFILE
45
45
  end
46
46
 
47
- File.write('Makefile', makefile_content)
47
+ File.write("Makefile", makefile_content)
@@ -1,5 +1,5 @@
1
- require 'rdoc/rdoc'
2
- require 'erb'
1
+ require "rdoc/rdoc"
2
+ require "erb"
3
3
 
4
4
  module RDoc
5
5
  module Generator
@@ -26,13 +26,13 @@ module RDoc
26
26
  private
27
27
 
28
28
  def render(data)
29
- class_template_path = File.join(File.dirname(__FILE__), 'class_template.md.erb')
30
- class_renderer = ERB.new(File.read(class_template_path), nil, '-')
29
+ class_template_path = File.join(File.dirname(__FILE__), "class_template.md.erb")
30
+ class_renderer = ERB.new(File.read(class_template_path), nil, "-")
31
31
  data.each do |cls|
32
32
  File.write("#{cls.filename}.md", class_renderer.result(cls.instance_eval { binding }))
33
33
  end
34
- index_template_path = File.join(File.dirname(__FILE__), 'index_template.md.erb')
35
- index_renderer = ERB.new(File.read(index_template_path), nil, '-')
34
+ index_template_path = File.join(File.dirname(__FILE__), "index_template.md.erb")
35
+ index_renderer = ERB.new(File.read(index_template_path), nil, "-")
36
36
  File.write("Core-APIs.md", index_renderer.result(OpenStruct.new(classes: data).instance_eval { binding }))
37
37
  end
38
38
 
@@ -46,8 +46,8 @@ module RDoc
46
46
  kind: kind,
47
47
  comment: @converter.convert(klass.comment.parse),
48
48
  constants: build_members(klass.constants),
49
- class_methods: build_members(klass.method_list.select { |m| m.type == 'class' }),
50
- instance_methods: build_members(klass.method_list.select { |m| m.type == 'instance' }),
49
+ class_methods: build_members(klass.method_list.select { |m| m.type == "class" }),
50
+ instance_methods: build_members(klass.method_list.select { |m| m.type == "instance" }),
51
51
  attributes: build_members(klass.attributes),
52
52
  extended: build_members(klass.extends),
53
53
  included: build_members(klass.includes),
@@ -68,7 +68,7 @@ module RDoc
68
68
  ClassMember.new(
69
69
  title: m.name,
70
70
  comment: @converter.convert(m.comment.parse),
71
- signature: m.respond_to?(:arglists) ? m.arglists : '',
71
+ signature: m.respond_to?(:arglists) ? m.arglists : "",
72
72
  source_code: source(m),
73
73
  )
74
74
  end
@@ -77,7 +77,7 @@ module RDoc
77
77
  # Just extracts sourcecode from html formatting/highlighting into a text
78
78
  # blob so that markdown can format it with a codeblock
79
79
  def source(m)
80
- return '' unless m.respond_to?(:token_stream)
80
+ return "" unless m.respond_to?(:token_stream)
81
81
  # each line, get the text
82
82
  src = (m.token_stream || []).map do |t|
83
83
  next unless t
@@ -93,7 +93,7 @@ module RDoc
93
93
  indent = n if n < indent
94
94
  break if n == 0
95
95
  end
96
- src.gsub!(/^#{' ' * indent}/, '') if indent > 0
96
+ src.gsub!(/^#{' ' * indent}/, "") if indent > 0
97
97
  src
98
98
  end
99
99
  end
@@ -3,77 +3,84 @@
3
3
  module Extension
4
4
  class Project < ShopifyCli::ProjectType
5
5
  hidden_feature
6
- title('App Extension')
7
- creator('Extension::Commands::Create')
6
+ title("App Extension")
7
+ creator("Extension::Commands::Create")
8
8
 
9
- register_command('Extension::Commands::Build', "build")
10
- register_command('Extension::Commands::Register', "register")
11
- register_command('Extension::Commands::Push', "push")
12
- register_command('Extension::Commands::Serve', "serve")
13
- register_command('Extension::Commands::Tunnel', "tunnel")
9
+ register_command("Extension::Commands::Build", "build")
10
+ register_command("Extension::Commands::Register", "register")
11
+ register_command("Extension::Commands::Push", "push")
12
+ register_command("Extension::Commands::Serve", "serve")
13
+ register_command("Extension::Commands::Tunnel", "tunnel")
14
14
 
15
- require Project.project_filepath('messages/messages')
16
- require Project.project_filepath('messages/message_loading')
17
- require Project.project_filepath('extension_project_keys')
15
+ require Project.project_filepath("messages/messages")
16
+ require Project.project_filepath("messages/message_loading")
17
+ require Project.project_filepath("extension_project_keys")
18
18
  register_messages(Extension::Messages::MessageLoading.load)
19
19
  end
20
20
 
21
21
  module Commands
22
- autoload :ExtensionCommand, Project.project_filepath('commands/extension_command')
23
- autoload :Create, Project.project_filepath('commands/create')
24
- autoload :Register, Project.project_filepath('commands/register')
25
- autoload :Build, Project.project_filepath('commands/build')
26
- autoload :Serve, Project.project_filepath('commands/serve')
27
- autoload :Push, Project.project_filepath('commands/push')
28
- autoload :Tunnel, Project.project_filepath('commands/tunnel')
22
+ autoload :ExtensionCommand, Project.project_filepath("commands/extension_command")
23
+ autoload :Create, Project.project_filepath("commands/create")
24
+ autoload :Register, Project.project_filepath("commands/register")
25
+ autoload :Build, Project.project_filepath("commands/build")
26
+ autoload :Serve, Project.project_filepath("commands/serve")
27
+ autoload :Push, Project.project_filepath("commands/push")
28
+ autoload :Tunnel, Project.project_filepath("commands/tunnel")
29
29
  end
30
30
 
31
31
  module Tasks
32
- autoload :UserErrors, Project.project_filepath('tasks/user_errors')
33
- autoload :GetApps, Project.project_filepath('tasks/get_apps')
34
- autoload :GetApp, Project.project_filepath('tasks/get_app')
35
- autoload :CreateExtension, Project.project_filepath('tasks/create_extension')
36
- autoload :UpdateDraft, Project.project_filepath('tasks/update_draft')
37
- autoload :FetchSpecifications, Project.project_filepath('tasks/fetch_specifications')
38
- autoload :ConfigureFeatures, Project.project_filepath('tasks/configure_features')
32
+ autoload :UserErrors, Project.project_filepath("tasks/user_errors")
33
+ autoload :GetApps, Project.project_filepath("tasks/get_apps")
34
+ autoload :GetApp, Project.project_filepath("tasks/get_app")
35
+ autoload :CreateExtension, Project.project_filepath("tasks/create_extension")
36
+ autoload :UpdateDraft, Project.project_filepath("tasks/update_draft")
37
+ autoload :FetchSpecifications, Project.project_filepath("tasks/fetch_specifications")
38
+ autoload :ConfigureFeatures, Project.project_filepath("tasks/configure_features")
39
39
 
40
40
  module Converters
41
- autoload :RegistrationConverter, Project.project_filepath('tasks/converters/registration_converter')
42
- autoload :VersionConverter, Project.project_filepath('tasks/converters/version_converter')
43
- autoload :ValidationErrorConverter, Project.project_filepath('tasks/converters/validation_error_converter')
44
- autoload :AppConverter, Project.project_filepath('tasks/converters/app_converter')
41
+ autoload :RegistrationConverter, Project.project_filepath("tasks/converters/registration_converter")
42
+ autoload :VersionConverter, Project.project_filepath("tasks/converters/version_converter")
43
+ autoload :ValidationErrorConverter, Project.project_filepath("tasks/converters/validation_error_converter")
44
+ autoload :AppConverter, Project.project_filepath("tasks/converters/app_converter")
45
45
  end
46
46
  end
47
47
 
48
48
  module Forms
49
- autoload :Create, Project.project_filepath('forms/create')
50
- autoload :Register, Project.project_filepath('forms/register')
49
+ module Questions
50
+ autoload :AskApp, Project.project_filepath("forms/questions/ask_app")
51
+ autoload :AskName, Project.project_filepath("forms/questions/ask_name")
52
+ autoload :AskType, Project.project_filepath("forms/questions/ask_type")
53
+ end
54
+
55
+ autoload :Create, Project.project_filepath("forms/create")
56
+ autoload :Register, Project.project_filepath("forms/register")
51
57
  end
52
58
 
53
59
  module Features
54
- autoload :ArgoSetup, Project.project_filepath('features/argo_setup')
55
- autoload :ArgoSetupStep, Project.project_filepath('features/argo_setup_step')
56
- autoload :ArgoSetupSteps, Project.project_filepath('features/argo_setup_steps')
57
- autoload :ArgoDependencies, Project.project_filepath('features/argo_dependencies')
58
- autoload :ArgoConfig, Project.project_filepath('features/argo_config')
59
- autoload :Argo, Project.project_filepath('features/argo')
60
+ autoload :ArgoSetup, Project.project_filepath("features/argo_setup")
61
+ autoload :ArgoSetupStep, Project.project_filepath("features/argo_setup_step")
62
+ autoload :ArgoSetupSteps, Project.project_filepath("features/argo_setup_steps")
63
+ autoload :ArgoDependencies, Project.project_filepath("features/argo_dependencies")
64
+ autoload :ArgoConfig, Project.project_filepath("features/argo_config")
65
+ autoload :Argo, Project.project_filepath("features/argo")
60
66
  end
61
67
 
62
68
  module Models
63
69
  module SpecificationHandlers
64
- autoload :Default, Project.project_filepath('models/specification_handlers/default')
70
+ autoload :Default, Project.project_filepath("models/specification_handlers/default")
65
71
  end
66
72
 
67
- autoload :App, Project.project_filepath('models/app')
68
- autoload :Registration, Project.project_filepath('models/registration')
69
- autoload :Version, Project.project_filepath('models/version')
70
- autoload :ValidationError, Project.project_filepath('models/validation_error')
71
- autoload :Specification, Project.project_filepath('models/specification')
72
- autoload :Specifications, Project.project_filepath('models/specifications')
73
+ autoload :App, Project.project_filepath("models/app")
74
+ autoload :Registration, Project.project_filepath("models/registration")
75
+ autoload :Version, Project.project_filepath("models/version")
76
+ autoload :ValidationError, Project.project_filepath("models/validation_error")
77
+ autoload :Specification, Project.project_filepath("models/specification")
78
+ autoload :Specifications, Project.project_filepath("models/specifications")
79
+ autoload :LazySpecificationHandler, Project.project_filepath("models/lazy_specification_handler")
73
80
  end
74
81
 
75
- autoload :ExtensionProjectKeys, Project.project_filepath('extension_project_keys')
76
- autoload :ExtensionProject, Project.project_filepath('extension_project')
82
+ autoload :ExtensionProjectKeys, Project.project_filepath("extension_project_keys")
83
+ autoload :ExtensionProject, Project.project_filepath("extension_project")
77
84
 
78
85
  def self.specifications
79
86
  @specifications ||= Models::Specifications.new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'shopify_cli'
2
+ require "shopify_cli"
3
3
 
4
4
  module Extension
5
5
  module Commands
@@ -12,9 +12,9 @@ module Extension
12
12
  def call(_args, _command_name)
13
13
  system = ShopifyCli::JsSystem.new(ctx: @ctx)
14
14
 
15
- CLI::UI::Frame.open(@ctx.message('build.frame_title', system.package_manager)) do
15
+ CLI::UI::Frame.open(@ctx.message("build.frame_title", system.package_manager)) do
16
16
  success = system.call(yarn: YARN_BUILD_COMMAND, npm: NPM_BUILD_COMMAND)
17
- @ctx.abort(@ctx.message('build.build_failure_message')) unless success
17
+ @ctx.abort(@ctx.message("build.build_failure_message")) unless success
18
18
  end
19
19
  end
20
20