shopify-cli 1.1.2 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  3. data/.github/workflows/release.yml +62 -0
  4. data/.gitignore +0 -1
  5. data/.rubocop.yml +41 -2
  6. data/.rubocop_todo.yml +24 -0
  7. data/.travis.yml +1 -0
  8. data/CHANGELOG.md +24 -0
  9. data/Gemfile +2 -2
  10. data/Gemfile.lock +35 -36
  11. data/RELEASING.md +24 -26
  12. data/docs/core/index.md +16 -0
  13. data/lib/project_types/extension/cli.rb +6 -1
  14. data/lib/project_types/extension/commands/register.rb +1 -1
  15. data/lib/project_types/extension/features/argo/admin.rb +20 -0
  16. data/lib/project_types/extension/features/argo/base.rb +129 -0
  17. data/lib/project_types/extension/features/argo/checkout.rb +20 -0
  18. data/lib/project_types/extension/features/argo_config.rb +60 -0
  19. data/lib/project_types/extension/messages/messages.rb +11 -2
  20. data/lib/project_types/extension/models/type.rb +4 -0
  21. data/lib/project_types/extension/models/types/checkout_post_purchase.rb +6 -3
  22. data/lib/project_types/extension/models/types/product_subscription.rb +24 -0
  23. data/lib/project_types/node/commands/create.rb +6 -1
  24. data/lib/project_types/rails/commands/create.rb +6 -1
  25. data/lib/project_types/script/config/extension_points.yml +8 -8
  26. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +2 -2
  27. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +36 -1
  28. data/lib/project_types/script/layers/infrastructure/errors.rb +7 -0
  29. data/lib/project_types/script/messages/messages.rb +4 -3
  30. data/lib/project_types/script/ui/error_handler.rb +13 -5
  31. data/lib/shopify-cli/api.rb +5 -9
  32. data/lib/shopify-cli/commands/config.rb +33 -1
  33. data/lib/shopify-cli/commands/system.rb +9 -0
  34. data/lib/shopify-cli/core/entry_point.rb +1 -1
  35. data/lib/shopify-cli/core/monorail.rb +4 -3
  36. data/lib/shopify-cli/http_request.rb +15 -0
  37. data/lib/shopify-cli/js_system.rb +22 -5
  38. data/lib/shopify-cli/messages/messages.rb +30 -10
  39. data/lib/shopify-cli/project.rb +3 -3
  40. data/lib/shopify-cli/shopifolk.rb +67 -0
  41. data/lib/shopify-cli/tasks/create_api_client.rb +4 -2
  42. data/lib/shopify-cli/tasks/select_org_and_shop.rb +1 -0
  43. data/lib/shopify-cli/tunnel.rb +1 -1
  44. data/lib/shopify-cli/version.rb +1 -1
  45. data/lib/shopify_cli.rb +1 -0
  46. metadata +11 -4
  47. data/lib/project_types/extension/features/argo.rb +0 -48
  48. data/lib/project_types/extension/models/types/subscription_management.rb +0 -20
@@ -10,6 +10,7 @@ module ShopifyCli
10
10
  return response(organization_id.to_i, shop_domain) unless organization_id.nil? || shop_domain.nil?
11
11
  org = get_organization(organization_id)
12
12
  shop_domain ||= get_shop_domain(org)
13
+ ShopifyCli::Core::Monorail.metadata[:organization_id] = org["id"].to_i
13
14
  response(org["id"].to_i, shop_domain)
14
15
  end
15
16
 
@@ -210,7 +210,7 @@ module ShopifyCli
210
210
  end
211
211
 
212
212
  def parse_account
213
- account, timeout, _ = @log.match(/AccountName:([\w\s\d@._\-]*) SessionDuration:([\d]+) PlanName/)&.captures
213
+ account, timeout, _ = @log.match(/AccountName:(.*)\s+SessionDuration:([\d]+) PlanName/)&.captures
214
214
  @account = account&.empty? ? nil : account
215
215
  @timeout = timeout&.empty? ? 0 : timeout.to_i
216
216
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = '1.1.2'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -116,6 +116,7 @@ module ShopifyCli
116
116
  autoload :Project, 'shopify-cli/project'
117
117
  autoload :ProjectType, 'shopify-cli/project_type'
118
118
  autoload :Resources, 'shopify-cli/resources'
119
+ autoload :Shopifolk, 'shopify-cli/shopifolk'
119
120
  autoload :SubCommand, 'shopify-cli/sub_command'
120
121
  autoload :Task, 'shopify-cli/task'
121
122
  autoload :Tasks, 'shopify-cli/tasks'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,8 +77,10 @@ files:
77
77
  - ".github/ISSUE_TEMPLATE.md"
78
78
  - ".github/PULL_REQUEST_TEMPLATE.md"
