shopify-cli 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/CODE_OF_CONDUCT.md +73 -0
- data/.github/CONTRIBUTING.md +51 -0
- data/.github/DESIGN.md +153 -0
- data/.github/ISSUE_TEMPLATE.md +38 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- data/.github/probots.yml +3 -0
- data/.gitignore +19 -0
- data/.rubocop.yml +47 -0
- data/.ruby-version +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +77 -0
- data/LICENSE.md +7 -0
- data/README.md +13 -0
- data/Rakefile +101 -0
- data/SECURITY.md +59 -0
- data/Vagrantfile +17 -0
- data/bin/load_shopify.rb +20 -0
- data/bin/shopify +32 -0
- data/dev.yml +17 -0
- data/docs/Gemfile +5 -0
- data/docs/Gemfile.lock +248 -0
- data/docs/_config.yml +16 -0
- data/docs/_data/nav.yml +26 -0
- data/docs/_includes/footer.html +15 -0
- data/docs/_includes/head.html +19 -0
- data/docs/_includes/sidebar_nav.html +22 -0
- data/docs/_includes/toc.html +112 -0
- data/docs/_layouts/default.html +79 -0
- data/docs/app/node/commands/index.md +82 -0
- data/docs/app/node/index.md +35 -0
- data/docs/app/rails/commands/index.md +80 -0
- data/docs/app/rails/index.md +36 -0
- data/docs/core/index.md +70 -0
- data/docs/css/docs.css +157 -0
- data/docs/getting-started/index.md +61 -0
- data/docs/help/start-app/index.md +6 -0
- data/docs/images/header.png +0 -0
- data/docs/index.md +27 -0
- data/docs/installing-ruby.md +28 -0
- data/ext/shopify-cli/extconf.rb +27 -0
- data/install.sh +7 -0
- data/lib/docgen/class_template.md.erb +81 -0
- data/lib/docgen/index_template.md.erb +5 -0
- data/lib/docgen/markdown.rb +101 -0
- data/lib/graphql/admin_introspection.graphql +87 -0
- data/lib/graphql/all_organizations.graphql +19 -0
- data/lib/graphql/all_orgs_with_apps.graphql +30 -0
- data/lib/graphql/api_versions.graphql +6 -0
- data/lib/graphql/convert_dev_to_test_store.graphql +10 -0
- data/lib/graphql/create_app.graphql +20 -0
- data/lib/graphql/create_customer.graphql +9 -0
- data/lib/graphql/create_draft_order.graphql +8 -0
- data/lib/graphql/create_product.graphql +9 -0
- data/lib/graphql/extension_create.graphql +21 -0
- data/lib/graphql/extension_update_draft.graphql +18 -0
- data/lib/graphql/find_organization.graphql +17 -0
- data/lib/graphql/get_app_urls.graphql +6 -0
- data/lib/graphql/update_dashboard_urls.graphql +8 -0
- data/lib/project_types/extension/cli.rb +71 -0
- data/lib/project_types/extension/commands/build.rb +29 -0
- data/lib/project_types/extension/commands/create.rb +49 -0
- data/lib/project_types/extension/commands/extension_command.rb +22 -0
- data/lib/project_types/extension/commands/push.rb +69 -0
- data/lib/project_types/extension/commands/register.rb +78 -0
- data/lib/project_types/extension/commands/serve.rb +24 -0
- data/lib/project_types/extension/commands/tunnel.rb +69 -0
- data/lib/project_types/extension/extension_project.rb +85 -0
- data/lib/project_types/extension/extension_project_keys.rb +10 -0
- data/lib/project_types/extension/features/argo.rb +48 -0
- data/lib/project_types/extension/features/argo_dependencies.rb +28 -0
- data/lib/project_types/extension/features/argo_setup.rb +54 -0
- data/lib/project_types/extension/features/argo_setup_step.rb +31 -0
- data/lib/project_types/extension/features/argo_setup_steps.rb +53 -0
- data/lib/project_types/extension/features/tunnel_url.rb +20 -0
- data/lib/project_types/extension/forms/create.rb +52 -0
- data/lib/project_types/extension/forms/register.rb +48 -0
- data/lib/project_types/extension/messages/message_loading.rb +37 -0
- data/lib/project_types/extension/messages/messages.rb +126 -0
- data/lib/project_types/extension/models/app.rb +14 -0
- data/lib/project_types/extension/models/registration.rb +19 -0
- data/lib/project_types/extension/models/type.rb +76 -0
- data/lib/project_types/extension/models/types/checkout_post_purchase.rb +20 -0
- data/lib/project_types/extension/models/types/subscription_management.rb +20 -0
- data/lib/project_types/extension/models/validation_error.rb +17 -0
- data/lib/project_types/extension/models/version.rb +15 -0
- data/lib/project_types/extension/tasks/converters/registration_converter.rb +26 -0
- data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +25 -0
- data/lib/project_types/extension/tasks/converters/version_converter.rb +28 -0
- data/lib/project_types/extension/tasks/create_extension.rb +31 -0
- data/lib/project_types/extension/tasks/get_apps.rb +34 -0
- data/lib/project_types/extension/tasks/update_draft.rb +29 -0
- data/lib/project_types/extension/tasks/user_errors.rb +45 -0
- data/lib/project_types/node/cli.rb +37 -0
- data/lib/project_types/node/commands/create.rb +117 -0
- data/lib/project_types/node/commands/deploy.rb +22 -0
- data/lib/project_types/node/commands/deploy/heroku.rb +91 -0
- data/lib/project_types/node/commands/generate.rb +51 -0
- data/lib/project_types/node/commands/generate/billing.rb +37 -0
- data/lib/project_types/node/commands/generate/page.rb +55 -0
- data/lib/project_types/node/commands/generate/webhook.rb +33 -0
- data/lib/project_types/node/commands/open.rb +16 -0
- data/lib/project_types/node/commands/populate.rb +23 -0
- data/lib/project_types/node/commands/populate/customer.rb +31 -0
- data/lib/project_types/node/commands/populate/draft_order.rb +28 -0
- data/lib/project_types/node/commands/populate/product.rb +30 -0
- data/lib/project_types/node/commands/serve.rb +45 -0
- data/lib/project_types/node/commands/tunnel.rb +39 -0
- data/lib/project_types/node/forms/create.rb +87 -0
- data/lib/project_types/node/messages/messages.rb +260 -0
- data/lib/project_types/rails/cli.rb +41 -0
- data/lib/project_types/rails/commands/create.rb +126 -0
- data/lib/project_types/rails/commands/deploy.rb +22 -0
- data/lib/project_types/rails/commands/deploy/heroku.rb +113 -0
- data/lib/project_types/rails/commands/generate.rb +49 -0
- data/lib/project_types/rails/commands/generate/webhook.rb +39 -0
- data/lib/project_types/rails/commands/open.rb +16 -0
- data/lib/project_types/rails/commands/populate.rb +23 -0
- data/lib/project_types/rails/commands/populate/customer.rb +31 -0
- data/lib/project_types/rails/commands/populate/draft_order.rb +28 -0
- data/lib/project_types/rails/commands/populate/product.rb +30 -0
- data/lib/project_types/rails/commands/serve.rb +47 -0
- data/lib/project_types/rails/commands/tunnel.rb +39 -0
- data/lib/project_types/rails/forms/create.rb +116 -0
- data/lib/project_types/rails/gem.rb +56 -0
- data/lib/project_types/rails/messages/messages.rb +283 -0
- data/lib/project_types/rails/ruby.rb +17 -0
- data/lib/project_types/script/cli.rb +76 -0
- data/lib/project_types/script/commands/create.rb +45 -0
- data/lib/project_types/script/commands/disable.rb +36 -0
- data/lib/project_types/script/commands/enable.rb +46 -0
- data/lib/project_types/script/commands/push.rb +39 -0
- data/lib/project_types/script/config/extension_points.yml +18 -0
- data/lib/project_types/script/errors.rb +16 -0
- data/lib/project_types/script/forms/create.rb +29 -0
- data/lib/project_types/script/forms/enable.rb +24 -0
- data/lib/project_types/script/forms/push.rb +19 -0
- data/lib/project_types/script/forms/script_form.rb +66 -0
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +27 -0
- data/lib/project_types/script/graphql/script_service_proxy.graphql +8 -0
- data/lib/project_types/script/graphql/shop_script_delete.graphql +14 -0
- data/lib/project_types/script/graphql/shop_script_update_or_create.graphql +28 -0
- data/lib/project_types/script/layers/application/build_script.rb +43 -0
- data/lib/project_types/script/layers/application/create_script.rb +47 -0
- data/lib/project_types/script/layers/application/disable_script.rb +19 -0
- data/lib/project_types/script/layers/application/enable_script.rb +21 -0
- data/lib/project_types/script/layers/application/extension_points.rb +17 -0
- data/lib/project_types/script/layers/application/project_dependencies.rb +34 -0
- data/lib/project_types/script/layers/application/push_script.rb +30 -0
- data/lib/project_types/script/layers/domain/errors.rb +25 -0
- data/lib/project_types/script/layers/domain/extension_point.rb +29 -0
- data/lib/project_types/script/layers/domain/push_package.rb +29 -0
- data/lib/project_types/script/layers/domain/script.rb +18 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_dependency_manager.rb +73 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +38 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb +39 -0
- data/lib/project_types/script/layers/infrastructure/dependency_manager.rb +36 -0
- data/lib/project_types/script/layers/infrastructure/errors.rb +38 -0
- data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +31 -0
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +47 -0
- data/lib/project_types/script/layers/infrastructure/script_builder.rb +34 -0
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +89 -0
- data/lib/project_types/script/layers/infrastructure/script_service.rb +165 -0
- data/lib/project_types/script/layers/infrastructure/test_suite_repository.rb +59 -0
- data/lib/project_types/script/messages/messages.rb +204 -0
- data/lib/project_types/script/script_project.rb +37 -0
- data/lib/project_types/script/templates/ts/as-pect.config.js +21 -0
- data/lib/project_types/script/ui/error_handler.rb +136 -0
- data/lib/project_types/script/ui/strict_spinner.rb +22 -0
- data/lib/rubygems_plugin.rb +18 -0
- data/lib/shopify-cli/admin_api.rb +99 -0
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +165 -0
- data/lib/shopify-cli/admin_api/schema.rb +32 -0
- data/lib/shopify-cli/api.rb +104 -0
- data/lib/shopify-cli/command.rb +67 -0
- data/lib/shopify-cli/commands.rb +28 -0
- data/lib/shopify-cli/commands/connect.rb +108 -0
- data/lib/shopify-cli/commands/create.rb +50 -0
- data/lib/shopify-cli/commands/help.rb +79 -0
- data/lib/shopify-cli/commands/logout.rb +23 -0
- data/lib/shopify-cli/commands/system.rb +135 -0
- data/lib/shopify-cli/commands/version.rb +15 -0
- data/lib/shopify-cli/context.rb +372 -0
- data/lib/shopify-cli/core.rb +9 -0
- data/lib/shopify-cli/core/entry_point.rb +40 -0
- data/lib/shopify-cli/core/executor.rb +21 -0
- data/lib/shopify-cli/core/help_resolver.rb +20 -0
- data/lib/shopify-cli/core/monorail.rb +118 -0
- data/lib/shopify-cli/db.rb +114 -0
- data/lib/shopify-cli/form.rb +40 -0
- data/lib/shopify-cli/git.rb +141 -0
- data/lib/shopify-cli/helpers.rb +5 -0
- data/lib/shopify-cli/helpers/haikunator.rb +92 -0
- data/lib/shopify-cli/heroku.rb +97 -0
- data/lib/shopify-cli/js_deps.rb +110 -0
- data/lib/shopify-cli/js_system.rb +98 -0
- data/lib/shopify-cli/messages/messages.rb +287 -0
- data/lib/shopify-cli/oauth.rb +192 -0
- data/lib/shopify-cli/oauth/servlet.rb +61 -0
- data/lib/shopify-cli/options.rb +40 -0
- data/lib/shopify-cli/packager.rb +116 -0
- data/lib/shopify-cli/partners_api.rb +114 -0
- data/lib/shopify-cli/partners_api/organizations.rb +32 -0
- data/lib/shopify-cli/process_supervision.rb +187 -0
- data/lib/shopify-cli/project.rb +191 -0
- data/lib/shopify-cli/project_type.rb +83 -0
- data/lib/shopify-cli/resources.rb +5 -0
- data/lib/shopify-cli/resources/env_file.rb +96 -0
- data/lib/shopify-cli/sub_command.rb +15 -0
- data/lib/shopify-cli/task.rb +10 -0
- data/lib/shopify-cli/tasks.rb +32 -0
- data/lib/shopify-cli/tasks/create_api_client.rb +29 -0
- data/lib/shopify-cli/tasks/ensure_dev_store.rb +41 -0
- data/lib/shopify-cli/tasks/ensure_env.rb +31 -0
- data/lib/shopify-cli/tasks/ensure_loopback_url.rb +20 -0
- data/lib/shopify-cli/tasks/update_dashboard_urls.rb +44 -0
- data/lib/shopify-cli/tunnel.rb +154 -0
- data/lib/shopify-cli/version.rb +3 -0
- data/lib/shopify_cli.rb +132 -0
- data/shopify-cli.gemspec +40 -0
- data/shopify.fish +12 -0
- data/shopify.sh +11 -0
- data/vendor/deps/cli-kit/REVISION +1 -0
- data/vendor/deps/cli-kit/lib/cli/kit.rb +60 -0
- data/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +21 -0
- data/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +49 -0
- data/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +94 -0
- data/vendor/deps/cli-kit/lib/cli/kit/config.rb +133 -0
- data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +115 -0
- data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +81 -0
- data/vendor/deps/cli-kit/lib/cli/kit/ini.rb +102 -0
- data/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +82 -0
- data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +76 -0
- data/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +60 -0
- data/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +6 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support.rb +9 -0
- data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +244 -0
- data/vendor/deps/cli-kit/lib/cli/kit/system.rb +207 -0
- data/vendor/deps/cli-kit/lib/cli/kit/util.rb +189 -0
- data/vendor/deps/cli-kit/lib/cli/kit/version.rb +5 -0
- data/vendor/deps/cli-ui/REVISION +1 -0
- data/vendor/deps/cli-ui/lib/cli/ui.rb +187 -0
- data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +153 -0
- data/vendor/deps/cli-ui/lib/cli/ui/box.rb +15 -0
- data/vendor/deps/cli-ui/lib/cli/ui/color.rb +79 -0
- data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +179 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +310 -0
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +78 -0
- data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +88 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +248 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +472 -0
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +24 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +48 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +40 -0
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +241 -0
- data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +227 -0
- data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +36 -0
- data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +102 -0
- data/vendor/deps/cli-ui/lib/cli/ui/version.rb +5 -0
- data/vendor/deps/smart_properties/REVISION +1 -0
- data/vendor/deps/smart_properties/lib/smart_properties.rb +174 -0
- data/vendor/deps/smart_properties/lib/smart_properties/errors.rb +114 -0
- data/vendor/deps/smart_properties/lib/smart_properties/property.rb +162 -0
- data/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +83 -0
- data/vendor/deps/smart_properties/lib/smart_properties/validations.rb +8 -0
- data/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +27 -0
- data/vendor/deps/smart_properties/lib/smart_properties/version.rb +3 -0
- data/vendor/lib/semantic/LICENSE +20 -0
- data/vendor/lib/semantic/semantic.rb +4 -0
- data/vendor/lib/semantic/version.rb +180 -0
- metadata +374 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
title: Getting started with Rails app projects
|
3
|
+
section: rails
|
4
|
+
toc: false
|
5
|
+
---
|
6
|
+
|
7
|
+
## Create a new Rails app project
|
8
|
+
|
9
|
+
To create a new Rails project, type `shopify create rails`. This will scaffold a new Rails app in a subdirectory.
|
10
|
+
|
11
|
+
```console
|
12
|
+
$ shopify create rails
|
13
|
+
? App Name
|
14
|
+
>
|
15
|
+
```
|
16
|
+
|
17
|
+
## Start a local development server
|
18
|
+
|
19
|
+
Once your app is created, you can work with it immediately by running `shopify serve` to start a local development server. Shopify App CLI uses [ngrok](https://ngrok.com) to create a tunnel. ngrok will choose a unique URL for you. The server will stay open until you type **Ctrl-C**.
|
20
|
+
|
21
|
+
```console
|
22
|
+
$ shopify serve
|
23
|
+
✓ ngrok tunnel running at https://example.ngrok.io
|
24
|
+
✓ writing .env file...
|
25
|
+
```
|
26
|
+
|
27
|
+
## Install your app on your development store
|
28
|
+
|
29
|
+
With the server running, open a new terminal window and run `shopify open` to open your app in your browser and install it on a development store.
|
30
|
+
|
31
|
+
```console
|
32
|
+
$ shopify open
|
33
|
+
```
|
34
|
+
|
35
|
+
For more information, consult the [Rails project command reference]({{ site.baseurl }}{% link app/rails/commands/index.md %}).
|
36
|
+
|
data/docs/core/index.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
title: Core commands
|
3
|
+
section: core
|
4
|
+
---
|
5
|
+
|
6
|
+
## `help`
|
7
|
+
|
8
|
+
Lists the available commands and describes what they do. The commands available will vary depending on whether you are inside a project directory, and what kind of project it is.
|
9
|
+
|
10
|
+
```console
|
11
|
+
$ shopify help
|
12
|
+
$ shopify -h
|
13
|
+
$ shopify --help
|
14
|
+
```
|
15
|
+
|
16
|
+
You can also use the `help` command or options to get more detailed information about a specific command:
|
17
|
+
|
18
|
+
```console
|
19
|
+
$ shopify help [command]
|
20
|
+
$ shopify [command] -h
|
21
|
+
$ shopify [command] --help
|
22
|
+
```
|
23
|
+
|
24
|
+
## `connect`
|
25
|
+
|
26
|
+
Connect an existing Shopify App CLI project with Shopify, such as a Partner account or a specific Shopify development store. This command re-creates the project’s `.env` file with your authentication tokens.
|
27
|
+
|
28
|
+
This is useful if you are working on one project across multiple computers, or collaborating with other developers using a version control system like git.
|
29
|
+
|
30
|
+
```console
|
31
|
+
$ shopify connect
|
32
|
+
```
|
33
|
+
|
34
|
+
## `create`
|
35
|
+
|
36
|
+
Create a new project of the specified type. The project will be created in a subdirectory of the current directory:
|
37
|
+
|
38
|
+
```console
|
39
|
+
$ shopify create
|
40
|
+
```
|
41
|
+
|
42
|
+
When running the `create` command on its own, the CLI will prompt you to choose a project type:
|
43
|
+
|
44
|
+
```console
|
45
|
+
$ shopify create
|
46
|
+
? What type of project would you like to create? (Choose with ↑ ↓ ⏎, filter with 'f')
|
47
|
+
> 1. Node.js App
|
48
|
+
2. Ruby on Rails App
|
49
|
+
```
|
50
|
+
|
51
|
+
You can also specify the type of app you want to create using a subcommand:
|
52
|
+
- For a Node.js app: `node`
|
53
|
+
- For a Ruby on Rails app: `rails`
|
54
|
+
|
55
|
+
If you specify a type, then Shopify App CLI will skip ahead and prompt you to enter a name for your project:
|
56
|
+
|
57
|
+
```console
|
58
|
+
$ shopify create node
|
59
|
+
? App Name
|
60
|
+
>
|
61
|
+
```
|
62
|
+
|
63
|
+
## `logout`
|
64
|
+
|
65
|
+
Log out of the currently authenticated partner organization and store. The `logout` command clears any invalid credentials. You’ll need to re-authenticate the next time you connect your project to Shopify.
|
66
|
+
|
67
|
+
```console
|
68
|
+
$ shopify logout
|
69
|
+
```
|
70
|
+
|
data/docs/css/docs.css
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
article {
|
2
|
+
padding: 30px 0;
|
3
|
+
color: #212326;
|
4
|
+
min-height: 80vh;
|
5
|
+
}
|
6
|
+
|
7
|
+
article a:link {
|
8
|
+
text-decoration: underline;
|
9
|
+
}
|
10
|
+
|
11
|
+
article a:hover {
|
12
|
+
text-decoration: none;
|
13
|
+
}
|
14
|
+
|
15
|
+
article h1,
|
16
|
+
article h2,
|
17
|
+
article h3,
|
18
|
+
article h4,
|
19
|
+
article h5,
|
20
|
+
article h6 {
|
21
|
+
margin-top: 1em;
|
22
|
+
}
|
23
|
+
|
24
|
+
article h1:first-child,
|
25
|
+
article h2:first-child,
|
26
|
+
article h3:first-child,
|
27
|
+
article h4:first-child,
|
28
|
+
article h5:first-child,
|
29
|
+
article h6:first-child {
|
30
|
+
margin-top: 0;
|
31
|
+
}
|
32
|
+
|
33
|
+
article ul {
|
34
|
+
list-style: disc;
|
35
|
+
margin-left: 20px;
|
36
|
+
}
|
37
|
+
|
38
|
+
article ol {
|
39
|
+
list-style: decimal;
|
40
|
+
margin-left: 20px;
|
41
|
+
}
|
42
|
+
|
43
|
+
blockquote {
|
44
|
+
margin: 0 0 30px 0;
|
45
|
+
padding: 20px 20px 10px 20px;
|
46
|
+
text-align: left;
|
47
|
+
background: #f0f1f2;
|
48
|
+
border-left: 4px solid #828a91;
|
49
|
+
}
|
50
|
+
|
51
|
+
blockquote b,
|
52
|
+
blockquote strong,
|
53
|
+
blockquote h4 {
|
54
|
+
margin-top: 0;
|
55
|
+
color: #647382;
|
56
|
+
}
|
57
|
+
|
58
|
+
blockquote h4 {
|
59
|
+
padding-left: 30px;
|
60
|
+
background-position: left top;
|
61
|
+
background-repeat: no-repeat;
|
62
|
+
background-size: 1em auto;
|
63
|
+
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2033.8%2039.5%22%3E%3Cstyle%20type=%22text/css%22%3Ecircle,%20ellipse,%20line,%20path,%20polygon,%20polyline,%20rect,%20text%20%7B%20fill:%20rgb(100,%20115,%20130)%20!important;%20%7D%3C/style%3E%3Cpath%20d=%22M13.3%2034.6c.2.1.4.2.7.4-.3-.1-.5-.2-.7-.4z%22/%3E%3Cpath%20d=%22M33%208c.7-1.2%201-2.6.6-4-.3-1.4-1.2-2.5-2.4-3.2-.7-.5-1.7-.8-2.6-.8-1.8%200-3.5.9-4.5%202.5-.8%201.3-1%202.8-.6%204.2-.7-.2-1.4-.3-2.2-.4-4.3-.4-8.6%201.4-11.3%204.9%200%200%200%20.1-.1.1-.3.3-.5.7-.7%201.1-.3.6-.6%201.1-.8%201.6-.8%201.8-2.1%203.2-3.9%204-1.6.7-2%20.7-2.1.7-.8.1-1.5.5-2%201.2-.4.7-.5%201.5-.2%202.3C1.3%2024.7%203%2026.9%205.3%2029l1.8%201.5c-.3.3-.5.6-.8%201-1.5%202.5-.7%205.7%201.7%207.2.8.5%201.8.8%202.7.8%201.8%200%203.5-.9%204.5-2.5.2-.3.4-.7.5-1.1.5.2%201%20.5%201.5.6%202.8%201.1%205.4%201.7%208%201.7h1.2c.8%200%201.5-.5%201.9-1.2.4-.7.5-1.6.2-2.3%200-.1-.2-.5-.3-2.2-.1-1.9.5-3.7%201.7-5.1l.1-.2c.4-.5.7-.9%201-1.4l.6-1.2v-.1c2-4.2%201.5-9.1-1.2-12.9-.3-.4-.6-.8-1-1.2C31%2010.1%2032.2%209.3%2033%208zM13.6%2036c-.6%201-1.6%201.5-2.8%201.5-.6%200-1.2-.2-1.7-.5-1.5-.9-2-2.9-1.1-4.5.2-.3.4-.6.7-.8.8.6%201.6%201.1%202.6%201.7.7.4%201.4.8%202%201.2.2.1.4.2.7.3-.1.4-.2.8-.4%201.1zm16.3-12.3c-.2.4-.3.7-.5%201-.2.4-.5.8-.9%201.2l-.1.1c-1%201.2-1.7%202.7-2%204.2-.1%200-.1.1-.2.1-1.6.4-11-2.6-16.2-8.9-.3-.4-1-.5-1.4-.1-.4.3-.5%201-.1%201.4%205%206.1%2014%209.7%2017.5%209.7h.3v.1c.1%201.9.3%202.6.5%202.9.1.2%200%20.4%200%20.5%200%20.1-.2.2-.4.2-2.7.2-5.3-.3-8.3-1.5-.8-.3-1.6-.7-2.5-1.1-1-.5-2.1-1.1-3.2-1.8s-2.1-1.3-3-2c-.9-.7-1.8-1.4-2.7-2.2-2.1-1.9-3.6-4-4.6-6.2-.1-.2%200-.4%200-.4%200-.1.2-.2.4-.2s.8-.1%202.8-.9c2.2-1%204-2.8%205-5%20.2-.4.4-.8.7-1.3.2-.3.4-.5.6-.8%200%200%200-.1.1-.1%202.2-2.9%205.9-4.5%209.6-4.1%201.6.2%203.2.7%204.6%201.6%201.2.8%202.3%201.7%203.1%202.9%202.2%203%202.6%207.1.9%2010.7zM31.3%207c-.6%201-1.6%201.5-2.8%201.5-.6%200-1.2-.2-1.7-.5-1.5-.9-2-2.9-1.1-4.5.6-1%201.6-1.5%202.8-1.5.6%200%201.2.2%201.7.5.7.5%201.3%201.2%201.5%202%20.2.8.1%201.7-.4%202.5z%22/%3E%3Cpath%20d=%22M22.8%2011.3c-.2.5-.7.8-1.2.7-.1%200-4.2-.7-8.8%208.5-.1.3-.5.5-.8.5-.2%200-.3%200-.4-.1-.5-.2-.7-.9-.5-1.3%205.5-10.9%2010.8-9.6%2011-9.5.6.1.9.7.7%201.2z%22/%3E%3C/svg%3E");
|
64
|
+
}
|
65
|
+
|
66
|
+
code {
|
67
|
+
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
|
68
|
+
padding: 0.5px 5px 2px;
|
69
|
+
border-radius: 5px;
|
70
|
+
background: #f4f6f8;
|
71
|
+
border: 1px solid #c4cdd5;
|
72
|
+
overflow-wrap: break-word;
|
73
|
+
}
|
74
|
+
|
75
|
+
h1 code, h2 code, h3 code, .on-this-page code {
|
76
|
+
background-color: transparent;
|
77
|
+
border: none;
|
78
|
+
padding: 0;
|
79
|
+
}
|
80
|
+
|
81
|
+
#PageContainer {
|
82
|
+
overflow: visible;
|
83
|
+
}
|
84
|
+
|
85
|
+
#Content {
|
86
|
+
}
|
87
|
+
|
88
|
+
#SidebarNav {
|
89
|
+
padding-top: 30px;
|
90
|
+
}
|
91
|
+
|
92
|
+
@media screen and (min-width: 46.875em) {
|
93
|
+
#SidebarNav {
|
94
|
+
position: -webkit-sticky;
|
95
|
+
position: -moz-sticky;
|
96
|
+
position: -ms-sticky;
|
97
|
+
position: -o-sticky;
|
98
|
+
position: sticky;
|
99
|
+
top: 0;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
#SidebarNav .is-active {
|
104
|
+
font-weight: 700;
|
105
|
+
border-color: #212326;
|
106
|
+
}
|
107
|
+
|
108
|
+
.marketing-nav__logo__shopify {
|
109
|
+
width: 214px;
|
110
|
+
height: 32px;
|
111
|
+
}
|
112
|
+
|
113
|
+
.in-page-menu li > ul {
|
114
|
+
margin-left: 30px;
|
115
|
+
}
|
116
|
+
|
117
|
+
.in-page-menu li ul a {
|
118
|
+
border-left: 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
.link--external {
|
122
|
+
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2020%2020%22%3E%3Cstyle%20type=%22text/css%22%3Ecircle,%20ellipse,%20line,%20path,%20polygon,%20polyline,%20rect,%20text%20%7B%20fill:%20rgb(92,%20106,%20196)%20!important;%20%7D%3C/style%3E%3Cpath%20d=%22M17%202c.553%200%201%20.448%201%201v5c0%20.552-.447%201-1%201s-1-.448-1-1V5.414l-7.293%207.293c-.195.195-.45.293-.707.293s-.512-.098-.707-.293c-.39-.39-.39-1.023%200-1.414L14.586%204H12c-.553%200-1-.448-1-1s.447-1%201-1h5zm-4%209c.553%200%201%20.448%201%201v5c0%20.552-.447%201-1%201H3c-.553%200-1-.448-1-1V7c0-.552.447-1%201-1h5c.553%200%201%20.448%201%201s-.447%201-1%201H4v8h8v-4c0-.552.447-1%201-1z%22/%3E%3C/svg%3E%0A");
|
123
|
+
background-position: right center;
|
124
|
+
background-repeat: no-repeat;
|
125
|
+
background-size: 16px 16px;
|
126
|
+
padding-right: 18px;
|
127
|
+
}
|
128
|
+
|
129
|
+
.footer-nav {
|
130
|
+
margin-bottom: 0;
|
131
|
+
border-bottom: 0;
|
132
|
+
}
|
133
|
+
|
134
|
+
/* Code highlights */
|
135
|
+
|
136
|
+
div.highlight {
|
137
|
+
color: #ffffff;
|
138
|
+
background-color: #000639;
|
139
|
+
border-radius: 5px;
|
140
|
+
margin-bottom: 15px;
|
141
|
+
}
|
142
|
+
|
143
|
+
pre.highlight {
|
144
|
+
font-size: 1em;
|
145
|
+
white-space: pre-wrap;
|
146
|
+
margin: 0;
|
147
|
+
overflow-x: auto;
|
148
|
+
text-align: left;
|
149
|
+
}
|
150
|
+
|
151
|
+
.highlight code {
|
152
|
+
display: block;
|
153
|
+
padding: 15px 0 15px 20px;
|
154
|
+
background: none;
|
155
|
+
border: none;
|
156
|
+
white-space: pre;
|
157
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
title: Getting started
|
3
|
+
section: getting-started
|
4
|
+
---
|
5
|
+
|
6
|
+
Developers should have some prior knowledge of the [Shopify app ecosystem](https://shopify.dev/concepts/apps). Shopify App CLI creates apps using either [Node.js](https://nodejs.org/) or [Ruby on Rails](https://rubyonrails.org/).
|
7
|
+
|
8
|
+
## Requirements
|
9
|
+
|
10
|
+
- [Ruby](https://www.ruby-lang.org) 2.5.1+
|
11
|
+
- [Node.js](https://nodejs.org) 10.0.0+
|
12
|
+
- [curl](https://curl.haxx.se)
|
13
|
+
- A [Shopify partner account](https://partners.shopify.com/signup)
|
14
|
+
- A [Shopify development store](https://help.shopify.com/en/partners/dashboard/development-stores#create-a-development-store) to install and test apps
|
15
|
+
- An [ngrok](https://ngrok.com/) account (free or paid) for local development
|
16
|
+
|
17
|
+
### Windows requirements
|
18
|
+
|
19
|
+
You’ll need to install the following tools to use Shopify App CLI on Windows:
|
20
|
+
|
21
|
+
- [Linux Subsystem for Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
|
22
|
+
- [Ubuntu VM](https://www.microsoft.com/en-ca/p/ubuntu/9nblggh4msv6)
|
23
|
+
|
24
|
+
## Install
|
25
|
+
|
26
|
+
Shopify App CLI installs using a shell script. Download and run it in your terminal with one command:
|
27
|
+
|
28
|
+
```console
|
29
|
+
eval "$(curl -sS https://raw.githubusercontent.com/Shopify/shopify-app-cli/master/install.sh)"
|
30
|
+
```
|
31
|
+
|
32
|
+
[View shell script source](https://raw.githubusercontent.com/Shopify/shopify-app-cli/master/install.sh)
|
33
|
+
|
34
|
+
|
35
|
+
## Uninstall
|
36
|
+
|
37
|
+
There are two steps to completely uninstall Shopify App CLI:
|
38
|
+
|
39
|
+
1. Delete the CLI files
|
40
|
+
1. Remove the `shopify` command from your shell profile
|
41
|
+
|
42
|
+
### 1. Delete the CLI files
|
43
|
+
|
44
|
+
By default, Shopify App CLI is installed in your home directory. All the files are contained in a hidden directory called `.shopify-app-cli`. Delete that directory to uninstall.
|
45
|
+
|
46
|
+
### 2. Remove the `shopify` command from your shell
|
47
|
+
|
48
|
+
During the install process, Shopify App CLI adds a line to your shell configuration. This line is typically located in the `.bash_profile` file in your home directory (depending on your system, it may also be found in `.bash_login` or `.profile`). It will look similar to this:
|
49
|
+
|
50
|
+
```sh
|
51
|
+
# The line won’t look exactly like this. `HOME_DIR` will instead be the absolute path to your home directory.
|
52
|
+
if [[ -f /HOME_DIR/.shopify-cli/shopify.sh ]]; then source /HOME_DIR/.shopify-cli/shopify.sh; fi
|
53
|
+
```
|
54
|
+
|
55
|
+
You can use `grep` to search for the correct file in your home directory. This command will return the name of the relevant file, and the line number where it appears:
|
56
|
+
|
57
|
+
```console
|
58
|
+
$ grep -Ens "^if.+\.shopify-app-cli/shopify\.sh.+fi$" ~/\.*
|
59
|
+
```
|
60
|
+
|
61
|
+
Deleting or commenting out the relevant line in your shell profile will remove `shopify` as a command. You may need to reload your shell.
|
Binary file
|
data/docs/index.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
title: Introduction
|
3
|
+
section: intro
|
4
|
+
toc: false
|
5
|
+
---
|
6
|
+
|
7
|
+
Shopify App CLI helps you build Shopify apps faster. It quickly scaffolds Node.js and Ruby on Rails apps, and automates many common development tasks.
|
8
|
+
|
9
|
+
**[Get started with Shopify App CLI]({{ site.baseurl }}{% link getting-started/index.md %})**
|
10
|
+
|
11
|
+
## Quick start
|
12
|
+
|
13
|
+
1. Install Shopify App CLI:
|
14
|
+
```console
|
15
|
+
$ eval "$(curl -sS https://raw.githubusercontent.com/Shopify/shopify-app-cli/master/install.sh)"
|
16
|
+
```
|
17
|
+
2. Create an app:
|
18
|
+
```console
|
19
|
+
$ shopify create
|
20
|
+
```
|
21
|
+
3. Start and install your app on a Shopify Development store:
|
22
|
+
```console
|
23
|
+
$ shopify serve
|
24
|
+
```
|
25
|
+
```console
|
26
|
+
$ shopify open
|
27
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Installing Ruby
|
2
|
+
|
3
|
+
## Mac OS
|
4
|
+
|
5
|
+
We recommend using [`ruby-install`][ruby-install] and [`chruby`][chruby] from Homebrew to manage ruby versions.
|
6
|
+
|
7
|
+
1. Install [Homebrew][brew]
|
8
|
+
1. Install `ruby-install` and `chruby`. Be sure to follow the instructions for adding the chruby shell hook to your ~/.bash_profile or ~/.zshrc file.
|
9
|
+
|
10
|
+
brew install ruby-install chruby
|
11
|
+
|
12
|
+
1. Install ruby 2.5.1:
|
13
|
+
|
14
|
+
ruby-install ruby-2.5.1
|
15
|
+
|
16
|
+
1. **Open a new terminal window** and activate ruby 2.5.1:
|
17
|
+
|
18
|
+
chruby ruby-2.5.1
|
19
|
+
|
20
|
+
1. Run your Shopify App CLI command.
|
21
|
+
|
22
|
+
## Linux
|
23
|
+
|
24
|
+
Ruby 2.5 is available for most recent versions of Ubuntu, including Trusty and Xenial, installable with `apt-get install ruby-2.5`. Look for it in your distributions package manager.
|
25
|
+
|
26
|
+
[brew]:https://brew.sh
|
27
|
+
[chruby]:https://github.com/postmodern/chruby
|
28
|
+
[ruby-install]:https://github.com/postmodern/ruby-install
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
gem = File.expand_path('../../../', __FILE__)
|
5
|
+
exe = File.join(gem, 'bin', 'shopify')
|
6
|
+
script = exe + '.sh'
|
7
|
+
symlink = '/usr/local/bin/shopify'
|
8
|
+
|
9
|
+
script_content = <<~SCRIPT
|
10
|
+
#!/usr/bin/env bash
|
11
|
+
#{RbConfig.ruby} --disable=gems -I #{gem} #{exe} $@
|
12
|
+
SCRIPT
|
13
|
+
|
14
|
+
File.write(script, script_content)
|
15
|
+
FileUtils.chmod("+x", script)
|
16
|
+
|
17
|
+
makefile_content = <<~MAKEFILE
|
18
|
+
.PHONY: clean install
|
19
|
+
|
20
|
+
clean:
|
21
|
+
\t@sudo rm -f #{symlink}
|
22
|
+
|
23
|
+
install: clean
|
24
|
+
\t@sudo ln -s #{script} #{symlink}
|
25
|
+
MAKEFILE
|
26
|
+
|
27
|
+
File.write('Makefile', makefile_content)
|
data/install.sh
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
<%= comment %>
|
2
|
+
<% if constants.any? -%>
|
3
|
+
- [Constants](#constants)
|
4
|
+
<%- end -%>
|
5
|
+
<%- if attributes.any? -%>
|
6
|
+
- [Attributes](#attributes)
|
7
|
+
<%- end -%>
|
8
|
+
<%- if class_methods.any? -%>
|
9
|
+
- [Class Methods](#class-methods)
|
10
|
+
<%- class_methods.each do |method| -%>
|
11
|
+
- [<%= method.title %>](#<%= method.title.gsub("?", "") %>)
|
12
|
+
<%- end -%>
|
13
|
+
<%- end -%>
|
14
|
+
<%- if instance_methods.any? -%>
|
15
|
+
- [Instance Methods](#instance-methods)
|
16
|
+
<%- instance_methods.each do |method| -%>
|
17
|
+
- [<%= method.title %>](#<%= method.title.gsub("?", "") %>)
|
18
|
+
<%- end -%>
|
19
|
+
<%- end -%>
|
20
|
+
<%- if included.any? -%>
|
21
|
+
- [Includes](#includes)
|
22
|
+
<%- end -%>
|
23
|
+
<%- if extended.any? -%>
|
24
|
+
- [Extends](#extends)
|
25
|
+
<%- end -%>
|
26
|
+
<%- if constants.any? %>
|
27
|
+
## Constants
|
28
|
+
<%- constants.each do |const| -%>
|
29
|
+
- `<%= const.title %>` <%= const.comment %>
|
30
|
+
<%- end -%>
|
31
|
+
<%- end -%>
|
32
|
+
<%- if attributes.any? %>
|
33
|
+
## Attributes
|
34
|
+
<%- attributes.each do |attr| -%>
|
35
|
+
- `<%= attr.title %>` <%= attr.comment %>
|
36
|
+
<%- end -%>
|
37
|
+
<%- end -%>
|
38
|
+
<%- if class_methods.any? %>
|
39
|
+
## Class Methods
|
40
|
+
<% class_methods.each do |method| %>
|
41
|
+
### <%= method.title %>
|
42
|
+
`<%= method.signature %>`
|
43
|
+
<%= method.comment %>
|
44
|
+
<details><summary>see source</summary><p>
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
<%= method.source_code %>
|
48
|
+
```
|
49
|
+
</p></details>
|
50
|
+
|
51
|
+
---
|
52
|
+
<%- end -%>
|
53
|
+
<%- end -%>
|
54
|
+
<%- if instance_methods.any? %>
|
55
|
+
## Instance Methods
|
56
|
+
<% instance_methods.each do |method| %>
|
57
|
+
### <%= method.title %>
|
58
|
+
`<%= method.signature %>`
|
59
|
+
<%= method.comment %>
|
60
|
+
<details><summary>see source</summary><p>
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
<%= method.source_code %>
|
64
|
+
```
|
65
|
+
</p></details>
|
66
|
+
|
67
|
+
---
|
68
|
+
<%- end -%>
|
69
|
+
<%- end -%>
|
70
|
+
<%- if included.any? %>
|
71
|
+
## Includes
|
72
|
+
<% included.each do |incld| %>
|
73
|
+
- <%= incld.title %>
|
74
|
+
<%- end -%>
|
75
|
+
<%- end -%>
|
76
|
+
<%- if extended.any? %>
|
77
|
+
## Extends
|
78
|
+
<% extended.each do |incld| %>
|
79
|
+
- <%= incld.title %>
|
80
|
+
<%- end -%>
|
81
|
+
<%- end -%>
|