shopify-cli 2.6.0 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +15 -4
  3. data/.github/workflows/shopify.yml +3 -6
  4. data/CHANGELOG.md +77 -94
  5. data/Dockerfile +12 -2
  6. data/Gemfile +1 -0
  7. data/Gemfile.lock +5 -3
  8. data/README.md +1 -1
  9. data/RELEASING.md +17 -30
  10. data/Rakefile +0 -5
  11. data/bin/shopify +1 -0
  12. data/ext/shopify-cli/extconf.rb +0 -1
  13. data/lib/project_types/extension/features/argo.rb +8 -2
  14. data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
  15. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +1 -1
  16. data/lib/project_types/node/commands/serve.rb +7 -16
  17. data/lib/project_types/node/messages/messages.rb +0 -5
  18. data/lib/project_types/php/commands/serve.rb +6 -9
  19. data/lib/project_types/php/messages/messages.rb +1 -4
  20. data/lib/project_types/rails/commands/serve.rb +7 -8
  21. data/lib/project_types/rails/messages/messages.rb +1 -4
  22. data/lib/project_types/script/commands/create.rb +3 -1
  23. data/lib/project_types/script/config/extension_points.yml +7 -0
  24. data/lib/project_types/script/graphql/app_script_set.graphql +2 -0
  25. data/lib/project_types/script/layers/application/build_script.rb +2 -1
  26. data/lib/project_types/script/layers/application/push_script.rb +15 -1
  27. data/lib/project_types/script/layers/domain/push_package.rb +5 -2
  28. data/lib/project_types/script/layers/infrastructure/errors.rb +17 -0
  29. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +10 -13
  30. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +4 -13
  31. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +4 -2
  32. data/lib/project_types/script/layers/infrastructure/script_service.rb +6 -1
  33. data/lib/project_types/script/messages/messages.rb +6 -0
  34. data/lib/project_types/script/ui/error_handler.rb +16 -0
  35. data/lib/project_types/theme/commands/serve.rb +1 -0
  36. data/lib/project_types/theme/messages/messages.rb +5 -0
  37. data/lib/shopify_cli/api.rb +4 -0
  38. data/lib/shopify_cli/app_type_detector.rb +32 -0
  39. data/lib/shopify_cli/command.rb +6 -1
  40. data/lib/shopify_cli/command_options/command_serve_options.rb +43 -0
  41. data/lib/shopify_cli/command_options.rb +7 -0
  42. data/lib/shopify_cli/commands/login.rb +3 -3
  43. data/lib/shopify_cli/commands/reporting.rb +38 -0
  44. data/lib/shopify_cli/commands/switch.rb +1 -1
  45. data/lib/shopify_cli/commands.rb +1 -0
  46. data/lib/shopify_cli/constants.rb +7 -3
  47. data/lib/shopify_cli/core/monorail.rb +9 -20
  48. data/lib/shopify_cli/environment.rb +15 -1
  49. data/lib/shopify_cli/exception_reporter.rb +25 -14
  50. data/lib/shopify_cli/messages/messages.rb +48 -19
  51. data/lib/shopify_cli/migrator/migration.rb +1 -1
  52. data/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +1 -1
  53. data/lib/shopify_cli/migrator/migrations/1633691650_merge_reporting_configuration.rb +41 -0
  54. data/lib/shopify_cli/reporting_configuration_controller.rb +64 -0
  55. data/lib/shopify_cli/services/base_service.rb +13 -0
  56. data/lib/shopify_cli/services/reporting_service.rb +16 -0
  57. data/lib/shopify_cli/services.rb +6 -0
  58. data/lib/shopify_cli/theme/dev_server/watcher.rb +2 -2
  59. data/lib/shopify_cli/theme/dev_server.rb +2 -2
  60. data/lib/shopify_cli/version.rb +1 -1
  61. data/lib/shopify_cli.rb +4 -0
  62. data/shopify-cli.gemspec +1 -8
  63. data/utilities/docker/container.rb +76 -0
  64. data/utilities/docker.rb +44 -3
  65. metadata +14 -5
  66. data/lib/shopify_cli/exception_reporter/permission_controller.rb +0 -54
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9bf62139d7f6ea0c4e88417521bd981c28c0823950768c3350410f2c8666e35
4
- data.tar.gz: a15af494f4dbbcb6e2b8c276e34fb1347e3142f59d5646e80370199ddc6d0bce
3
+ metadata.gz: 51b5808e81e2d168620af088bec6f155869a9870b516960927735f9b7b886e55
4
+ data.tar.gz: 47c04e0dbabd30bb2c03e8c99771e724e16fe7c336fd342be01540749088bee5
5
5
  SHA512:
6
- metadata.gz: f4dbceb0f0d41f605bb3be605e54eae58868d83e86fe7cd0476dc0193c7e2cf7369fa86a8d5d2a2070711f54dd03b02b2200bc844f02b42be9297178095f2106
7
- data.tar.gz: 2c75055724e3fce904caca22f974f9cbc87bf10bfb9388f5227a227799f8b6c7e33aece62d7301cfde366d69fcc27832256e1da791e2dc4ca7f85d02f7c41191
6
+ metadata.gz: d75f831a6214930264f60c6c5699beddba9ae73c834878723b2b6c764a5e98d30e427183fa6946fdf57c45a90859cc0a4bbd5420616a72b2f340c0c91093a430
7
+ data.tar.gz: b73c3d43b0a711994930c0490de71bfeeeff0775b5e0ce6efc48c8c40935b630e5d0ed7182d6eb20188357199a469325b7b40f6cbf317dccb34655745e315ef6
@@ -21,12 +21,23 @@ Fixes #0000 <!-- link to issue if one exists -->
21
21
  Before / after screenshots appreciated for UI changes.
22
22
  -->
23
23
 
24
- ### Update checklist
24
+ ### How to test your changes?
25
+
25
26
  <!--
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.
27
+ Please, provide steps for the reviewer to test your changes locally.
29
28
  -->
29
+
30
+ ### Post-release steps
31
+
32
+ <!--
33
+ If changes require post-release steps, for example merging and publishing some documentation changes,
34
+ specify it in this section and add the label "includes-post-release-steps".
35
+ If it doesn't, feel free to remove this section.
36
+ -->
37
+
38
+ ### Update checklist
39
+
30
40
  - [ ] I've added a CHANGELOG entry for this PR (if the change is public-facing)
31
41
  - [ ] I've considered possible cross-platform impacts (Mac, Linux, Windows).
32
42
  - [ ] I've left the version number as is (we'll handle incrementing this when releasing).
43
+ - [ ] I've included any post-release steps in the section above.
@@ -44,19 +44,14 @@ jobs:
44
44
  - name: Run Tests
45
45
  run: bundle exec rake test
46
46
  acceptance_tests:
47
- name: Acceptance Tests with Ruby ${{ matrix.version }} on ${{ matrix.os }}
47
+ name: Acceptance Tests
48
48
  runs-on: ${{ matrix.os }}
49
49
  strategy:
50
50
  matrix:
51
51
  version:
52
52
  - 3.0.2
53
- - 2.6.6
54
- - 2.7.1
55
53
  os:
56
- - macos-10.15
57
- - macos-11
58
54
  - ubuntu-20.04
59
- - ubuntu-18.04
60
55
  steps:
61
56
  - uses: actions/checkout@v2
62
57
  - name: Set Git configuration
@@ -74,6 +69,8 @@ jobs:
74
69
  with:
75
70
  node-version: "14.9.0"
76
71
 
72
+ - uses: docker-practice/actions-setup-docker@master
73
+
77
74
  - name: Install Dependencies
78
75
  run: bundle install
79
76
 