79
79
  - ".github/probots.yml"
80
+ - ".github/workflows/release.yml"
80
81
  - ".gitignore"
81
82
  - ".rubocop.yml"
83
+ - ".rubocop_todo.yml"
82
84
  - ".ruby-version"
83
85
  - ".tmp/.gitkeep"
84
86
  - ".tmp/sv/.gitkeep"
@@ -147,7 +149,10 @@ files:
147
149
  - lib/project_types/extension/commands/tunnel.rb
148
150
  - lib/project_types/extension/extension_project.rb
149
151
  - lib/project_types/extension/extension_project_keys.rb
150
- - lib/project_types/extension/features/argo.rb
152
+ - lib/project_types/extension/features/argo/admin.rb
153
+ - lib/project_types/extension/features/argo/base.rb
154
+ - lib/project_types/extension/features/argo/checkout.rb
155
+ - lib/project_types/extension/features/argo_config.rb
151
156
  - lib/project_types/extension/features/argo_dependencies.rb
152
157
  - lib/project_types/extension/features/argo_setup.rb
153
158
  - lib/project_types/extension/features/argo_setup_step.rb
@@ -161,7 +166,7 @@ files:
161
166
  - lib/project_types/extension/models/registration.rb
162
167
  - lib/project_types/extension/models/type.rb
163
168
  - lib/project_types/extension/models/types/checkout_post_purchase.rb
164
- - lib/project_types/extension/models/types/subscription_management.rb
169
+ - lib/project_types/extension/models/types/product_subscription.rb
165
170
  - lib/project_types/extension/models/validation_error.rb
166
171
  - lib/project_types/extension/models/version.rb
167
172
  - lib/project_types/extension/tasks/converters/app_converter.rb
@@ -275,6 +280,7 @@ files:
275
280
  - lib/shopify-cli/helpers.rb
276
281
  - lib/shopify-cli/helpers/haikunator.rb
277
282
  - lib/shopify-cli/heroku.rb
283
+ - lib/shopify-cli/http_request.rb
278
284
  - lib/shopify-cli/js_deps.rb
279
285
  - lib/shopify-cli/js_system.rb
280
286
  - lib/shopify-cli/messages/messages.rb
@@ -289,6 +295,7 @@ files:
289
295
  - lib/shopify-cli/project_type.rb
290
296
  - lib/shopify-cli/resources.rb
291
297
  - lib/shopify-cli/resources/env_file.rb
298
+ - lib/shopify-cli/shopifolk.rb
292
299
  - lib/shopify-cli/sub_command.rb
293
300
  - lib/shopify-cli/task.rb
294
301
  - lib/shopify-cli/tasks.rb
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'base64'
3
-
4
- module Extension
5
- module Features
6
- class Argo
7
- include SmartProperties
8
-
9
- GIT_ADMIN_TEMPLATE = 'https://github.com/Shopify/argo-admin-template.git'
10
- GIT_CHECKOUT_TEMPLATE = 'https://github.com/Shopify/argo-checkout-template.git'
11
- SCRIPT_PATH = %w(build main.js).freeze
12
-
13
- class << self
14
- def admin
15
- @admin ||= Argo.new(setup: ArgoSetup.new(git_template: GIT_ADMIN_TEMPLATE))
16
- end
17
-
18
- def checkout
19
- @checkout ||= Argo.new(
20
- setup: ArgoSetup.new(
21
- git_template: GIT_CHECKOUT_TEMPLATE,
22
- dependency_checks: [ArgoDependencies.node_installed(min_major: 10, min_minor: 16)]
23
- )
24
- )
25
- end
26
- end
27
-
28
- property! :setup, accepts: Features::ArgoSetup
29
-
30
- def create(directory_name, identifier, context)
31
- setup.call(directory_name, identifier, context)
32
- end
33
-
34
- def config(context)
35
- filepath = File.join(context.root, SCRIPT_PATH)
36
- context.abort(context.message('features.argo.missing_file_error')) unless File.exist?(filepath)
37
-
38
- begin
39
- {
40
- serialized_script: Base64.strict_encode64(File.open(filepath).read.chomp),
41
- }
42
- rescue StandardError
43
- context.abort(context.message('features.argo.script_prepare_error'))
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'base64'
3
-
4
- module Extension
5
- module Models
6
- module Types
7
- class SubscriptionManagement < Models::Type
8
- IDENTIFIER = 'SUBSCRIPTION_MANAGEMENT'
9
-
10
- def create(directory_name, context)
11
- Features::Argo.admin.create(directory_name, IDENTIFIER, context)
12
- end
13
-
14
- def config(context)
15
- Features::Argo.admin.config(context)
16
- end
17
- end
18
- end
19
- end
20
- end