shopify-cli 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +2 -2
  3. data/.github/CONTRIBUTING.md +9 -1
  4. data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
  5. data/.github/workflows/release.yml +0 -1
  6. data/.github/workflows/triage.yml +22 -0
  7. data/.rubocop.yml +21 -7
  8. data/.rubocop_todo.yml +2 -15
  9. data/.travis.yml +0 -1
  10. data/CHANGELOG.md +5 -0
  11. data/Gemfile +1 -0
  12. data/Gemfile.lock +9 -6
  13. data/RELEASING.md +5 -13
  14. data/lib/project_types/extension/cli.rb +2 -1
  15. data/lib/project_types/node/cli.rb +4 -1
  16. data/lib/project_types/node/commands/connect.rb +15 -0
  17. data/lib/project_types/node/commands/create.rb +6 -7
  18. data/lib/project_types/node/messages/messages.rb +7 -6
  19. data/lib/project_types/rails/cli.rb +4 -1
  20. data/lib/project_types/rails/commands/connect.rb +15 -0
  21. data/lib/project_types/rails/commands/create.rb +6 -7
  22. data/lib/project_types/rails/messages/messages.rb +7 -4
  23. data/lib/project_types/script/cli.rb +2 -1
  24. data/lib/project_types/script/commands/enable.rb +12 -4
  25. data/lib/project_types/script/config/extension_points.yml +9 -8
  26. data/lib/project_types/script/errors.rb +4 -0
  27. data/lib/project_types/script/layers/application/build_script.rb +12 -16
  28. data/lib/project_types/script/layers/domain/errors.rb +3 -0
  29. data/lib/project_types/script/layers/domain/extension_point.rb +0 -1
  30. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +13 -48
  31. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +28 -7
  32. data/lib/project_types/script/layers/infrastructure/errors.rb +16 -0
  33. data/lib/project_types/script/layers/infrastructure/script_repository.rb +0 -12
  34. data/lib/project_types/script/layers/infrastructure/script_service.rb +2 -0
  35. data/lib/project_types/script/messages/messages.rb +22 -2
  36. data/lib/project_types/script/ui/error_handler.rb +25 -0
  37. data/lib/shopify-cli/api.rb +3 -1
  38. data/lib/shopify-cli/commands/config.rb +24 -0
  39. data/lib/shopify-cli/commands/connect.rb +32 -15
  40. data/lib/shopify-cli/core/monorail.rb +2 -1
  41. data/lib/shopify-cli/js_deps.rb +1 -1
  42. data/lib/shopify-cli/messages/messages.rb +22 -4
  43. data/lib/shopify-cli/partners_api.rb +17 -1
  44. data/lib/shopify-cli/process_supervision.rb +1 -1
  45. data/lib/shopify-cli/project.rb +12 -8
  46. data/lib/shopify-cli/project_type.rb +17 -1
  47. data/lib/shopify-cli/shopifolk.rb +32 -13
  48. data/lib/shopify-cli/task.rb +8 -0
  49. data/lib/shopify-cli/tasks/create_api_client.rb +9 -0
  50. data/lib/shopify-cli/tasks/ensure_env.rb +3 -0
  51. data/lib/shopify-cli/tasks/select_org_and_shop.rb +3 -0
  52. data/lib/shopify-cli/version.rb +1 -1
  53. metadata +5 -3
  54. data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +0 -38
@@ -17,6 +17,15 @@ module ShopifyCli
17
17
  redir: [OAuth::REDIRECT_HOST]
18
18
  )
19
19
 
20
+ unless resp
21
+ ctx.abort("Error - empty response")
22
+ end
23
+
24
+ errors = resp.dig("errors")
25
+ if !errors.nil? && errors.any?
26
+ ctx.abort(errors.map { |err| "#{err['field']} #{err['message']}" }.join(", "))
27
+ end
28
+
20
29
  user_errors = resp.dig("data", "appCreate", "userErrors")
21
30
  if !user_errors.nil? && user_errors.any?
22
31
  ctx.abort(user_errors.map { |err| "#{err['field']} #{err['message']}" }.join(", "))
