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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4994302e6b4675d919d6eba3f29037f6531e9d763332e688f6a4e2008a9f8785
4
+ data.tar.gz: de8db4ec0be15baac70f091548861364919543c193e0c73ecf94e43ac645b9fa
5
+ SHA512:
6
+ metadata.gz: ba5c507a109d2511dc33382152f46aebbfa0ffb80d8e1f34e588730ecbead56ccc476df04d9e902120c1beecd3e69a957415e73c30b11ade137a9572f94fba73
7
+ data.tar.gz: d4dcd572be32221413d30ebb28acb1a66bf8f8290a6825159c92802e149f48a93cde4dea6d5eb13a0a82e52af34c5a02403328b0e98566f0ef83078875fca942
@@ -0,0 +1 @@
1
+ * @shopify/platform-dev-tools-education
@@ -0,0 +1,73 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ education, socio-economic status, nationality, personal appearance, race,
10
+ religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others’ private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at opensource@shopify.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project’s leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,51 @@
1
+ # How to contribute
2
+
3
+ Shopify App CLI is an open source project. We want to make it as easy and transparent as possible to contribute. If we are missing anything or can make the process easier in any way, please let us know by [opening an issue](https://github.com/Shopify/shopify-app-cli/issues/new).
4
+
5
+ ## Code of conduct
6
+
7
+ We expect all participants to read our [code of conduct](https://github.com/Shopify/shopify-app-cli/.github/CODE_OF_CONDUCT.md) to understand which actions are and aren’t tolerated.
8
+
9
+ ## Open development
10
+
11
+ All work on Shopify App CLI happens directly on GitHub. Both team members and external contributors send pull requests which go through the same review process.
12
+
13
+ ## Design guidelines
14
+ When contributing to the Shopify App CLI, there are a set of [design guidelines](https://github.com/Shopify/shopify-app-cli/blob/master/.github/DESIGN.md) that should be followed. The design guidelines are meant to help create a consistent and predictable experience for all users of the tool, and help make descisions quicker when creating new commands or adding to existing ones.
15
+
16
+ ## Bugs
17
+
18
+ ### Where to find known issues
19
+
20
+ We track all of our issues in GitHub and [bugs](https://github.com/Shopify/shopify-app-cli/labels/Bug) are labeled accordingly. If you are planning to work on an issue, avoid ones which already have an assignee, where someone has commented within the last two weeks they are working on it, or the issue is labeled with [fix in progress](https://github.com/Shopify/shopify-app-cli/labels/fix%20in%20progress). We will do our best to communicate when an issue is being worked on internally.
21
+
22
+ ### Reporting new issues
23
+
24
+ To reduce duplicates, look through open issues before filing one. When [opening an issue](https://github.com/Shopify/shopify-app-cli/issues/new?template=ISSUE.md), complete as much of the template as possible.
25
+
26
+
27
+ ## Your first pull request
28
+
29
+ Working on your first pull request? You can learn how from this free video series:
30
+
31
+ [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
32
+
33
+ To help you get familiar with our contribution process, we have a list of [good first issues](https://github.com/Shopify/shopify-app-cli/labels/good%20first%20issue) that contain bugs with limited scope. This is a great place to get started.
34
+
35
+ If you decide to fix an issue, please check the comment thread in case somebody is already working on a fix. If nobody is working on it, leave a comment stating that you intend to work on it.
36
+
37
+ If somebody claims an issue but doesn’t follow up for more than two weeks, it’s fine to take it over but still leave a comment stating that you intend to work on it.
38
+
39
+ ### Sending a pull request
40
+
41
+ We’ll review your pull request and either merge it, request changes to it, or close it with an explanation. We’ll do our best to provide updates and feedback throughout the process.
42
+
43
+ ### Contributor License Agreement (CLA)
44
+
45
+ Each contributor is required to [sign a CLA](https://cla.shopify.com/). This process is automated as part of your first pull request and is only required once. If any contributor has not signed or does not have an associated GitHub account, the CLA check will fail and the pull request is unable to be merged.
46
+
47
+ ## Releasing a new version
48
+
49
+ If you are changing the CLI version, please make sure to update all the places that use it:
50
+ * ShopifyCLI::VERSION
51
+ * Debian package version under `packaging/debian`
@@ -0,0 +1,153 @@
1
+ # Shopify App CLI design guidelines
2
+
3
+ #### Table of Contents
4
+
5
+ - [Introduction](#introduction)
6
+ - [Assumptions](#assumptions)
7
+ - [Components of a well designed command](#Components-of-a-well-designed-command)
8
+ - [Design Principles](#design-principles)
9
+ - [CLI UI states](#CLI-UI-states)
10
+ - [Commands](#commands)
11
+
12
+ ## Introduction
13
+
14
+ The purpose of this doc is to outline all the heuristics, patterns, and templates we are using in the Shopify App CLI tool. All the content is based on the CLI Design and Style Guidelines doc, as well as the guidance on the Shopify cli-ui Github repo.
15
+
16
+ The most important principle to follow is **speed**. CLI tools are built to be extremely fast to use and to perform tasks quickly. If there is ever a collision between heuristics, default to whatever results in the fastest perceived or actual performance.
17
+
18
+ To help visualize all the components and states available in the Shopify App CLI, we have created a [UI Kit](https://www.figma.com/file/ZXIgM4wQpfRNjGaIArjWOgTD/CLI-UI-Kit?node-id=67%3A0) in [Figma](http://figma.com) that you can use to build command flows.
19
+
20
+ *Figma is a free web-based design tool.*
21
+
22
+ ## Assumptions
23
+ The user understands the following mechanics of a CLI:
24
+ - type in commands to execute tasks
25
+ - there is a persistent `help` command that will educate them on specifics of each command/subcommand
26
+ - `CTRL + C` quits any running task
27
+ - how to navigate and manipulate the filesystem via the command line: `cd` and `mkdir`
28
+
29
+ ## Components of a well designed command
30
+ When creating a new command or subcommand there are a few things to keep in mind.
31
+
32
+ ### What is the quickest way to execute a command?
33
+ Commands are best executed autonomously. Most of the time the command should be self contained and should not requre additional input from the user. For example when running `shopify populate products` the command will execute without additional inputs required from the user even though the command could ask for things like `product name`, `price`, etc.
34
+
35
+ When creating a new command or subcommand consider how much information is absolutely necessary for the command to execute autonomously. If a command always requires arguments or additional information then adding smart defaults could help make inputting the command faster.
36
+
37
+ ### Add arguments for key overrides
38
+ Arguments allow the user to override a commands default execution. For example if we run `shopify populate products` the default will be to create 5 products. However if the user wanted more then 5 products to be generated they could use an argument to override the defaults which would look it would look like this `shopify populate products --count=20`.
39
+
40
+ When creating a new command or subcommand consider what are the smart defaults included in the command, and what are the arguments you should expose to allow a user to override it.
41
+
42
+ ### Always add to `Help`
43
+ Help is the primary way a user will find more information about how to use a command. This is a pattern built in to the CLI mental model and should not be overlooked.
44
+
45
+ When adding a new command or subcommand always make sure it is documented in the `Help` pages properly. There is a standard pattern we use which can be found by running `shopify help [command]`.
46
+
47
+ ### Other surface areas to consider
48
+ The nature of CLIs usually means they are writing files or lines of code in files, as well as making API calls.
49
+
50
+ When your command or subcommand creates new files or adds lines of code to existing files, consider adding comments or content in those files that describe how to use the feature. It could be a link to the docs to explain more, it could contain multiple commented out examples of how to use the feature, etc.
51
+
52
+ Think about how to help the user work with the feature or file most effectively.
53
+
54
+
55
+ ## Design principles
56
+ High-level guiding principles to help make decisions faster when creating a CLI UI.
57
+
58
+ **Communicate every state (success, waiting, error) even if it’s redundant.**
59
+
60
+ ✅ Communicate task success even if the external process has also communicated success. Always wrap up what just happened with a success/error message.
61
+ ❌ Assume that success is understood because the process finished.
62
+
63
+ **Suppress output when the process is successful, and show output when the process has an error.**
64
+
65
+ ✅ Hide all STDOUT information if the process has run successfully, and show all output if the process failed.
66
+ ❌ Show every line or state if the process success/error state has not been determined yet.
67
+
68
+ **Error out if a task needs to make a system change and tell the user how to complete the installation.**
69
+
70
+ ✅ Prompt the user if you need to run something external that will modify their system to complete the installation.
71
+ ❌ Automatically install an NPM package that modifies the system. Prompt them that it’s needed and ask them if they would like the CLI to install it.
72
+
73
+ **If a process that fails early will affect the rest of the task, terminate it as soon as possible and tell the user why.**
74
+
75
+ ✅ Error out of a process if you know the rest of the task will fail.
76
+ ❌ Continue to try successfully completing the task if one crucial task failed.
77
+
78
+ **Output one idea per line.**
79
+
80
+ ✅ Error: you are not in an app project folder
81
+ ✅ Tip: use shopify create project to create a new app project
82
+ ❌ Error: you are not in an app project folder, use shopify create project to create a new app project.
83
+
84
+ **Ask for all the information needed to execute the task automatically.**
85
+
86
+ ✅ Use smart defaults to execute the task as fast as possible, and include arguments to let the user override the defaults.
87
+ ❌ Defer multiple options or inputs to after the command is executing.
88
+
89
+ **Let the user opt in to verbosity.**
90
+
91
+ ✅ Show the user whatever is necessary given the task at hand. A summary may be best suited for tasks with many subprocesses, where some output might make sense for small tasks.
92
+ ❌ Show the user every bit of information that comes in from external or internal tasks.
93
+
94
+ ## CLI UI states
95
+ Because of the serial nature of terminal input and output, CLIs have fewer states than graphical user interfaces. We provide design guidelines for three states:
96
+
97
+ **Input**
98
+ The command a user types in to execute a task.
99
+ `shopify create project projectName`
100
+
101
+ **Execute**
102
+ While a task is running, the output from the task to communicate what is happening to the user.
103
+ `Installing NPM...`
104
+ `Updating files`
105
+ `Checking dependencies`
106
+
107
+ **Success/Error**
108
+ Message at the end of the task executing to summarize what happened. This can be either a success or error message - because a CLI executes linearly, an error cannot happen inline or during a process, and the completion of a task will either end in success or error.
109
+ `[success] Installed NPM in [directory]`
110
+ `[error] NPM could not be installed because [output]`
111
+
112
+ ## CLI commands
113
+ When contributing to the CLI consider the following commands and what their intents are before either adding new subcommands to them or creating new top-level commands.
114
+
115
+ ### `Create`
116
+ Creating new parent resources that other commands depend on.
117
+
118
+ Subcommand:
119
+ `project projectName`
120
+
121
+ Examples:
122
+ `shopify create project myApp`
123
+
124
+ ### `Generate`
125
+ Generate is for creating new files and examples in the current app project.
126
+
127
+ Subcommand:
128
+ `page`
129
+ `webhook`
130
+ `billing`
131
+
132
+ Examples:
133
+ `shopify generate page`
134
+
135
+ ### `Populate`
136
+ Allows a user to add data to a development store.
137
+
138
+ Subcommands:
139
+ `products`
140
+ `customers`
141
+ `draftorders`
142
+
143
+ Options:
144
+ `--count [integer]`
145
+
146
+ Examples:
147
+ `shopify populate products --count 100`
148
+
149
+ ### `Serve`
150
+ Start an ngrok tunnel.
151
+
152
+ Example:
153
+ `shopify serve`
@@ -0,0 +1,38 @@
1
+ # Issue summary
2
+
3
+ Write a short description of the issue here ↓
4
+
5
+
6
+
7
+ ## Expected behavior
8
+
9
+ What do you think should happen?
10
+
11
+
12
+
13
+ ## Actual behavior
14
+
15
+ What actually happens?
16
+
17
+ Tip: include an error message (in a `<details></details>` tag) if your issue is related to an error
18
+
19
+
20
+
21
+ ## Steps to reproduce the problem
22
+
23
+ 1.
24
+ 1.
25
+ 1.
26
+
27
+ ## Reduced test case
28
+
29
+ The best way to get your bug fixed is to provide a [reduced test case](https://developer.mozilla.org/en-US/docs/Mozilla/QA/Reducing_testcases).
30
+
31
+
32
+
33
+ ## Specifications
34
+
35
+ - App type:
36
+ - Operating System:
37
+ - Shell:
38
+ - Ruby version (ruby -v):
@@ -0,0 +1,22 @@
1
+ <!--
2
+ ☝️How to write a good PR title:
3
+ - Prefix it with [Feature] (if applicable)
4
+ - Start with a verb, for example: Add, Delete, Improve, Fix…
5
+ - Give as much context as necessary and as little as possible
6
+ - Prefix it with [WIP] while it’s a work in progress
7
+ -->
8
+
9
+ ### WHY are these changes introduced?
10
+
11
+ Fixes #0000 <!-- link to issue if one exists -->
12
+
13
+ <!--
14
+ Context about the problem that’s being addressed.
15
+ -->
16
+
17
+ ### WHAT is this pull request doing?
18
+
19
+ <!--
20
+ Summary of the changes committed.
21
+ Before / after screenshots appreciated for UI changes.
22
+ -->
@@ -0,0 +1,3 @@
1
+ # .github/probots.yml
2
+ enabled:
3
+ - cla
@@ -0,0 +1,19 @@
1
+ .rubocop-*
2
+ .tmp/*
3
+ .bundle/*
4
+ .DS_Store
5
+ *.gz
6
+ .vagrant/
7
+ *.log
8
+ docs/_site/
9
+ tmp/
10
+ .git/*
11
+ markdown_intermediate
12
+ .idea
13
+ vendor/bundle
14
+ *.gem
15
+ packaging/builds
16
+ packaging/debian/shopify-cli
17
+ packaging/debian/shopify-cli.deb
18
+ packaging/rpm/build
19
+ packaging/rpm/shopify-cli.spec
@@ -0,0 +1,47 @@
1
+ inherit_from:
2
+ - https://shopify.github.io/ruby-style-guide/rubocop-cli.yml
3
+
4
+ AllCops:
5
+ Exclude:
6
+ - 'vendor/**/*'
7
+ - 'docs/**/*'
8
+ - 'packaging/**/*'
9
+ TargetRubyVersion: 2.4
10
+
11
+ Layout/EmptyLines:
12
+ Exclude:
13
+ # Need extra line so comment at top isnt registered to the Dev namespace
14
+ - 'lib/dev/helpers/chruby_reset.rb'
15
+
16
+ # Changing this could effect the way the content is rendered.
17
+ Layout/HeredocIndentation:
18
+ Exclude:
19
+ - 'lib/project_types/node/messages/messages.rb'
20
+ - 'lib/project_types/rails/messages/messages.rb'
21
+ - 'lib/project_types/script/messages/messages.rb'
22
+ - 'lib/shopify-cli/messages/messages.rb'
23
+
24
+ # allow String.new to create mutable strings
25
+ Style/EmptyLiteral:
26
+ Enabled: false
27
+
28
+ # allow String.new to create mutable strings
29
+ Style/HashSyntax:
30
+ Exclude:
31
+ - 'Rakefile'
32
+
33
+ # allow using %r{} for regexes
34
+ Style/RegexpLiteral:
35
+ Enabled: false
36
+
37
+ Style/MethodCallWithArgsParentheses:
38
+ IgnoredMethods:
39
+ - require
40
+ - require_relative
41
+ - require_dependency
42
+ - yield
43
+ - raise
44
+ - puts
45
+ - assert_equal
46
+ - assert
47
+ - refute
@@ -0,0 +1 @@
1
+ 2.5.1
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4.7
4
+ - 2.5.1
5
+ before_install:
6
+ - gem install bundler -v '1.17.3'
7
+ cache:
8
+ bundler: true
9
+ install:
10
+ - bundle install
11
+ script:
12
+ - bundle exec rake
data/Gemfile ADDED
@@ -0,0 +1,22 @@
1
+ # NOTE: These are development-only dependencies
2
+ source "https://rubygems.org"
3
+
4
+ # None of these can actually be used in a development copy of dev
5
+ # They are all for CI and tests
6
+ # `dev` uses no gems
7
+ group :development, :test do
8
+ gem 'rake'
9
+ gem 'pry-byebug'
10
+ gem 'byebug'
11
+ gem 'rubocop'
12
+ end
13
+
14
+ group :test do
15
+ gem 'session'
16
+ gem 'mocha', require: false
17
+ gem 'minitest', '>= 5.0.0', require: false
18
+ gem 'minitest-reporters', require: false
19
+ gem 'fakefs', require: false
20
+ gem 'webmock', require: false
21
+ gem 'timecop', require: false
22
+ end