shopify-cli 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/docs/getting-started/install/index.md +37 -1
- data/docs/getting-started/migrate/index.md +34 -1
- data/lib/project_types/node/messages/messages.rb +2 -2
- data/lib/project_types/rails/messages/messages.rb +2 -2
- data/lib/project_types/script/config/extension_points.yml +3 -3
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +1 -1
- data/lib/project_types/script/script_project.rb +2 -2
- data/lib/shopify-cli/admin_api/schema.rb +11 -1
- data/lib/shopify-cli/context.rb +10 -1
- data/lib/shopify-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3355ade46f06f8fad98098842f7b68bb0a154a53921a498ca4aba18379512ff6
|
4
|
+
data.tar.gz: 57617469febb8905d737a9991f4da4a578e0f87bc8cad17bfc3d674e28cd40c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a71cd8e3f4f9409f0c527ab6da9152e592d7cd1be173d9fe4e1499713998cf245541504151a1e63fa5901cf0c83b1d41302bc6628defff86042908b5e63d37af
|
7
|
+
data.tar.gz: 2d16c25b44bd21abbcd154abd0ff5d3b3e9e464b7c89377b523299855800cd65bf3357d89b3d92d8a66137e8316d64de755263a1bc21f30df1c5ad3b8e492492
|
data/CHANGELOG.md
CHANGED
@@ -36,4 +36,40 @@ $ sudo yum install shopify-cli-x.y.x.rpm
|
|
36
36
|
|
37
37
|
```console
|
38
38
|
$ gem install shopify-cli
|
39
|
-
```
|
39
|
+
```
|
40
|
+
|
41
|
+
### To check that Shopify App CLI is installed correctly:
|
42
|
+
|
43
|
+
```console
|
44
|
+
$ shopify version
|
45
|
+
1.0.0
|
46
|
+
$
|
47
|
+
```
|
48
|
+
|
49
|
+
> Note 1: the version displayed may be newer.
|
50
|
+
|
51
|
+
> Note 2: If you have the `shopify_api` gem installed, you may see the following response:
|
52
|
+
> ```console
|
53
|
+
> shopify command is no longer bundled with shopify_api.
|
54
|
+
> if you need these tools, install the shopify_cli gem
|
55
|
+
> ```
|
56
|
+
>
|
57
|
+
> If so, then you will also need to upgrade the `shopify_api` gem to v9.2.0+ to remove a deprecated `shopify` command that is contained in that gem.
|
58
|
+
>
|
59
|
+
> If you also have the `shopify_app` gem (which depends on `shopify_api` gem), you'll need to install or update `shopify_api` first, then uninstall the older version.
|
60
|
+
>
|
61
|
+
> To get a list of the version(s) of `shopify_api` currently installed:
|
62
|
+
> ```console
|
63
|
+
> $ gem list shopify_api
|
64
|
+
> ```
|
65
|
+
>
|
66
|
+
> To install the latest version:
|
67
|
+
> ```console
|
68
|
+
> $ gem install shopify_api
|
69
|
+
> ```
|
70
|
+
>
|
71
|
+
> To uninstall the older version:
|
72
|
+
> ```console
|
73
|
+
> $ gem uninstall shopify_api -v x.y.z
|
74
|
+
> ```
|
75
|
+
> Replace x.y.z with a version number listed from the `gem list` command. Repeat as needed.
|
@@ -22,6 +22,7 @@ There are two steps to completely uninstall the legacy version of Shopify App CL
|
|
22
22
|
|
23
23
|
1. Delete the legacy CLI files
|
24
24
|
1. Remove the legacy `shopify` command from your shell profile
|
25
|
+
1. Reload your terminal
|
25
26
|
|
26
27
|
### 1. Delete the CLI files
|
27
28
|
|
@@ -51,7 +52,39 @@ if [[ -f /HOME_DIR/.shopify-cli/shopify.sh ]]; then source /HOME_DIR/.shopify-cl
|
|
51
52
|
[ -f "/HOME_DIR/.shopify-app-cli/shopify.sh" ] && source "/HOME_DIR/.shopify-app-cli/shopify.sh"
|
52
53
|
```
|
53
54
|
|
54
|
-
Deleting or commenting out the relevant line in your shell profile will remove `shopify` as a command.
|
55
|
+
Deleting or commenting out the relevant line in your shell profile will remove `shopify` as a command.
|
56
|
+
|
57
|
+
### 3. Reload your terminal
|
58
|
+
|
59
|
+
For the changes above to take effect, exit your terminal, and start a new one.
|
60
|
+
|
61
|
+
If you try running `shopify` now, you should get a `command not found` error.
|
62
|
+
|
63
|
+
> If you have the `shopify_api` gem installed, you may see the following response:
|
64
|
+
> ```console
|
65
|
+
> shopify command is no longer bundled with shopify_api.
|
66
|
+
> if you need these tools, install the shopify_cli gem
|
67
|
+
> ```
|
68
|
+
>
|
69
|
+
> If so, then you will also need to upgrade the `shopify_api` gem to v9.2.0+ to remove a deprecated `shopify` command that is contained in that gem.
|
70
|
+
>
|
71
|
+
> If you also have the `shopify_app` gem (which depends on `shopify_api` gem), you'll need to install or update `shopify_api` first, then uninstall the older version.
|
72
|
+
>
|
73
|
+
> To get a list of the version(s) of `shopify_api` currently installed:
|
74
|
+
> ```console
|
75
|
+
> $ gem list shopify_api
|
76
|
+
> ```
|
77
|
+
>
|
78
|
+
> To install the latest version:
|
79
|
+
> ```console
|
80
|
+
> $ gem install shopify_api
|
81
|
+
> ```
|
82
|
+
>
|
83
|
+
> To uninstall the older version:
|
84
|
+
> ```console
|
85
|
+
> $ gem uninstall shopify_api -v x.y.z
|
86
|
+
> ```
|
87
|
+
> Replace x.y.z with a version number listed from the `gem list` command. Repeat as needed.
|
55
88
|
|
56
89
|
## 2. Install the new version
|
57
90
|
|
@@ -28,8 +28,8 @@ module Node
|
|
28
28
|
},
|
29
29
|
info: {
|
30
30
|
created: "{{v}} {{green:%s}} was created in your Partner Dashboard {{underline:%s}}",
|
31
|
-
serve: "{{*}} Change
|
32
|
-
"local server",
|
31
|
+
serve: "{{*}} Change directories to your new project folder {{green:%s}} and run {{command:%s serve}} " \
|
32
|
+
"to start a local server",
|
33
33
|
install: "{{*}} Then, visit {{underline:%s/test}} to install {{green:%s}} on your Dev Store",
|
34
34
|
},
|
35
35
|
node_version: "node %s",
|
@@ -37,8 +37,8 @@ module Rails
|
|
37
37
|
|
38
38
|
info: {
|
39
39
|
created: "{{v}} {{green:%s}} was created in your Partner Dashboard {{underline:%s}}",
|
40
|
-
serve: "{{*}} Change
|
41
|
-
"local server",
|
40
|
+
serve: "{{*}} Change directories to your new project folder {{green:%s}} and run {{command:%s serve}} " \
|
41
|
+
"to start a local server",
|
42
42
|
install: "{{*}} Then, visit {{underline:%s/test}} to install {{green:%s}} on your Dev Store",
|
43
43
|
},
|
44
44
|
installing_bundler: "Installing bundler…",
|
@@ -1,18 +1,18 @@
|
|
1
1
|
discount:
|
2
2
|
assemblyscript:
|
3
3
|
package: "@shopify/extension-point-as-discount"
|
4
|
-
version: "^0.2.
|
4
|
+
version: "^0.2.3"
|
5
5
|
sdk-version: "^6.0.0"
|
6
6
|
toolchain-version: "^1.1.0"
|
7
7
|
unit_limit_per_order:
|
8
8
|
assemblyscript:
|
9
9
|
package: "@shopify/extension-point-as-unit-limit-per-order"
|
10
|
-
version: "^0.1.
|
10
|
+
version: "^0.1.4"
|
11
11
|
sdk-version: "^6.0.0"
|
12
12
|
toolchain-version: "^1.1.0"
|
13
13
|
payment_filter:
|
14
14
|
assemblyscript:
|
15
15
|
package: "@shopify/extension-point-as-payment-filter"
|
16
|
-
version: "^0.1
|
16
|
+
version: "^0.2.1"
|
17
17
|
sdk-version: "^6.0.0"
|
18
18
|
toolchain-version: "^1.1.0"
|
@@ -22,7 +22,7 @@ module Script
|
|
22
22
|
def get_push_package(script, compiled_type)
|
23
23
|
build_file_path = file_path(script.name, compiled_type)
|
24
24
|
|
25
|
-
raise Domain::PushPackageNotFoundError unless
|
25
|
+
raise Domain::PushPackageNotFoundError unless ctx.file_exist?(build_file_path)
|
26
26
|
|
27
27
|
script_content = File.read(build_file_path)
|
28
28
|
|
@@ -9,7 +9,7 @@ module Script
|
|
9
9
|
|
10
10
|
def get_script(language, extension_point_type, script_name)
|
11
11
|
source_file_path = src_code_file(language)
|
12
|
-
unless
|
12
|
+
unless ctx.file_exist?(source_file_path)
|
13
13
|
raise Domain::Errors::ScriptNotFoundError.new(extension_point_type, source_file_path)
|
14
14
|
end
|
15
15
|
|
@@ -36,14 +36,14 @@ module Script
|
|
36
36
|
|
37
37
|
class << self
|
38
38
|
def create(ctx, dir)
|
39
|
-
raise Errors::ScriptProjectAlreadyExistsError, dir if ctx.
|
39
|
+
raise Errors::ScriptProjectAlreadyExistsError, dir if ctx.dir_exist?(dir)
|
40
40
|
ctx.mkdir_p(dir)
|
41
41
|
ctx.chdir(dir)
|
42
42
|
end
|
43
43
|
|
44
44
|
def cleanup(ctx:, script_name:, root_dir:)
|
45
45
|
ctx.chdir(root_dir)
|
46
|
-
ctx.rm_r("#{root_dir}/#{script_name}") if ctx.
|
46
|
+
ctx.rm_r("#{root_dir}/#{script_name}") if ctx.dir_exist?("#{root_dir}/#{script_name}")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -5,7 +5,8 @@ module ShopifyCli
|
|
5
5
|
class Schema < Hash
|
6
6
|
def self.get(ctx)
|
7
7
|
unless ShopifyCli::DB.exists?(:shopify_admin_schema)
|
8
|
-
|
8
|
+
shop = Project.current.env.shop || get_shop(@ctx)
|
9
|
+
schema = AdminAPI.query(ctx, 'admin_introspection', shop: shop)
|
9
10
|
ShopifyCli::DB.set(shopify_admin_schema: JSON.dump(schema))
|
10
11
|
end
|
11
12
|
# This is ruby magic for making a new hash with another hash.
|
@@ -27,6 +28,15 @@ module ShopifyCli
|
|
27
28
|
object["name"]
|
28
29
|
end
|
29
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def get_shop(ctx)
|
35
|
+
res = ShopifyCli::Tasks::SelectOrgAndShop.call(ctx)
|
36
|
+
domain = res[:shop_domain]
|
37
|
+
Project.current.env.update(ctx, :shop, domain)
|
38
|
+
domain
|
39
|
+
end
|
30
40
|
end
|
31
41
|
end
|
32
42
|
end
|
data/lib/shopify-cli/context.rb
CHANGED
@@ -146,10 +146,19 @@ module ShopifyCli
|
|
146
146
|
# #### Parameters
|
147
147
|
# * `path` - the file path to a directory, relative to the context root to remove from the FS
|
148
148
|
#
|
149
|
-
def
|
149
|
+
def dir_exist?(path)
|
150
150
|
Dir.exist?(ctx_path(path))
|
151
151
|
end
|
152
152
|
|
153
|
+
# checks if a file exists, the filepath is relative to the command root unless absolute
|
154
|
+
#
|
155
|
+
# #### Parameters
|
156
|
+
# * `path` - the file path to a file, relative to the context root to remove from the FS
|
157
|
+
#
|
158
|
+
def file_exist?(path)
|
159
|
+
File.exist?(ctx_path(path))
|
160
|
+
end
|
161
|
+
|
153
162
|
# will recursively copy a directory from the FS, the filepath is relative to the command
|
154
163
|
# root unless absolute
|
155
164
|
#
|
data/lib/shopify-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|