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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +12 -12
- data/Rakefile +32 -30
- data/bin/load_shopify.rb +6 -6
- data/bin/shopify +2 -2
- data/ext/shopify-cli/extconf.rb +7 -7
- data/lib/docgen/markdown.rb +11 -11
- data/lib/{project_types/extension/graphql → graphql}/get_app_by_api_key.graphql +0 -0
- data/lib/project_types/extension/cli.rb +52 -45
- data/lib/project_types/extension/commands/build.rb +3 -3
- data/lib/project_types/extension/commands/create.rb +16 -9
- data/lib/project_types/extension/commands/extension_command.rb +8 -5
- data/lib/project_types/extension/commands/push.rb +8 -8
- data/lib/project_types/extension/commands/register.rb +19 -30
- data/lib/project_types/extension/commands/serve.rb +2 -2
- data/lib/project_types/extension/commands/tunnel.rb +12 -12
- data/lib/project_types/extension/extension_project.rb +4 -4
- data/lib/project_types/extension/extension_project_keys.rb +4 -4
- data/lib/project_types/extension/features/argo.rb +13 -13
- data/lib/project_types/extension/features/argo_config.rb +5 -5
- data/lib/project_types/extension/features/argo_dependencies.rb +5 -5
- data/lib/project_types/extension/features/argo_setup.rb +2 -2
- data/lib/project_types/extension/features/argo_setup_steps.rb +4 -4
- data/lib/project_types/extension/forms/create.rb +28 -34
- data/lib/project_types/extension/forms/questions/ask_app.rb +53 -0
- data/lib/project_types/extension/forms/questions/ask_name.rb +40 -0
- data/lib/project_types/extension/forms/questions/ask_type.rb +36 -0
- data/lib/project_types/extension/messages/messages.rb +53 -52
- data/lib/project_types/extension/models/lazy_specification_handler.rb +12 -0
- data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/default.rb +2 -2
- data/lib/project_types/extension/models/specifications.rb +3 -3
- data/lib/project_types/extension/tasks/configure_features.rb +4 -4
- data/lib/project_types/extension/tasks/converters/app_converter.rb +6 -6
- data/lib/project_types/extension/tasks/converters/registration_converter.rb +6 -6
- data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +4 -4
- data/lib/project_types/extension/tasks/converters/version_converter.rb +7 -7
- data/lib/project_types/extension/tasks/create_extension.rb +4 -4
- data/lib/project_types/extension/tasks/fetch_specifications.rb +4 -4
- data/lib/project_types/extension/tasks/get_app.rb +4 -4
- data/lib/project_types/extension/tasks/get_apps.rb +3 -3
- data/lib/project_types/extension/tasks/update_draft.rb +4 -4
- data/lib/project_types/extension/tasks/user_errors.rb +4 -4
- data/lib/project_types/node/cli.rb +19 -19
- data/lib/project_types/node/commands/connect.rb +3 -3
- data/lib/project_types/node/commands/create.rb +40 -38
- data/lib/project_types/node/commands/deploy.rb +4 -4
- data/lib/project_types/node/commands/deploy/heroku.rb +24 -24
- data/lib/project_types/node/commands/generate.rb +8 -8
- data/lib/project_types/node/commands/open.rb +2 -2
- data/lib/project_types/node/commands/populate.rb +6 -6
- data/lib/project_types/node/commands/populate/customer.rb +5 -5
- data/lib/project_types/node/commands/populate/draft_order.rb +5 -5
- data/lib/project_types/node/commands/populate/product.rb +5 -5
- data/lib/project_types/node/commands/serve.rb +9 -9
- data/lib/project_types/node/commands/tunnel.rb +7 -7
- data/lib/project_types/node/forms/create.rb +7 -7
- data/lib/project_types/node/messages/messages.rb +3 -3
- data/lib/project_types/rails/cli.rb +21 -21
- data/lib/project_types/rails/commands/connect.rb +3 -3
- data/lib/project_types/rails/commands/create.rb +51 -48
- data/lib/project_types/rails/commands/deploy.rb +4 -4
- data/lib/project_types/rails/commands/deploy/heroku.rb +30 -30
- data/lib/project_types/rails/commands/generate.rb +7 -7
- data/lib/project_types/rails/commands/generate/webhook.rb +6 -6
- data/lib/project_types/rails/commands/open.rb +2 -2
- data/lib/project_types/rails/commands/populate.rb +6 -6
- data/lib/project_types/rails/commands/populate/customer.rb +5 -5
- data/lib/project_types/rails/commands/populate/draft_order.rb +5 -5
- data/lib/project_types/rails/commands/populate/product.rb +5 -5
- data/lib/project_types/rails/commands/serve.rb +11 -11
- data/lib/project_types/rails/commands/tunnel.rb +7 -7
- data/lib/project_types/rails/forms/create.rb +23 -23
- data/lib/project_types/rails/gem.rb +23 -23
- data/lib/project_types/rails/messages/messages.rb +4 -4
- data/lib/project_types/rails/ruby.rb +2 -2
- data/lib/project_types/script/cli.rb +40 -40
- data/lib/project_types/script/commands/create.rb +9 -8
- data/lib/project_types/script/commands/disable.rb +3 -3
- data/lib/project_types/script/commands/enable.rb +9 -7
- data/lib/project_types/script/commands/push.rb +5 -4
- data/lib/project_types/script/errors.rb +17 -0
- data/lib/project_types/script/forms/create.rb +5 -5
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +2 -0
- data/lib/project_types/script/layers/application/build_script.rb +6 -8
- data/lib/project_types/script/layers/application/create_script.rb +2 -2
- data/lib/project_types/script/layers/application/disable_script.rb +2 -2
- data/lib/project_types/script/layers/application/enable_script.rb +2 -2
- data/lib/project_types/script/layers/application/project_dependencies.rb +4 -4
- data/lib/project_types/script/layers/application/push_script.rb +4 -12
- data/lib/project_types/script/layers/domain/push_package.rb +5 -1
- data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +3 -3
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +10 -10
- data/lib/project_types/script/layers/infrastructure/errors.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +12 -17
- data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +4 -4
- data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_service.rb +18 -16
- data/lib/project_types/script/messages/messages.rb +14 -8
- data/lib/project_types/script/script_project.rb +27 -5
- data/lib/project_types/script/ui/error_handler.rb +80 -68
- data/lib/project_types/script/ui/printing_spinner.rb +1 -1
- data/lib/project_types/script/ui/strict_spinner.rb +1 -1
- data/lib/project_types/theme/cli.rb +19 -19
- data/lib/project_types/theme/commands/connect.rb +12 -12
- data/lib/project_types/theme/commands/create.rb +11 -11
- data/lib/project_types/theme/commands/deploy.rb +8 -8
- data/lib/project_types/theme/commands/generate.rb +3 -3
- data/lib/project_types/theme/commands/generate/env.rb +15 -15
- data/lib/project_types/theme/commands/push.rb +15 -15
- data/lib/project_types/theme/commands/serve.rb +5 -5
- data/lib/project_types/theme/forms/connect.rb +4 -4
- data/lib/project_types/theme/forms/create.rb +5 -5
- data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +22 -22
- data/lib/project_types/theme/themekit.rb +15 -15
- data/lib/rubygems_plugin.rb +3 -3
- data/lib/shopify-cli/admin_api.rb +11 -11
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +17 -17
- data/lib/shopify-cli/admin_api/schema.rb +3 -3
- data/lib/shopify-cli/api.rb +10 -10
- data/lib/shopify-cli/command.rb +1 -1
- data/lib/shopify-cli/commands.rb +9 -9
- data/lib/shopify-cli/commands/config.rb +28 -52
- data/lib/shopify-cli/commands/connect.rb +10 -10
- data/lib/shopify-cli/commands/create.rb +5 -5
- data/lib/shopify-cli/commands/help.rb +6 -6
- data/lib/shopify-cli/commands/logout.rb +3 -3
- data/lib/shopify-cli/commands/system.rb +32 -32
- data/lib/shopify-cli/commands/version.rb +2 -2
- data/lib/shopify-cli/context.rb +23 -23
- data/lib/shopify-cli/core.rb +4 -4
- data/lib/shopify-cli/core/entry_point.rb +5 -5
- data/lib/shopify-cli/core/executor.rb +1 -1
- data/lib/shopify-cli/core/help_resolver.rb +2 -2
- data/lib/shopify-cli/core/monorail.rb +16 -16
- data/lib/shopify-cli/db.rb +2 -2
- data/lib/shopify-cli/feature.rb +1 -1
- data/lib/shopify-cli/form.rb +1 -1
- data/lib/shopify-cli/git.rb +17 -17
- data/lib/shopify-cli/helpers.rb +1 -1
- data/lib/shopify-cli/helpers/haikunator.rb +1 -1
- data/lib/shopify-cli/heroku.rb +28 -28
- data/lib/shopify-cli/http_request.rb +2 -2
- data/lib/shopify-cli/js_deps.rb +12 -12
- data/lib/shopify-cli/js_system.rb +5 -5
- data/lib/shopify-cli/lazy_delegator.rb +55 -0
- data/lib/shopify-cli/messages/messages.rb +4 -14
- data/lib/shopify-cli/oauth.rb +25 -25
- data/lib/shopify-cli/oauth/servlet.rb +9 -9
- data/lib/shopify-cli/options.rb +3 -3
- data/lib/shopify-cli/packager.rb +24 -24
- data/lib/shopify-cli/partners_api.rb +16 -16
- data/lib/shopify-cli/partners_api/organizations.rb +10 -10
- data/lib/shopify-cli/process_supervision.rb +7 -7
- data/lib/shopify-cli/project.rb +16 -16
- data/lib/shopify-cli/project_type.rb +3 -3
- data/lib/shopify-cli/resources.rb +1 -1
- data/lib/shopify-cli/resources/env_file.rb +9 -9
- data/lib/shopify-cli/result.rb +8 -8
- data/lib/shopify-cli/shopifolk.rb +6 -9
- data/lib/shopify-cli/sub_command.rb +1 -1
- data/lib/shopify-cli/task.rb +3 -3
- data/lib/shopify-cli/tasks.rb +7 -7
- data/lib/shopify-cli/tasks/create_api_client.rb +5 -5
- data/lib/shopify-cli/tasks/ensure_dev_store.rb +11 -11
- data/lib/shopify-cli/tasks/ensure_env.rb +15 -15
- data/lib/shopify-cli/tasks/ensure_loopback_url.rb +4 -4
- data/lib/shopify-cli/tasks/select_org_and_shop.rb +19 -19
- data/lib/shopify-cli/tasks/update_dashboard_urls.rb +10 -10
- data/lib/shopify-cli/transform_data_structure.rb +86 -0
- data/lib/shopify-cli/tunnel.rb +30 -30
- data/lib/shopify-cli/version.rb +1 -1
- data/lib/shopify_cli.rb +56 -54
- data/shopify-cli.gemspec +6 -6
- data/vendor/gen/template/bin/update-deps +9 -9
- metadata +9 -4
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 718e73fd7541d075d7caf66c078dfe9ba3723299aa4fc668164dda9953c5dc7f
|
4
|
+
data.tar.gz: 116ed7d69bca5345c7120b9ca5e53172afe3bebaceb0a0539a2d128ebab6235f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
12
|
-
gem
|
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
|
17
|
-
gem
|
18
|
-
gem
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
gem
|
22
|
-
gem
|
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
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
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[
|
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(
|
19
|
+
exec("irb", "-r", "./bin/load_shopify.rb", "-r", "byebug")
|
20
20
|
end
|
21
21
|
|
22
22
|
namespace :rdoc do
|
23
|
-
repo =
|
24
|
-
intermediate =
|
23
|
+
repo = "https://github.com/Shopify/shopify-app-cli.wiki.git"
|
24
|
+
intermediate = "markdown_intermediate"
|
25
25
|
file_to_doc = [
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
45
|
-
require
|
46
|
+
require "rdoc/rdoc"
|
47
|
+
require "docgen/markdown"
|
46
48
|
options = RDoc::Options.new
|
47
|
-
options.setup_generator(
|
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
|
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,
|
60
|
+
FileUtils.cp(Dir[File.join(intermediate, "*.md")], temp_dir)
|
59
61
|
Dir.chdir(temp_dir) do
|
60
|
-
system(
|
62
|
+
system("git add --all")
|
61
63
|
system('git commit -am "auto doc update"')
|
62
|
-
system(
|
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:
|
76
|
+
task(rdoc: "rdoc:all")
|
75
77
|
|
76
78
|
namespace :package do
|
77
|
-
require
|
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:
|
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[
|
7
|
-
ENV[
|
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[
|
13
|
-
p.start_with?(
|
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
|
18
|
+
require "shopify_cli"
|
19
19
|
|
20
|
-
if ENV[
|
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[
|
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
|
30
|
+
require_relative "./load_shopify"
|
31
31
|
|
32
32
|
exit(ShopifyCli::ErrorHandler.call do
|
33
33
|
ShopifyCli::Core::EntryPoint.call(ARGV.dup)
|
data/ext/shopify-cli/extconf.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "rbconfig"
|
2
|
+
require "fileutils"
|
3
3
|
|
4
|
-
gem = File.expand_path(
|
5
|
-
exe = File.join(gem,
|
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 +
|
26
|
-
symlink =
|
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(
|
47
|
+
File.write("Makefile", makefile_content)
|
data/lib/docgen/markdown.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
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__),
|
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__),
|
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 ==
|
50
|
-
instance_methods: build_members(klass.method_list.select { |m| m.type ==
|
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
|
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}/,
|
96
|
+
src.gsub!(/^#{' ' * indent}/, "") if indent > 0
|
97
97
|
src
|
98
98
|
end
|
99
99
|
end
|
File without changes
|
@@ -3,77 +3,84 @@
|
|
3
3
|
module Extension
|
4
4
|
class Project < ShopifyCli::ProjectType
|
5
5
|
hidden_feature
|
6
|
-
title(
|
7
|
-
creator(
|
6
|
+
title("App Extension")
|
7
|
+
creator("Extension::Commands::Create")
|
8
8
|
|
9
|
-
register_command(
|
10
|
-
register_command(
|
11
|
-
register_command(
|
12
|
-
register_command(
|
13
|
-
register_command(
|
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(
|
16
|
-
require Project.project_filepath(
|
17
|
-
require Project.project_filepath(
|
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(
|
23
|
-
autoload :Create, Project.project_filepath(
|
24
|
-
autoload :Register, Project.project_filepath(
|
25
|
-
autoload :Build, Project.project_filepath(
|
26
|
-
autoload :Serve, Project.project_filepath(
|
27
|
-
autoload :Push, Project.project_filepath(
|
28
|
-
autoload :Tunnel, Project.project_filepath(
|
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(
|
33
|
-
autoload :GetApps, Project.project_filepath(
|
34
|
-
autoload :GetApp, Project.project_filepath(
|
35
|
-
autoload :CreateExtension, Project.project_filepath(
|
36
|
-
autoload :UpdateDraft, Project.project_filepath(
|
37
|
-
autoload :FetchSpecifications, Project.project_filepath(
|
38
|
-
autoload :ConfigureFeatures, Project.project_filepath(
|
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(
|
42
|
-
autoload :VersionConverter, Project.project_filepath(
|
43
|
-
autoload :ValidationErrorConverter, Project.project_filepath(
|
44
|
-
autoload :AppConverter, Project.project_filepath(
|
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
|
-
|
50
|
-
|
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(
|
55
|
-
autoload :ArgoSetupStep, Project.project_filepath(
|
56
|
-
autoload :ArgoSetupSteps, Project.project_filepath(
|
57
|
-
autoload :ArgoDependencies, Project.project_filepath(
|
58
|
-
autoload :ArgoConfig, Project.project_filepath(
|
59
|
-
autoload :Argo, Project.project_filepath(
|
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(
|
70
|
+
autoload :Default, Project.project_filepath("models/specification_handlers/default")
|
65
71
|
end
|
66
72
|
|
67
|
-
autoload :App, Project.project_filepath(
|
68
|
-
autoload :Registration, Project.project_filepath(
|
69
|
-
autoload :Version, Project.project_filepath(
|
70
|
-
autoload :ValidationError, Project.project_filepath(
|
71
|
-
autoload :Specification, Project.project_filepath(
|
72
|
-
autoload :Specifications, Project.project_filepath(
|
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(
|
76
|
-
autoload :ExtensionProject, Project.project_filepath(
|
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
|
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(
|
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(
|
17
|
+
@ctx.abort(@ctx.message("build.build_failure_message")) unless success
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|