data/CHANGELOG.md CHANGED
@@ -1,9 +1,30 @@
1
- Unreleased
2
- ------
3
-
4
- Version 2.6.0
5
- ------
6
-
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
+ ## [Unreleased]
3
+
4
+ ## Version 2.6.4
5
+ ### Fixed
6
+ * [#1633](https://github.com/Shopify/shopify-cli/pull/1633): Runtime error when the shop passed on login is invalid
7
+ * [#1625](https://github.com/Shopify/shopify-cli/pull/1625): Fix push bug with post-purchase extensions
8
+
9
+ ### Added
10
+ * [#1542](https://github.com/Shopify/shopify-cli/pull/1542): Add option theme serve --poll to force polling when watching files
11
+ * [#1635](https://github.com/Shopify/shopify-cli/pull/1635): Command to enable or disable anonymous usage and error reporting.
12
+ * [#1614](https://github.com/Shopify/shopify-cli/pull/1614): Add ability to set custom ngrok port for all app serve commands.
13
+ ### Removed
14
+
15
+ ### Changed
16
+ * [#1635](https://github.com/Shopify/shopify-cli/pull/1635): Automatic usage and error reporting configuration has been unified under `analytics.enabled`.
17
+ ### Security
18
+
19
+ ## Version 2.6.3
20
+ * Enable error-reporting.
21
+
22
+ ## Version 2.6.2
23
+ * Fix broken installation due to a missing variable in `extconf.rb`
24
+
25
+ ## Version 2.6.1
26
+ * [#1608](https://github.com/Shopify/shopify-cli/pull/1608): Fix errors not being reported.
27
+ ## Version 2.6.0
7
28
  * [#1574](https://github.com/Shopify/shopify-cli/pull/1574): Hide LoadError for ${RUBY_MAJOR}/ffi_c.
8
29
  * [#1567](https://github.com/Shopify/shopify-cli/pull/1567): Add ability to set custom port for ngrok tunnel in node serve.
9
30
  * [#1584](https://github.com/Shopify/shopify-cli/issues/1584): Fixed extended help message not showing.
@@ -12,92 +33,72 @@ Version 2.6.0
12
33
  * [#1528](https://github.com/Shopify/shopify-cli/pull/1528): Bump theme-check version to 1.7
13
34
  * [#1566](https://github.com/Shopify/shopify-cli/pull/1566): Fix bug when running `npm | yarn list` for extension package resolution
14
35
 
15
- Version 2.5.0
16
- ------
17
-
36
+ ## Version 2.5.0
18
37
  * [#1553](https://github.com/Shopify/shopify-cli/pull/1553): Add support for PHP app projects
19
38
 
20
- Version 2.4.0
21
- ------
22
-
39
+ ## Version 2.4.0
23
40
  * [#1488](https://github.com/Shopify/shopify-cli/pull/1488): Update Theme-Check to 1.4
24
41
  * [#1507](https://github.com/Shopify/shopify-cli/pull/1507): Limit the generated name for themes to 50 characters
25
42
 
26
- Version 2.3.0
27
- ------
28
-
43
+ ## Version 2.3.0
29
44
  * [#1386](https://github.com/Shopify/shopify-cli/pull/1386): Update Theme-Check to 1.2
30
45
  * [#1457](https://github.com/Shopify/shopify-cli/pull/1457): Fix uploading of binary theme files under Windows
31
46
  * [#1480](https://github.com/Shopify/shopify-cli/pull/1480): Fix customers pages not working with `theme serve`
32
47
  * [#1479](https://github.com/Shopify/shopify-cli/pull/1479): Add theme push & pull option to ignore files per command
48
+ v
49
+ ## Version 2.2.2
50
+ * [1382](https:/github.com/Shopify/shopify-cli/pull/1382): Client side module upload for Scripts
33
51
 
34
- Version 2.2.2
35
- ------
36
- * [1382](https://github.com/Shopify/shopify-cli/pull/1382): Client side module upload for Scripts
37
-
38
- Version 2.2.1
39
- ------
40
-
52
+ ## Version 2.2.1
41
53
  * [1432](https://github.com/Shopify/shopify-cli/pull/1432) New method for determining renderer package name
42
54
 
43
- Version 2.2.0
44
- ------
45
- * [#1424](https://github.com/Shopify/shopify-cli/pull/1424/): Add `--resourceUrl` flag to extension serve command
55
+ ## Version 2.2.0
56
+ * [#1424](https//github.com/Shopify/shopify-cli/pull/1424/): Add `--resourceUrl` flag to extension serve command
46
57
  * [#1419](https://github.com/Shopify/shopify-cli/pull/1419): Remove analytics prompt when used in CI
47
58
  * [#1418](https://github.com/Shopify/shopify-cli/pull/1418): Auto configure resource URL for Checkout Extensions
48
59
  * [#1399](https://github.com/Shopify/shopify-cli/pull/1399): Fix error when running `shopify extension serve` in a theme app extension project
49
60
 
50
- Version 2.1.0
51
- -------------
52
- * [#1357](https://github.com/Shopify/shopify-cli/pull/1357): Update Theme-Check to 1.1
61
+ ## Version 2.1.0
62
+ * [#1357](https//github.com/Shopify/shopify-cli/pull/1357): Update Theme-Check to 1.1
53
63
  * [#1352](https://github.com/Shopify/shopify-cli/pull/1352): Add `shopify extension check` for checking theme app extensions
54
64
  * [#1304](https://github.com/Shopify/shopify-cli/pull/1304): Prompt user to run `shopify extension connect` if .env file is missing
55
65
 
56
- Version 2.0.2
57
- -------------
58
- * [#1305](https://github.com/Shopify/shopify-cli/pull/1305): Fix `Uninitialized constant Net::WriteTimeout` error
66
+ ## Version 2.0.2
67
+ * [#1305](https//github.com/Shopify/shopify-cli/pull/1305): Fix `Uninitialized constant Net::WriteTimeout` error
59
68
  * [#1319](https://github.com/Shopify/shopify-cli/pull/1319): Fix `theme pull` not pulling some files
60
69
  * [#1321](https://github.com/Shopify/shopify-cli/pull/1321): Fix error when pulling images with `theme pull`
61
70
  * [#1322](https://github.com/Shopify/shopify-cli/pull/1322): Fix error when running `shopify theme language-server --help`
62
71
  * [#1324](https://github.com/Shopify/shopify-cli/pull/1324): Fix issue [#1308](https://github.com/Shopify/shopify-cli/issues/1308) where a non-English language on Partner Account breaks how CLI determines latest API version.
63
72
  * [#1343](https://github.com/Shopify/shopify-cli/pull/1343): Fix inconsistent use of periods vs ellipsis in messages. This replaces periods with ellipsis.
64
73
 
65
- Version 2.0.1
66
- -------------
67
- * [#1295](https://github.com/Shopify/shopify-cli/pull/1295): Ignore files at the root of a theme app extension project
74
+ ## Version 2.0.1
75
+ * [#1295](https//github.com/Shopify/shopify-cli/pull/1295): Ignore files at the root of a theme app extension project
68
76
  * [#1296](https://github.com/Shopify/shopify-cli/pull/1296): Fix issue [#1294](https://github.com/Shopify/shopify-cli/issues/1294) regarding call to Windows `start` command with URL.
69
77
  * [#1298](https://github.com/Shopify/shopify-cli/pull/1298): Fix error in `theme serve` command
70
78
  * [#1301](https://github.com/Shopify/shopify-cli/pull/1301): Add `theme init` command
71
79
 
72
- Version 2.0.0
73
- -------------
74
- * Adds support for theme development
80
+ ## Version 2.0.0
81
+ * Adds support or theme development
75
82
  * Changes to command structure (note that these are breaking changes, see [README](README.md))
76
83
  * Checkout the [apps](https://shopify.dev/apps/tools/cli) and [themes](https://shopify.dev/themes/tools/cli) sections of the new [shopify.dev](https://shopify.dev) after Unite 2021 (June 29).
77
84
 
78
- Version 1.14.0
79
- --------------
85
+ ## Version 1.14.0
80
86
  * [#1275](https://github.com/Shopify/shopify-cli/pull/1275): Use script.json to specify script metadata
81
87
  * [#1279](https://github.com/Shopify/shopify-cli/pull/1279): Fix bug where a script push still fails after the user answers the force push prompt
82
88
  * [#1288](https://github.com/Shopify/shopify-cli/pull/1288): Fix bug where Scripts SDK was included for projects that don't require it
83
89
 
84
- Version 1.13.1
85
- --------------
90
+ ## Version 1.13.1
86
91
  * [#1274](https://github.com/Shopify/shopify-cli/pull/1274): Only print api_key during error if it exists
87
92
  * [#1272](https://github.com/Shopify/shopify-cli/pull/1272): Fix minor bug with extension serve for UI extensions
88
93
 
89
- Version 1.13.0
90
- --------------
91
-
94
+ ## Version 1.13.0
92
95
  * [#1266](https://github.com/Shopify/shopify-cli/pull/1266): Developer Console release
93
96
  * [#1265](https://github.com/Shopify/shopify-cli/pull/1265): Fix bug where commands hang after an unsuccessful authentication
94
97
 
95
- Version 1.12.0
96
- --------------
98
+ ## Version 1.12.0
97
99
  * [#1255](https://github.com/Shopify/shopify-cli/pull/1255): Fix beta flag checks when running `shopify serve`
98
100
 
99
- Version 1.11.0
100
- --------------
101
+ ## Version 1.11.0
101
102
  * [#1221](https://github.com/Shopify/shopify-cli/pull/1221): Prioritizes returning an HTTPS URL over HTTP from `shopify tunnel status`.
102
103
  * [#1223](https://github.com/Shopify/shopify-cli/pull/1233): Running `shopify serve` in an extension project now automatically runs `shopify tunnel`.
103
104
  * [#1225](https://github.com/Shopify/shopify-cli/pull/1225): Improved handling of "account not found" scenario, plus improvements to related tests and UX messaging
@@ -105,60 +106,52 @@ Version 1.11.0
105
106
  * [#1238](https://github.com/Shopify/shopify-cli/pull/1238): Auto Tunnel Support for Checkout Extension
106
107
  * [#1256](https://github.com/Shopify/shopify-cli/pull/1256): Allow using spaces around the equal sign on .env file.
107
108
 
108
- Version 1.10.0
109
- --------------
109
+ ## Version 1.10.0
110
110
  * Updating internal features in development
111
111
 
112
- Version 1.9.1
113
- -------------
112
+ ## Version 1.9.1
114
113
  * [#1201](https://github.com/Shopify/shopify-cli/pull/1201) Determine Argo Renderer Dynamically. This fixes `shopify serve` and `shopify push` for extensions.
115
114
 
116
- Version 1.9.0
117
- -------------
115
+ ## Version 1.9.0
118
116
  * [#1181](https://github.com/Shopify/shopify-cli/pull/1181): Remove the subcommand references of the `generate` command for node apps (fixes [1176](https://github.com/Shopify/shopify-cli/issues/1176))
119
117
 
120
- Version 1.8.0
121
- -------------
118
+ ## Version 1.8.0
122
119
  * [#1119](https://github.com/Shopify/shopify-cli/pull/1119): Enable guest serialization for scripts
123
120
 
124
- Version 1.7.1
125
- ------
121
+ ## Version 1.7.1
122
+
126
123
  * Updating internal features in development
127
124
 
128
- Version 1.7.0
129
- -----
125
+ ## Version 1.7.0
130
126
  * [#1109](https://github.com/Shopify/shopify-cli/pull/1109): Abort app generation if name contains disallowed text.
131
127
  * [#1075](https://github.com/Shopify/shopify-cli/pull/1075): Add support for kebab-case flags
132
128
 
133
- Version 1.6.0
134
- -----
129
+ ## Version 1.6.0
135
130
  * [#1049](https://github.com/Shopify/shopify-cli/pull/1049): Add schema versioning support to the script project type
136
131
  * [#1059](https://github.com/Shopify/shopify-cli/pull/1059): Remove the functionality of the `generate` command for node apps, since it will no longer be feasible with the new node library
137
132
  * [#1046](https://github.com/Shopify/shopify-cli/pull/1046): Include a vendored copy of Webrick, as it's no longer included in Ruby 3.
138
133
  * [#1041](https://github.com/Shopify/shopify-cli/pull/1041): Remove unnecessary shell call to `spring stop`. We already pass `--skip-spring` when creating the app so running `spring stop` would have no effect.
139
134
  * [#1034](https://github.com/Shopify/shopify-cli/pull/1034): Abort if a system call fails.
140
135
 
141
- Version 1.5.0
142
- -----
136
+ ## Version 1.5.0
143
137
  * [#965](https://github.com/Shopify/shopify-cli/pull/965): Remove --no-optional when using npm to create new project
144
138
  * [#958](https://github.com/Shopify/shopify-cli/pull/958): Split `connect` command into project-specific functionality
145
139
  * [#992](https://github.com/Shopify/shopify-cli/pull/992): Add Theme Kit functionality to CLI
146
140
 
147
- Version 1.4.1
148
- ------
141
+ ## Version 1.4.1
142
+
149
143
  * [#917](https://github.com/Shopify/shopify-cli/pull/917): Ensure analytics for create action includes the same fields as other commands
150
144
 
151
- Version 1.4.0
152
- ------
145
+ ## Version 1.4.0
146
+
153
147
  * Updates to tests, dependencies and internal tooling
154
148
  * [#924](https://github.com/Shopify/shopify-cli/pull/924): Improve debugging messages on Partner API errors
155
149
 
156
- Version 1.3.1
157
- ------
150
+ ## Version 1.3.1
151
+
158
152
  * Allow any characters in ngrok account names
159
153
 
160
- Version 1.3.0
161
- ------
154
+ ## Version 1.3.0
162
155
  * Support for new `shopify config analytics` command to enable/disable anonymous usage reporting
163
156
 
164
157
  Version 1.2.0
@@ -173,49 +166,39 @@ Version 1.1.1
173
166
  ------
174
167
  * Fix a bug where usernames with spaces caused issues on Windows
175
168
 
176
- Version 1.1.0
177
- ------
169
+ ## Version 1.1.0
178
170
  * Add native Windows 10 support, including variety of stability fixes.
179
171
 
180
- Version 1.0.5
181
- ------
172
+ ## Version 1.0.5
182
173
  * Fix a bug in out opt-in metrics
183
174
 
184
- Version 1.0.4
185
- ------
175
+ ## Version 1.0.4
186
176
  * Fix a bug when running the `connect` command with an account with multiple organizations
187
177
 
188
- Version 1.0.3
189
- ------
178
+ ## Version 1.0.3
190
179
  * Fix a bug which causes an error in the `populate` and `generate` commands when prompting for the shop name
191
180
 
192
- Version 1.0.2
193
- ------
181
+ ## Version 1.0.2
194
182
  * Fix missing shop parameter to AdminAPI.query() call (impacting populate and generate commands)
195
183
 
196
- Version 1.0.1
197
- ------
184
+ ## Version 1.0.1
198
185
  * Fixed an issue with RVM taking over the shell shim fd when it was not in use
199
186
 
200
- Version 1.0.0
201
- ------
187
+ ## Version 1.0.0
202
188
  * Release the installer-based version of the CLI
203
189
 
204
- Version 0.9.3 - Internal Test Version
205
- ------
190
+ ## Version 0.9.3 - Internal Test Version
206
191
  * Rebased to master
207
192
  * Removed auto-generated files from builds directory
208
193
 
209
- Version 0.9.2 - Internal Test Version
210
- ------
194
+ ## Version 0.9.2 - Internal Test Version
211
195
  * Rebased to master, to pull in 7+ Pull Requests
212
196
  * Updates to dependencies to package files (updated Ruby version)
213
197
 
214
- Version 0.9.1 - Internal Test Version
215
- ------
198
+ ## Version 0.9.1 - Internal Test Version
216
199
  * Updated required Ruby version for the CLI
217
200
  * Minor fixes for the build / release process
218
201
 
219
- Version 0.9.0 - Internal Test Version
220
- ------
202
+ ## Version 0.9.0 - Internal Test Version
203
+
221
204
  * Initial test release of gem-based CLI
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # This is a Docker image to test the CLI in UNIX environments other than macOS
2
2
  # Build the image: docker build . -t shopify-cli
3
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-node
4
+ FROM cimg/ruby:2.7.1
5
5
 
6
6
  RUN git config --global user.email "development-lifecycle@shopify.com"
7
7
  RUN git config --global user.name "Development Lifecycle"
@@ -14,4 +14,14 @@ WORKDIR /usr/src/app
14
14
  COPY Gemfile Gemfile.lock ./
15
15
  COPY shopify-cli.gemspec shopify-cli.gemspec
16
16
  COPY lib/shopify_cli/version.rb lib/shopify_cli/version.rb
17
- RUN bundle install
17
+ RUN bundle install
18
+
19
+ # Update git
20
+ RUN sudo add-apt-repository -y ppa:git-core/ppa
21
+ RUN sudo apt-get update
22
+ RUN sudo apt-get install git -y
23
+
24
+ # Install the latest version of NodeJS
25
+ RUN sudo apt-get install ca-certificates -y
26
+ RUN curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
27
+ RUN sudo apt-get install -y nodejs
data/Gemfile CHANGED
@@ -13,6 +13,7 @@ group :development, :test do
13
13
  gem "rubocop-shopify", require: false
14
14
  gem "rubocop-minitest", require: false
15
15
  gem "rubocop-rake", require: false
16
+ gem "iniparse", "~> 1.5"
16
17
  end
17
18
 
18
19
  group :test do
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.6.0)
4
+ shopify-cli (2.6.4)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
- theme-check (~> 1.7)
7
+ theme-check (~> 1.7.2)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -56,6 +56,7 @@ GEM
56
56
  fakefs (1.3.2)
57
57
  ffi (1.15.4)
58
58
  hashdiff (1.0.1)
59
+ iniparse (1.5.0)
59
60
  liquid (5.1.0)
60
61
  listen (3.7.0)
61
62
  rb-fsevent (~> 0.10, >= 0.10.3)
@@ -136,6 +137,7 @@ DEPENDENCIES
136
137
  byebug
137
138
  cucumber (~> 7.0)
138
139
  fakefs (>= 1.0)
140
+ iniparse (~> 1.5)
139
141
  minitest (>= 5.0.0)
140
142
  minitest-fail-fast
141
143
  minitest-reporters
@@ -151,4 +153,4 @@ DEPENDENCIES
151
153
  webmock
152
154
 
153
155
  BUNDLED WITH
154
- 2.2.22
156
+ 2.2.29
data/README.md CHANGED
@@ -85,7 +85,7 @@ When prompted, open the provided accounts.shopify.com URL in a browser. In your
85
85
 
86
86
  Run:
87
87
 
88
- `shopify theme create`
88
+ `shopify theme init`
89
89
 
90
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
91
 
data/RELEASING.md CHANGED
@@ -1,65 +1,52 @@
1
1
  ## Releasing Shopify CLI
2
2
 
3
3
  1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
-
5
- 1. Make sure you're on the most recent `main`
4
+ 2. Make sure you're on the most recent `main`
6
5
  ```
7
6
  $ git checkout main
8
7
  $ git pull
9
8
  ```
10
-
11
- 1. Create a branch named `release_X_Y_Z` (replacing `X_Y_Z` with the intended release version)
9
+ 3. Create a branch named `release_X_Y_Z` (replacing `X_Y_Z` with the intended release version)
12
10
  ```
13
11
  $ git checkout -b release_X_Y_Z
14
12
  ```
15
-
16
- 1. Update the version of Shopify CLI in `lib/shopify_cli/version.rb`
17
-
18
- 1. Update the version of Shopify CLI at the top of `Gemfile.lock` (failing to do so causes the CI build to fail)
19
-
20
- 1. Add an entry for the new release to `CHANGELOG.md`
21
-
22
- 1. Commit the changes with a commit message like "Packaging for release X.Y.Z"
13
+ 4. Update the version of Shopify CLI in `lib/shopify_cli/version.rb`
14
+ 5. Update the version of Shopify CLI at the top of `Gemfile.lock` (failing to do so causes the CI build to fail)
15
+ 6. Add an entry for the new release to `CHANGELOG.md`
16
+ 7. Commit the changes with a commit message like "Packaging for release X.Y.Z"
23
17
  ```
24
18
  $ git commit -am "Packaging for release vX.Y.Z"
25
19
  ```
26
-
27
- 1. Push out the changes
20
+ 8. Push out the changes
28
21
  ```
29
22
  $ git push -u origin release_X_Y_Z
30
23
  ```
31
24
 
32
- 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
33
-
34
- 1. Deploy using Shipit
35
-
36
- 1. Update your `main` branch to the latest version
25
+ 9. 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
26
+ 10. Deploy using Shipit
27
+ 11. Update your `main` branch to the latest version
37
28
  ```
38
29
  $ git checkout main
39
30
  $ git pull
40
31
  ```
41
-
42
- 1. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
32
+
33
+ 12. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
43
34
  ```
44
35
  $ rake package
45
36
  ```
46
37
  This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
47
38
 
48
- 1. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
39
+ 13. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
49
40
  * create a branch named `release_X_Y_Z_of_shopify-cli`
50
41
  * update the brew formula in `shopify-cli.rb` with the generated formula in `packaging/builds/X.Y.Z/` in the `Shopify/shopify-cli` repo (from the `rake package` step above)
51
42
  * commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
52
43
  * when PR is approved, merge into main branch
53
-
54
- 1. Go to [releases](https://github.com/Shopify/shopify-cli/releases) page of `Shopify/shopify-cli` repo and create a new release:
44
+
45
+ 14. Go to [releases](https://github.com/Shopify/shopify-cli/releases) page of `Shopify/shopify-cli` repo and create a new release:
55
46
  * use the tag created by Shipit (should be "vX.Y.Z")
56
47
  * release title = "Version X.Y.Z"
57
- * description should be
58
- ```
59
- Release of version X.Y.Z of Shopify CLI
60
-
61
- Please refer to [CHANGELOG](https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md) for details.
62
- ```
48
+ * description should be the content of the section in the `CHANGELOG.md`
63
49
  * upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
64
50
  * if it's a pre-release version, select the "This is a pre-release" checkbox
65
51
  * and click "Publish release".
52
+ 15. Go through all the PR [labeled with `includes-post-release-steps`](https://github.com/Shopify/shopify-cli/labels/includes-post-release-steps) and follow the post-release steps described in those PRs. Delete the labels afterward.
data/Rakefile CHANGED
@@ -22,11 +22,6 @@ namespace :linux do
22
22
  task :test do
23
23
  Utilities::Docker.run_and_rm_container("bundle", "exec", "rake", "test")
24
24
  end
25
-
26
- desc "Runs the acceptance tests suite in a Linux Docker environment"
27
- task :features do
28
- Utilities::Docker.run_and_rm_container("bundle", "exec", "cucumber")
29
- end
30
25
  end
31
26
 
32
27
  RuboCop::RakeTask.new
data/bin/shopify CHANGED
@@ -37,6 +37,7 @@ exit(proc do
37
37
  ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
38
38
  end
39
39
  rescue StandardError => error
40
+ ShopifyCLI::ErrorHandler.exception = error
40
41
  if ShopifyCLI::Environment.print_stacktrace?
41
42
  raise error
42
43
  else
@@ -57,5 +57,4 @@ else
57
57
  MAKEFILE
58
58
  end
59
59
 
60
- File.write(installation_date_path, Time.now.to_i.to_s)
61
60
  File.write("Makefile", makefile_content)
@@ -23,7 +23,7 @@ module Extension
23
23
  Features::ArgoSetup.new(git_template: git_template).call(directory_name, identifier, context)
24
24
  end
25
25
 
26
- def config(context)
26
+ def config(context, include_renderer_version: true)
27
27
  js_system = ShopifyCLI::JsSystem.new(ctx: context)
28
28
  if js_system.package_manager == "yarn"
29
29
  run_yarn_install(context, js_system)
@@ -31,9 +31,15 @@ module Extension
31
31
  end
32
32
  filepath = File.join(context.root, SCRIPT_PATH)
33
33
  context.abort(context.message("features.argo.missing_file_error")) unless File.exist?(filepath)
34
+
35
+ renderer_version = nil
36
+ if include_renderer_version
37
+ renderer_version = renderer_package(context).version
38
+ end
39
+
34
40
  begin
35
41
  {
36
- renderer_version: renderer_package(context).version,
42
+ renderer_version: renderer_version,
37
43
  serialized_script: Base64.strict_encode64(File.read(filepath).chomp),
38
44
  }
39
45
  rescue StandardError
@@ -11,7 +11,7 @@ module Extension
11
11
  def config(context)
12
12
  {
13
13
  **Features::ArgoConfig.parse_yaml(context, PERMITTED_CONFIG_KEYS),
14
- **argo.config(context),
14
+ **argo.config(context, include_renderer_version: false),
15
15
  }
16
16
  end
17
17
 
@@ -9,7 +9,7 @@ module Extension
9
9
  def config(context)
10
10
  {
11
11
  **Features::ArgoConfig.parse_yaml(context, PERMITTED_CONFIG_KEYS),
12
- **argo.config(context),
12
+ **argo.config(context, include_renderer_version: false),
13
13
  }
14
14
  end
15
15
 
@@ -2,20 +2,18 @@
2
2
  module Node
3
3
  class Command
4
4
  class Serve < ShopifyCLI::SubCommand
5
+ include ShopifyCLI::CommandOptions::CommandServeOptions
6
+
5
7
  prerequisite_task ensure_project_type: :node
6
8
  prerequisite_task :ensure_env, :ensure_dev_store
7
9
 
8
- options do |parser, flags|
9
- parser.on("--host=HOST") do |h|
10
- flags[:host] = h.gsub('"', "")
11
- end
12
- parser.on("--port=PORT") { |port| flags[:port] = port }
13
- end
10
+ parse_host_option
11
+ parse_port_option
14
12
 
15
13
  def call(*)
16
14
  project = ShopifyCLI::Project.current
17
- url = options.flags[:host] || ShopifyCLI::Tunnel.start(@ctx)
18
- @ctx.abort(@ctx.message("node.serve.error.host_must_be_https")) if url.match(/^https/i).nil?
15
+ tunnel_port = port.to_s
16
+ url = host || ShopifyCLI::Tunnel.start(@ctx, port: tunnel_port)
19
17
  project.env.update(@ctx, :host, url)
20
18
  ShopifyCLI::Tasks::UpdateDashboardURLS.call(
21
19
  @ctx,
@@ -30,18 +28,11 @@ module Node
30
28
 
31
29
  CLI::UI::Frame.open(@ctx.message("node.serve.running_server")) do
32
30
  env = project.env.to_h
33
- env["PORT"] = port.to_s
31
+ env["PORT"] = tunnel_port
34
32
  @ctx.system("npm run dev", env: env)
35
33
  end
36
34
  end
37
35
 
38
- def port
39
- return ShopifyCLI::Tunnel::PORT.to_s unless options.flags.key?(:port)
40
- port = options.flags[:port].to_i
41
- @ctx.abort(@ctx.message("node.serve.error.invalid_port", options.flags[:port])) unless port > 0
42
- port
43
- end
44
-
45
36
  def self.help
46
37
  ShopifyCLI::Context.message("node.serve.help", ShopifyCLI::TOOL_NAME)
47
38
  end
@@ -122,11 +122,6 @@ module Node
122
122
  {{cyan:--port=PORT}}: Use custom port.
123
123
  HELP
124
124
 
125
- error: {
126
- host_must_be_https: "HOST must be a HTTPS url.",
127
- invalid_port: "%s is not a valid port.",
128
- },
129
-
130
125
  open_info: <<~MESSAGE,
131
126
  {{*}} To install and start using your app, open this URL in your browser:
132
127
  {{green:%s}}