shopify-cli 2.6.3 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) 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 +71 -102
  5. data/Dockerfile +12 -2
  6. data/Gemfile +1 -0
  7. data/Gemfile.lock +5 -3
  8. data/RELEASING.md +17 -30
  9. data/Rakefile +0 -5
  10. data/lib/project_types/extension/features/argo.rb +8 -2
  11. data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
  12. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +1 -1
  13. data/lib/project_types/node/commands/serve.rb +7 -16
  14. data/lib/project_types/node/messages/messages.rb +0 -5
  15. data/lib/project_types/php/commands/serve.rb +6 -9
  16. data/lib/project_types/php/messages/messages.rb +1 -4
  17. data/lib/project_types/rails/commands/serve.rb +7 -8
  18. data/lib/project_types/rails/messages/messages.rb +1 -4
  19. data/lib/project_types/script/commands/create.rb +3 -1
  20. data/lib/project_types/script/config/extension_points.yml +7 -0
  21. data/lib/project_types/script/graphql/app_script_set.graphql +2 -0
  22. data/lib/project_types/script/layers/application/build_script.rb +2 -1
  23. data/lib/project_types/script/layers/application/push_script.rb +15 -1
  24. data/lib/project_types/script/layers/domain/push_package.rb +5 -2
  25. data/lib/project_types/script/layers/infrastructure/errors.rb +17 -0
  26. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +10 -13
  27. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +4 -13
  28. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +4 -2
  29. data/lib/project_types/script/layers/infrastructure/script_service.rb +6 -1
  30. data/lib/project_types/script/messages/messages.rb +6 -0
  31. data/lib/project_types/script/ui/error_handler.rb +16 -0
  32. data/lib/project_types/theme/commands/serve.rb +1 -0
  33. data/lib/project_types/theme/messages/messages.rb +5 -0
  34. data/lib/shopify_cli/app_type_detector.rb +32 -0
  35. data/lib/shopify_cli/command.rb +6 -1
  36. data/lib/shopify_cli/command_options/command_serve_options.rb +43 -0
  37. data/lib/shopify_cli/command_options.rb +7 -0
  38. data/lib/shopify_cli/commands/login.rb +3 -3
  39. data/lib/shopify_cli/commands/reporting.rb +38 -0
  40. data/lib/shopify_cli/commands/switch.rb +1 -1
  41. data/lib/shopify_cli/commands.rb +1 -0
  42. data/lib/shopify_cli/constants.rb +7 -3
  43. data/lib/shopify_cli/core/monorail.rb +9 -20
  44. data/lib/shopify_cli/environment.rb +15 -1
  45. data/lib/shopify_cli/exception_reporter.rb +24 -13
  46. data/lib/shopify_cli/messages/messages.rb +48 -19
  47. data/lib/shopify_cli/migrator/migration.rb +1 -1
  48. data/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +1 -1
  49. data/lib/shopify_cli/migrator/migrations/1633691650_merge_reporting_configuration.rb +41 -0
  50. data/lib/shopify_cli/reporting_configuration_controller.rb +64 -0
  51. data/lib/shopify_cli/services/base_service.rb +13 -0
  52. data/lib/shopify_cli/services/reporting_service.rb +16 -0
  53. data/lib/shopify_cli/services.rb +6 -0
  54. data/lib/shopify_cli/theme/dev_server/watcher.rb +2 -2
  55. data/lib/shopify_cli/theme/dev_server.rb +2 -2
  56. data/lib/shopify_cli/version.rb +1 -1
  57. data/lib/shopify_cli.rb +4 -0
  58. data/shopify-cli.gemspec +1 -8
  59. data/utilities/docker/container.rb +76 -0
  60. data/utilities/docker.rb +44 -3
  61. metadata +14 -5
  62. 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: 5eeebd9058a041844656003db1812bd64cc52b71f2cd9e971a196017ef272ad7
4
- data.tar.gz: cfb9881073152f718fb32bc6150329b0a0c7891058de9ce5145847717deaae35
3
+ metadata.gz: 51b5808e81e2d168620af088bec6f155869a9870b516960927735f9b7b886e55
4
+ data.tar.gz: 47c04e0dbabd30bb2c03e8c99771e724e16fe7c336fd342be01540749088bee5
5
5
  SHA512:
