shopify-cli 2.6.6 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer.json +5 -0
  3. data/.github/DESIGN.md +1 -1
  4. data/.github/ISSUE_TEMPLATE.md +7 -0
  5. data/.vscode/extensions.json +5 -0
  6. data/.vscode/settings.json +9 -0
  7. data/CHANGELOG.md +12 -3
  8. data/CONTRIBUTING.md +1 -29
  9. data/{Dockerfile → Codespace.dockerfile} +0 -0
  10. data/Gemfile.lock +4 -4
  11. data/README.md +20 -99
  12. data/Tests.dockerfile +35 -0
  13. data/assets/logo.png +0 -0
  14. data/dev.yml +0 -3
  15. data/docs/README.md +13 -0
  16. data/docs/contributors/testing.md +27 -0
  17. data/docs/users/installation.md +46 -0
  18. data/{THEMEKIT_MIGRATION.md → docs/users/migrate-from-themekit.md} +1 -1
  19. data/lib/project_types/extension/cli.rb +6 -3
  20. data/lib/project_types/extension/commands/create.rb +5 -6
  21. data/lib/project_types/extension/commands/extension_command.rb +1 -1
  22. data/lib/project_types/extension/features/argo_serve.rb +9 -23
  23. data/lib/project_types/extension/forms/questions/ask_template.rb +1 -5
  24. data/lib/project_types/extension/models/development_server_requirements.rb +2 -3
  25. data/lib/project_types/extension/models/server_config/app.rb +13 -0
  26. data/lib/project_types/extension/models/server_config/development.rb +5 -4
  27. data/lib/project_types/extension/models/server_config/development_renderer.rb +1 -1
  28. data/lib/project_types/extension/models/server_config/development_resource.rb +13 -0
  29. data/lib/project_types/extension/models/server_config/extension.rb +3 -1
  30. data/lib/project_types/extension/models/server_config/root.rb +4 -1
  31. data/lib/project_types/extension/tasks/convert_server_config.rb +65 -0
  32. data/lib/project_types/extension/tasks/ensure_resource_url.rb +39 -0
  33. data/lib/project_types/extension/tasks/merge_server_config.rb +32 -0
  34. data/lib/project_types/extension/tasks/run_extension_command.rb +10 -9
  35. data/lib/project_types/node/cli.rb +0 -16
  36. data/lib/project_types/node/forms/create.rb +5 -5
  37. data/lib/project_types/node/messages/messages.rb +2 -144
  38. data/lib/project_types/php/cli.rb +0 -11
  39. data/lib/project_types/php/forms/create.rb +5 -6
  40. data/lib/project_types/php/messages/messages.rb +2 -161
  41. data/lib/project_types/rails/cli.rb +0 -16
  42. data/lib/project_types/rails/commands/create.rb +1 -1
  43. data/lib/project_types/rails/forms/create.rb +5 -6
  44. data/lib/project_types/rails/messages/messages.rb +6 -151
  45. data/lib/project_types/script/cli.rb +1 -1
  46. data/lib/project_types/script/commands/create.rb +1 -1
  47. data/lib/project_types/script/commands/push.rb +1 -1
  48. data/lib/project_types/theme/cli.rb +1 -1
  49. data/lib/project_types/theme/commands/check.rb +1 -1
  50. data/lib/project_types/theme/commands/delete.rb +1 -1
  51. data/lib/project_types/theme/commands/init.rb +1 -1
  52. data/lib/project_types/theme/commands/language_server.rb +1 -1
  53. data/lib/project_types/theme/commands/package.rb +1 -1
  54. data/lib/project_types/theme/commands/publish.rb +1 -1
  55. data/lib/project_types/theme/commands/pull.rb +1 -1
  56. data/lib/project_types/theme/commands/push.rb +1 -1
  57. data/lib/project_types/theme/commands/serve.rb +9 -3
  58. data/lib/project_types/theme/messages/messages.rb +5 -1
  59. data/lib/shopify_cli/admin_api/populate_resource_command.rb +1 -1
  60. data/lib/shopify_cli/api.rb +7 -2
  61. data/lib/shopify_cli/app_type_detector.rb +24 -20
  62. data/lib/shopify_cli/command/app_sub_command.rb +10 -0
  63. data/lib/shopify_cli/command/project_command.rb +18 -0
  64. data/lib/shopify_cli/command/sub_command.rb +19 -0
  65. data/lib/shopify_cli/command.rb +7 -2
  66. data/lib/shopify_cli/commands/app/connect.rb +22 -0
  67. data/lib/shopify_cli/commands/app/create/node.rb +38 -0
  68. data/lib/shopify_cli/commands/app/create/php.rb +36 -0
  69. data/lib/shopify_cli/commands/app/create/rails.rb +40 -0
  70. data/lib/shopify_cli/commands/app/create.rb +28 -0
  71. data/lib/shopify_cli/commands/app/deploy.rb +49 -0
  72. data/lib/shopify_cli/commands/app/open.rb +19 -0
  73. data/lib/shopify_cli/commands/app/serve.rb +49 -0
  74. data/lib/shopify_cli/commands/app/tunnel.rb +43 -0
  75. data/lib/shopify_cli/commands/app.rb +29 -0
  76. data/lib/shopify_cli/commands/config.rb +2 -2
  77. data/lib/shopify_cli/commands.rb +1 -0
  78. data/lib/shopify_cli/constants.rb +4 -0
  79. data/lib/shopify_cli/exception_reporter.rb +3 -4
  80. data/lib/shopify_cli/git.rb +12 -1
  81. data/lib/shopify_cli/github/issue_url_generator.rb +19 -0
  82. data/lib/shopify_cli/github.rb +5 -0
  83. data/lib/shopify_cli/messages/messages.rb +252 -8
  84. data/lib/shopify_cli/project.rb +5 -1
  85. data/lib/shopify_cli/project_commands.rb +1 -1
  86. data/lib/shopify_cli/services/app/connect_service.rb +25 -0
  87. data/lib/shopify_cli/services/app/create/node_service.rb +153 -0
  88. data/lib/shopify_cli/services/app/create/php_service.rb +152 -0
  89. data/lib/shopify_cli/services/app/create/rails_service.rb +213 -0
  90. data/lib/shopify_cli/services/app/deploy/heroku/node_service.rb +101 -0
  91. data/lib/shopify_cli/services/app/deploy/heroku/php_service.rb +135 -0
  92. data/lib/shopify_cli/services/app/deploy/heroku/rails_service.rb +120 -0
  93. data/lib/shopify_cli/services/app/open_service.rb +19 -0
  94. data/lib/shopify_cli/services/app/serve/node_service.rb +42 -0
  95. data/lib/shopify_cli/services/app/serve/php_service.rb +46 -0
  96. data/lib/shopify_cli/services/app/serve/rails_service.rb +48 -0
  97. data/lib/shopify_cli/services/app/tunnel/auth_service.rb +21 -0
  98. data/lib/shopify_cli/services/app/tunnel/start_service.rb +20 -0
  99. data/lib/shopify_cli/services/app/tunnel/stop_service.rb +20 -0
  100. data/lib/shopify_cli/services.rb +31 -0
  101. data/lib/shopify_cli/theme/dev_server/local_assets.rb +1 -1
  102. data/lib/shopify_cli/theme/dev_server.rb +8 -2
  103. data/lib/shopify_cli/version.rb +1 -1
  104. data/lib/shopify_cli.rb +1 -2
  105. data/shopify-cli.gemspec +1 -1
  106. data/shopify-dev +18 -0
  107. data/utilities/constants.rb +7 -0
  108. data/utilities/docker/container.rb +10 -3
  109. data/utilities/docker.rb +2 -2
  110. data/utilities/utilities.rb +1 -0
  111. metadata +49 -48
  112. data/docs/_config.yml +0 -2
  113. data/docs/app/node/commands/index.md +0 -4
  114. data/docs/app/node/index.md +0 -4
  115. data/docs/app/rails/commands/index.md +0 -4
  116. data/docs/app/rails/index.md +0 -4
  117. data/docs/core/index.md +0 -4
  118. data/docs/getting-started/index.md +0 -4
  119. data/docs/getting-started/install/index.md +0 -4
  120. data/docs/getting-started/migrate/index.md +0 -4
  121. data/docs/getting-started/uninstall/index.md +0 -4
  122. data/docs/getting-started/upgrade/index.md +0 -4
  123. data/docs/help/start-app/index.md +0 -4
  124. data/docs/index.md +0 -4
  125. data/install.sh +0 -7
  126. data/lib/project_types/extension/tasks/converters/server_config_converter.rb +0 -30
  127. data/lib/project_types/extension/tasks/load_server_config.rb +0 -28
  128. data/lib/project_types/node/commands/connect.rb +0 -21
  129. data/lib/project_types/node/commands/create.rb +0 -125
  130. data/lib/project_types/node/commands/deploy/heroku.rb +0 -96
  131. data/lib/project_types/node/commands/deploy.rb +0 -32
  132. data/lib/project_types/node/commands/generate.rb +0 -22
  133. data/lib/project_types/node/commands/open.rb +0 -18
  134. data/lib/project_types/node/commands/serve.rb +0 -45
  135. data/lib/project_types/node/commands/tunnel.rb +0 -41
  136. data/lib/project_types/php/commands/connect.rb +0 -19
  137. data/lib/project_types/php/commands/create.rb +0 -143
  138. data/lib/project_types/php/commands/deploy/heroku.rb +0 -129
  139. data/lib/project_types/php/commands/deploy.rb +0 -32
  140. data/lib/project_types/php/commands/open.rb +0 -16
  141. data/lib/project_types/php/commands/serve.rb +0 -48
  142. data/lib/project_types/php/commands/tunnel.rb +0 -37
  143. data/lib/project_types/rails/commands/connect.rb +0 -21
  144. data/lib/project_types/rails/commands/deploy/heroku.rb +0 -115
  145. data/lib/project_types/rails/commands/deploy.rb +0 -32
  146. data/lib/project_types/rails/commands/generate/webhook.rb +0 -42
  147. data/lib/project_types/rails/commands/generate.rb +0 -60
  148. data/lib/project_types/rails/commands/open.rb +0 -18
  149. data/lib/project_types/rails/commands/serve.rb +0 -51
  150. data/lib/project_types/rails/commands/tunnel.rb +0 -41
  151. data/lib/shopify_cli/sub_command.rb +0 -17
  152. data/shopify.fish +0 -12
  153. data/shopify.sh +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb41d18df964832b9ebc6be79e80006c4750c8d416c9550cbcc625d190bf26b9
