shopify-cli 1.6.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +15 -2
- data/CHANGELOG.md +21 -0
- data/Gemfile +12 -12
- data/Gemfile.lock +14 -14
- data/Rakefile +32 -30
- data/bin/load_shopify.rb +6 -6
- data/bin/shopify +2 -2
- data/dev.yml +3 -0
- data/ext/shopify-cli/extconf.rb +7 -7
- data/lib/docgen/markdown.rb +12 -12
- data/lib/graphql/extension_create.graphql +17 -2
- data/lib/graphql/fetch_specifications.graphql +14 -0
- data/lib/{project_types/extension/graphql → graphql}/get_app_by_api_key.graphql +0 -0
- data/lib/project_types/extension/cli.rb +56 -55
- data/lib/project_types/extension/commands/build.rb +3 -3
- data/lib/project_types/extension/commands/create.rb +17 -10
- data/lib/project_types/extension/commands/extension_command.rb +14 -7
- data/lib/project_types/extension/commands/push.rb +10 -10
- data/lib/project_types/extension/commands/register.rb +22 -32
- data/lib/project_types/extension/commands/serve.rb +1 -7
- data/lib/project_types/extension/commands/tunnel.rb +12 -12
- data/lib/project_types/extension/extension_project.rb +22 -7
- data/lib/project_types/extension/extension_project_keys.rb +5 -4
- data/lib/project_types/extension/features/argo.rb +26 -42
- 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_renderer_package.rb +47 -0
- data/lib/project_types/extension/features/argo_serve.rb +69 -0
- data/lib/project_types/extension/features/argo_setup.rb +3 -3
- 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 +47 -0
- data/lib/project_types/extension/messages/message_loading.rb +3 -1
- data/lib/project_types/extension/messages/messages.rb +55 -55
- data/lib/project_types/extension/models/lazy_specification_handler.rb +12 -0
- data/lib/project_types/extension/models/registration.rb +1 -0
- data/lib/project_types/extension/models/specification.rb +6 -2
- data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/default.rb +10 -2
- data/lib/project_types/extension/models/specifications.rb +14 -3
- data/lib/project_types/extension/models/version.rb +1 -1
- data/lib/project_types/extension/tasks/configure_features.rb +7 -5
- data/lib/project_types/extension/tasks/converters/app_converter.rb +6 -6
- data/lib/project_types/extension/tasks/converters/registration_converter.rb +8 -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 +8 -28
- 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 +2 -24
- 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 +17 -8
- data/lib/project_types/node/messages/messages.rb +8 -7
- 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 +34 -24
- data/lib/project_types/rails/gem.rb +23 -23
- data/lib/project_types/rails/messages/messages.rb +9 -8
- data/lib/project_types/rails/ruby.rb +2 -2
- data/lib/project_types/script/cli.rb +36 -40
- data/lib/project_types/script/commands/create.rb +9 -13
- data/lib/project_types/script/commands/push.rb +6 -5
- data/lib/project_types/script/config/extension_points.yml +25 -10
- data/lib/project_types/script/errors.rb +1 -19
- data/lib/project_types/script/forms/create.rb +7 -18
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +7 -5
- data/lib/project_types/script/graphql/script_service_proxy.graphql +1 -2
- data/lib/project_types/script/layers/application/build_script.rb +6 -8
- data/lib/project_types/script/layers/application/create_script.rb +34 -24
- data/lib/project_types/script/layers/application/extension_points.rb +3 -2
- data/lib/project_types/script/layers/application/project_dependencies.rb +4 -4
- data/lib/project_types/script/layers/application/push_script.rb +10 -15
- data/lib/project_types/script/layers/domain/config_ui.rb +16 -0
- data/lib/project_types/script/layers/domain/errors.rb +16 -0
- data/lib/project_types/script/layers/domain/extension_point.rb +60 -45
- data/lib/project_types/script/layers/domain/metadata.rb +18 -25
- data/lib/project_types/script/layers/domain/push_package.rb +9 -5
- data/lib/project_types/script/layers/domain/script_project.rb +38 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +39 -10
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +9 -44
- data/lib/project_types/script/layers/infrastructure/errors.rb +50 -19
- data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +16 -21
- data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +4 -4
- data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +179 -0
- data/lib/project_types/script/layers/infrastructure/script_service.rb +35 -78
- data/lib/project_types/script/messages/messages.rb +33 -57
- data/lib/project_types/script/ui/error_handler.rb +116 -88
- 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 +51 -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 +7 -7
- data/lib/shopify-cli/lazy_delegator.rb +55 -0
- data/lib/shopify-cli/messages/messages.rb +7 -16
- data/lib/shopify-cli/method_object.rb +1 -1
- data/lib/shopify-cli/oauth.rb +27 -27
- data/lib/shopify-cli/oauth/servlet.rb +9 -9
- data/lib/shopify-cli/options.rb +3 -3
- data/lib/shopify-cli/packager.rb +25 -25
- 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/resolve_constant.rb +1 -1
- data/lib/shopify-cli/resources.rb +1 -1
- data/lib/shopify-cli/resources/env_file.rb +10 -10
- data/lib/shopify-cli/result.rb +11 -11
- 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 +12 -12
- 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/deps/smart_properties/REVISION +1 -1
- data/vendor/deps/smart_properties/lib/smart_properties/property.rb +7 -1
- data/vendor/deps/smart_properties/lib/smart_properties/version.rb +1 -1
- data/vendor/gen/template/bin/update-deps +9 -9
- metadata +15 -11
- data/lib/project_types/extension/forms/register.rb +0 -47
- data/lib/project_types/script/commands/disable.rb +0 -25
- data/lib/project_types/script/commands/enable.rb +0 -78
- data/lib/project_types/script/graphql/shop_script_delete.graphql +0 -14
- data/lib/project_types/script/graphql/shop_script_update_or_create.graphql +0 -28
- data/lib/project_types/script/layers/application/disable_script.rb +0 -21
- data/lib/project_types/script/layers/application/enable_script.rb +0 -23
- data/lib/project_types/script/script_project.rb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 180a4674bfed27bb04ad09499b5c128980a93288666d3ab6aa58aa6d404d61c6
|
4
|
+
data.tar.gz: 8906cecf6a5a76db71e37ef5c1f756d417a3785c63618d4e70d808e3dcad5773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443523c8b3e6ec1bcf3b7aef21f0e45148f6c5d1c3ebbc90b7206600bfb2ba484e87e63db423bd1e9abf21e03cda550680283d37534a5879dbcfcb93ed3a80e7
|
7
|
+
data.tar.gz: 8b0c0c59a792fdc06cb2a990bc745ba1bcc64f44ed2c7caa31ef7a1daa11ccec868eb6539b3c195302b046dd1bd7fe80501a4fac2043462dc68224e0a1506b2d
|
data/.rubocop_todo.yml
CHANGED
@@ -1,11 +1,24 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-04-08 18:25:36 UTC using RuboCop version 1.12.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 35
|
10
10
|
Minitest/MultipleAssertions:
|
11
11
|
Max: 9
|
12
|
+
|
13
|
+
# Offense count: 1
|
14
|
+
# Cop supports --auto-correct.
|
15
|
+
Style/PerlBackrefs:
|
16
|
+
Exclude:
|
17
|
+
- 'lib/docgen/markdown.rb'
|
18
|
+
|
19
|
+
# Offense count: 2
|
20
|
+
# Cop supports --auto-correct.
|
21
|
+
Style/RedundantBegin:
|
22
|
+
Exclude:
|
23
|
+
- 'lib/shopify-cli/shopifolk.rb'
|
24
|
+
- 'test/shopify-cli/tunnel_test.rb'
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
Unreleased
|
2
2
|
------
|
3
3
|
|
4
|
+
Version 1.9.1
|
5
|
+
-------------
|
6
|
+
* [1201](https://github.com/Shopify/shopify-app-cli/pull/1201) Determine Argo Renderer Dynamically. This fixes `shopify serve` and `shopify push` for extensions.
|
7
|
+
|
8
|
+
Version 1.9.0
|
9
|
+
-------------
|
10
|
+
* [1181](https://github.com/Shopify/shopify-app-cli/pull/1181): Remove the subcommand references of the `generate` command for node apps (fixes [1176](https://github.com/Shopify/shopify-app-cli/issues/1176))
|
11
|
+
|
12
|
+
Version 1.8.0
|
13
|
+
-------------
|
14
|
+
* [1119](https://github.com/Shopify/shopify-app-cli/pull/1119): Enable guest serialization for scripts
|
15
|
+
|
16
|
+
Version 1.7.1
|
17
|
+
------
|
18
|
+
* Updating internal features in development
|
19
|
+
|
20
|
+
Version 1.7.0
|
21
|
+
-----
|
22
|
+
* [#1109](https://github.com/Shopify/shopify-app-cli/pull/1109): Abort app generation if name contains disallowed text.
|
23
|
+
* [#1075](https://github.com/Shopify/shopify-app-cli/pull/1075): Add support for kebab-case flags
|
24
|
+
|
4
25
|
Version 1.6.0
|
5
26
|
-----
|
6
27
|
* [#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/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ GEM
|
|
4
4
|
addressable (2.7.0)
|
5
5
|
public_suffix (>= 2.0.2, < 5.0)
|
6
6
|
ansi (1.5.0)
|
7
|
-
ast (2.4.
|
7
|
+
ast (2.4.2)
|
8
8
|
builder (3.2.4)
|
9
9
|
byebug (11.1.3)
|
10
10
|
coderay (1.1.3)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
ruby-progressbar
|
23
23
|
mocha (1.11.2)
|
24
24
|
parallel (1.20.1)
|
25
|
-
parser (
|
25
|
+
parser (3.0.1.0)
|
26
26
|
ast (~> 2.4.1)
|
27
27
|
pry (0.13.1)
|
28
28
|
coderay (~> 1.1)
|
@@ -33,26 +33,26 @@ GEM
|
|
33
33
|
public_suffix (4.0.6)
|
34
34
|
rainbow (3.0.0)
|
35
35
|
rake (13.0.1)
|
36
|
-
regexp_parser (1.
|
37
|
-
rexml (3.2.
|
38
|
-
rubocop (1.
|
36
|
+
regexp_parser (2.1.1)
|
37
|
+
rexml (3.2.5)
|
38
|
+
rubocop (1.12.1)
|
39
39
|
parallel (~> 1.10)
|
40
|
-
parser (>=
|
40
|
+
parser (>= 3.0.0.0)
|
41
41
|
rainbow (>= 2.2.2, < 4.0)
|
42
|
-
regexp_parser (>= 1.8)
|
42
|
+
regexp_parser (>= 1.8, < 3.0)
|
43
43
|
rexml
|
44
|
-
rubocop-ast (>= 1.
|
44
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
45
45
|
ruby-progressbar (~> 1.7)
|
46
|
-
unicode-display_width (>= 1.4.0, <
|
47
|
-
rubocop-ast (1.
|
46
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
47
|
+
rubocop-ast (1.4.1)
|
48
48
|
parser (>= 2.7.1.5)
|
49
49
|
rubocop-minitest (0.10.1)
|
50
50
|
rubocop (>= 0.87)
|
51
|
-
rubocop-shopify (
|
52
|
-
rubocop (~> 1.
|
53
|
-
ruby-progressbar (1.
|
51
|
+
rubocop-shopify (2.0.1)
|
52
|
+
rubocop (~> 1.11)
|
53
|
+
ruby-progressbar (1.11.0)
|
54
54
|
timecop (0.9.2)
|
55
|
-
unicode-display_width (
|
55
|
+
unicode-display_width (2.0.0)
|
56
56
|
webmock (3.9.3)
|
57
57
|
addressable (>= 2.3.6)
|
58
58
|
crack (>= 0.3.2)
|
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/dev.yml
CHANGED
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
|
@@ -89,11 +89,11 @@ module RDoc
|
|
89
89
|
lines.shift if src =~ /\A.*#\ *File/i # remove '# File' comment
|
90
90
|
lines.each do |line|
|
91
91
|
next unless line =~ /^ *(?=\S)/
|
92
|
-
n =
|
92
|
+
n = Regexp.last_match(0).length
|
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
|
@@ -1,7 +1,22 @@
|
|
1
|
-
mutation ExtensionCreate(
|
2
|
-
|
1
|
+
mutation ExtensionCreate(
|
2
|
+
$api_key: String!
|
3
|
+
$type: ExtensionType!
|
4
|
+
$title: String!
|
5
|
+
$config: JSON!
|
6
|
+
$extension_context: String
|
7
|
+
) {
|
8
|
+
extensionCreate(
|
9
|
+
input: {
|
10
|
+
apiKey: $api_key
|
11
|
+
type: $type
|
12
|
+
title: $title
|
13
|
+
config: $config
|
14
|
+
context: $extension_context
|
15
|
+
}
|
16
|
+
) {
|
3
17
|
extensionRegistration {
|
4
18
|
id
|
19
|
+
uuid
|
5
20
|
type
|
6
21
|
title
|
7
22
|
draftVersion {
|