shopify-cli 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/CODE_OF_CONDUCT.md +73 -0
  4. data/.github/CONTRIBUTING.md +51 -0
  5. data/.github/DESIGN.md +153 -0
  6. data/.github/ISSUE_TEMPLATE.md +38 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  8. data/.github/probots.yml +3 -0
  9. data/.gitignore +19 -0
  10. data/.rubocop.yml +47 -0
  11. data/.ruby-version +1 -0
  12. data/.travis.yml +12 -0
  13. data/Gemfile +22 -0
  14. data/Gemfile.lock +77 -0
  15. data/LICENSE.md +7 -0
  16. data/README.md +13 -0
  17. data/Rakefile +101 -0
  18. data/SECURITY.md +59 -0
  19. data/Vagrantfile +17 -0
  20. data/bin/load_shopify.rb +20 -0
  21. data/bin/shopify +32 -0
  22. data/dev.yml +17 -0
  23. data/docs/Gemfile +5 -0
  24. data/docs/Gemfile.lock +248 -0
  25. data/docs/_config.yml +16 -0
  26. data/docs/_data/nav.yml +26 -0
  27. data/docs/_includes/footer.html +15 -0
  28. data/docs/_includes/head.html +19 -0
  29. data/docs/_includes/sidebar_nav.html +22 -0
  30. data/docs/_includes/toc.html +112 -0
  31. data/docs/_layouts/default.html +79 -0
  32. data/docs/app/node/commands/index.md +82 -0
  33. data/docs/app/node/index.md +35 -0
  34. data/docs/app/rails/commands/index.md +80 -0
  35. data/docs/app/rails/index.md +36 -0
  36. data/docs/core/index.md +70 -0
  37. data/docs/css/docs.css +157 -0
  38. data/docs/getting-started/index.md +61 -0
  39. data/docs/help/start-app/index.md +6 -0
  40. data/docs/images/header.png +0 -0
  41. data/docs/index.md +27 -0
  42. data/docs/installing-ruby.md +28 -0
  43. data/ext/shopify-cli/extconf.rb +27 -0
  44. data/install.sh +7 -0
  45. data/lib/docgen/class_template.md.erb +81 -0
  46. data/lib/docgen/index_template.md.erb +5 -0
  47. data/lib/docgen/markdown.rb +101 -0
  48. data/lib/graphql/admin_introspection.graphql +87 -0
  49. data/lib/graphql/all_organizations.graphql +19 -0
  50. data/lib/graphql/all_orgs_with_apps.graphql +30 -0
  51. data/lib/graphql/api_versions.graphql +6 -0
  52. data/lib/graphql/convert_dev_to_test_store.graphql +10 -0
  53. data/lib/graphql/create_app.graphql +20 -0
  54. data/lib/graphql/create_customer.graphql +9 -0
  55. data/lib/graphql/create_draft_order.graphql +8 -0
  56. data/lib/graphql/create_product.graphql +9 -0
  57. data/lib/graphql/extension_create.graphql +21 -0
  58. data/lib/graphql/extension_update_draft.graphql +18 -0
  59. data/lib/graphql/find_organization.graphql +17 -0
  60. data/lib/graphql/get_app_urls.graphql +6 -0
  61. data/lib/graphql/update_dashboard_urls.graphql +8 -0
  62. data/lib/project_types/extension/cli.rb +71 -0
  63. data/lib/project_types/extension/commands/build.rb +29 -0
  64. data/lib/project_types/extension/commands/create.rb +49 -0
  65. data/lib/project_types/extension/commands/extension_command.rb +22 -0
  66. data/lib/project_types/extension/commands/push.rb +69 -0
  67. data/lib/project_types/extension/commands/register.rb +78 -0
  68. data/lib/project_types/extension/commands/serve.rb +24 -0
  69. data/lib/project_types/extension/commands/tunnel.rb +69 -0
  70. data/lib/project_types/extension/extension_project.rb +85 -0
  71. data/lib/project_types/extension/extension_project_keys.rb +10 -0
  72. data/lib/project_types/extension/features/argo.rb +48 -0
  73. data/lib/project_types/extension/features/argo_dependencies.rb +28 -0
  74. data/lib/project_types/extension/features/argo_setup.rb +54 -0
  75. data/lib/project_types/extension/features/argo_setup_step.rb +31 -0
  76. data/lib/project_types/extension/features/argo_setup_steps.rb +53 -0
  77. data/lib/project_types/extension/features/tunnel_url.rb +20 -0
  78. data/lib/project_types/extension/forms/create.rb +52 -0
  79. data/lib/project_types/extension/forms/register.rb +48 -0
  80. data/lib/project_types/extension/messages/message_loading.rb +37 -0
  81. data/lib/project_types/extension/messages/messages.rb +126 -0
  82. data/lib/project_types/extension/models/app.rb +14 -0
  83. data/lib/project_types/extension/models/registration.rb +19 -0
  84. data/lib/project_types/extension/models/type.rb +76 -0
  85. data/lib/project_types/extension/models/types/checkout_post_purchase.rb +20 -0
  86. data/lib/project_types/extension/models/types/subscription_management.rb +20 -0
  87. data/lib/project_types/extension/models/validation_error.rb +17 -0
  88. data/lib/project_types/extension/models/version.rb +15 -0
  89. data/lib/project_types/extension/tasks/converters/registration_converter.rb +26 -0
  90. data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +25 -0
  91. data/lib/project_types/extension/tasks/converters/version_converter.rb +28 -0
  92. data/lib/project_types/extension/tasks/create_extension.rb +31 -0
  93. data/lib/project_types/extension/tasks/get_apps.rb +34 -0
  94. data/lib/project_types/extension/tasks/update_draft.rb +29 -0
  95. data/lib/project_types/extension/tasks/user_errors.rb +45 -0
  96. data/lib/project_types/node/cli.rb +37 -0
  97. data/lib/project_types/node/commands/create.rb +117 -0
  98. data/lib/project_types/node/commands/deploy.rb +22 -0
  99. data/lib/project_types/node/commands/deploy/heroku.rb +91 -0
  100. data/lib/project_types/node/commands/generate.rb +51 -0
  101. data/lib/project_types/node/commands/generate/billing.rb +37 -0
  102. data/lib/project_types/node/commands/generate/page.rb +55 -0
  103. data/lib/project_types/node/commands/generate/webhook.rb +33 -0
  104. data/lib/project_types/node/commands/open.rb +16 -0
  105. data/lib/project_types/node/commands/populate.rb +23 -0
  106. data/lib/project_types/node/commands/populate/customer.rb +31 -0
  107. data/lib/project_types/node/commands/populate/draft_order.rb +28 -0
  108. data/lib/project_types/node/commands/populate/product.rb +30 -0
  109. data/lib/project_types/node/commands/serve.rb +45 -0
  110. data/lib/project_types/node/commands/tunnel.rb +39 -0
  111. data/lib/project_types/node/forms/create.rb +87 -0
  112. data/lib/project_types/node/messages/messages.rb +260 -0
  113. data/lib/project_types/rails/cli.rb +41 -0
  114. data/lib/project_types/rails/commands/create.rb +126 -0
  115. data/lib/project_types/rails/commands/deploy.rb +22 -0
  116. data/lib/project_types/rails/commands/deploy/heroku.rb +113 -0
  117. data/lib/project_types/rails/commands/generate.rb +49 -0
  118. data/lib/project_types/rails/commands/generate/webhook.rb +39 -0
  119. data/lib/project_types/rails/commands/open.rb +16 -0
  120. data/lib/project_types/rails/commands/populate.rb +23 -0
  121. data/lib/project_types/rails/commands/populate/customer.rb +31 -0
  122. data/lib/project_types/rails/commands/populate/draft_order.rb +28 -0
  123. data/lib/project_types/rails/commands/populate/product.rb +30 -0
  124. data/lib/project_types/rails/commands/serve.rb +47 -0
  125. data/lib/project_types/rails/commands/tunnel.rb +39 -0
  126. data/lib/project_types/rails/forms/create.rb +116 -0
  127. data/lib/project_types/rails/gem.rb +56 -0
  128. data/lib/project_types/rails/messages/messages.rb +283 -0
  129. data/lib/project_types/rails/ruby.rb +17 -0
  130. data/lib/project_types/script/cli.rb +76 -0
  131. data/lib/project_types/script/commands/create.rb +45 -0
  132. data/lib/project_types/script/commands/disable.rb +36 -0
  133. data/lib/project_types/script/commands/enable.rb +46 -0
  134. data/lib/project_types/script/commands/push.rb +39 -0
  135. data/lib/project_types/script/config/extension_points.yml +18 -0
  136. data/lib/project_types/script/errors.rb +16 -0
  137. data/lib/project_types/script/forms/create.rb +29 -0
  138. data/lib/project_types/script/forms/enable.rb +24 -0
  139. data/lib/project_types/script/forms/push.rb +19 -0
  140. data/lib/project_types/script/forms/script_form.rb +66 -0
  141. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +27 -0
  142. data/lib/project_types/script/graphql/script_service_proxy.graphql +8 -0
  143. data/lib/project_types/script/graphql/shop_script_delete.graphql +14 -0
  144. data/lib/project_types/script/graphql/shop_script_update_or_create.graphql +28 -0
  145. data/lib/project_types/script/layers/application/build_script.rb +43 -0
  146. data/lib/project_types/script/layers/application/create_script.rb +47 -0
  147. data/lib/project_types/script/layers/application/disable_script.rb +19 -0
  148. data/lib/project_types/script/layers/application/enable_script.rb +21 -0
  149. data/lib/project_types/script/layers/application/extension_points.rb +17 -0
  150. data/lib/project_types/script/layers/application/project_dependencies.rb +34 -0
  151. data/lib/project_types/script/layers/application/push_script.rb +30 -0
  152. data/lib/project_types/script/layers/domain/errors.rb +25 -0
  153. data/lib/project_types/script/layers/domain/extension_point.rb +29 -0
  154. data/lib/project_types/script/layers/domain/push_package.rb +29 -0
  155. data/lib/project_types/script/layers/domain/script.rb +18 -0
  156. data/lib/project_types/script/layers/infrastructure/assemblyscript_dependency_manager.rb +73 -0
  157. data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +38 -0
  158. data/lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb +39 -0
  159. data/lib/project_types/script/layers/infrastructure/dependency_manager.rb +36 -0
  160. data/lib/project_types/script/layers/infrastructure/errors.rb +38 -0
  161. data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +31 -0
  162. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +47 -0
  163. data/lib/project_types/script/layers/infrastructure/script_builder.rb +34 -0
  164. data/lib/project_types/script/layers/infrastructure/script_repository.rb +89 -0
  165. data/lib/project_types/script/layers/infrastructure/script_service.rb +165 -0
  166. data/lib/project_types/script/layers/infrastructure/test_suite_repository.rb +59 -0
  167. data/lib/project_types/script/messages/messages.rb +204 -0
  168. data/lib/project_types/script/script_project.rb +37 -0
  169. data/lib/project_types/script/templates/ts/as-pect.config.js +21 -0
  170. data/lib/project_types/script/ui/error_handler.rb +136 -0
  171. data/lib/project_types/script/ui/strict_spinner.rb +22 -0
  172. data/lib/rubygems_plugin.rb +18 -0
  173. data/lib/shopify-cli/admin_api.rb +99 -0
  174. data/lib/shopify-cli/admin_api/populate_resource_command.rb +165 -0
  175. data/lib/shopify-cli/admin_api/schema.rb +32 -0
  176. data/lib/shopify-cli/api.rb +104 -0
  177. data/lib/shopify-cli/command.rb +67 -0
  178. data/lib/shopify-cli/commands.rb +28 -0
  179. data/lib/shopify-cli/commands/connect.rb +108 -0
  180. data/lib/shopify-cli/commands/create.rb +50 -0
  181. data/lib/shopify-cli/commands/help.rb +79 -0
  182. data/lib/shopify-cli/commands/logout.rb +23 -0
  183. data/lib/shopify-cli/commands/system.rb +135 -0
  184. data/lib/shopify-cli/commands/version.rb +15 -0
  185. data/lib/shopify-cli/context.rb +372 -0
  186. data/lib/shopify-cli/core.rb +9 -0
  187. data/lib/shopify-cli/core/entry_point.rb +40 -0
  188. data/lib/shopify-cli/core/executor.rb +21 -0
  189. data/lib/shopify-cli/core/help_resolver.rb +20 -0
  190. data/lib/shopify-cli/core/monorail.rb +118 -0
  191. data/lib/shopify-cli/db.rb +114 -0
  192. data/lib/shopify-cli/form.rb +40 -0
  193. data/lib/shopify-cli/git.rb +141 -0
  194. data/lib/shopify-cli/helpers.rb +5 -0
  195. data/lib/shopify-cli/helpers/haikunator.rb +92 -0
  196. data/lib/shopify-cli/heroku.rb +97 -0
  197. data/lib/shopify-cli/js_deps.rb +110 -0
  198. data/lib/shopify-cli/js_system.rb +98 -0
  199. data/lib/shopify-cli/messages/messages.rb +287 -0
  200. data/lib/shopify-cli/oauth.rb +192 -0
  201. data/lib/shopify-cli/oauth/servlet.rb +61 -0
  202. data/lib/shopify-cli/options.rb +40 -0
  203. data/lib/shopify-cli/packager.rb +116 -0
  204. data/lib/shopify-cli/partners_api.rb +114 -0
  205. data/lib/shopify-cli/partners_api/organizations.rb +32 -0
  206. data/lib/shopify-cli/process_supervision.rb +187 -0
  207. data/lib/shopify-cli/project.rb +191 -0
  208. data/lib/shopify-cli/project_type.rb +83 -0
  209. data/lib/shopify-cli/resources.rb +5 -0
  210. data/lib/shopify-cli/resources/env_file.rb +96 -0
  211. data/lib/shopify-cli/sub_command.rb +15 -0
  212. data/lib/shopify-cli/task.rb +10 -0
  213. data/lib/shopify-cli/tasks.rb +32 -0
  214. data/lib/shopify-cli/tasks/create_api_client.rb +29 -0
  215. data/lib/shopify-cli/tasks/ensure_dev_store.rb +41 -0
  216. data/lib/shopify-cli/tasks/ensure_env.rb +31 -0
  217. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +20 -0
  218. data/lib/shopify-cli/tasks/update_dashboard_urls.rb +44 -0
  219. data/lib/shopify-cli/tunnel.rb +154 -0
  220. data/lib/shopify-cli/version.rb +3 -0
  221. data/lib/shopify_cli.rb +132 -0
  222. data/shopify-cli.gemspec +40 -0
  223. data/shopify.fish +12 -0
  224. data/shopify.sh +11 -0
  225. data/vendor/deps/cli-kit/REVISION +1 -0
  226. data/vendor/deps/cli-kit/lib/cli/kit.rb +60 -0
  227. data/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +21 -0
  228. data/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +49 -0
  229. data/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +94 -0
  230. data/vendor/deps/cli-kit/lib/cli/kit/config.rb +133 -0
  231. data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +115 -0
  232. data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +81 -0
  233. data/vendor/deps/cli-kit/lib/cli/kit/ini.rb +102 -0
  234. data/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +82 -0
  235. data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +76 -0
  236. data/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +60 -0
  237. data/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +6 -0
  238. data/vendor/deps/cli-kit/lib/cli/kit/support.rb +9 -0
  239. data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +244 -0
  240. data/vendor/deps/cli-kit/lib/cli/kit/system.rb +207 -0
  241. data/vendor/deps/cli-kit/lib/cli/kit/util.rb +189 -0
  242. data/vendor/deps/cli-kit/lib/cli/kit/version.rb +5 -0
  243. data/vendor/deps/cli-ui/REVISION +1 -0
  244. data/vendor/deps/cli-ui/lib/cli/ui.rb +187 -0
  245. data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +153 -0
  246. data/vendor/deps/cli-ui/lib/cli/ui/box.rb +15 -0
  247. data/vendor/deps/cli-ui/lib/cli/ui/color.rb +79 -0
  248. data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +179 -0
  249. data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +310 -0
  250. data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +78 -0
  251. data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +88 -0
  252. data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +248 -0
  253. data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +472 -0
  254. data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +24 -0
  255. data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +48 -0
  256. data/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +40 -0
  257. data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +241 -0
  258. data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +227 -0
  259. data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +36 -0
  260. data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +102 -0
  261. data/vendor/deps/cli-ui/lib/cli/ui/version.rb +5 -0
  262. data/vendor/deps/smart_properties/REVISION +1 -0
  263. data/vendor/deps/smart_properties/lib/smart_properties.rb +174 -0
  264. data/vendor/deps/smart_properties/lib/smart_properties/errors.rb +114 -0
  265. data/vendor/deps/smart_properties/lib/smart_properties/property.rb +162 -0
  266. data/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +83 -0
  267. data/vendor/deps/smart_properties/lib/smart_properties/validations.rb +8 -0
  268. data/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +27 -0
  269. data/vendor/deps/smart_properties/lib/smart_properties/version.rb +3 -0
  270. data/vendor/lib/semantic/LICENSE +20 -0
  271. data/vendor/lib/semantic/semantic.rb +4 -0
  272. data/vendor/lib/semantic/version.rb +180 -0
  273. metadata +374 -0
