shopify-cli 2.15.0 → 2.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/stale.yml +7 -2
  3. data/.vscode/settings.json +1 -2
  4. data/CHANGELOG.md +70 -19
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +39 -7
  7. data/Rakefile +48 -0
  8. data/ext/javy/hashes/javy-arm-macos-v0.3.0.gz.sha256 +1 -0
  9. data/ext/javy/hashes/javy-x86_64-linux-v0.3.0.gz.sha256 +1 -0
  10. data/ext/javy/hashes/javy-x86_64-macos-v0.3.0.gz.sha256 +1 -0
  11. data/ext/javy/hashes/javy-x86_64-windows-v0.3.0.gz.sha256 +1 -0
  12. data/ext/javy/version +1 -1
  13. data/ext/shopify-extensions/version +1 -1
  14. data/lib/project_types/extension/commands/check.rb +6 -1
  15. data/lib/project_types/extension/forms/questions/ask_template.rb +5 -8
  16. data/lib/project_types/extension/messages/messages.rb +11 -3
  17. data/lib/project_types/extension/models/development_server_requirements.rb +14 -7
  18. data/lib/project_types/extension/models/server_config/root.rb +2 -0
  19. data/lib/project_types/extension/models/specification_handlers/beacon_extension.rb +57 -0
  20. data/lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config.rb +33 -0
  21. data/lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config_repository.rb +75 -0
  22. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +16 -1
  23. data/lib/project_types/extension/tasks/configure_options.rb +2 -1
  24. data/lib/project_types/extension/tasks/convert_server_config.rb +13 -2
  25. data/lib/project_types/extension/tasks/merge_server_config.rb +5 -2
  26. data/lib/project_types/script/cli.rb +1 -0
  27. data/lib/project_types/script/config/extension_points.yml +18 -0
  28. data/lib/project_types/script/layers/application/create_script.rb +14 -6
  29. data/lib/project_types/script/layers/infrastructure/errors.rb +17 -0
  30. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +6 -21
  31. data/lib/project_types/script/layers/infrastructure/script_service.rb +2 -0
  32. data/lib/project_types/script/layers/infrastructure/sparse_checkout_details.rb +35 -0
  33. data/lib/project_types/script/messages/messages.rb +3 -0
  34. data/lib/project_types/script/ui/error_handler.rb +11 -0
  35. data/lib/project_types/theme/cli.rb +1 -0
  36. data/lib/project_types/theme/commands/check.rb +4 -1
  37. data/lib/project_types/theme/commands/open.rb +2 -2
  38. data/lib/project_types/theme/commands/push.rb +1 -3
  39. data/lib/project_types/theme/commands/serve.rb +1 -0
  40. data/lib/project_types/theme/commands/share.rb +56 -0
  41. data/lib/project_types/theme/messages/messages.rb +71 -11
  42. data/lib/shopify_cli/changelog.rb +148 -0
  43. data/lib/shopify_cli/command.rb +7 -0
  44. data/lib/shopify_cli/command_options/command_serve_options.rb +10 -0
  45. data/lib/shopify_cli/commands/app/serve.rb +7 -7
  46. data/lib/shopify_cli/commands/login.rb +5 -2
  47. data/lib/shopify_cli/context.rb +13 -0
  48. data/lib/shopify_cli/git.rb +36 -0
  49. data/lib/shopify_cli/identity_auth.rb +24 -4
  50. data/lib/shopify_cli/messages/messages.rb +26 -5
  51. data/lib/shopify_cli/release.rb +194 -0
  52. data/lib/shopify_cli/sed.rb +19 -0
  53. data/lib/shopify_cli/services/app/create/rails_service.rb +10 -2
  54. data/lib/shopify_cli/services/app/serve/node_service.rb +2 -25
  55. data/lib/shopify_cli/services/app/serve/php_service.rb +2 -25
  56. data/lib/shopify_cli/services/app/serve/rails_service.rb +8 -28
  57. data/lib/shopify_cli/services/app/serve/serve_service.rb +57 -0
  58. data/lib/shopify_cli/services.rb +1 -0
  59. data/lib/shopify_cli/tasks/update_dashboard_urls.rb +7 -9
  60. data/lib/shopify_cli/theme/dev_server/hot-reload.js +40 -13
  61. data/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +1 -1
  62. data/lib/shopify_cli/theme/dev_server/hot_reload/sections_index.rb +51 -0
  63. data/lib/shopify_cli/theme/dev_server/hot_reload.rb +6 -1
  64. data/lib/shopify_cli/theme/dev_server/local_assets.rb +1 -1
  65. data/lib/shopify_cli/theme/dev_server/remote_watcher/json_files_update_job.rb +35 -0
  66. data/lib/shopify_cli/theme/dev_server/remote_watcher.rb +44 -0
  67. data/lib/shopify_cli/theme/dev_server/watcher.rb +2 -8
  68. data/lib/shopify_cli/theme/dev_server.rb +18 -5
  69. data/lib/shopify_cli/theme/file.rb +15 -4
  70. data/lib/shopify_cli/theme/syncer/checksums.rb +60 -0
  71. data/lib/shopify_cli/theme/syncer/forms/apply_to_all.rb +39 -0
  72. data/lib/shopify_cli/theme/syncer/forms/apply_to_all_form.rb +35 -0
  73. data/lib/shopify_cli/theme/syncer/forms/base_strategy_form.rb +62 -0
  74. data/lib/shopify_cli/theme/syncer/forms/select_delete_strategy.rb +27 -0
  75. data/lib/shopify_cli/theme/syncer/forms/select_update_strategy.rb +28 -0
  76. data/lib/shopify_cli/theme/syncer/ignore_helper.rb +33 -0
  77. data/lib/shopify_cli/theme/syncer/json_delete_handler.rb +51 -0
  78. data/lib/shopify_cli/theme/syncer/json_update_handler.rb +82 -0
  79. data/lib/shopify_cli/theme/syncer/merger.rb +53 -0
  80. data/lib/shopify_cli/theme/syncer/operation.rb +1 -1
  81. data/lib/shopify_cli/theme/syncer.rb +79 -63
  82. data/lib/shopify_cli/theme/theme.rb +26 -4
  83. data/lib/shopify_cli/theme/theme_admin_api.rb +23 -8
  84. data/lib/shopify_cli/thread_pool/job.rb +10 -2
  85. data/lib/shopify_cli/thread_pool.rb +15 -3
  86. data/lib/shopify_cli/tunnel.rb +9 -0
  87. data/lib/shopify_cli/version.rb +1 -1
  88. data/shopify-cli.gemspec +3 -1
  89. data/vendor/deps/cli-ui/lib/cli/ui/os.rb +8 -0
  90. metadata +30 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5861ffd7a22ca4048791e4993469dff421162159c7dabbf06b413522297c4a8
