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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cff1487d9bbf811bd4640cb9d67ea439ad198794e409355477757dac56052d65
4
- data.tar.gz: 396f98fe6702a8c37cd58c906d843bc92888a7943375f99d723e7269d2dcda04
3
+ metadata.gz: 1b440a68e264b97888e3cb181eea5e2465522c3d67338851e08775cc743416a5
4
+ data.tar.gz: a6f2acacf046ab9c6bd174d7bd077a0ea87312f844db05de015c9cacf5d972bf
5
5
  SHA512:
6
- metadata.gz: 93ad0fa7d1f935f07bc0549acaf7fdc4041dd7b00c1e097a13dcd591cec4e0a76f380c9fef0a69d33eb114703aebee8a57b6ad81fdac8f3b4c7463a22048af81
7
- data.tar.gz: d326315732e87f9343a71bbf5719c46f9a951974b31c5e927437cb8e1bb64373c312aaef2fda2ddd904bb79f36fd25309fadd3cea21b6c0482d3abd6d1e7a1ea
6
+ metadata.gz: dc49412e3aa3f7bc5dde8fa5943d2d52ae09138e92de3fcbd949353430a2ea5275dd157951dcf81770cdb36ccb5c023a570ddea3eb7756a357709360d51bb3b4
7
+ data.tar.gz: 648a9df9b5647e869d92cc23241628fbe336efeeb8c9c6ade691d55b14cb075c419e87a2f97c5eddf851e99bba1da5e595cfcd13d2d78c6c5c0cafbaeaa85dc1
@@ -20,3 +20,11 @@ Fixes #0000 <!-- link to issue if one exists -->
20
20
  Summary of the changes committed.
21
21
  Before / after screenshots appreciated for UI changes.
22
22
  -->
23
+
24
+ ### Update checklist
25
+ <!--
26
+ Ideally, CHANGELOG entries should be in the format
27
+ `* [#PR](PR URL): Message`. You should consider adding your PR
28
+ and then making the CHANGELOG update once you know the PR number.
29
+ -->
30
+ - [ ] I've added a CHANGELOG entry for this PR
@@ -0,0 +1,62 @@
1
+ name: Create Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ create-release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Extract tag name
13
+ id: tag
14
+ run: echo "::set-output name=value::${GITHUB_REF##*/}"
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Set up Ruby
18
+ uses: actions/setup-ruby@v1.1.2
19
+ with:
20
+ ruby-version: 2.6
21
+
22
+ - name: Install dependencies
23
+ run: bundle install
24
+
25
+ - name: Create package
26
+ run: bundle exec rake package
27
+
28
+ - name: Get Directory
29
+ id: folder
30
+ run: |
31
+ cd packaging/builds
32
+ echo ::set-output name=name::$(ls)
33
+
34
+ - name: Get Packages
35
+ id: binaries
36
+ run: |
37
+ cd packaging/builds/${{ steps.folder.outputs.name }}
38
+ deb=$(find . -type f -name '*.deb')
39
+ rpm=$(find . -type f -name "*.rpm")
40
+ echo ::set-output name=deb_file::"${deb:2}"
41
+ echo ::set-output name=rpm_file::"${rpm:2}"
42
+
43
+ - uses: dawidd6/action-homebrew-bump-formula@v3
44
+ with:
45
+ token: ${{secrets.BREW_TOKEN}}
46
+ tap: shopify/shopify
47
+ formula: shopify-cli
48
+ tag: ${{ steps.folder.outputs.name }}
49
+ message: "Version bump, created by github actions"
50
+
51
+ - name: Create Release # https://hub.github.com/hub-release.1.html
52
+ env:
53
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54
+ run: |
55
+ cd packaging/builds/${{ steps.folder.outputs.name }}
56
+ hub release create ${{ steps.tag.outputs.value }} \
57
+ -a ${{ steps.binaries.outputs.deb_file }} \
58
+ -a ${{ steps.binaries.outputs.rpm_file }} \
59
+ -m "Version ${{ steps.folder.outputs.name }}
60
+
61
+ Release of version ${{ steps.folder.outputs.name }} of the Shopify App CLI
62
+ Please refer to [CHANGELOG](https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md) for details."
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- .rubocop-*
2
1
  .tmp/*
3
2
  .bundle/*
4
3
  .DS_Store
@@ -1,5 +1,43 @@
1
- inherit_from:
2
- - https://shopify.github.io/ruby-style-guide/rubocop-cli.yml
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require: rubocop-minitest
4
+
5
+ inherit_gem:
6
+ rubocop-shopify:
7
+ - rubocop-cli.yml
8
+
9
+ Minitest:
10
+ Enabled: true
11
+ Include:
12
+ - '**/test/**/*'
13
+ - '**/*_test.rb'
14
+
15
+ Minitest/AssertInDelta: # (new in 0.10)
16
+ Enabled: true
17
+ Minitest/AssertionInLifecycleHook: # (new in 0.10)
18
+ Enabled: true
19
+ Minitest/AssertKindOf: # (new in 0.10)
20
+ Enabled: true
21
+ Minitest/AssertOutput: # (new in 0.10)
22
+ Enabled: true
23
+ Minitest/AssertPathExists: # (new in 0.10)
24
+ Enabled: false # only available from minitest 5.13.0
25
+ Minitest/AssertSilent: # (new in 0.10)
26
+ Enabled: true
27
+ Minitest/LiteralAsActualArgument: # (new in 0.10)
28
+ Enabled: true
29
+ Minitest/MultipleAssertions: # (new in 0.10)
30
+ Enabled: true
31
+ Minitest/RefuteInDelta: # (new in 0.10)
32
+ Enabled: true
33
+ Minitest/RefuteKindOf: # (new in 0.10)
34
+ Enabled: true
35
+ Minitest/RefutePathExists: # (new in 0.10)
36
+ Enabled: false # only available from minitest 5.13.0
37
+ Minitest/TestMethodName: # (new in 0.10)
38
+ Enabled: true
39
+ Minitest/UnspecifiedException: # (new in 0.10)
40
+ Enabled: true
3
41
 