6
- metadata.gz: 606af4b1db0d92a2d1c15cf31a2376da3b5dc24b3def4cf5d78a7a5662cb64fc76b29e364f85e1880db5e7e2383ac3a9dd9b705f4f319414e6e5bf8c6c59788a
7
- data.tar.gz: 6880b9158d5ff14287e6bbfec091b6240979ef663c1b64494f6ed3b1fe2fdb98e60bc21b4dfc30a09129a3ff1c5136a68166f363ba111d21e0fdb6976ae737a8
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,23 +1,30 @@
1
- Unreleased
2
- ------
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
3
 
4
- Version 2.6.3
5
- ------
6
- * Enable error-reporting.
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
7
8
 
8
- Version 2.6.2
9
- ------
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.
10
21
 
22
+ ## Version 2.6.2
11
23
  * Fix broken installation due to a missing variable in `extconf.rb`
12
24
 
13
- Version 2.6.1
14
- ------
15
-
25
+ ## Version 2.6.1
16
26
  * [#1608](https://github.com/Shopify/shopify-cli/pull/1608): Fix errors not being reported.
17
-
18
- Version 2.6.0
19
- ------
20
-
27
+ ## Version 2.6.0
21
28
  * [#1574](https://github.com/Shopify/shopify-cli/pull/1574): Hide LoadError for ${RUBY_MAJOR}/ffi_c.
22
29
  * [#1567](https://github.com/Shopify/shopify-cli/pull/1567): Add ability to set custom port for ngrok tunnel in node serve.
23
30
  * [#1584](https://github.com/Shopify/shopify-cli/issues/1584): Fixed extended help message not showing.
@@ -26,92 +33,72 @@ Version 2.6.0
26
33
  * [#1528](https://github.com/Shopify/shopify-cli/pull/1528): Bump theme-check version to 1.7
27
34
  * [#1566](https://github.com/Shopify/shopify-cli/pull/1566): Fix bug when running `npm | yarn list` for extension package resolution
28
35
 
29
- Version 2.5.0
30
- ------
31
-
36
+ ## Version 2.5.0
32
37
  * [#1553](https://github.com/Shopify/shopify-cli/pull/1553): Add support for PHP app projects
33
38
 
34
- Version 2.4.0
35
- ------
36
-
39
+ ## Version 2.4.0
37
40
  * [#1488](https://github.com/Shopify/shopify-cli/pull/1488): Update Theme-Check to 1.4
38
41
  * [#1507](https://github.com/Shopify/shopify-cli/pull/1507): Limit the generated name for themes to 50 characters
39
42
 
40
- Version 2.3.0
41
- ------
42
-
43
+ ## Version 2.3.0
43
44
  * [#1386](https://github.com/Shopify/shopify-cli/pull/1386): Update Theme-Check to 1.2
44
45
  * [#1457](https://github.com/Shopify/shopify-cli/pull/1457): Fix uploading of binary theme files under Windows
45
46
  * [#1480](https://github.com/Shopify/shopify-cli/pull/1480): Fix customers pages not working with `theme serve`
46
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
47
51
 
48
- Version 2.2.2
49
- ------
50
- * [1382](https://github.com/Shopify/shopify-cli/pull/1382): Client side module upload for Scripts
51
-
52
- Version 2.2.1
53
- ------
54
-
52
+ ## Version 2.2.1
55
53
  * [1432](https://github.com/Shopify/shopify-cli/pull/1432) New method for determining renderer package name
56
54
 
57
- Version 2.2.0
58
- ------
59
- * [#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
60
57
  * [#1419](https://github.com/Shopify/shopify-cli/pull/1419): Remove analytics prompt when used in CI
61
58
  * [#1418](https://github.com/Shopify/shopify-cli/pull/1418): Auto configure resource URL for Checkout Extensions
62
59
  * [#1399](https://github.com/Shopify/shopify-cli/pull/1399): Fix error when running `shopify extension serve` in a theme app extension project
63
60
 
64
- Version 2.1.0
65
- -------------
66
- * [#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
67
63
  * [#1352](https://github.com/Shopify/shopify-cli/pull/1352): Add `shopify extension check` for checking theme app extensions
68
64
  * [#1304](https://github.com/Shopify/shopify-cli/pull/1304): Prompt user to run `shopify extension connect` if .env file is missing
69
65
 
70
- Version 2.0.2
71
- -------------
72
- * [#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
73
68
  * [#1319](https://github.com/Shopify/shopify-cli/pull/1319): Fix `theme pull` not pulling some files
74
69
  * [#1321](https://github.com/Shopify/shopify-cli/pull/1321): Fix error when pulling images with `theme pull`
75
70
  * [#1322](https://github.com/Shopify/shopify-cli/pull/1322): Fix error when running `shopify theme language-server --help`
76
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.
77
72
  * [#1343](https://github.com/Shopify/shopify-cli/pull/1343): Fix inconsistent use of periods vs ellipsis in messages. This replaces periods with ellipsis.
78
73
 
79
- Version 2.0.1
80
- -------------
81
- * [#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
82
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.
83
77
  * [#1298](https://github.com/Shopify/shopify-cli/pull/1298): Fix error in `theme serve` command
84
78
  * [#1301](https://github.com/Shopify/shopify-cli/pull/1301): Add `theme init` command
85
79
 
86
- Version 2.0.0
87
- -------------
88
- * Adds support for theme development
80
+ ## Version 2.0.0
81
+ * Adds support or theme development
89
82
  * Changes to command structure (note that these are breaking changes, see [README](README.md))
90
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).
91
84
 
92
- Version 1.14.0
93
- --------------
85
+ ## Version 1.14.0
94
86
  * [#1275](https://github.com/Shopify/shopify-cli/pull/1275): Use script.json to specify script metadata
95
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
96
88
  * [#1288](https://github.com/Shopify/shopify-cli/pull/1288): Fix bug where Scripts SDK was included for projects that don't require it
97
89
 
98
- Version 1.13.1
99
- --------------
90
+ ## Version 1.13.1
100
91
  * [#1274](https://github.com/Shopify/shopify-cli/pull/1274): Only print api_key during error if it exists
101
92
  * [#1272](https://github.com/Shopify/shopify-cli/pull/1272): Fix minor bug with extension serve for UI extensions
102
93
 
103
- Version 1.13.0
104
- --------------
105
-
94
+ ## Version 1.13.0
106
95
  * [#1266](https://github.com/Shopify/shopify-cli/pull/1266): Developer Console release
107
96
  * [#1265](https://github.com/Shopify/shopify-cli/pull/1265): Fix bug where commands hang after an unsuccessful authentication
108
97
 
109
- Version 1.12.0
110
- --------------
98
+ ## Version 1.12.0
111
99
  * [#1255](https://github.com/Shopify/shopify-cli/pull/1255): Fix beta flag checks when running `shopify serve`
112
100
 
113
- Version 1.11.0
114
- --------------
101
+ ## Version 1.11.0
115
102
  * [#1221](https://github.com/Shopify/shopify-cli/pull/1221): Prioritizes returning an HTTPS URL over HTTP from `shopify tunnel status`.
116
103
  * [#1223](https://github.com/Shopify/shopify-cli/pull/1233): Running `shopify serve` in an extension project now automatically runs `shopify tunnel`.
117
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
@@ -119,60 +106,52 @@ Version 1.11.0
119
106
  * [#1238](https://github.com/Shopify/shopify-cli/pull/1238): Auto Tunnel Support for Checkout Extension
120
107
  * [#1256](https://github.com/Shopify/shopify-cli/pull/1256): Allow using spaces around the equal sign on .env file.
121
108
 
122
- Version 1.10.0
123
- --------------
109
+ ## Version 1.10.0
124
110
  * Updating internal features in development
125
111
 
126
- Version 1.9.1
127
- -------------
112
+ ## Version 1.9.1
128
113
  * [#1201](https://github.com/Shopify/shopify-cli/pull/1201) Determine Argo Renderer Dynamically. This fixes `shopify serve` and `shopify push` for extensions.
129
114
 
130
- Version 1.9.0
131
- -------------
115
+ ## Version 1.9.0
132
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))
133
117
 
134
- Version 1.8.0
135
- -------------
118
+ ## Version 1.8.0
136
119
  * [#1119](https://github.com/Shopify/shopify-cli/pull/1119): Enable guest serialization for scripts
137
120
 
138
- Version 1.7.1
139
- ------
121
+ ## Version 1.7.1
122
+
140
123
  * Updating internal features in development
141
124
 
142
- Version 1.7.0
143
- -----
125
+ ## Version 1.7.0
144
126
  * [#1109](https://github.com/Shopify/shopify-cli/pull/1109): Abort app generation if name contains disallowed text.
145
127
  * [#1075](https://github.com/Shopify/shopify-cli/pull/1075): Add support for kebab-case flags
146
128
 
147
- Version 1.6.0
148
- -----
129
+ ## Version 1.6.0
149
130
  * [#1049](https://github.com/Shopify/shopify-cli/pull/1049): Add schema versioning support to the script project type
150
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
151
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.
152
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.
153
134
  * [#1034](https://github.com/Shopify/shopify-cli/pull/1034): Abort if a system call fails.
154
135
 
155
- Version 1.5.0
156
- -----
136
+ ## Version 1.5.0
157
137
  * [#965](https://github.com/Shopify/shopify-cli/pull/965): Remove --no-optional when using npm to create new project
158
138
  * [#958](https://github.com/Shopify/shopify-cli/pull/958): Split `connect` command into project-specific functionality
159
139
  * [#992](https://github.com/Shopify/shopify-cli/pull/992): Add Theme Kit functionality to CLI
160
140
 
161
- Version 1.4.1
162
- ------
141
+ ## Version 1.4.1
142
+
163
143
  * [#917](https://github.com/Shopify/shopify-cli/pull/917): Ensure analytics for create action includes the same fields as other commands
164
144
 
165
- Version 1.4.0
166
- ------
145
+ ## Version 1.4.0
146
+
167
147
  * Updates to tests, dependencies and internal tooling
168
148
  * [#924](https://github.com/Shopify/shopify-cli/pull/924): Improve debugging messages on Partner API errors
169
149
 
170
- Version 1.3.1
171
- ------
150
+ ## Version 1.3.1
151
+
172
152
  * Allow any characters in ngrok account names
173
153
 
174
- Version 1.3.0
175
- ------
154
+ ## Version 1.3.0
176
155
  * Support for new `shopify config analytics` command to enable/disable anonymous usage reporting
177
156
 
178
157
  Version 1.2.0
@@ -187,49 +166,39 @@ Version 1.1.1
187
166
  ------
188
167
  * Fix a bug where usernames with spaces caused issues on Windows
189
168
 
190
- Version 1.1.0
191
- ------
169
+ ## Version 1.1.0
192
170
  * Add native Windows 10 support, including variety of stability fixes.
193
171
 
194
- Version 1.0.5
195
- ------
172
+ ## Version 1.0.5
196
173
  * Fix a bug in out opt-in metrics
197
174
 
198
- Version 1.0.4
199
- ------
175
+ ## Version 1.0.4
200
176
  * Fix a bug when running the `connect` command with an account with multiple organizations
201
177
 
202
- Version 1.0.3
203
- ------
178
+ ## Version 1.0.3
204
179
  * Fix a bug which causes an error in the `populate` and `generate` commands when prompting for the shop name
205
180
 
206
- Version 1.0.2
207
- ------
181
+ ## Version 1.0.2
208
182
  * Fix missing shop parameter to AdminAPI.query() call (impacting populate and generate commands)
209
183
 
210
- Version 1.0.1
211
- ------
184
+ ## Version 1.0.1
212
185
  * Fixed an issue with RVM taking over the shell shim fd when it was not in use
213
186
 
214
- Version 1.0.0
215
- ------
187
+ ## Version 1.0.0
216
188
  * Release the installer-based version of the CLI
217
189
 
218
- Version 0.9.3 - Internal Test Version
219
- ------
190
+ ## Version 0.9.3 - Internal Test Version
220
191
  * Rebased to master
221
192
  * Removed auto-generated files from builds directory
222
193
 
223
- Version 0.9.2 - Internal Test Version
224
- ------
194
+ ## Version 0.9.2 - Internal Test Version
225
195
  * Rebased to master, to pull in 7+ Pull Requests
226
196
  * Updates to dependencies to package files (updated Ruby version)
227
197
 
228
- Version 0.9.1 - Internal Test Version
229
- ------
198
+ ## Version 0.9.1 - Internal Test Version
230
199
  * Updated required Ruby version for the CLI
231
200
  * Minor fixes for the build / release process
232
201
 
233
- Version 0.9.0 - Internal Test Version
234
- ------
202
+ ## Version 0.9.0 - Internal Test Version
203
+
235
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.3)
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/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
@@ -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}}