4
- data.tar.gz: d5c6b523faf27c0a6b3c53ccaadd1c4f47e932d7e0c2520e7f0bfcb2f7f7b820
3
+ metadata.gz: 4cce33ea79f749e3dc6e18d724ac5e584f887971224119f6e8ea61ade325798d
4
+ data.tar.gz: 3ae9563de4ea7eb1eaf3e51a03e71fba509ca9249c35e9be8d1311e952ddf577
5
5
  SHA512:
6
- metadata.gz: 396c3c47f510e78d67775fc6b6a091849ce8c3955d2c91ec516659ef4377df44a00a3faaa70facdd0649763b2a3b69f96ab4f859a003b23becd6baf3202d4b64
7
- data.tar.gz: 1514e2a4c8f1841e8714a30f4e05450c5116863cc2c14cf5655143a43a49e1b5f6f2da1b8ffc2af6acd683359ea970920090ba55c6f82213e91de1cd4aeb7b87
6
+ metadata.gz: f5e46c8fa4c9eeb026d7e7b451a53886338a32ea084153f541eda085a6a3bb6cf5247831498b0dcc960c9079e7eaf3906662965c32e17f2dfd31a47113343674
7
+ data.tar.gz: 46df1b135b1d37618560a00fb8121291ddf9d63f0e35c2c33abfdcf3decb2b9d0fb3380c99726cedab37bd4b01627ac4a3df51869312f82bbfd5ebeb43d9b6a3
@@ -0,0 +1,5 @@
1
+ {
2
+ "build": {
3
+ "dockerfile": "Codespace.dockerfile"
4
+ },
5
+ }
data/.github/DESIGN.md CHANGED
@@ -30,7 +30,7 @@ The user understands the following mechanics of a CLI:
30
30
  When creating a new command or subcommand there are a few things to keep in mind.