@@ -22,6 +22,9 @@ module ShopifyCli
22
22
  private
23
23
 
24
24
  def fetch_org
25
+ if Shopifolk.check && wants_to_run_against_shopify_org?
26
+ Shopifolk.act_as_shopify_organization
27
+ end
25
28
  orgs = PartnersAPI::Organizations.fetch_with_app(@ctx)
26
29
  org_id = if orgs.count == 1
27
30
  orgs.first["id"]
@@ -8,6 +8,9 @@ module ShopifyCli
8
8
  def call(ctx, organization_id: nil, shop_domain: nil)
9
9
  @ctx = ctx
10
10
  return response(organization_id.to_i, shop_domain) unless organization_id.nil? || shop_domain.nil?
11
+ if Shopifolk.check && wants_to_run_against_shopify_org?
12
+ Shopifolk.act_as_shopify_organization
13
+ end
11
14
  org = get_organization(organization_id)
12
15
  shop_domain ||= get_shop_domain(org)
13
16
  ShopifyCli::Core::Monorail.metadata[:organization_id] = org["id"].to_i
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = '1.4.1'
2
+ VERSION = '1.5.0'
3
3
  end
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.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-29 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,6 +78,7 @@ files:
78
78
  - ".github/PULL_REQUEST_TEMPLATE.md"
79
79
  - ".github/probots.yml"
80
80
  - ".github/workflows/release.yml"
81
+ - ".github/workflows/triage.yml"
81
82
  - ".gitignore"
82
83
  - ".rubocop.yml"
83
84
  - ".rubocop_todo.yml"
@@ -179,6 +180,7 @@ files:
179
180
  - lib/project_types/extension/tasks/update_draft.rb
180
181
  - lib/project_types/extension/tasks/user_errors.rb
181
182
  - lib/project_types/node/cli.rb
183
+ - lib/project_types/node/commands/connect.rb
182
184
  - lib/project_types/node/commands/create.rb
183
185
  - lib/project_types/node/commands/deploy.rb
184
186
  - lib/project_types/node/commands/deploy/heroku.rb
@@ -196,6 +198,7 @@ files:
196
198
  - lib/project_types/node/forms/create.rb
197
199
  - lib/project_types/node/messages/messages.rb
198
200
  - lib/project_types/rails/cli.rb
201
+ - lib/project_types/rails/commands/connect.rb
199
202
  - lib/project_types/rails/commands/create.rb
200
203
  - lib/project_types/rails/commands/deploy.rb
201
204
  - lib/project_types/rails/commands/deploy/heroku.rb
@@ -237,7 +240,6 @@ files:
237
240
  - lib/project_types/script/layers/domain/script.rb
238
241
  - lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb
239
242
  - lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb
240
- - lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb
241
243
  - lib/project_types/script/layers/infrastructure/errors.rb
242
244
  - lib/project_types/script/layers/infrastructure/extension_point_repository.rb
243
245
  - lib/project_types/script/layers/infrastructure/project_creator.rb
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "pathname"
4
-
5
- module Script
6
- module Layers
7
- module Infrastructure
8
- class AssemblyScriptTsConfig
9
- TSCONFIG_FILE = "tsconfig.json"
10
-
11
- attr_reader :config
12
-
13
- def initialize(dir_to_write_in:)
14
- @dir_to_write_in = dir_to_write_in
15
- @config = {}
16
- end
17
-
18
- def with_extends_assemblyscript_config(relative_path_to_node_modules:)
19
- relative_path = Pathname.new(relative_path_to_node_modules).relative_path_from(@dir_to_write_in)
20
- @config[:extends] = "#{relative_path}/node_modules/assemblyscript/std/assembly.json"
21
- self
22
- end
23
-
24
- def with_module_resolution_paths(paths:)
25
- @config[:compilerOptions] = {
26
- baseUrl: ".",
27
- paths: paths,
28
- }
29
- self
30
- end
31
-
32
- def write
33
- File.write("#{@dir_to_write_in}/#{TSCONFIG_FILE}", JSON.pretty_generate(@config))
34
- end
35
- end
36
- end
37
- end
38
- end