4
- data.tar.gz: b5593ee5d6cfbf5c9b616b050263eb825d2d7a9846f5bf71953b4d7f708ee06e
3
+ metadata.gz: 8f795330308fe8098043f9757452c62c5366eebcd724a90b3e81aafceb82a4f0
4
+ data.tar.gz: b5bac3e2def77bb94b993d39230a489d646bee5848cf4500e523da2b413e517f
5
5
  SHA512:
6
- metadata.gz: 8cf0ff62f5bf1687d5d98f4d808bf9f7d0bb921322483a5e446e34ef6638ff5a67a5ae15b3e34916a9c4fe627f4aee581f8630d4182925928eb67a762624c103
7
- data.tar.gz: 161eba94f7e0fd3ca350a162eef9706c8f5a76da972eb4b3cbefdc2f9f3fdc8a37a72b7a48f47d81e1860dca4367eb8c2ceae6fe1bd57d4a9a61c7df3ecd0209
6
+ metadata.gz: 05ffb12d03f75fd4bd1f5f8e0709445b51364cd8d8576407473c2f7ccc8ae1fa6d202181005041dd258ede96a1cd4a2382d9572cc427f936d62a9071229ce997
7
+ data.tar.gz: 2afbac5fe6fc03aa52858b00118661faac907cb23bb9c37368e46e4eb79feb3a309482d7ac59828b964c7a43d6de3c2446e750b6412344729e115f422b42bb84
@@ -8,6 +8,7 @@ name: Mark stale issues and pull requests
8
8
  on:
9
9
  schedule:
10
10
  - cron: '31 3 * * *' # randomly chosen time of day
11
+ workflow_dispatch:
11
12
 
12
13
  jobs:
13
14
  stale:
@@ -18,7 +19,7 @@ jobs:
18
19
  pull-requests: write
19
20
 
20
21
  steps:
21
- - uses: actions/stale@v3
22
+ - uses: actions/stale@v4
22
23
  with:
23
24
  repo-token: ${{ secrets.GITHUB_TOKEN }}
24
25
  days-before-issue-stale: 90
@@ -38,4 +39,8 @@ jobs:
38
39
  Thanks for helping to improve Shopify's dev tooling and experience.
39
40
  stale-issue-label: 'no-issue-activity'
40
41
  stale-pr-label: 'no-pr-activity'
41
- operations-per-run: 10 # temporary so we can ease into staling and see what happens
42
+ ascending: true
43
+ # The math seems a bit fuzzy, but this should amount to a max of 50 issues daily.
44
+ # But then the same issues get checked first so we don't end up progressing too quickly until we can close what we started.
45
+ # Hopefully https://github.com/actions/stale/issues/692 will be closed and fix some of this mess.
46
+ operations-per-run: 200
@@ -5,5 +5,4 @@
5
5
  "**/.DS_Store": true
6
6
  },
7
7
  "editor.formatOnSave": false,