31
31
 
32
32
  ### What is the quickest way to execute a command?
33
- Commands are best executed autonomously. Most of the time the command should be self contained and should not requre additional input from the user. For example when running `shopify populate products` the command will execute without additional inputs required from the user even though the command could ask for things like `product name`, `price`, etc.
33
+ Commands are best executed autonomously. Most of the time the command should be self contained and should not require additional input from the user. For example when running `shopify populate products` the command will execute without additional inputs required from the user even though the command could ask for things like `product name`, `price`, etc.
34
34
 
35
35
  When creating a new command or subcommand consider how much information is absolutely necessary for the command to execute autonomously. If a command always requires arguments or additional information then adding smart defaults could help make inputting the command faster.
36
36
 
@@ -25,6 +25,13 @@ Tip: include an error message (in a `<details></details>` tag) if your issue is
25
25
  1.
26
26
 
27
27
 
28
+ ## Stacktrace
29
+
30
+ <!--Stacktrace
31
+ Add any stacktrace that might help debug the reported issue.
32
+ Otherwise, delete this section.
33
+ -->
34
+
28
35
 
29
36
  ## Specifications
30
37
 
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "dracula-theme.theme-dracula",
4
+ ]
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "files.exclude": {
3
+ "**/.git": true,
4
+ "**/node_modules": true,
5
+ "**/.DS_Store": true
6
+ },
7
+ "editor.formatOnSave": false,
8
+ "workbench.colorTheme": "Dracula Soft",
9
+ }
data/CHANGELOG.md CHANGED
@@ -1,9 +1,17 @@
1
1
  From version 2.6.0, the sections in this file adhere to the [keep a changelog](https://keepachangelog.com/en/1.0.0/) specification.
2
2
  ## [Unreleased]
3
3
 
4
+ ## Version 2.7.0
5
+ ### Changed
6
+ * [#1650](https://github.com/Shopify/shopify-cli/pull/1650): **Breaking** Move app commands under `shopify app`.
7
+
8
+ ### Fixed
9
+ * [#1714](https://github.com/Shopify/shopify-cli/pull/1714): Fix theme serve not serving assets locally when two URLs are on the same line
10
+ * [#1729](https://github.com/Shopify/shopify-cli/pull/1729): Update theme-check to 1.8.0
11
+
4
12
  ## Version 2.6.6
5
13
  ### Added
6
- * [#1609](https://github.com/Shopify/shopify-cli/pull/1609): Add `--bind=HOST` option to `shopify theme serve`.
14
+ * [#1609](https://github.com/Shopify/shopify-cli/pull/1609): Add `--http-bind=HOST` option to `shopify theme serve`.
7
15
 
8
16
  ### Fixed
9
17
  * [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Fix migrator's incompatibility with Ruby 2.5.
@@ -30,6 +38,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
30
38
 
31
39
  ### Changed
32
40
  * [#1635](https://github.com/Shopify/shopify-cli/pull/1635): Automatic usage and error reporting configuration has been unified under `analytics.enabled`.
41
+
33
42
  ### Security
34
43
 
35
44
  ## Version 2.6.3
@@ -53,11 +62,11 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
53
62
  * [#1553](https://github.com/Shopify/shopify-cli/pull/1553): Add support for PHP app projects
54
63
 
55
64
  ## Version 2.4.0
56
- * [#1488](https://github.com/Shopify/shopify-cli/pull/1488): Update Theme-Check to 1.4
65
+ * [#1488](https://github.com/Shopify/shopify-cli/pull/1488): Update theme-check to 1.4
57
66
  * [#1507](https://github.com/Shopify/shopify-cli/pull/1507): Limit the generated name for themes to 50 characters
58
67
 
59
68
  ## Version 2.3.0
60
- * [#1386](https://github.com/Shopify/shopify-cli/pull/1386): Update Theme-Check to 1.2
69
+ * [#1386](https://github.com/Shopify/shopify-cli/pull/1386): Update theme-check to 1.2
61
70
  * [#1457](https://github.com/Shopify/shopify-cli/pull/1457): Fix uploading of binary theme files under Windows
62
71
  * [#1480](https://github.com/Shopify/shopify-cli/pull/1480): Fix customers pages not working with `theme serve`
63
72
  * [#1479](https://github.com/Shopify/shopify-cli/pull/1479): Add theme push & pull option to ignore files per command
data/CONTRIBUTING.md CHANGED
@@ -1,31 +1,3 @@
1
1
  # Contributing
2
2
 
3
- This documents includes guidelines for contributors.
4
-
5
- ## Testing
6
-
7
- The project employs a diverse suite tests that help ensure it works as intended and prevents regressions as it continues to grow and evolve.
8
-
9
- ### Unit Tests
10
- Most of the internal components the project uses have unit tests to thoroughly test them. Here dependencies of components are mocked or stubbed appropriately to ensure tests are reliable, test only one component and are fast!
11
-
12
- ### Acceptance Tests
13
-
14
- Acceptance tests run the built `shopify` command line against a wide range of fixtures and verify its output and results. They are the slowest to run however provide the most coverage. The idea is to test a few complete scenarios for each major feature.
15
-
16
- Those are written in [Cucumber](https://cucumber.io/) and Ruby and can be found in the [`features/`](/features) directory. They can be executed by running:
17
-
18
- ```bash
19
- bundle exec cucumber
20
- bundle exec cucumber features/theme.feature:3 # A specific test
21
- ```
22
-
23
- > **Note** that we currently don't have an approach for stubbing the interactions with the GraphQL APIs and that therefore we can't write acceptance tests for commands that interact with APIs.
24
-
25
- #### Debugging acceptance tests
26
- When developing acceptance tests, it can be helpful to see the outputs of running commands.
27
- To see outputs, append `--verbose` when running an acceptance test. Example:
28
-
29
- ```sh
30
- bundle exec cucumber features/theme.feature --verbose
31
- ```
3
+ Check out the [contributors' documentation](/docs)
File without changes
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.6.6)
4
+ shopify-cli (2.7.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
- theme-check (~> 1.7.2)
7
+ theme-check (~> 1.8.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -90,7 +90,7 @@ GEM
90
90
  byebug (~> 11.0)
91
91
  pry (~> 0.13.0)
92
92
  public_suffix (4.0.6)
93
- racc (1.5.2)
93
+ racc (1.6.0)
94
94
  rack (2.2.3)
95
95
  rainbow (3.0.0)
96
96
  rake (13.0.6)
@@ -119,7 +119,7 @@ GEM
119
119
  ruby-progressbar (1.11.0)
120
120
  sys-uname (1.2.2)
121
121
  ffi (~> 1.1)
122
- theme-check (1.7.2)
122
+ theme-check (1.8.0)
123
123
  liquid (>= 5.1.0)
124
124
  nokogiri (>= 1.12)
125
125
  parser (~> 3)
data/README.md CHANGED
@@ -1,113 +1,34 @@
1
- # Shopify CLI
2
-
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)
4
- [![Build Status](https://github.com/Shopify/shopify-cli/workflows/CI/badge.svg)](https://github.com/Shopify/shopify-cli/actions)
1
+ <div align="center">
2
+ <img src="assets/logo.png" width="150"/>
3
+ <h1>Shopify CLI</h1>
4
+ <a href=""><img src="https://github.com/shopify/shopify-cli/workflows/CI/badge.svg" alt="Shopify"></a>
5
+ <img src="https://img.shields.io/github/v/release/shopify/shopify-cli?include_prereleases&style=flat-square" alt="Latest Version">
6
+ <img src="https://img.shields.io/github/forks/shopify/shopify-cli?style=flat-square" alt="GitHub forks">
7
+ <img src="https://img.shields.io/github/stars/shopify/shopify-cli?style=flat-square" alt="GitHub stars">
8
+ <img src="https://img.shields.io/github/commit-activity/w/shopify/shopify-cli?style=flat-square" alt="Commit Activity">
9
+ <img src="https://img.shields.io/github/contributors/shopify/shopify-cli?style=flat-square" alt="Contributors">
10
+ <img src="https://img.shields.io/github/commits-since/shopify/shopify-cli/latest?style=flat-square" alt="Latest Commits">
11
+ <a href="http://twitter.com/ShopifyDevs"><img src="https://img.shields.io/twitter/follow/ShopifyDevs?style=flat-square" alt="Twitter Followers"></a>
12
+ <img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License">
13
+ <img src="https://img.shields.io/badge/Powered%20by-Ruby-red" alt="Powered by Ruby">
14
+ </div>
5
15
 
6
16
 
7
17
  Shopify CLI helps you build Shopify themes and apps. Use Shopify CLI to automate and enhance your local development workflow.
8
18
 
9
19
  Shopify CLI is available as a gem and can be run and installed on Mac, Linux and Windows systems.
10
20
 
11
- ## Installation for Mac OS Users
12
-
13
- - Make sure you have [Homebrew](https://brew.sh/) installed
14
- - Open your terminal app
15
- - Run `brew tap shopify/shopify`
16
- - Run `brew install shopify-cli`
17
- - After the installation is completed, run `shopify version`, if this outputs a version number you've successfully installed the CLI.
18
-
19
- ### To upgrade Shopify CLI
20
-
21
- #### Homebrew (Mac OS)
22
-
23
- ```shell
24
- $ brew update
25
- $ brew upgrade shopify-cli
26
- ```
27
-
28
- #### apt (Debian, Ubuntu)
29
-
30
- 1.- Download the latest `.deb` binary for Shopify CLI from the releases page.
31
-
32
- 2.- Install the downloaded file and make sure to replace /path/to/download/shopify-cli-x.y.z.deb with the path to your file's location:
33
-
34
- ```shell
35
- $ sudo apt install /path/to/downloaded/shopify-cli-x.y.z.deb
36
- ```
37
-
38
- #### yum (CentOS 8+, Fedora, Red Hat, SUSE)
39
-
40
- 1.- Download the latest .rpm file for Shopify App CLI from the releases page.
41
-
42
- 2.- Install the downloaded file and make sure to replace /path/to/downloaded/shopify-cli-x.y.x.rpm with the path to your file's location:
43
-
44
- ```shell
45
- $ sudo yum install /path/to/downloaded/shopify-cli-x.y.x.rpm
46
- ```
47
-
48
- #### RubyGems (macOS, Linux, Windows 10)
49
-
50
- ```shell
51
- $ gem update shopify-cli
52
- ```
53
-
54
-
55
- ## Command specification and semantics
56
-
57
- Shopify CLI offers a command structure similar to other CLIs:
58
-
59
- `shopify [ GLOBAL_ACTION | RESOURCE [ ACTION ] ] [ VARIADIC_ARGS ] [ OPTIONS ]`
60
-
61
- The top level command will always be a **resource** or a **global action**:
62
-
63
- - Resources represent Shopify concepts that you can work with in the CLI, for example `theme`.
64
- - Usually, global actions are commands that alter the state of the CLI (e.g `config` or `login`)
65
-
66
- Actions are commands that you can run to interact with a resource.
67
-
68
- You can add `--help` or `-h` to the end of your command to get a full explanation of the available options for the command.
69
-
70
- ## Quick start guide for theme developers
71
-
72
- This quick start guide shows you how to begin local theme development when working with a new theme from scratch.
73
-
74
- ### 1.- Authenticate the CLI
75
-
76
- After you install Shopify CLI, you need to authenticate your CLI instance and connect to the store that you want to work on.
77
-
78
- Run:
79
-
80
- `shopify login --store=<your-shop-url>`
81
-
82
- When prompted, open the provided accounts.shopify.com URL in a browser. In your browser window, log into the account that's attached to the store that you want to use for development.
83
-
84
- ### 2.- Create a new theme
85
-
86
- Run:
87
-
88
- `shopify theme init`
89
-
90
- To initialize a theme on your current working directory. This will actually clone Shopify's starter theme which you should use as a reference when building themes for Shopify.
91
-
92
- ### 3.- Start the local theme server
93
-
94
- Shopify CLI comes with a local theme server which lets you preview your changes live on your local machine.
95
-
96
- After you create or navigate to your theme, you can run `shopify theme serve` to interact with the theme in a browser. Shopify CLI uploads the theme as a development theme on the store that you're connected to, and gives you an IP address and port to preview changes in real time using the store's data.
97
-
98
- Run:
99
-
100
- `shopify theme serve`
21
+ ## Installation
101
22
 
102
- To start the server. The server includes hot reload for CSS & Sections.
23
+ Check out our [installation steps](docs/users/installation.md).
103
24
 
104
- **Note:** Shopify CLI is the recommended and officially supported tool for developing themes and creating CI/CD workflows. Please refer to the [Theme Kit Migration Guide](https://github.com/Shopify/shopify-cli/blob/main/THEMEKIT_MIGRATION.md) for details.
25
+ ## Contributing 👩‍💻
105
26
 
106
- ### Contributing
27
+ Shopify CLI is an [open source tool](/LICENSE) and everyone is welcome to help the community by [contributing](/docs/README.md) to the project.
107
28
 
108
- Shopify CLI is an [open source tool](https://github.com/Shopify/shopify-cli/blob/main/LICENSE) and everyone is welcome to help the community by [contributing](https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md) to the project.
29
+ ## Help 🖐
109
30
 
110
- ### Where to get help
31
+ If you encounter issues using the CLI or have feedback you'd like to share with us, below are some options:
111
32
 
112
33
  - [Open a GitHub issue](https://github.com/Shopify/shopify-cli/issues) - To report bugs or request new features, open an issue in the Shopify CLI repository.
113
34
 
data/Tests.dockerfile ADDED
@@ -0,0 +1,35 @@
1
+ # This is a Docker image to test the CLI in UNIX environments other than macOS
2
+ # Build the image: docker build . -t shopify-cli
3
+ # Run tests: docker run -t --rm --volume "$(pwd):/usr/src/app" shopify-cli bundle exec rake test
4
+ FROM cimg/ruby:2.7.1
5
+
6
+ RUN git config --global user.email "development-lifecycle@shopify.com"
7
+ RUN git config --global user.name "Development Lifecycle"
8
+
9
+ RUN gem update bundler
10
+
11
+ WORKDIR /usr/src/app
12
+
13
+ COPY Gemfile Gemfile.lock ./
14
+ COPY shopify-cli.gemspec shopify-cli.gemspec
15
+ COPY lib/shopify_cli/version.rb lib/shopify_cli/version.rb
16
+ RUN bundle install
17
+
18
+ # Update git
19
+ RUN sudo add-apt-repository -y ppa:git-core/ppa
20
+ RUN sudo apt-get update
21
+ RUN sudo apt-get install git -y
22
+
23
+ # Install the latest version of NodeJS
24
+ RUN sudo apt-get install ca-certificates -y
25
+ RUN curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
26
+ RUN sudo apt-get install -y nodejs
27
+
28
+ # Install the latest version of Yarn
29
+ RUN sudo npm install --global yarn
30
+
31
+ # Python is necessary to compile NPM packages with native extensions through node-gyp
32
+ RUN sudo apt install python-minimal -y
33
+
34
+ # Install sqlite3
35
+ RUN sudo apt-get install libsqlite3-dev -y
data/assets/logo.png ADDED
Binary file
data/dev.yml CHANGED
@@ -13,9 +13,6 @@ up:
13
13
  - rpm:
14
14
  version: 4.16.1.3
15
15
  - bundler
16
- - node:
17
- version: 14.9.0
18
- yarn: true
19
16
  - docker
20
17
 
21
18
  test:
data/docs/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # Documentation
2
+
3
+ This directory contains documentation for **contributors** of the Shopify CLI.
4
+ It also contains documentation that is relevant to **users** like migration guidelines.
5
+
6
+ ## Contributors
7
+
8
+ - [**Testing**](contributors/testing.md): Read about testing strategies and how they are used across the codebase.
9
+
10
+ ## Users
11
+
12
+ - [**Installation**](users/installation.md): Learn how to install the Shopify CLI in different OSs.
13
+ - [**Migrate from theme-kit**](users/migrate-from-themekit.md): If you were previously using theme-kit, check out this documentation to learn how to migrate to the Shopify CLI theme commands.
@@ -0,0 +1,27 @@
1
+ ## Testing
2
+
3
+ The project employs a diverse suite tests that help ensure it works as intended and prevents regressions as it continues to grow and evolve.
4
+
5
+ ### Unit Tests
6
+ Most of the internal components the project uses have unit tests to thoroughly test them. Here dependencies of components are mocked or stubbed appropriately to ensure tests are reliable, test only one component and are fast!
7
+
8
+ ### Acceptance Tests
9
+
10
+ Acceptance tests run the built `shopify` command line against a wide range of fixtures and verify its output and results. They are the slowest to run however provide the most coverage. The idea is to test a few complete scenarios for each major feature.
11
+
12
+ Those are written in [Cucumber](https://cucumber.io/) and Ruby and can be found in the [`features/`](/features) directory. They can be executed by running:
13
+
14
+ ```bash
15
+ bundle exec cucumber
16
+ bundle exec cucumber features/theme.feature:3 # A specific test
17
+ ```
18
+
19
+ > **Note** that we currently don't have an approach for stubbing the interactions with the GraphQL APIs and that therefore we can't write acceptance tests for commands that interact with APIs.
20
+
21
+ #### Debugging acceptance tests
22
+ When developing acceptance tests, it can be helpful to see the outputs of running commands.
23
+ To see outputs, append `--verbose` when running an acceptance test. Example:
24
+
25
+ ```sh
26
+ bundle exec cucumber features/theme.feature --verbose
27
+ ```
@@ -0,0 +1,46 @@
1
+ # Installation
2
+
3
+ ## Installation through RubyGems
4
+
5
+ The easiest method to install the Shopify CLI is through RubyGems:
6
+
7
+ ```shell
8
+ $ gem install shopify-cli
9
+ ```
10
+
11
+ ## Installation for macOS Users
12
+
13
+ - Make sure you have [Homebrew](https://brew.sh/) installed
14
+ - Open your terminal app
15
+ - Run `brew tap shopify/shopify`
16
+ - Run `brew install shopify-cli`
17
+ - After the installation is completed, run `shopify version`, if this outputs a version number you've successfully installed the CLI.
18
+
19
+ ### To upgrade Shopify CLI
20
+
21
+ #### Homebrew (Mac OS)
22
+
23
+ ```shell
24
+ $ brew update
25
+ $ brew upgrade shopify-cli
26
+ ```
27
+
28
+ ## Installation for Debian and Ubuntu users through `apt`
29
+
30
+ 1.- Download the latest `.deb` binary for Shopify CLI from the releases page.
31
+
32
+ 2.- Install the downloaded file and make sure to replace /path/to/download/shopify-cli-x.y.z.deb with the path to your file's location:
33
+
34
+ ```shell
35
+ $ sudo apt install /path/to/downloaded/shopify-cli-x.y.z.deb
36
+ ```
37
+
38
+ ## Installation for CentOS 8+, Fedora, Red Hat, and SUSE users through `yum`
39
+
40
+ 1.- Download the latest .rpm file for Shopify App CLI from the releases page.
41
+
42
+ 2.- Install the downloaded file and make sure to replace /path/to/downloaded/shopify-cli-x.y.x.rpm with the path to your file's location:
43
+
44
+ ```shell
45
+ $ sudo yum install /path/to/downloaded/shopify-cli-x.y.x.rpm
46
+ ```
@@ -1,4 +1,4 @@
1
- # Theme Kit Migration
1
+ # Migrate from Theme Kit
2
2
 
3
3
  Shopify CLI is the recommended and officially supported tool for developing Themes and creating CI/CD workflows.
4
4
 
@@ -12,7 +12,7 @@ module Extension
12
12
  register_messages(Extension::Messages::MessageLoading.load)
13
13
  end
14
14
 
15
- class Command < ShopifyCLI::ProjectCommands
15
+ class Command < ShopifyCLI::Command::ProjectCommand
16
16
  hidden_feature
17
17
  autoload :ExtensionCommand, Project.project_filepath("commands/extension_command")
18
18
 
@@ -42,8 +42,10 @@ module Extension
42
42
  autoload :GetExtensions, Project.project_filepath("tasks/get_extensions")
43
43
  autoload :GetProduct, Project.project_filepath("tasks/get_product")
44
44
  autoload :RunExtensionCommand, Project.project_filepath("tasks/run_extension_command")
45
- autoload :LoadServerConfig, Project.project_filepath("tasks/load_server_config")
45
+ autoload :MergeServerConfig, Project.project_filepath("tasks/merge_server_config")
46
46
  autoload :FindPackageFromJson, Project.project_filepath("tasks/find_package_from_json.rb")
47
+ autoload :EnsureResourceUrl, Project.project_filepath("tasks/ensure_resource_url.rb")
48
+ autoload :ConvertServerConfig, Project.project_filepath("tasks/convert_server_config")
47
49
 
48
50
  module Converters
49
51
  autoload :RegistrationConverter, Project.project_filepath("tasks/converters/registration_converter")
@@ -51,7 +53,6 @@ module Extension
51
53
  autoload :ValidationErrorConverter, Project.project_filepath("tasks/converters/validation_error_converter")
52
54
  autoload :AppConverter, Project.project_filepath("tasks/converters/app_converter")
53
55
  autoload :ProductConverter, Project.project_filepath("tasks/converters/product_converter")
54
- autoload :ServerConfigConverter, Project.project_filepath("tasks/converters/server_config_converter")
55
56
  end
56
57
  end
57
58
 
@@ -94,9 +95,11 @@ module Extension
94
95
 
95
96
  module ServerConfig
96
97
  autoload :Base, Project.project_filepath("models/server_config/base")
98
+ autoload :App, Project.project_filepath("models/server_config/app")
97
99
  autoload :Development, Project.project_filepath("models/server_config/development")
98
100
  autoload :DevelopmentEntries, Project.project_filepath("models/server_config/development_entries")
99
101
  autoload :DevelopmentRenderer, Project.project_filepath("models/server_config/development_renderer")
102
+ autoload :DevelopmentResource, Project.project_filepath("models/server_config/development_resource")
100
103
  autoload :Extension, Project.project_filepath("models/server_config/extension")
101
104
  autoload :Root, Project.project_filepath("models/server_config/root")
102
105
  autoload :User, Project.project_filepath("models/server_config/user")
@@ -2,12 +2,10 @@
2
2
 
3
3
  module Extension
4
4
  class Command
5
- class Create < ShopifyCLI::SubCommand
6
- DEVELOPMENT_SERVER_SUPPORTED_TYPES = [
7
- "checkout_ui_extension",
8
- ]
9
-
10
- prerequisite_task :ensure_authenticated
5
+ class Create < ShopifyCLI::Command::SubCommand
6
+ unless ShopifyCLI::Environment.acceptance_test?
7
+ prerequisite_task :ensure_authenticated
8
+ end
11
9
 
12
10
  options do |parser, flags|
13
11
  parser.on("--name=NAME") { |name| flags[:name] = name }
@@ -66,6 +64,7 @@ module Extension
66
64
  @ctx.chdir(form.directory_name)
67
65
  write_env_file(form)
68
66
  rescue => error
67
+ @ctx.debug(error)
69
68
  raise error
70
69
  end
71
70
 
@@ -3,7 +3,7 @@ require "shopify_cli"
3
3
 
4
4
  module Extension
5
5
  class Command
6
- class ExtensionCommand < ShopifyCLI::SubCommand
6
+ class ExtensionCommand < ShopifyCLI::Command::SubCommand
7
7
  def project
8
8
  @project ||= ExtensionProject.current
9
9
  end
@@ -63,7 +63,9 @@ module Extension
63
63
  ShopifyCLI::Tasks::EnsureDevStore.call(context) if required_fields.include?(:shop)
64
64
 
65
65
  project = ExtensionProject.current
66
- ensure_resource_resource_url! if specification_handler.supplies_resource_url? && !supports_development_server?
66
+ if resource_url_required?
67
+ Tasks::EnsureResourceUrl.call(context: context, specification_handler: specification_handler)
68
+ end
67
69
 
68
70
  return if required_fields.all? do |field|
69
71
  value = project.env.public_send(field)
@@ -73,6 +75,10 @@ module Extension
73
75
  context.abort(context.message("serve.serve_missing_information"))
74
76
  end
75
77
 
78
+ def resource_url_required?
79
+ specification_handler.supplies_resource_url? && resource_url.nil?
80
+ end
81
+
76
82
  def options
77
83
  project = ExtensionProject.current
78
84
 
@@ -88,28 +94,6 @@ module Extension
88
94
  end
89
95
  end
90
96
 
91
- def ensure_resource_resource_url!
92
- project = ExtensionProject.current(force_reload: true)
93
-
94
- ShopifyCLI::Result
95
- .wrap(project.resource_url)
96
- .rescue { specification_handler.build_resource_url(shop: project.env.shop, context: context) }
97
- .then(&method(:persist_resource_url))
98
- .unwrap do |nil_or_exception|
99
- case nil_or_exception
100
- when nil
101
- context.warn(context.message("warnings.resource_url_auto_generation_failed", project.env.shop))
102
- else
103
- context.abort(nil_or_exception)
104
- end
105
- end
106
- end
107
-
108
- def persist_resource_url(resource_url)
109
- ExtensionProject.update_env_file(context: context, resource_url: resource_url)
110
- resource_url
111
- end
112
-
113
97
  def new_serve_flow
114
98
  Tasks::RunExtensionCommand.new(
115
99
  type: specification_handler.specification.identifier,
@@ -117,6 +101,8 @@ module Extension
117
101
  context: context,
118
102
  port: port,
119
103
  config_file_name: specification_handler.server_config_file,
104
+ resource_url: resource_url,
105
+ tunnel_url: tunnel_url
120
106
  ).call
121
107
  end
122
108
 
@@ -4,10 +4,6 @@ module Extension
4
4
  class AskTemplate
5
5
  include ShopifyCLI::MethodObject
6
6
 
7
- TEMPLATE_REQUIRED_TYPES = [
8
- "checkout_ui_extension",
9
- ]
10
-
11
7
  property! :ctx
12
8
  property :template, accepts: Models::ServerConfig::Development::VALID_TEMPLATES
13
9
  property :prompt,
@@ -25,7 +21,7 @@ module Extension
25
21
  def template_required?(project_details)
26
22
  return false unless extension_server_beta?
27
23
  type = project_details&.type&.identifier
28
- TEMPLATE_REQUIRED_TYPES.include?(type.downcase)
24
+ Models::DevelopmentServerRequirements::SUPPORTED_EXTENSION_TYPES.include?(type.downcase)
29
25
  end
30
26
 
31
27
  def extension_server_beta?
@@ -6,11 +6,10 @@ module Extension
6
6
  class DevelopmentServerRequirements
7
7
  SUPPORTED_EXTENSION_TYPES = [
8
8
  "checkout_ui_extension",
9
+ "checkout_post_purchase",
10
+ "product_subscription",
9
11
  ]
10
12
 
11
- UNIX_NAME = "shopify-extensions"
12
- WINDOWS_NAME = "shopify-extensions.exe"
13
-
14
13
  class << self
15
14
  def supported?(type)
16
15
  binary_installed? && type_supported?(type) && beta_enabled?
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Extension
4
+ module Models
5
+ module ServerConfig
6
+ class App < Base
7
+ include SmartProperties
8
+
9
+ property! :api_key, accepts: String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -12,11 +12,12 @@ module Extension
12
12
 
13
13
  CURRENT_DIRECTORY = "."
14
14
 
15
- property :root_dir, accepts: String, default: CURRENT_DIRECTORY
15
+ property :root_dir, accepts: String, default: CURRENT_DIRECTORY
16
16
  property! :build_dir, accepts: String, default: "build"
17
- property :template, accepts: VALID_TEMPLATES
18
- property :renderer, accepts: ServerConfig::DevelopmentRenderer
19
- property :entries, accepts: ServerConfig::DevelopmentEntries
17
+ property :template, accepts: VALID_TEMPLATES
18
+ property :renderer, accepts: ServerConfig::DevelopmentRenderer
19
+ property :entries, accepts: ServerConfig::DevelopmentEntries
20
+ property :resource, accepts: ServerConfig::DevelopmentResource
20
21
  end
21
22
  end
22
23
  end