4
42
  AllCops:
5
43
  Exclude:
@@ -45,3 +83,4 @@ Style/MethodCallWithArgsParentheses:
45
83
  - assert_equal
46
84
  - assert
47
85
  - refute
86
+ - assert_requested # from Webmock
@@ -0,0 +1,24 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-10-24 22:13:10 UTC using RuboCop version 0.93.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 29
10
+ Minitest/MultipleAssertions:
11
+ Max: 9
12
+
13
+ # Offense count: 74
14
+ # Cop supports --auto-correct.
15
+ # Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
16
+ # SupportedStyles: require_parentheses, omit_parentheses
17
+ Style/MethodCallWithArgsParentheses:
18
+ Enabled: false
19
+
20
+ # Offense count: 1
21
+ # Cop supports --auto-correct.
22
+ Style/RedundantBegin:
23
+ Exclude:
24
+ - 'test/test_helper.rb'
@@ -11,3 +11,4 @@ install:
11
11
  - bundle install
12
12
  script:
13
13
  - bundle exec rake
14
+ - if [ -f "~/.config/shopify/config" ]; then echo "Found a config file in home directory. This means the tests would modify a developer's local config. Consider using FakeFS"; exit 1; fi
@@ -1,3 +1,27 @@
1
+ Unreleased
2
+ ------
3
+
4
+ Version 1.4.1
5
+ ------
6
+ * [#917](https://github.com/Shopify/shopify-app-cli/pull/917): Ensure analytics for create action includes the same fields as other commands
7
+
8
+ Version 1.4.0
9
+ ------
10
+ * Updates to tests, dependencies and internal tooling
11
+ * [#924](https://github.com/Shopify/shopify-app-cli/pull/924): Improve debugging messages on Partner API errors
12
+
13
+ Version 1.3.1
14
+ ------
15
+ * Allow any characters in ngrok account names
16
+
17
+ Version 1.3.0
18
+ ------
19
+ * Support for new `shopify config analytics` command to enable/disable anonymous usage reporting
20
+
21
+ Version 1.2.0
22
+ ------
23
+ * Improvements and new functionality to various internal components
24
+
1
25
  Version 1.1.2
2
26
  ------
3
27
  * Fix various minor bugs (check dir before creating Rails project, catch stderr from failed git command)
data/Gemfile CHANGED
@@ -8,11 +8,11 @@ group :development, :test do
8
8
  gem 'rake'
9
9
  gem 'pry-byebug'
10
10
  gem 'byebug'
11
- gem 'rubocop'
11
+ gem 'rubocop-shopify', require: false
12
+ gem 'rubocop-minitest', require: false
12
13
  end
13
14
 
14
15
  group :test do
15
- gem 'session'
16
16
  gem 'mocha', require: false
17
17
  gem 'minitest', '>= 5.0.0', require: false
18
18
  gem 'minitest-reporters', require: false
@@ -1,61 +1,60 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.5.2)
5
- public_suffix (>= 2.0.2, < 4.0)
4
+ addressable (2.7.0)
5
+ public_suffix (>= 2.0.2, < 5.0)
6
6
  ansi (1.5.0)
7
7
  ast (2.4.1)
8
- builder (3.2.3)
9
- byebug (8.2.5)
10
- coderay (1.1.2)
11
- crack (0.4.3)
12
- safe_yaml (~> 1.0.0)
8
+ builder (3.2.4)
9
+ byebug (11.1.3)
10
+ coderay (1.1.3)
11
+ crack (0.4.4)
13
12
  fakefs (1.2.2)
14
- hashdiff (0.3.2)
15
- metaclass (0.0.4)
16
- method_source (0.9.2)
17
- minitest (5.11.3)
18
- minitest-reporters (1.3.5)
13
+ hashdiff (1.0.1)
14
+ method_source (1.0.0)
15
+ minitest (5.14.2)
16
+ minitest-reporters (1.4.2)
19
17
  ansi
20
18
  builder
21
19
  minitest (>= 5.0)
22
20
  ruby-progressbar
23
- mocha (1.7.0)
24
- metaclass (~> 0.0.1)
21
+ mocha (1.11.2)
25
22
  parallel (1.19.2)
26
- parser (2.7.1.4)
23
+ parser (2.7.2.0)
27
24
  ast (~> 2.4.1)
28
- pry (0.12.2)
29
- coderay (~> 1.1.0)
30
- method_source (~> 0.9.0)
31
- pry-byebug (3.3.0)
32
- byebug (~> 8.0)
33
- pry (~> 0.10)
34
- public_suffix (3.0.3)
25
+ pry (0.13.1)
26
+ coderay (~> 1.1)
27
+ method_source (~> 1.0)
28
+ pry-byebug (3.9.0)
29
+ byebug (~> 11.0)
30
+ pry (~> 0.13.0)
31
+ public_suffix (4.0.6)
35
32
  rainbow (3.0.0)
36
33
  rake (13.0.1)
37
- regexp_parser (1.7.1)
34
+ regexp_parser (1.8.2)
38
35
  rexml (3.2.4)
39
- rubocop (0.89.1)
36
+ rubocop (0.93.1)
40
37
  parallel (~> 1.10)
41
- parser (>= 2.7.1.1)
38
+ parser (>= 2.7.1.5)
42
39
  rainbow (>= 2.2.2, < 4.0)
43
- regexp_parser (>= 1.7)
40
+ regexp_parser (>= 1.8)
44
41
  rexml
45
- rubocop-ast (>= 0.3.0, < 1.0)
42
+ rubocop-ast (>= 0.6.0)
46
43
  ruby-progressbar (~> 1.7)
47
44
  unicode-display_width (>= 1.4.0, < 2.0)
48
- rubocop-ast (0.3.0)
49
- parser (>= 2.7.1.4)
45
+ rubocop-ast (1.1.0)
46
+ parser (>= 2.7.1.5)
47
+ rubocop-minitest (0.10.1)
48
+ rubocop (>= 0.87)
49
+ rubocop-shopify (1.0.6)
50
+ rubocop (>= 0.92, < 0.94)
50
51
  ruby-progressbar (1.10.1)
51
- safe_yaml (1.0.4)
52
- session (3.2.0)
53
- timecop (0.9.1)
52
+ timecop (0.9.2)
54
53
  unicode-display_width (1.7.0)
55
- webmock (2.3.2)
54
+ webmock (3.9.3)
56
55
  addressable (>= 2.3.6)
57
56
  crack (>= 0.3.2)
58
- hashdiff
57
+ hashdiff (>= 0.4.0, < 2.0.0)
59
58
 
60
59
  PLATFORMS
61
60
  ruby
@@ -68,8 +67,8 @@ DEPENDENCIES
68
67
  mocha
69
68
  pry-byebug
70
69
  rake
71
- rubocop
72
- session
70
+ rubocop-minitest
71
+ rubocop-shopify
73
72
  timecop
74
73
  webmock
75
74
 
@@ -2,50 +2,48 @@
2
2
 
3
3
  1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
4
 
5
- 2. Create a branch named `release_X_Y_Z` (replacing `X_Y_Z` with the intended release version)
5
+ 1. Make sure you're on the most recent `master`
6
+ ```
7
+ $ git checkout master
8
+ $ git pull
9
+ ```
10
+
11
+ 1. Create a branch named `release_X_Y_Z` (replacing `X_Y_Z` with the intended release version)
6
12
  ```
7
13
  $ git checkout -b release_X_Y_Z
8
14
  ```
9
15
 
10
- 3. Update the version of Shopify CLI in `lib/shopify-cli/version.rb`
16
+ 1. Update the version of Shopify CLI in `lib/shopify-cli/version.rb`
11
17
 
12
- 4. Add an entry for the new release to `CHANGELOG.md`
18
+ 1. Add an entry for the new release to `CHANGELOG.md`
13
19
 
14
- 5. Commit the changes with a commit message like "Packaging for release X.Y.Z"
20
+ 1. Commit the changes with a commit message like "Packaging for release X.Y.Z"
15
21
  ```
16
22
  $ git commit -am "Packaging for release vX.Y.Z"
17
23
  ```
18
24
 
19
- 6. Push out the changes
25
+ 1. Push out the changes
20
26
  ```
21
27
  $ git push -u origin release_X_Y_Z
22
28
  ```
23
29
 
24
- 7. Open a PR for the branch, get necessary approvals from code owners and merge into main branch. Note that the PR title will be the release note in Shipit, so make sure it mentions the release
30
+ 1. Open a PR for the branch, get necessary approvals from code owners and merge into main branch. Note that the PR title will be the release note in Shipit, so make sure it mentions the release
25
31
 
26
- 8. Deploy using Shipit
32
+ 1. Deploy using Shipit
27
33
 
28
- 9. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
34
+ 1. Update your `master` branch to the latest version
35
+ ```
36
+ $ git checkout master
37
+ $ git pull
38
+ ```
39
+
40
+ 1. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
29
41
  ```
30
42
  $ rake package
31
43
  ```
32
44
  This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
33
45
 
34
- 10. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
35
- * create a branch named `release_X_Y_Z_of_shopify-cli`
36
- * update the brew formula in `shopify-cli.rb` with the generated formula in `packaging/builds/X.Y.Z/` in the `Shopify/shopify-app-cli` repo (from step 9)
37
- * commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
38
- * when PR is approved, merge into main branch
39
-
40
- 11. Go to [releases](https://github.com/Shopify/shopify-app-cli/releases) page of `Shopify/shopify-app-cli` repo and create a new release:
41
- * use the tag created in step 8 by Shipit (should be "vX.Y.Z")
42
- * release title = "Version X.Y.Z"
43
- * description should be
44
- ```
45
- Release of version X.Y.Z of Shopify App CLI
46
-
47
- Please refer to [CHANGELOG](https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md) for details.
48
- ```
49
- * upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
50
- * if it's a pre-release version, select the "This is a pre-release" checkbox
51
- * and click "Publish release".
46
+ 1. Check the "Actions" tab to see if the _Create Release_ workflow is successful.
47
+ The workflow will automatically create a release with the latest tag and the `.deb`, `.rpm` assets attached.
48
+
49
+ 1. Check the `Shopify/homebrew-shopify` repository for new branch `bump-shopify-cli-{version}` and create PR.
@@ -68,3 +68,19 @@ Log out of the currently authenticated partner organization and store. The `logo
68
68
  $ shopify logout
69
69
  ```
70
70
 
71
+ ## `config`
72
+
73
+ Configure Shopify App CLI options. Currently there are two available options.
74
+
75
+ ### `analytics`
76
+
77
+ Configure anonymous usage reporting by enabling or disabling analytics
78
+ ```console
79
+ $ shopify config analytics [ --status | --enable | --disable ]
80
+ ```
81
+
82
+ ### `feature`
83
+ Configure active [feature sets](https://github.com/Shopify/shopify-app-cli/wiki/Feature-Sets) in the CLI. This command is used for development and debugging work on the CLI tool itself. Only alter it if you know what you're doing. Check the [Shopify App CLI development guide](https://github.com/Shopify/shopify-app-cli/wiki) for more information.
84
+ ```console
85
+ $ shopify config feature [ feature_name ] [ --status | --enable | --disable ]
86
+ ```
@@ -48,11 +48,16 @@ module Extension
48
48
  end
49
49
 
50
50
  module Features
51
- autoload :Argo, Project.project_filepath('features/argo')
52
51
  autoload :ArgoSetup, Project.project_filepath('features/argo_setup')
53
52
  autoload :ArgoSetupStep, Project.project_filepath('features/argo_setup_step')
54
53
  autoload :ArgoSetupSteps, Project.project_filepath('features/argo_setup_steps')
55
54
  autoload :ArgoDependencies, Project.project_filepath('features/argo_dependencies')
55
+ autoload :ArgoConfig, Project.project_filepath('features/argo_config')
56
+ module Argo
57
+ autoload :Base, Project.project_filepath('features/argo/base')
58
+ autoload :Admin, Project.project_filepath('features/argo/admin')
59
+ autoload :Checkout, Project.project_filepath('features/argo/checkout')
60
+ end
56
61
  end
57
62
 
58
63
  module Models
@@ -52,7 +52,7 @@ module Extension
52
52
  Tasks::CreateExtension.call(
53
53
  context: @ctx,
54
54
  api_key: app.api_key,
55
- type: extension_type.identifier,
55
+ type: extension_type.graphql_identifier,
56
56
  title: project.title,
57
57
  config: {},
58
58
  extension_context: extension_type.extension_context(@ctx)