@@ -0,0 +1,77 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.5.2)
5
+ public_suffix (>= 2.0.2, < 4.0)
6
+ ansi (1.5.0)
7
+ ast (2.4.0)
8
+ builder (3.2.3)
9
+ byebug (8.2.2)
10
+ coderay (1.1.2)
11
+ crack (0.4.3)
12
+ safe_yaml (~> 1.0.0)
13
+ fakefs (0.20.0)
14
+ hashdiff (0.3.2)
15
+ metaclass (0.0.4)
16
+ method_source (0.9.2)
17
+ minitest (5.11.3)
18
+ minitest-reporters (1.3.5)
19
+ ansi
20
+ builder
21
+ minitest (>= 5.0)
22
+ ruby-progressbar
23
+ mocha (1.7.0)
24
+ metaclass (~> 0.0.1)
25
+ parallel (1.19.1)
26
+ parser (2.7.1.3)
27
+ ast (~> 2.4.0)
28
+ pry (0.12.2)
29
+ coderay (~> 1.1.0)
30
+ method_source (~> 0.9.0)
31
+ pry-byebug (3.3.0)
32
+ byebug (~> 8.0)
33
+ pry (~> 0.10)
34
+ public_suffix (3.0.3)
35
+ rainbow (3.0.0)
36
+ rake (13.0.1)
37
+ regexp_parser (1.7.0)
38
+ rexml (3.2.4)
39
+ rubocop (0.85.0)
40
+ parallel (~> 1.10)
41
+ parser (>= 2.7.0.1)
42
+ rainbow (>= 2.2.2, < 4.0)
43
+ regexp_parser (>= 1.7)
44
+ rexml
45
+ rubocop-ast (>= 0.0.3)
46
+ ruby-progressbar (~> 1.7)
47
+ unicode-display_width (>= 1.4.0, < 2.0)
48
+ rubocop-ast (0.0.3)
49
+ parser (>= 2.7.0.1)
50
+ ruby-progressbar (1.10.1)
51
+ safe_yaml (1.0.4)
52
+ session (3.2.0)
53
+ timecop (0.9.1)
54
+ unicode-display_width (1.7.0)
55
+ webmock (2.3.2)
56
+ addressable (>= 2.3.6)
57
+ crack (>= 0.3.2)
58
+ hashdiff
59
+
60
+ PLATFORMS
61
+ ruby
62
+
63
+ DEPENDENCIES
64
+ byebug
65
+ fakefs
66
+ minitest (>= 5.0.0)
67
+ minitest-reporters
68
+ mocha
69
+ pry-byebug
70
+ rake
71
+ rubocop
72
+ session
73
+ timecop
74
+ webmock
75
+
76
+ BUNDLED WITH
77
+ 1.17.3
@@ -0,0 +1,7 @@
1
+ Copyright 2019-present, Shopify Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ # Shopify App CLI
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)[![Build Status](https://travis-ci.com/Shopify/shopify-app-cli.svg?token=qtPazgjyosjEEgxgq7VZ&branch=master)](https://travis-ci.com/Shopify/shopify-app-cli)
4
+
5
+ Shopify App CLI helps you build Shopify apps faster. It automates many common tasks in the development process and lets you quickly add popular features, such as billing and webhooks.
6
+
7
+ ## Using the CLI
8
+ Consult the [Shopify App CLI documentation](https://shopify.github.io/shopify-app-cli) to get started.
9
+
10
+ ## Developing the CLI
11
+ This is an [open-source](https://github.com/Shopify/shopify-app-cli/blob/master/.github/LICENSE.md) tool and developers are [invited to contribute](https://github.com/Shopify/shopify-app-cli/blob/master/.github/CONTRIBUTING.md) to it. Please check the [code of conduct](https://github.com/Shopify/shopify-app-cli/blob/master/.github/CODE_OF_CONDUCT.md) before you begin.
12
+
13
+ [Read the development guide](https://github.com/Shopify/shopify-app-cli/wiki) to learn more.
@@ -0,0 +1,101 @@
1
+ require_relative 'bin/load_shopify'
2
+ require 'rake/testtask'
3
+ require 'rubocop/rake_task'
4
+ require 'bundler/gem_tasks'
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs += %w(test)
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ t.verbose = false
10
+ t.warning = false
11
+ end
12
+
13
+ RuboCop::RakeTask.new
14
+
15
+ task(default: [:test, :rubocop])
16
+
17
+ desc("Start up irb with cli loaded")
18
+ task :console do
19
+ exec('irb', '-r', './bin/load_shopify.rb', '-r', 'byebug')
20
+ end
21
+
22
+ namespace :rdoc do
23
+ repo = 'https://github.com/Shopify/shopify-app-cli.wiki.git'
24
+ intermediate = 'markdown_intermediate'
25
+ file_to_doc = [
26
+ 'lib/shopify-cli/admin_api.rb',
27
+ 'lib/shopify-cli/context.rb',
28
+ 'lib/shopify-cli/db.rb',
29
+ 'lib/shopify-cli/git.rb',
30
+ 'lib/shopify-cli/heroku.rb',
31
+ 'lib/shopify-cli/js_deps.rb',
32
+ 'lib/shopify-cli/partners_api.rb',
33
+ 'lib/shopify-cli/process_supervision.rb',
34
+ 'lib/shopify-cli/project.rb',
35
+ 'lib/shopify-cli/tunnel.rb',
36
+ ]
37
+
38
+ task all: [:markdown, :wiki, :cleanup]
39
+
40
+ desc("Generate markdown files from rdoc comments")
41
+ task :markdown do
42
+ require 'rdoc/rdoc'
43
+ require 'docgen/markdown'
44
+ options = RDoc::Options.new
45
+ options.setup_generator('markdown')
46
+ options.op_dir = intermediate
47
+ options.files = file_to_doc
48
+ RDoc::RDoc.new.document(options)
49
+ end
50
+
51
+ desc("Copy markdown documentation to the wiki and commit them")
52
+ task :wiki do
53
+ require 'tmpdir'
54
+ Dir.mktmpdir do |temp_dir|
55
+ system("git clone --depth=1 #{repo} #{temp_dir}")
56
+ FileUtils.cp(Dir[File.join(intermediate, '*.md')], temp_dir)
57
+ Dir.chdir(temp_dir) do
58
+ system('git add --all')
59
+ system('git commit -am "auto doc update"')
60
+ system('git push')
61
+ end
62
+ end
63
+ end
64
+
65
+ desc("Clean up any documentation related files")
66
+ task :cleanup do
67
+ FileUtils.rm_r(intermediate)
68
+ end
69
+ end
70
+
71
+ desc("Generate markdown documentation and update the wiki")
72
+ task(rdoc: 'rdoc:all')
73
+
74
+ namespace :package do
75
+ require 'shopify-cli/packager'
76
+
77
+ task all: [:debian, :rpm, :homebrew]
78
+
79
+ desc("Builds a gem of the CLI")
80
+ task :gem do
81
+ ShopifyCli::Packager.new.build_gem
82
+ end
83
+
84
+ desc("Builds a Debian package of the CLI")
85
+ task :debian do
86
+ ShopifyCli::Packager.new.build_debian
87
+ end
88
+
89
+ desc("Builds an RPM package of the CLI")
90
+ task :rpm do
91
+ ShopifyCli::Packager.new.build_rpm
92
+ end
93
+
94
+ desc("Builds a Homebrew package of the CLI")
95
+ task :homebrew => :"package:gem" do
96
+ ShopifyCli::Packager.new.build_homebrew
97
+ end
98
+ end
99
+
100
+ desc("Builds all distribution packages of the CLI")
101
+ task(package: 'package:all')
@@ -0,0 +1,59 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ ### New features
6
+
7
+ New features will only be added to the master branch and will not be made available in point releases.
8
+
9
+ ### Bug fixes
10
+
11
+ Only the latest release series will receive bug fixes. When enough bugs are fixed and its deemed worthy to release a new gem, this is the branch it happens from.
12
+
13
+ ### Security issues
14
+
15
+ Only the latest release series will receive patches and new versions in case of a security issue.
16
+
17
+ ### Severe security issues
18
+
19
+ For severe security issues we will provide new versions as above, and also the last major release series will receive patches and new versions. The classification of the security issue is judged by the core team.
20
+
21
+ ### Unsupported Release Series
22
+
23
+ When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. If you are not comfortable maintaining your own versions, you should upgrade to a supported version.
24
+
25
+ ## Reporting a bug
26
+
27
+ All security bugs in shopify repositories should be reported to [our hackerone program](https://hackerone.com/shopify)
28
+ Shopify's whitehat program is our way to reward security researchers for finding serious security vulnerabilities in the In Scope properties listed at the bottom of this page, including our core application (all functionality associated with a Shopify store, particularly your-store.myshopify.com/admin) and certain ancillary applications.
29
+
30
+ ## Disclosure Policy
31
+
32
+ We look forward to working with all security researchers and strive to be respectful, always assume the best and treat others as peers. We expect the same in return from all participants. To achieve this, our team strives to:
33
+
34
+ - Reply to all reports within one business day and triage within two business days (if applicable)
35
+ - Be as transparent as possible, answering all inquires about our report decisions and adding hackers to duplicate HackerOne reports
36
+ - Award bounties within a week of resolution (excluding extenuating circumstances)
37
+ - Only close reports as N/A when the issue reported is included in Known Issues, Ineligible Vulnerabilities Types or lacks evidence of a vulnerability
38
+
39
+ **The following rules must be followed in order for any rewards to be paid:**
40
+
41
+ - You may only test against shops you have created which include your HackerOne YOURHANDLE @ wearehackerone.com registered email address.
42
+ - You must not attempt to gain access to, or interact with, any shops other than those created by you.
43
+ - The use of commercial scanners is prohibited (e.g., Nessus).
44
+ - Rules for reporting must be followed.
45
+ - Do not disclose any issues publicly before they have been resolved.
46
+ - Shopify reserves the right to modify the rules for this program or deem any submissions invalid at any time. Shopify may cancel the whitehat program without notice at any time.
47
+ - Contacting Shopify Support over chat, email or phone about your HackerOne report is not allowed. We may disqualify you from receiving a reward, or from participating in the program altogether.
48
+ - You are not an employee of Shopify; employees should report bugs to the internal bug bounty program.
49
+ - You hereby represent, warrant and covenant that any content you submit to Shopify is an original work of authorship and that you are legally entitled to grant the rights and privileges conveyed by these terms. You further represent, warrant and covenant that the consent of no other person or entity is or will be necessary for Shopify to use the submitted content.
50
+ - By submitting content to Shopify, you irrevocably waive all moral rights which you may have in the content.
51
+ - All content submitted by you to Shopify under this program is licensed under the MIT License.
52
+ - You must report any discovered vulnerability to Shopify as soon as you have validated the vulnerability.
53
+ - Failure to follow any of the foregoing rules will disqualify you from participating in this program.
54
+
55
+ ** Please see our [Hackerone Profile](https://hackerone.com/shopify) for full details
56
+
57
+ ## Receiving Security Updates
58
+
59
+ To recieve all general updates to vulnerabilities, please subscribe to our hackerone [Hacktivity](https://hackerone.com/shopify/hacktivity)
@@ -0,0 +1,17 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure('2') do |config|
5
+ # config.vm.define "centos" do |centos|
6
+ # centos.vm.box = "centos/7"
7
+ # end
8
+
9
+ # config.vm.define "windows" do |windows|
10
+ # windows.vm.box = "Microsoft/EdgeOnWindows10"
11
+ # windows.vm.box_version = "1.0"
12
+ # end
13
+
14
+ config.vm.define('ubuntu') do |ubuntu|
15
+ ubuntu.vm.box = 'ubuntu/xenial64'
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby --disable=gems
2
+
3
+ lib_path = File.expand_path("../../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
5
+
6
+ ENV['SHELLPID'] ||= Process.ppid.to_s
7
+ ENV['USER_PWD'] ||= Dir.pwd
8
+
9
+ # Prune non-absolute paths from PATH to prevent non-deterministic behavior
10
+ # i.e. If user has "." or "./bin" in their PATH
11
+ # Note that this logic is duplicated in lib/shopify.rb
12
+ ENV['PATH'] = ENV['PATH'].split(':').select { |p| p.start_with?('/', '~') }.join(':')
13
+
14
+ $original_env = ENV.to_hash
15
+
16
+ require 'shopify_cli'
17
+
18
+ if ENV['PRINT_LOADED_FEATURES']
19
+ puts $LOADED_FEATURES
20
+ end
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby --disable=gems
2
+
3
+ module Kernel
4
+ # make an alias of the original require
5
+ alias_method :original_require, :require
6
+
7
+ # rewrite require
8
+ def require(name)
9
+ original_require(name)
10
+ rescue LoadError => e
11
+ # Special case for psych (yaml), which rescues this itself
12
+ raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
13
+ STDERR.puts "[Note] You cannot use gems with Shopify App CLI."
14
+ STDERR.puts "[LoadError] #{e.message}"
15
+ if ENV['DEBUG']
16
+ STDERR.puts e.backtrace
17
+ STDERR.puts "\n"
18
+ end
19
+ STDERR.puts " They are disabled."
20
+ STDERR.puts " Please don't modify the CLI locally."
21
+ STDERR.puts " If you would like to contribute to the CLI project, please refer to"
22
+ STDERR.puts " https://github.com/Shopify/shopify-app-cli/blob/master/.github/CONTRIBUTING.md"
23
+ STDERR.puts "\n"
24
+ raise
25
+ end
26
+ end
27
+
28
+ require_relative './load_shopify'
29
+
30
+ exit(ShopifyCli::ErrorHandler.call do
31
+ ShopifyCli::Core::EntryPoint.call(ARGV.dup)
32
+ end)
data/dev.yml ADDED
@@ -0,0 +1,17 @@
1
+ name: dev
2
+ type:
3
+ - ruby
4
+
5
+ up:
6
+ - ruby: 2.5.1
7
+ - bundler
8
+
9
+ test:
10
+ desc: 'Run tests.'
11
+ run: |
12
+ if [ "$#" -eq 1 ] && [[ -f $1 ]];
13
+ then
14
+ rake test TEST=$1
15
+ else
16
+ rake test $@
17
+ fi
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :jekyll_plugins do
4
+ gem 'github-pages'
5
+ end
@@ -0,0 +1,248 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (6.0.3.1)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 0.7, < 2)
7
+ minitest (~> 5.1)
8
+ tzinfo (~> 1.1)
9
+ zeitwerk (~> 2.2, >= 2.2.2)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ coffee-script (2.4.1)
13
+ coffee-script-source
14
+ execjs
15
+ coffee-script-source (1.11.1)
16
+ colorator (1.1.0)
17
+ commonmarker (0.17.13)
18
+ ruby-enum (~> 0.5)
19
+ concurrent-ruby (1.1.6)
20
+ dnsruby (1.61.3)
21
+ addressable (~> 2.5)
22
+ em-websocket (0.5.1)
23
+ eventmachine (>= 0.12.9)
24
+ http_parser.rb (~> 0.6.0)
25
+ ethon (0.12.0)
26
+ ffi (>= 1.3.0)
27
+ eventmachine (1.2.7)
28
+ execjs (2.7.0)
29
+ faraday (1.0.1)
30
+ multipart-post (>= 1.2, < 3)
31
+ ffi (1.13.0)
32
+ forwardable-extended (2.6.0)
33
+ gemoji (3.0.1)
34
+ github-pages (206)
35
+ github-pages-health-check (= 1.16.1)
36
+ jekyll (= 3.8.7)
37
+ jekyll-avatar (= 0.7.0)
38
+ jekyll-coffeescript (= 1.1.1)
39
+ jekyll-commonmark-ghpages (= 0.1.6)
40
+ jekyll-default-layout (= 0.1.4)
41
+ jekyll-feed (= 0.13.0)
42
+ jekyll-gist (= 1.5.0)
43
+ jekyll-github-metadata (= 2.13.0)
44
+ jekyll-mentions (= 1.5.1)
45
+ jekyll-optional-front-matter (= 0.3.2)
46
+ jekyll-paginate (= 1.1.0)
47
+ jekyll-readme-index (= 0.3.0)
48
+ jekyll-redirect-from (= 0.15.0)
49
+ jekyll-relative-links (= 0.6.1)
50
+ jekyll-remote-theme (= 0.4.1)
51
+ jekyll-sass-converter (= 1.5.2)
52
+ jekyll-seo-tag (= 2.6.1)
53
+ jekyll-sitemap (= 1.4.0)
54
+ jekyll-swiss (= 1.0.0)
55
+ jekyll-theme-architect (= 0.1.1)
56
+ jekyll-theme-cayman (= 0.1.1)
57
+ jekyll-theme-dinky (= 0.1.1)
58
+ jekyll-theme-hacker (= 0.1.1)
59
+ jekyll-theme-leap-day (= 0.1.1)
60
+ jekyll-theme-merlot (= 0.1.1)
61
+ jekyll-theme-midnight (= 0.1.1)
62
+ jekyll-theme-minimal (= 0.1.1)
63
+ jekyll-theme-modernist (= 0.1.1)
64
+ jekyll-theme-primer (= 0.5.4)
65
+ jekyll-theme-slate (= 0.1.1)
66
+ jekyll-theme-tactile (= 0.1.1)
67
+ jekyll-theme-time-machine (= 0.1.1)
68
+ jekyll-titles-from-headings (= 0.5.3)
69
+ jemoji (= 0.11.1)
70
+ kramdown (= 1.17.0)
71
+ liquid (= 4.0.3)
72
+ mercenary (~> 0.3)
73
+ minima (= 2.5.1)
74
+ nokogiri (>= 1.10.4, < 2.0)
75
+ rouge (= 3.19.0)
76
+ terminal-table (~> 1.4)
77
+ github-pages-health-check (1.16.1)
78
+ addressable (~> 2.3)
79
+ dnsruby (~> 1.60)
80
+ octokit (~> 4.0)
81
+ public_suffix (~> 3.0)
82
+ typhoeus (~> 1.3)
83
+ html-pipeline (2.13.0)
84
+ activesupport (>= 2)
85
+ nokogiri (>= 1.4)
86
+ http_parser.rb (0.6.0)
87
+ i18n (0.9.5)
88
+ concurrent-ruby (~> 1.0)
89
+ jekyll (3.8.7)
90
+ addressable (~> 2.4)
91
+ colorator (~> 1.0)
92
+ em-websocket (~> 0.5)
93
+ i18n (~> 0.7)
94
+ jekyll-sass-converter (~> 1.0)
95
+ jekyll-watch (~> 2.0)
96
+ kramdown (~> 1.14)
97
+ liquid (~> 4.0)
98
+ mercenary (~> 0.3.3)
99
+ pathutil (~> 0.9)
100
+ rouge (>= 1.7, < 4)
101
+ safe_yaml (~> 1.0)
102
+ jekyll-avatar (0.7.0)
103
+ jekyll (>= 3.0, < 5.0)
104
+ jekyll-coffeescript (1.1.1)
105
+ coffee-script (~> 2.2)
106
+ coffee-script-source (~> 1.11.1)
107
+ jekyll-commonmark (1.3.1)
108
+ commonmarker (~> 0.14)
109
+ jekyll (>= 3.7, < 5.0)
110
+ jekyll-commonmark-ghpages (0.1.6)
111
+ commonmarker (~> 0.17.6)
112
+ jekyll-commonmark (~> 1.2)
113
+ rouge (>= 2.0, < 4.0)
114
+ jekyll-default-layout (0.1.4)
115
+ jekyll (~> 3.0)
116
+ jekyll-feed (0.13.0)
117
+ jekyll (>= 3.7, < 5.0)
118
+ jekyll-gist (1.5.0)
119
+ octokit (~> 4.2)
120
+ jekyll-github-metadata (2.13.0)
121
+ jekyll (>= 3.4, < 5.0)
122
+ octokit (~> 4.0, != 4.4.0)
123
+ jekyll-mentions (1.5.1)
124
+ html-pipeline (~> 2.3)
125
+ jekyll (>= 3.7, < 5.0)
126
+ jekyll-optional-front-matter (0.3.2)
127
+ jekyll (>= 3.0, < 5.0)
128
+ jekyll-paginate (1.1.0)
129
+ jekyll-readme-index (0.3.0)
130
+ jekyll (>= 3.0, < 5.0)
131
+ jekyll-redirect-from (0.15.0)
132
+ jekyll (>= 3.3, < 5.0)
133
+ jekyll-relative-links (0.6.1)
134
+ jekyll (>= 3.3, < 5.0)
135
+ jekyll-remote-theme (0.4.1)
136
+ addressable (~> 2.0)
137
+ jekyll (>= 3.5, < 5.0)
138
+ rubyzip (>= 1.3.0)
139
+ jekyll-sass-converter (1.5.2)
140
+ sass (~> 3.4)
141
+ jekyll-seo-tag (2.6.1)
142
+ jekyll (>= 3.3, < 5.0)
143
+ jekyll-sitemap (1.4.0)
144
+ jekyll (>= 3.7, < 5.0)
145
+ jekyll-swiss (1.0.0)
146
+ jekyll-theme-architect (0.1.1)
147
+ jekyll (~> 3.5)
148
+ jekyll-seo-tag (~> 2.0)
149
+ jekyll-theme-cayman (0.1.1)
150
+ jekyll (~> 3.5)
151
+ jekyll-seo-tag (~> 2.0)
152
+ jekyll-theme-dinky (0.1.1)
153
+ jekyll (~> 3.5)
154
+ jekyll-seo-tag (~> 2.0)
155
+ jekyll-theme-hacker (0.1.1)
156
+ jekyll (~> 3.5)
157
+ jekyll-seo-tag (~> 2.0)
158
+ jekyll-theme-leap-day (0.1.1)
159
+ jekyll (~> 3.5)
160
+ jekyll-seo-tag (~> 2.0)
161
+ jekyll-theme-merlot (0.1.1)
162
+ jekyll (~> 3.5)
163
+ jekyll-seo-tag (~> 2.0)
164
+ jekyll-theme-midnight (0.1.1)
165
+ jekyll (~> 3.5)
166
+ jekyll-seo-tag (~> 2.0)
167
+ jekyll-theme-minimal (0.1.1)
168
+ jekyll (~> 3.5)
169
+ jekyll-seo-tag (~> 2.0)
170
+ jekyll-theme-modernist (0.1.1)
171
+ jekyll (~> 3.5)
172
+ jekyll-seo-tag (~> 2.0)
173
+ jekyll-theme-primer (0.5.4)
174
+ jekyll (> 3.5, < 5.0)
175
+ jekyll-github-metadata (~> 2.9)
176
+ jekyll-seo-tag (~> 2.0)
177
+ jekyll-theme-slate (0.1.1)
178
+ jekyll (~> 3.5)
179
+ jekyll-seo-tag (~> 2.0)
180
+ jekyll-theme-tactile (0.1.1)
181
+ jekyll (~> 3.5)
182
+ jekyll-seo-tag (~> 2.0)
183
+ jekyll-theme-time-machine (0.1.1)
184
+ jekyll (~> 3.5)
185
+ jekyll-seo-tag (~> 2.0)
186
+ jekyll-titles-from-headings (0.5.3)
187
+ jekyll (>= 3.3, < 5.0)
188
+ jekyll-watch (2.2.1)
189
+ listen (~> 3.0)
190
+ jemoji (0.11.1)
191
+ gemoji (~> 3.0)
192
+ html-pipeline (~> 2.2)
193
+ jekyll (>= 3.0, < 5.0)
194
+ kramdown (1.17.0)
195
+ liquid (4.0.3)
196
+ listen (3.2.1)
197
+ rb-fsevent (~> 0.10, >= 0.10.3)
198
+ rb-inotify (~> 0.9, >= 0.9.10)
199
+ mercenary (0.3.6)
200
+ mini_portile2 (2.4.0)
201
+ minima (2.5.1)
202
+ jekyll (>= 3.5, < 5.0)
203
+ jekyll-feed (~> 0.9)
204
+ jekyll-seo-tag (~> 2.1)
205
+ minitest (5.14.1)
206
+ multipart-post (2.1.1)
207
+ nokogiri (1.10.9)
208
+ mini_portile2 (~> 2.4.0)
209
+ octokit (4.18.0)
210
+ faraday (>= 0.9)
211
+ sawyer (~> 0.8.0, >= 0.5.3)
212
+ pathutil (0.16.2)
213
+ forwardable-extended (~> 2.6)
214
+ public_suffix (3.1.1)
215
+ rb-fsevent (0.10.4)
216
+ rb-inotify (0.10.1)
217
+ ffi (~> 1.0)
218
+ rouge (3.19.0)
219
+ ruby-enum (0.8.0)
220
+ i18n
221
+ rubyzip (2.3.0)
222
+ safe_yaml (1.0.5)
223
+ sass (3.7.4)
224
+ sass-listen (~> 4.0.0)
225
+ sass-listen (4.0.0)
226
+ rb-fsevent (~> 0.9, >= 0.9.4)
227
+ rb-inotify (~> 0.9, >= 0.9.7)
228
+ sawyer (0.8.2)
229
+ addressable (>= 2.3.5)
230
+ faraday (> 0.8, < 2.0)
231
+ terminal-table (1.8.0)
232
+ unicode-display_width (~> 1.1, >= 1.1.1)
233
+ thread_safe (0.3.6)
234
+ typhoeus (1.4.0)
235
+ ethon (>= 0.9.0)
236
+ tzinfo (1.2.7)
237
+ thread_safe (~> 0.1)
238
+ unicode-display_width (1.7.0)
239
+ zeitwerk (2.3.0)
240
+
241
+ PLATFORMS
242
+ ruby
243
+
244
+ DEPENDENCIES
245
+ github-pages
246
+
247
+ BUNDLED WITH
248
+ 1.17.3