shopify-cli 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +3 -3
- data/lib/project_types/extension/cli.rb +1 -0
- data/lib/project_types/extension/commands/check.rb +44 -0
- data/lib/project_types/extension/extension_project.rb +7 -0
- data/lib/project_types/extension/messages/messages.rb +4 -0
- data/lib/shopify-cli/version.rb +1 -1
- data/shopify-cli.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df03f65d3f06543a72fff5a777f93b7948aaa97c5ea10b42039d550cb82c0432
|
4
|
+
data.tar.gz: b0741e669b67f6a39e030d7dfb7aa252dcf79ff5b15fd4ad27d543a9ef6347d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ab134a89911c7b4468253efc5798eae0552bcb38099fd8f8aa9aa0a5144efa52cb7cd62d7b4b064b6cf8618ca0dbc7d24572fd2f3e83bb1ffa320bfb7849ab9
|
7
|
+
data.tar.gz: 9db58f843181d955b76a7c48af7663b3ab2327b6884c25ffba9a36a4cf5b1b4d184740c42ee7e2dc6ba6eece85785aa15709df8c3d604610e58f2e5a320ba084
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
Unreleased
|
2
2
|
------
|
3
3
|
|
4
|
+
Version 2.1.0
|
5
|
+
-------------
|
6
|
+
* [#1357](https://github.com/Shopify/shopify-cli/pull/1357): Update Theme-Check to 1.1
|
7
|
+
* [#1352](https://github.com/Shopify/shopify-cli/pull/1352): Add `shopify extension check` for checking theme app extensions
|
8
|
+
* [#1304](https://github.com/Shopify/shopify-cli/pull/1304): Prompt user to run `shopify extension connect` if .env file is missing
|
9
|
+
|
4
10
|
Version 2.0.2
|
5
11
|
-------------
|
6
12
|
* [#1305](https://github.com/Shopify/shopify-cli/pull/1305): Fix `Uninitialized constant Net::WriteTimeout` error
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shopify-cli (2.0
|
4
|
+
shopify-cli (2.1.0)
|
5
5
|
listen (~> 3.5)
|
6
|
-
theme-check (~> 1.
|
6
|
+
theme-check (~> 1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
rubocop-shopify (2.0.1)
|
77
77
|
rubocop (~> 1.11)
|
78
78
|
ruby-progressbar (1.11.0)
|
79
|
-
theme-check (1.
|
79
|
+
theme-check (1.1.0)
|
80
80
|
liquid (>= 5.0.1)
|
81
81
|
nokogumbo
|
82
82
|
timecop (0.9.2)
|
@@ -24,6 +24,7 @@ module Extension
|
|
24
24
|
subcommand :Serve, "serve", Project.project_filepath("commands/serve")
|
25
25
|
subcommand :Push, "push", Project.project_filepath("commands/push")
|
26
26
|
subcommand :Tunnel, "tunnel", Project.project_filepath("commands/tunnel")
|
27
|
+
subcommand :Check, "check", Project.project_filepath("commands/check")
|
27
28
|
end
|
28
29
|
ShopifyCli::Commands.register("Extension::Command", "extension")
|
29
30
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "theme_check"
|
3
|
+
|
4
|
+
module Extension
|
5
|
+
class Command
|
6
|
+
class Check < ExtensionCommand
|
7
|
+
class CheckOptions < ShopifyCli::Options
|
8
|
+
def initialize(ctx, theme_check)
|
9
|
+
super()
|
10
|
+
@theme_check = theme_check
|
11
|
+
@ctx = ctx
|
12
|
+
end
|
13
|
+
|
14
|
+
def parse(_options_block, args)
|
15
|
+
# Check if .theme-check.yml exists, or if another -C has been passed on the command line
|
16
|
+
unless args.include?("-C") || @ctx.file_exist?(".theme-check.yml")
|
17
|
+
args += ["-C", ":theme_app_extension"]
|
18
|
+
end
|
19
|
+
@theme_check.parse(args)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(*)
|
24
|
+
super
|
25
|
+
if project.specification_identifier == "THEME_APP_EXTENSION"
|
26
|
+
@theme_check = ThemeCheck::Cli.new
|
27
|
+
self.options = CheckOptions.new(@ctx, @theme_check)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(*)
|
32
|
+
if project.specification_identifier == "THEME_APP_EXTENSION"
|
33
|
+
@theme_check.run
|
34
|
+
else
|
35
|
+
@ctx.abort(@ctx.message("check.unsupported", project.specification_identifier))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.help
|
40
|
+
ShopifyCli::Context.message("check.help", ShopifyCli::TOOL_NAME)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -49,6 +49,7 @@ module Extension
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def app
|
52
|
+
validate_env_present
|
52
53
|
Models::App.new(api_key: env["api_key"], secret: env["secret"])
|
53
54
|
end
|
54
55
|
|
@@ -107,9 +108,15 @@ module Extension
|
|
107
108
|
end
|
108
109
|
|
109
110
|
def property_present?(key)
|
111
|
+
validate_env_present
|
110
112
|
!env[key].nil? && !env[key].strip.empty?
|
111
113
|
end
|
112
114
|
|
115
|
+
def validate_env_present
|
116
|
+
return if env
|
117
|
+
raise ShopifyCli::Abort, "Missing .env file. Run `shopify extension connect` to generate an .env file."
|
118
|
+
end
|
119
|
+
|
113
120
|
def integer?(value)
|
114
121
|
value.to_i.to_s == value.to_s
|
115
122
|
end
|
@@ -139,6 +139,10 @@ module Extension
|
|
139
139
|
Usage: {{command:%1$s extension tunnel status}}
|
140
140
|
HELP
|
141
141
|
},
|
142
|
+
check: {
|
143
|
+
help: "Check your extension for errors, suggestions, and best practices.",
|
144
|
+
unsupported: "{{red:%s projects are not supported for `extension check`}}",
|
145
|
+
},
|
142
146
|
features: {
|
143
147
|
argo: {
|
144
148
|
missing_file_error: "Could not find built extension file.",
|
data/lib/shopify-cli/version.rb
CHANGED
data/shopify-cli.gemspec
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: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '1.
|
81
|
+
version: '1.1'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '1.
|
88
|
+
version: '1.1'
|
89
89
|
description: |
|
90
90
|
Shopify CLI helps you build Shopify apps faster. It quickly scaffolds Node.js
|
91
91
|
and Ruby on Rails embedded apps. It also automates many common tasks in the
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/graphql/update_dashboard_urls.graphql
|
163
163
|
- lib/project_types/extension/cli.rb
|
164
164
|
- lib/project_types/extension/commands/build.rb
|
165
|
+
- lib/project_types/extension/commands/check.rb
|
165
166
|
- lib/project_types/extension/commands/connect.rb
|
166
167
|
- lib/project_types/extension/commands/create.rb
|
167
168
|
- lib/project_types/extension/commands/extension_command.rb
|