8
- "workbench.colorTheme": "Dracula Soft",
9
- }
8
+ }
data/CHANGELOG.md CHANGED
@@ -2,7 +2,44 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## Version 2.15.0
5
+ ## Version 2.15.3 - 2022-04-07
6
+
7
+ ### Changed
8
+ * [#2188](https://github.com/Shopify/shopify-cli/pull/2188): Update URLs by default on serve and add --no-update flag to skip it
9
+ * [#2203](https://github.com/Shopify/shopify-cli/pull/2203): Use javy version 0.3.0
10
+
11
+ ### Fixed
12
+ * [#2162](https://github.com/Shopify/shopify-cli/pull/2162): Improve encoding error handling for Checkout Extension localization
13
+ * [#2187](https://github.com/Shopify/shopify-cli/pull/2187): Fix app serve after rails update
14
+ * [#2191](https://github.com/Shopify/shopify-cli/pull/2191): Directories with the `.json` extension should not be handled as JSON files
15
+ * [#2018](https://github.com/Shopify/shopify-cli/pull/2018): Run theme-check as a code dependency, not a pseudo-CLI invocation
16
+ * [#2211](https://github.com/Shopify/shopify-cli/pull/2211): Fix the `theme open` command to open the theme in the browser
17
+ * [#2183](https://github.com/Shopify/shopify-cli/pull/2183): Improve error message when suspended users run `theme serve`
18
+ * [#2219](https://github.com/Shopify/shopify-cli/pull/2219): Fix issues when creating Rails apps after the release of `shopify_app` v19
19
+
20
+ ### Added
21
+ * [#2190](https://github.com/Shopify/shopify-cli/pull/2190): Better login experience with spinner
22
+ * [#2200](https://github.com/Shopify/shopify-cli/pull/2200): Add `theme share` command
23
+
24
+ ## Version 2.15.2 - 2022-03-28
25
+
26
+ ### Fixed
27
+ * [#2121](https://github.com/Shopify/shopify-cli/pull/2121): Fix the hot-reload to work when the section name is not equal to the type
28
+
29
+ ### Added
30
+ * [#2174](https://github.com/Shopify/shopify-cli/pull/2174): Add optional 2-way sync between the CLI (`theme serve`) and the Theme Editor
31
+
32
+ ## Version 2.15.1 - 2022-03-24
33
+
34
+ ### Added
35
+ * [#1934](https://github.com/Shopify/shopify-cli/pull/1934): Block directories in theme assets
36
+ * [#1880](https://github.com/Shopify/shopify-cli/pull/1880): Recognize attempts to pass a store name and suggest correction
37
+
38
+ ### Fixed
39
+ * [#1874](https://github.com/Shopify/shopify-cli/pull/1874): Make ngrok errors more robust and helpful
40
+ * [#2172](https://github.com/Shopify/shopify-cli/pull/2172): Fix Ruby check for Rails app creation
41
+
42
+ ## Version 2.15.0 - 2022-03-21
6
43
 
7
44
  ### Fixed
8
45
  * [#2086](https://github.com/Shopify/shopify-cli/pull/2086): Improve check of dependency versions
@@ -10,7 +47,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
10
47
  * [#2122](https://github.com/Shopify/shopify-cli/pull/2122): Fix `--only`/`--ignore` flags parser to support multiple occurrences without quotes
11
48
  * [#2146](https://github.com/Shopify/shopify-cli/pull/2146): Prevent duplicate locales for Checkout extension localization
12
49
 
13
- ## Version 2.14.0
50
+ ## Version 2.14.0 - 2022-03-15
14
51
 
15
52
  ### Changed
16
53
  * [#2126](https://github.com/Shopify/shopify-cli/pull/2126): Use javy version 0.2.1
@@ -24,7 +61,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
24
61
  * [#2130](https://github.com/Shopify/shopify-cli/pull/2130): Fix Homebrew installation.
25
62
  * [#2133](https://github.com/Shopify/shopify-cli/pull/2133): Fix ignore file handling in DevServer::Watcher.
26
63
 
27
- ## Version 2.13.0
64
+ ## Version 2.13.0 - 2022-03-02
28
65
 
29
66
  ### Added
30
67
  * [#2087](https://github.com/Shopify/shopify-cli/pull/2087): Add new Theme CLI commands: `theme list` and `theme open`
@@ -38,7 +75,8 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
38
75
  ### Removed
39
76
  * [#2102](https://github.com/Shopify/shopify-cli/pull/2102): Remove AssemblyScript as a supported script language.
40
77
 
41
- ## Version 2.12.0
78
+ ## Version 2.12.0 - 2022-02-23
79
+
42
80
  ### Added
43
81
  * [#1866](https://github.com/Shopify/shopify-cli/pull/1866): Enforce git dependency
44
82
  * [#2009](https://github.com/Shopify/shopify-cli/pull/2009): Add localization support for Checkout Extensions
@@ -53,21 +91,24 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
53
91
  * [#2066](https://github.com/Shopify/shopify-cli/pull/2066): Improve `--only`/`--ignore` parameters on Theme `pull`/`push` commands to work without quotes
54
92
  * [#2078](https://github.com/Shopify/shopify-cli/pull/2078): Fix errors on section rendering caused by CORS issues
55
93
 
56
- ## Version 2.11.2
94
+ ## Version 2.11.2 - 2022-02-14
95
+
57
96
  ### Fixed
58
97
  * [#2047](https://github.com/Shopify/shopify-cli/pull/2047): Fix the Homebrew installation
59
98
  * [#2019](https://github.com/Shopify/shopify-cli/pull/2019): Provide helpful link when nokogiri fails to load
60
99
  * [#2055](https://github.com/Shopify/shopify-cli/pull/2055): Remove unneeded Node requirements
61
100
  * [#2020](https://github.com/Shopify/shopify-cli/pull/2020): Fix `theme pull` so that correct dev theme is used with `-d` option
62
101
 
63
- ## Version 2.11.1
102
+ ## Version 2.11.1 - 2022-02-09
103
+
64
104
  ### Fixed
65
105
  * [#1973](https://github.com/Shopify/shopify-cli/pull/1973): Fix `theme serve` to preview generated files (`*.css.liquid`)
66
106
  * [#2034](https://github.com/Shopify/shopify-cli/pull/2034): Fix `theme serve` to accept parameters with multiple values
67
107
  * [#2033](https://github.com/Shopify/shopify-cli/pull/2033): Pin Homebrew Ruby to 3.0
68
108
  * [#2032](https://github.com/Shopify/shopify-cli/pull/2032): Runtime error checking the Node version if Node is not present in the environment.
69
109
 
70
- ## Version 2.11.0
110
+ ## Version 2.11.0 - 2022-02-07
111
+
71
112
  ### Fixed
72
113
  * [#2005](https://github.com/Shopify/shopify-cli/pull/2005): Fix PHP app serve on Windows environments
73
114
 
@@ -82,17 +123,20 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
82
123
  * [#2002](https://github.com/Shopify/shopify-cli/pull/2002): Update `-o`/`--only` parameter to allow multiple patterns on `theme push`/`theme pull` commands
83
124
  * [#2022](https://github.com/Shopify/shopify-cli/pull/2022): Don't warn the user if the Ruby version is in the range 3.0.x.
84
125
 
85
- ## Version 2.10.2
126
+ ## Version 2.10.2 - 2022-01-31
127
+
86
128
  ### Fixed
87
129
  * [#1983](https://github.com/Shopify/shopify-cli/pull/1983): Improve Windows compatibility
88
130
  * [#1928](https://github.com/Shopify/shopify-cli/pull/1928): Ensure script Wasm file sizes don't exceed the limit
89
131
  * [#2006](https://github.com/Shopify/shopify-cli/pull/2006): Fix: More defensive URL generation
90
132
 
91
- ## Version 2.10.1
133
+ ## Version 2.10.1 - 2022-01-28
134
+
92
135
  ### Fixed
93
136
  * [#1985](https://github.com/Shopify/shopify-cli/pull/1985): Revert "Fix CORS (Cross-origin resource sharing) errors (#1952)"
94
137
 
95
- ## Version 2.10.0
138
+ ## Version 2.10.0 - 2022-01-25
139
+
96
140
  ### Fixed
97
141
  * [#1937](https://github.com/Shopify/shopify-cli/pull/1937): Fix `theme pull` to no longer add empty lines on Windows
98
142
  * [#1952](https://github.com/Shopify/shopify-cli/pull/1952): Fix CORS (cross-origin resource sharing) errors
@@ -101,7 +145,8 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
101
145
  ### Added
102
146
  * [#1892](https://github.com/Shopify/shopify-cli/pull/1892): Add `-o`/`--only` parameter to filter files on `theme push`/`theme pull` commands
103
147
 
104
- ## Version 2.9.0
148
+ ## Version 2.9.0 - 2022-01-17
149
+
105
150
  ### Fixed
106
151
  * [#1922](https://github.com/Shopify/shopify-cli/pull/1922): Respect RUBY_BINDIR from Homebrew for installing gem
107
152
  * [#1906](https://github.com/Shopify/shopify-cli/pull/1906): Fix Ngrok incompatibility with some Apple ARM environments
@@ -115,13 +160,15 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
115
160
  * [#1871](https://github.com/Shopify/shopify-cli/pull/1871): Add a new `--live-reload` parameter to the `theme serve` command
116
161
 
117
162
  ### Changed
118
- - [#1929](https://github.com/Shopify/shopify-cli/pull/1929): Rename `--registration-id` to `--extension-id` in `shopify extension push`.
163
+ * [#1929](https://github.com/Shopify/shopify-cli/pull/1929): Rename `--registration-id` to `--extension-id` in `shopify extension push`.
164
+
165
+ ## Version 2.8.0 - 2022-01-06
119
166
 
120
- ## Version 2.8.0
121
167
  ### Fixed
122
168
  * [#1879](https://github.com/Shopify/shopify-cli/pull/1879): Disambiguate -s as store option
123
169
 
124
- ## Version 2.7.4
170
+ ## Version 2.7.4 - 2021-12-22
171
+
125
172
  ### Added
126
173
  * [#1825](https://github.com/Shopify/shopify-cli/pull/1825): Support passing the connection information through arguments
127
174
 
@@ -132,10 +179,11 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
132
179
  * [#1850](https://github.com/Shopify/shopify-cli/pull/1850): Fix `shopify extension` commands timeout when organization has too many apps
133
180
  * [#1860](https://github.com/Shopify/shopify-cli/pull/1860): Fix `theme serve` hot reload when there are many tabs active
134
181
 
135
- ## Version 2.7.3
182
+ ## Version 2.7.3 - 2021-12-13
183
+
136
184
  ### Added
137
185
  * [#1826](https://github.com/Shopify/shopify-cli/pull/1826): Support using `script.config.yml` file for script configuration
138
- * [#1843](https://github.com/Shopify/shopify-cli/pull/1826): Support using javy on Apple ARM processors
186
+ * [#1843](https://github.com/Shopify/shopify-cli/pull/1843): Support using javy on Apple ARM processors
139
187
  * [#1847](https://github.com/Shopify/shopify-cli/pull/1847): `shopify script connect` command.
140
188
 
141
189
  ### Fixed
@@ -148,7 +196,8 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
148
196
  * [#1830](https://github.com/Shopify/shopify-cli/pull/1830): Fix hot reload when users update many files "simultaneously"
149
197
  * [#1837](https://github.com/Shopify/shopify-cli/pull/1837): Fix `ShopifyCLI::Theme::DevServer::CdnFonts` class to support any font
150
198
 
151
- ## Version 2.7.2
199
+ ## Version 2.7.2 - 2021-11-30
200
+
152
201
  ### Fixed
153
202
  * [#1763](https://github.com/Shopify/shopify-cli/pull/1763): Fix: Tunnel --PORT parameter not working in Node.js app.
154
203
  * [#1769](https://github.com/Shopify/shopify-cli/pull/1769): Fix `theme push --development --json` to output the proper exit code
@@ -159,14 +208,16 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
159
208
  * [#1788](https://github.com/Shopify/shopify-cli/pull/1788): Improve `theme serve` errors and add logs for successful operations
160
209
  * [#1794](https://github.com/Shopify/shopify-cli/pull/1794): Fix bug where hidden subcommands appear in the help menu.
161
210
 
162
- ## Version 2.7.1
211
+ ## Version 2.7.1 - 2021-11-17
212
+
163
213
  ### Fixed
164
214
  * [#1722](https://github.com/Shopify/shopify-cli/pull/1722): Fix `theme serve` failing when the port is already being used
165
215
  * [#1751](https://github.com/Shopify/shopify-cli/pull/1751): A bug in the app creation flow that caused the CLI to abort when the form validation failed.
166
216
  * [#1750](https://github.com/Shopify/shopify-cli/pull/1750): Runtime errors in Windows' environments when the `PATHEXT` environment variable is not defined.
167
217
  * [#1758](https://github.com/Shopify/shopify-cli/pull/1758): Fix tunnel creation for expired anonymous tunnels
168
218
 
169
- ## Version 2.7.0
219
+ ## Version 2.7.0 - 2021-11-15
220
+
170
221
  ### Changed
171
222
  * [#1650](https://github.com/Shopify/shopify-cli/pull/1650): **Breaking** Move app commands under `shopify app`.
172
223
 
data/Gemfile CHANGED
@@ -15,6 +15,7 @@ group :development, :test do
15
15
  gem "rubocop-rake", require: false
16
16
  gem "iniparse", "~> 1.5"
17
17
  gem "colorize", "~> 0.8.1"
18
+ gem "octokit", "~> 4.0"
18
19
  end
19
20
 
20
21
  group :test do
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.15.0)
4
+ shopify-cli (2.15.3)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.1)
@@ -13,13 +13,13 @@ GEM
13
13
  public_suffix (>= 2.0.2, < 5.0)
14
14
  ansi (1.5.0)
15
15
  ast (2.4.2)
16
- bugsnag (6.23.0)
16
+ bugsnag (6.24.2)
17
17
  concurrent-ruby (~> 1.0)
18
18
  builder (3.2.4)
19
19
  byebug (11.1.3)
20
20
  coderay (1.1.3)
21
21
  colorize (0.8.1)
22
- concurrent-ruby (1.1.9)
22
+ concurrent-ruby (1.1.10)
23
23
  crack (0.4.5)
24
24
  rexml
25
25
  cucumber (7.0.0)
@@ -55,11 +55,34 @@ GEM
55
55
  cucumber-messages (~> 17.0, >= 17.0.1)
56
56
  diff-lcs (1.4.4)
57
57
  fakefs (1.3.2)
58
+ faraday (1.10.0)
59
+ faraday-em_http (~> 1.0)
60
+ faraday-em_synchrony (~> 1.0)
61
+ faraday-excon (~> 1.1)
62
+ faraday-httpclient (~> 1.0)
63
+ faraday-multipart (~> 1.0)
64
+ faraday-net_http (~> 1.0)
65
+ faraday-net_http_persistent (~> 1.0)
66
+ faraday-patron (~> 1.0)
67
+ faraday-rack (~> 1.0)
68
+ faraday-retry (~> 1.0)
69
+ ruby2_keywords (>= 0.0.4)
70
+ faraday-em_http (1.0.0)
71
+ faraday-em_synchrony (1.0.0)
72
+ faraday-excon (1.1.0)
73
+ faraday-httpclient (1.0.1)
74
+ faraday-multipart (1.0.3)
75
+ multipart-post (>= 1.2, < 3)
76
+ faraday-net_http (1.0.1)
77
+ faraday-net_http_persistent (1.2.0)
78
+ faraday-patron (1.0.0)
79
+ faraday-rack (1.0.0)
80
+ faraday-retry (1.0.3)
58
81
  ffi (1.15.4)
59
82
  hashdiff (1.0.1)
60
83
  iniparse (1.5.0)
61
- liquid (5.1.0)
62
- listen (3.7.0)
84
+ liquid (5.3.0)
85
+ listen (3.7.1)
63
86
  rb-fsevent (~> 0.10, >= 0.10.3)
64
87
  rb-inotify (~> 0.9, >= 0.9.10)
65
88
  method_source (1.0.0)
@@ -77,9 +100,13 @@ GEM
77
100
  ruby-progressbar
78
101
  mocha (1.13.0)
79
102
  multi_test (0.1.2)
103
+ multipart-post (2.1.1)
80
104
  nokogiri (1.13.3)
81
105
  mini_portile2 (~> 2.8.0)
82
106
  racc (~> 1.4)
107
+ octokit (4.22.0)
108
+ faraday (>= 0.9)
109
+ sawyer (~> 0.8.0, >= 0.5.3)
83
110
  parallel (1.21.0)
84
111
  parser (3.1.1.0)
85
112
  ast (~> 2.4.1)
@@ -94,7 +121,7 @@ GEM
94
121
  rack (2.2.3)
95
122
  rainbow (3.1.1)
96
123
  rake (13.0.6)
97
- rb-fsevent (0.11.0)
124
+ rb-fsevent (0.11.1)
98
125
  rb-inotify (0.10.1)
99
126
  ffi (~> 1.0)
100
127
  regexp_parser (2.2.0)
@@ -117,9 +144,13 @@ GEM
117
144
  rubocop-shopify (2.0.1)
118
145
  rubocop (~> 1.11)
119
146
  ruby-progressbar (1.11.0)
147
+ ruby2_keywords (0.0.5)
148
+ sawyer (0.8.2)
149
+ addressable (>= 2.3.5)
150
+ faraday (> 0.8, < 2.0)
120
151
  sys-uname (1.2.2)
121
152
  ffi (~> 1.1)
122
- theme-check (1.10.1)
153
+ theme-check (1.10.2)
123
154
  liquid (>= 5.1.0)
124
155
  nokogiri (>= 1.12)
125
156
  parser (~> 3)
@@ -144,6 +175,7 @@ DEPENDENCIES
144
175
  minitest-fail-fast
145
176
  minitest-reporters
146
177
  mocha
178
+ octokit (~> 4.0)
147
179
  pry-byebug
148
180
  rack
149
181
  rake
data/Rakefile CHANGED
@@ -129,6 +129,54 @@ end
129
129
  desc("Builds all distribution packages of the CLI")
130
130
  task(package: "package:all")
131
131
 
132
+ namespace :changelog do
133
+ require "shopify_cli/changelog"
134
+
135
+ task :update do
136
+ ShopifyCLI::Changelog.new.update!
137
+ end
138
+ end
139
+
140
+ namespace :release do
141
+ require "shopify_cli/release"
142
+
143
+ task :prepare, [:new_version] do |_t, args|
144
+ new_version = args[:new_version]
145
+ unless new_version
146
+ raise <<~NO_NEW_VERSION
147
+ New version must be provided, e.g.:
148
+
149
+ $ GITHUB_ACCESS_TOKEN=abcdef rake "release:prepare[1.2.3]"
150
+
151
+ NO_NEW_VERSION
152
+ end
153
+ github_access_token = ENV["GITHUB_ACCESS_TOKEN"]
154
+ unless github_access_token
155
+ raise <<~NO_GITHUB_ACCESS_TOKEN
156
+ GitHub access token must be provided, e.g.:
157
+
158
+ $ GITHUB_ACCESS_TOKEN=abcdef rake "release:prepare[1.2.3]"
159
+ NO_GITHUB_ACCESS_TOKEN
160
+ end
161
+
162
+ ShopifyCLI::Release.new(new_version, github_access_token).prepare!
163
+ puts "Completed!"
164
+ end
165
+
166
+ task :package do
167
+ github_access_token = ENV["GITHUB_ACCESS_TOKEN"]
168
+ unless github_access_token
169
+ raise <<~NO_GITHUB_ACCESS_TOKEN
170
+ GitHub access token must be provided, e.g.:
171
+
172
+ $ GITHUB_ACCESS_TOKEN=abcdef rake release:package
173
+ NO_GITHUB_ACCESS_TOKEN
174
+ end
175
+ ShopifyCLI::Release.new(ShopifyCLI::VERSION, github_access_token).package!
176
+ puts "Completed!"
177
+ end
178
+ end
179
+
132
180
  namespace :extensions do
133
181
  task :update do
134
182
  version = ENV.fetch("VERSION").strip
@@ -0,0 +1 @@
1
+ c7e97d166e46d96fa43a70046c80607035101b4a96e40edcf4643a6c92913692
@@ -0,0 +1 @@
1
+ 877e6383b921de2b93ecaf5d1d902c7305d65bdab52758b9d5c02d9c5cea45ab
@@ -0,0 +1 @@
1
+ c8a40adf83cacae33f819fa78501355eee9077dce3818ab4a483b2473952941e
@@ -0,0 +1 @@
1
+ 9ca1e65b0f7a2645f408cb65e683d243069f03828d4b3eeaf59f3012e5d41e73
data/ext/javy/version CHANGED
@@ -1 +1 @@
1
- v0.2.1
1
+ v0.3.0
@@ -1 +1 @@
1
- v0.1.0
1
+ v0.2.0
@@ -32,7 +32,12 @@ module Extension
32
32
 
33
33
  def call(*)
34
34
  if project.specification_identifier == "THEME_APP_EXTENSION"
35
- @theme_check.run
35
+ begin
36
+ @theme_check.run!
37
+ rescue ThemeCheck::Cli::Abort, ThemeCheck::ThemeCheckError => e
38
+ raise ShopifyCLI::Abort,
39
+ ShopifyCLI::Context.message("theme.check.error", e.full_message)
40
+ end
36
41
  else
37
42
  @ctx.abort(@ctx.message("check.unsupported", project.specification_identifier))
38
43
  end
@@ -11,21 +11,18 @@ module Extension
11
11
  default: -> { CLI::UI::Prompt.method(:ask) }
12
12
 
13
13
  def call(project_details)
14
- return project_details unless template_required?(project_details)
15
- project_details.template = template || choose_interactively
14
+ if template_required?(project_details)
15
+ project_details.template = template || choose_interactively
16
+ end
16
17
  project_details
17
18
  end
18
19
 
19
20
  private
20
21
 
21
22
  def template_required?(project_details)
22
- return false unless extension_server_beta?
23
23
  type = project_details&.type&.identifier
24
- Models::DevelopmentServerRequirements::SUPPORTED_EXTENSION_TYPES.include?(type.downcase)
25
- end
26
-
27
- def extension_server_beta?
28
- ShopifyCLI::Shopifolk.check && ShopifyCLI::Feature.enabled?(:extension_server_beta)
24
+ (Models::DevelopmentServerRequirements.beta_enabled? &&
25
+ Models::DevelopmentServerRequirements.type_supported?(type.downcase))
29
26
  end
30
27
 
31
28
  def choose_interactively
@@ -41,7 +41,7 @@ module Extension
41
41
  invalid_api_key: "The API key %s does not match any of your apps.",
42
42
  ask_app: "Which app would you like to register this extension with?",
43
43
  no_apps: "{{x}} You don’t have any apps.",
44
- learn_about_apps: "{{*}} Learn more about building apps at <https://shopify.dev/concepts/apps>, " \
44
+ learn_about_apps: "{{*}} Learn more about building apps at <https://shopify.dev/apps>, " \
45
45
  "or try creating a new app using {{command:shopify [node|rails] create}}.",
46
46
  loading_apps: "Loading your apps…",
47
47
  no_available_extensions: "{{x}} There are no available extensions for this app.",
@@ -73,8 +73,6 @@ module Extension
73
73
  help: <<~HELP,
74
74
  Register your local extension to a Shopify app
75
75
  Usage: {{command:%s extension register}}
76
- Options:
77
- {{command:--api-key=API_KEY}} The API key used to register an app with the extension. This can be found on the app page on Partners Dashboard.
78
76
  HELP
79
77
  frame_title: "Registering Extension",
80
78
  waiting_text: "Registering with Shopify…",
@@ -115,6 +113,16 @@ module Extension
115
113
  tunnel_already_running: "A tunnel running on another port has been detected. Close the tunnel and try again.",
116
114
  },
117
115
  tunnel: {
116
+ duplicate_session: <<~MESSAGE,
117
+ Another ngrok tunnel is currently running with your auth token, possibly on another machine.
118
+
119
+ Terminate that tunnel before opening a new one.
120
+ MESSAGE
121
+ invalid_token: <<~MESSAGE,
122
+ The ngrok token currently configured is invalid.
123
+
124
+ After generating a new token, update your local ngrok configuration using {{command:shopify app tunnel auth <token>}}
125
+ MESSAGE
118
126
  missing_token: "{{x}} {{red:auth requires a token argument}}. "\
119
127
  "Find it on your ngrok dashboard: {{underline:https://dashboard.ngrok.com/auth/your-authtoken}}.",
120
128
  invalid_port: "%s is not a valid port.",
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "shopify_cli"
3
4
 
4
5
  module Extension
@@ -8,25 +9,31 @@ module Extension
8
9
  "checkout_ui_extension",
9
10
  "checkout_post_purchase",
10
11
  "product_subscription",
12
+ "beacon_extension",
11
13
  ]
12
14
 
13
15
  class << self
14
16
  def supported?(type)
15
- binary_installed? && type_supported?(type) && beta_enabled?
17
+ binary_installed? && type_supported?(type) && type_enabled?(type)
16
18
  end
17
19
 
18
- private
19
-
20
- def binary_installed?
21
- Models::DevelopmentServer.new.executable_installed?
20
+ def beta_enabled?
21
+ ShopifyCLI::Feature.enabled?(:extension_server_beta)
22
22
  end
23
23
 
24
24
  def type_supported?(type)
25
25
  SUPPORTED_EXTENSION_TYPES.include?(type.downcase)
26
26
  end
27
27
 
28
- def beta_enabled?
29
- ShopifyCLI::Shopifolk.check && ShopifyCLI::Feature.enabled?(:extension_server_beta)
28
+ private
29
+
30
+ def binary_installed?
31
+ Models::DevelopmentServer.new.executable_installed?
32
+ end
33
+
34
+ # Some types are enabled unconditionally; others require beta_enabled
35
+ def type_enabled?(type)
36
+ beta_enabled? || "checkout_ui_extension" == type.downcase
30
37
  end
31
38
  end
32
39
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "yaml"
4
+
3
5
  module Extension
4
6
  module Models
5
7
  module ServerConfig
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+ require "base64"
3
+ require "fileutils"
4
+ require "json"
5
+ require_relative "beacon_extension_utils/script_config"
6
+ require_relative "beacon_extension_utils/script_config_repository"
7
+
8
+ module Extension
9
+ module Models
10
+ module SpecificationHandlers
11
+ class BeaconExtension < Default
12
+ SCRIPT_FILE = "build/main.js"
13
+
14
+ def name
15
+ "Beacon Extension"
16
+ end
17
+
18
+ def read_configuration
19
+ end
20
+
21
+ def access_config_property(context, ext_config, key, &process_value)
22
+ context.abort(context.message("core.extension.push.beacon_extension.error.missing_config_key_error",
23
+ key)) unless ext_config.key?(key)
24
+
25
+ begin
26
+ process_value.nil? ? ext_config[key] : process_value.call(ext_config[key])
27
+ rescue StandardError
28
+ context.abort(context.message("core.extension.push.beacon_extension.error.invalid_config_value_error", key))
29
+ end
30
+ end
31
+
32
+ def config(context)
33
+ begin
34
+ ext_config = BeaconExtensionUtils::ScriptConfigYmlRepository.new(ctx: context).get!.content
35
+ rescue StandardError
36
+ context.abort(context.message("core.extension.push.beacon_extension.error.file_read_error",
37
+ BeaconExtensionUtils::ScriptConfigYmlRepository.filename))
38
+ end
39
+
40
+ begin
41
+ script_contents = File.read(File.join(context.root, SCRIPT_FILE)).chomp
42
+ rescue
43
+ context.abort(context.message("core.extension.push.beacon_extension.error.file_read_error", SCRIPT_FILE))
44
+ end
45
+ {
46
+ runtime_context: access_config_property(context, ext_config, "runtime_context"),
47
+ serialized_script: Base64.strict_encode64(script_contents),
48
+ runtime_configuration_definition: access_config_property(context, ext_config,
49
+ "configuration", &:to_json),
50
+ config_version: access_config_property(context, ext_config,
51
+ "version", &:to_s),
52
+ }
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Extension
4
+ module Models
5
+ module SpecificationHandlers
6
+ module BeaconExtensionUtils
7
+ class ScriptConfig
8
+ attr_reader :content, :version, :configuration, :filename
9
+
10
+ REQUIRED_FIELDS = %w(version)
11
+
12
+ def initialize(content:, filename:)
13
+ @filename = filename
14
+ validate_content!(content)
15
+ @content = content
16
+ @version = @content["version"].to_s
17
+ @configuration = @content["configuration"]
18
+ end
19
+
20
+ private
21
+
22
+ def validate_content!(content)
23
+ REQUIRED_FIELDS.each do |field|
24
+ if content[field].nil?
25
+ raise "invalid field:#{field}, filename:#{filename}"
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end