shopify-cli 0.9.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +3 -0
- data/CHANGELOG.md +26 -0
- data/{LICENSE.md → LICENSE} +0 -0
- data/RELEASING.md +51 -0
- data/Rakefile +1 -6
- data/docs/_config.yml +3 -0
- data/docs/_data/nav.yml +9 -0
- data/docs/getting-started/index.md +5 -40
- data/docs/getting-started/install/index.md +39 -0
- data/docs/getting-started/migrate/index.md +63 -0
- data/docs/getting-started/uninstall/index.md +37 -0
- data/docs/getting-started/upgrade/index.md +37 -0
- data/docs/index.md +5 -6
- data/lib/project_types/extension/cli.rb +2 -1
- data/lib/project_types/extension/commands/tunnel.rb +1 -1
- data/lib/project_types/extension/forms/register.rb +2 -3
- data/lib/project_types/extension/graphql/get_app_by_api_key.graphql +9 -0
- data/lib/project_types/extension/tasks/converters/app_converter.rb +27 -0
- data/lib/project_types/extension/tasks/get_app.rb +22 -0
- data/lib/project_types/extension/tasks/get_apps.rb +1 -6
- data/lib/project_types/node/forms/create.rb +3 -54
- data/lib/project_types/node/messages/messages.rb +1 -12
- data/lib/project_types/rails/forms/create.rb +3 -52
- data/lib/project_types/rails/messages/messages.rb +0 -11
- data/lib/project_types/script/cli.rb +5 -5
- data/lib/project_types/script/commands/create.rb +5 -4
- data/lib/project_types/script/commands/push.rb +1 -0
- data/lib/project_types/script/errors.rb +1 -0
- data/lib/project_types/script/forms/create.rb +8 -4
- data/lib/project_types/script/layers/application/build_script.rb +7 -10
- data/lib/project_types/script/layers/application/create_script.rb +16 -14
- data/lib/project_types/script/layers/application/project_dependencies.rb +3 -9
- data/lib/project_types/script/layers/application/push_script.rb +13 -11
- data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +106 -0
- data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +64 -0
- data/lib/project_types/script/layers/infrastructure/errors.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/project_creator.rb +23 -0
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +5 -2
- data/lib/project_types/script/layers/infrastructure/script_repository.rb +7 -37
- data/lib/project_types/script/layers/infrastructure/task_runner.rb +18 -0
- data/lib/project_types/script/messages/messages.rb +5 -6
- data/lib/project_types/script/script_project.rb +22 -9
- data/lib/project_types/script/templates/ts/as-pect.d.ts +1 -0
- data/lib/project_types/script/ui/error_handler.rb +5 -0
- data/lib/shopify-cli/admin_api.rb +1 -2
- data/lib/shopify-cli/admin_api/populate_resource_command.rb +10 -1
- data/lib/shopify-cli/api.rb +2 -0
- data/lib/shopify-cli/context.rb +51 -0
- data/lib/shopify-cli/core/entry_point.rb +6 -0
- data/lib/shopify-cli/core/finalize.rb +13 -0
- data/lib/shopify-cli/git.rb +14 -10
- data/lib/shopify-cli/messages/messages.rb +22 -2
- data/lib/shopify-cli/packager.rb +17 -25
- data/lib/shopify-cli/tasks.rb +1 -0
- data/lib/shopify-cli/tasks/select_org_and_shop.rb +77 -0
- data/lib/shopify-cli/tunnel.rb +33 -1
- data/lib/shopify-cli/version.rb +1 -1
- data/shopify-cli.gemspec +3 -5
- data/vendor/deps/cli-ui/REVISION +1 -1
- data/vendor/deps/cli-ui/lib/cli/ui.rb +52 -11
- data/vendor/deps/cli-ui/lib/cli/ui/color.rb +11 -7
- data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +34 -21
- data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +107 -149
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb +99 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +119 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb +158 -0
- data/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +112 -0
- data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +9 -15
- data/vendor/deps/cli-ui/lib/cli/ui/printer.rb +47 -0
- data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +9 -7
- data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +39 -14
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +62 -44
- data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +7 -2
- data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +23 -3
- data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +34 -10
- data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +12 -7
- data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +26 -16
- data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +3 -3
- data/vendor/deps/cli-ui/lib/cli/ui/widgets.rb +75 -0
- data/vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb +27 -0
- data/vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb +61 -0
- metadata +30 -13
- data/lib/project_types/extension/features/tunnel_url.rb +0 -20
- data/lib/project_types/script/layers/infrastructure/assemblyscript_dependency_manager.rb +0 -73
- data/lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb +0 -39
- data/lib/project_types/script/layers/infrastructure/dependency_manager.rb +0 -36
- data/lib/project_types/script/layers/infrastructure/script_builder.rb +0 -34
- data/lib/project_types/script/layers/infrastructure/test_suite_repository.rb +0 -59
- data/vendor/deps/cli-ui/lib/cli/ui/box.rb +0 -15
|
@@ -15,8 +15,13 @@ module CLI
|
|
|
15
15
|
@options[option] = handler
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def call(
|
|
19
|
-
|
|
18
|
+
def call(options)
|
|
19
|
+
case options
|
|
20
|
+
when Array
|
|
21
|
+
options.map { |option| @options[option].call(options) }
|
|
22
|
+
else
|
|
23
|
+
@options[options].call(options)
|
|
24
|
+
end
|
|
20
25
|
end
|
|
21
26
|
end
|
|
22
27
|
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen-string-literal: true
|
|
1
2
|
require 'cli/ui'
|
|
2
3
|
|
|
3
4
|
module CLI
|
|
@@ -9,11 +10,30 @@ module CLI
|
|
|
9
10
|
PERIOD = 0.1 # seconds
|
|
10
11
|
TASK_FAILED = :task_failed
|
|
11
12
|
|
|
13
|
+
RUNES = %w(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏).freeze
|
|
14
|
+
|
|
12
15
|
begin
|
|
13
|
-
runes = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
|
|
14
16
|
colors = [CLI::UI::Color::CYAN.code] * 5 + [CLI::UI::Color::MAGENTA.code] * 5
|
|
15
|
-
raise unless
|
|
16
|
-
GLYPHS = colors.zip(
|
|
17
|
+
raise unless RUNES.size == colors.size
|
|
18
|
+
GLYPHS = colors.zip(RUNES).map(&:join)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class << self
|
|
22
|
+
attr_accessor(:index)
|
|
23
|
+
|
|
24
|
+
# We use this from CLI::UI::Widgets::Status to render an additional
|
|
25
|
+
# spinner next to the "working" element. While this global state looks
|
|
26
|
+
# a bit repulsive at first, it's worth realizing that:
|
|
27
|
+
#
|
|
28
|
+
# * It's managed by the SpinGroup#wait method, not individual tasks; and
|
|
29
|
+
# * It would be complete insanity to run two separate but concurrent SpinGroups.
|
|
30
|
+
#
|
|
31
|
+
# While it would be possible to stitch through some connection between
|
|
32
|
+
# the SpinGroup and the Widgets included in its title, this is simpler
|
|
33
|
+
# in practice and seems unlikely to cause issues in practice.
|
|
34
|
+
def current_rune
|
|
35
|
+
RUNES[index || 0]
|
|
36
|
+
end
|
|
17
37
|
end
|
|
18
38
|
|
|
19
39
|
# Adds a single spinner
|
|
@@ -25,6 +25,7 @@ module CLI
|
|
|
25
25
|
@consumed_lines = 0
|
|
26
26
|
@tasks = []
|
|
27
27
|
@auto_debrief = auto_debrief
|
|
28
|
+
@start = Time.new
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
class Task
|
|
@@ -40,6 +41,7 @@ module CLI
|
|
|
40
41
|
#
|
|
41
42
|
def initialize(title, &block)
|
|
42
43
|
@title = title
|
|
44
|
+
@always_full_render = title =~ Formatter::SCAN_WIDGET
|
|
43
45
|
@thread = Thread.new do
|
|
44
46
|
cap = CLI::UI::StdoutRouter::Capture.new(self, with_frame_inset: false, &block)
|
|
45
47
|
begin
|
|
@@ -50,8 +52,9 @@ module CLI
|
|
|
50
52
|
end
|
|
51
53
|
end
|
|
52
54
|
|
|
55
|
+
@m = Mutex.new
|
|
53
56
|
@force_full_render = false
|
|
54
|
-
@done
|
|
57
|
+
@done = false
|
|
55
58
|
@exception = nil
|
|
56
59
|
@success = false
|
|
57
60
|
end
|
|
@@ -75,7 +78,17 @@ module CLI
|
|
|
75
78
|
@done
|
|
76
79
|
end
|
|
77
80
|
|
|
78
|
-
# Re-renders the task if required
|
|
81
|
+
# Re-renders the task if required:
|
|
82
|
+
#
|
|
83
|
+
# We try to be as lazy as possible in re-rendering the full line. The
|
|
84
|
+
# spinner rune will change on each render for the most part, but the
|
|
85
|
+
# body text will rarely have changed. If the body text *has* changed,
|
|
86
|
+
# we set @force_full_render.
|
|
87
|
+
#
|
|
88
|
+
# Further, if the title string includes any CLI::UI::Widgets, we
|
|
89
|
+
# assume that it may change from render to render, since those
|
|
90
|
+
# evaluate more dynamically than the rest of our format codes, which
|
|
91
|
+
# are just text formatters. This is controlled by @always_full_render.
|
|
79
92
|
#
|
|
80
93
|
# ==== Attributes
|
|
81
94
|
#
|
|
@@ -84,10 +97,17 @@ module CLI
|
|
|
84
97
|
# * +width+ - current terminal width to format for
|
|
85
98
|
#
|
|
86
99
|
def render(index, force = true, width: CLI::UI::Terminal.width)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
@m.synchronize do
|
|
101
|
+
begin
|
|
102
|
+
if force || @always_full_render || @force_full_render
|
|
103
|
+
full_render(index, width)
|
|
104
|
+
else
|
|
105
|
+
partial_render(index)
|
|
106
|
+
end
|
|
107
|
+
ensure
|
|
108
|
+
@force_full_render = false
|
|
109
|
+
end
|
|
110
|
+
end
|
|
91
111
|
end
|
|
92
112
|
|
|
93
113
|
# Update the spinner title
|
|
@@ -97,8 +117,11 @@ module CLI
|
|
|
97
117
|
# * +title+ - title to change the spinner to
|
|
98
118
|
#
|
|
99
119
|
def update_title(new_title)
|
|
100
|
-
@
|
|
101
|
-
|
|
120
|
+
@m.synchronize do
|
|
121
|
+
@always_full_render = new_title =~ Formatter::SCAN_WIDGET
|
|
122
|
+
@title = new_title
|
|
123
|
+
@force_full_render = true
|
|
124
|
+
end
|
|
102
125
|
end
|
|
103
126
|
|
|
104
127
|
private
|
|
@@ -182,7 +205,7 @@ module CLI
|
|
|
182
205
|
@consumed_lines += 1
|
|
183
206
|
else
|
|
184
207
|
offset = @consumed_lines - int_index
|
|
185
|
-
move_to
|
|
208
|
+
move_to = CLI::UI::ANSI.cursor_up(offset) + "\r"
|
|
186
209
|
move_from = "\r" + CLI::UI::ANSI.cursor_down(offset)
|
|
187
210
|
|
|
188
211
|
print(move_to + task.render(idx, idx.zero?, width: width) + move_from)
|
|
@@ -194,6 +217,7 @@ module CLI
|
|
|
194
217
|
break if all_done
|
|
195
218
|
|
|
196
219
|
idx = (idx + 1) % GLYPHS.size
|
|
220
|
+
Spinner.index = idx
|
|
197
221
|
sleep(PERIOD)
|
|
198
222
|
end
|
|
199
223
|
|
|
@@ -217,7 +241,7 @@ module CLI
|
|
|
217
241
|
out = task.stdout
|
|
218
242
|
err = task.stderr
|
|
219
243
|
|
|
220
|
-
CLI::UI::Frame.open('Task Failed: ' + task.title, color: :red) do
|
|
244
|
+
CLI::UI::Frame.open('Task Failed: ' + task.title, color: :red, timing: Time.new - @start) do
|
|
221
245
|
if e
|
|
222
246
|
puts "#{e.class}: #{e.message}"
|
|
223
247
|
puts "\tfrom #{e.backtrace.join("\n\tfrom ")}"
|
|
@@ -26,13 +26,14 @@ module CLI
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
hook = Thread.current[:cliui_output_hook]
|
|
30
29
|
# hook return of false suppresses output.
|
|
31
|
-
if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
if (hook = Thread.current[:cliui_output_hook])
|
|
31
|
+
return if hook.call(args.map(&:to_s).join, @name) == false
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
@stream.write_without_cli_ui(*prepend_id(@stream, args))
|
|
35
|
+
if (dup = StdoutRouter.duplicate_output_to)
|
|
36
|
+
dup.write(*prepend_id(dup, args))
|
|
36
37
|
end
|
|
37
38
|
end
|
|
38
39
|
|
|
@@ -117,6 +118,10 @@ module CLI
|
|
|
117
118
|
prev_frame_inset = Thread.current[:no_cliui_frame_inset]
|
|
118
119
|
prev_hook = Thread.current[:cliui_output_hook]
|
|
119
120
|
|
|
121
|
+
if Thread.current.respond_to?(:report_on_exception)
|
|
122
|
+
Thread.current.report_on_exception = false
|
|
123
|
+
end
|
|
124
|
+
|
|
120
125
|
self.class.with_stdin_masked do
|
|
121
126
|
Thread.current[:no_cliui_frame_inset] = !@with_frame_inset
|
|
122
127
|
Thread.current[:cliui_output_hook] = ->(data, stream) do
|
|
@@ -159,7 +164,7 @@ module CLI
|
|
|
159
164
|
id = format("%05d", rand(10**5))
|
|
160
165
|
Thread.current[:cliui_output_id] = {
|
|
161
166
|
id: id,
|
|
162
|
-
streams: on_streams
|
|
167
|
+
streams: on_streams,
|
|
163
168
|
}
|
|
164
169
|
yield(id)
|
|
165
170
|
ensure
|
|
@@ -8,28 +8,38 @@ module CLI
|
|
|
8
8
|
DEFAULT_HEIGHT = 24
|
|
9
9
|
|
|
10
10
|
# Returns the width of the terminal, if possible
|
|
11
|
-
# Otherwise will return
|
|
11
|
+
# Otherwise will return DEFAULT_WIDTH
|
|
12
12
|
#
|
|
13
13
|
def self.width
|
|
14
|
-
|
|
15
|
-
width = console.winsize[1]
|
|
16
|
-
width.zero? ? DEFAULT_WIDTH : width
|
|
17
|
-
else
|
|
18
|
-
DEFAULT_WIDTH
|
|
19
|
-
end
|
|
20
|
-
rescue Errno::EIO
|
|
21
|
-
DEFAULT_WIDTH
|
|
14
|
+
winsize[1]
|
|
22
15
|
end
|
|
23
16
|
|
|
17
|
+
# Returns the width of the terminal, if possible
|
|
18
|
+
# Otherwise, will return DEFAULT_HEIGHT
|
|
19
|
+
#
|
|
24
20
|
def self.height
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
winsize[0]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.winsize
|
|
25
|
+
@winsize ||= begin
|
|
26
|
+
winsize = IO.console.winsize
|
|
27
|
+
setup_winsize_trap
|
|
28
|
+
|
|
29
|
+
if winsize.any?(&:zero?)
|
|
30
|
+
[DEFAULT_HEIGHT, DEFAULT_WIDTH]
|
|
31
|
+
else
|
|
32
|
+
winsize
|
|
33
|
+
end
|
|
34
|
+
rescue
|
|
35
|
+
[DEFAULT_HEIGHT, DEFAULT_WIDTH]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.setup_winsize_trap
|
|
40
|
+
@winsize_trap ||= Signal.trap('WINCH') do
|
|
41
|
+
@winsize = nil
|
|
30
42
|
end
|
|
31
|
-
rescue Errno::EIO
|
|
32
|
-
DEFAULT_HEIGHT
|
|
33
43
|
end
|
|
34
44
|
end
|
|
35
45
|
end
|
|
@@ -52,11 +52,11 @@ module CLI
|
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
when PARSE_ESC
|
|
55
|
-
case cp
|
|
55
|
+
mode = case cp
|
|
56
56
|
when LEFT_SQUARE_BRACKET
|
|
57
|
-
|
|
57
|
+
PARSE_ANSI
|
|
58
58
|
else
|
|
59
|
-
|
|
59
|
+
PARSE_ROOT
|
|
60
60
|
end
|
|
61
61
|
when PARSE_ANSI
|
|
62
62
|
# ANSI escape codes preeeetty much have the format of:
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require('cli/ui')
|
|
2
|
+
|
|
3
|
+
module CLI
|
|
4
|
+
module UI
|
|
5
|
+
# Widgets are formatter objects with more custom implementations than the
|
|
6
|
+
# other features, which all center around formatting text with colours,
|
|
7
|
+
# etc.
|
|
8
|
+
#
|
|
9
|
+
# If you want to extend CLI::UI with your own widgets, you may want to do
|
|
10
|
+
# something like this:
|
|
11
|
+
#
|
|
12
|
+
# require('cli/ui')
|
|
13
|
+
# class MyWidget < CLI::UI::Widgets::Base
|
|
14
|
+
# # ...
|
|
15
|
+
# end
|
|
16
|
+
# CLI::UI::Widgets.register('my-widget') { MyWidget }
|
|
17
|
+
# puts(CLI::UI.fmt("{{@widget/my-widget:args}}"))
|
|
18
|
+
module Widgets
|
|
19
|
+
MAP = {}
|
|
20
|
+
|
|
21
|
+
autoload(:Base, 'cli/ui/widgets/base')
|
|
22
|
+
|
|
23
|
+
def self.register(name, &cb)
|
|
24
|
+
MAP[name] = cb
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
autoload(:Status, 'cli/ui/widgets/status')
|
|
28
|
+
register('status') { Widgets::Status }
|
|
29
|
+
|
|
30
|
+
# Looks up a widget by handle
|
|
31
|
+
#
|
|
32
|
+
# ==== Raises
|
|
33
|
+
# Raises InvalidWidgetHandle if the widget is not available.
|
|
34
|
+
#
|
|
35
|
+
# ==== Returns
|
|
36
|
+
# A callable widget, to be invoked like `.call(argstring)`
|
|
37
|
+
#
|
|
38
|
+
def self.lookup(handle)
|
|
39
|
+
MAP.fetch(handle.to_s).call
|
|
40
|
+
rescue KeyError, NameError
|
|
41
|
+
raise(InvalidWidgetHandle, handle)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# All available widgets by name
|
|
45
|
+
#
|
|
46
|
+
def self.available
|
|
47
|
+
MAP.keys
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
class InvalidWidgetHandle < ArgumentError
|
|
51
|
+
def initialize(handle)
|
|
52
|
+
@handle = handle
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def message
|
|
56
|
+
keys = Widget.available.join(',')
|
|
57
|
+
"invalid widget handle: #{@handle} " \
|
|
58
|
+
"-- must be one of CLI::UI::Widgets.available (#{keys})"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class InvalidWidgetArguments < ArgumentError
|
|
63
|
+
def initialize(argstring, pattern)
|
|
64
|
+
@argstring = argstring
|
|
65
|
+
@pattern = pattern
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def message
|
|
69
|
+
"invalid widget arguments: #{@argstring} " \
|
|
70
|
+
"-- must match pattern: #{@pattern.inspect}"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require('cli/ui')
|
|
2
|
+
|
|
3
|
+
module CLI
|
|
4
|
+
module UI
|
|
5
|
+
module Widgets
|
|
6
|
+
class Base
|
|
7
|
+
def self.call(argstring)
|
|
8
|
+
new(argstring).render
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(argstring)
|
|
12
|
+
pat = self.class.argparse_pattern
|
|
13
|
+
unless (@match_data = pat.match(argstring))
|
|
14
|
+
raise(Widgets::InvalidWidgetArguments.new(argstring, pat))
|
|
15
|
+
end
|
|
16
|
+
@match_data.names.each do |name|
|
|
17
|
+
instance_variable_set(:"@#{name}", @match_data[name])
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.argparse_pattern
|
|
22
|
+
const_get(:ARGPARSE_PATTERN)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen-string-literal: true
|
|
2
|
+
require('cli/ui')
|
|
3
|
+
|
|
4
|
+
module CLI
|
|
5
|
+
module UI
|
|
6
|
+
module Widgets
|
|
7
|
+
class Status < Widgets::Base
|
|
8
|
+
ARGPARSE_PATTERN = %r{
|
|
9
|
+
\A (?<succeeded> \d+)
|
|
10
|
+
: (?<failed> \d+)
|
|
11
|
+
: (?<working> \d+)
|
|
12
|
+
: (?<pending> \d+) \z
|
|
13
|
+
}x # e.g. "1:23:3:404"
|
|
14
|
+
OPEN = Color::RESET.code + Color::BOLD.code + '[' + Color::RESET.code
|
|
15
|
+
CLOSE = Color::RESET.code + Color::BOLD.code + ']' + Color::RESET.code
|
|
16
|
+
ARROW = Color::RESET.code + Color::GRAY.code + '◂' + Color::RESET.code
|
|
17
|
+
COMMA = Color::RESET.code + Color::GRAY.code + ',' + Color::RESET.code
|
|
18
|
+
|
|
19
|
+
SPINNER_STOPPED = '⠿'
|
|
20
|
+
EMPTY_SET = '∅'
|
|
21
|
+
|
|
22
|
+
def render
|
|
23
|
+
if zero?(@succeeded) && zero?(@failed) && zero?(@working) && zero?(@pending)
|
|
24
|
+
Color::RESET.code + Color::BOLD.code + EMPTY_SET + Color::RESET.code
|
|
25
|
+
else
|
|
26
|
+
# [ 0✓ , 2✗ ◂ 3⠼ ◂ 4⌛︎ ]
|
|
27
|
+
"#{OPEN}#{succeeded_part}#{COMMA}#{failed_part}#{ARROW}#{working_part}#{ARROW}#{pending_part}#{CLOSE}"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def zero?(num_str)
|
|
34
|
+
num_str == '0'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def colorize_if_nonzero(num_str, rune, color)
|
|
38
|
+
color = Color::GRAY if zero?(num_str)
|
|
39
|
+
color.code + num_str + rune
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def succeeded_part
|
|
43
|
+
colorize_if_nonzero(@succeeded, Glyph::CHECK.char, Color::GREEN)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def failed_part
|
|
47
|
+
colorize_if_nonzero(@failed, Glyph::X.char, Color::RED)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def working_part
|
|
51
|
+
rune = zero?(@working) ? SPINNER_STOPPED : Spinner.current_rune
|
|
52
|
+
colorize_if_nonzero(@working, rune, Color::BLUE)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def pending_part
|
|
56
|
+
colorize_if_nonzero(@pending, Glyph::HOURGLASS.char, Color::WHITE)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
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: 0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shopify
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -64,7 +64,7 @@ description: |
|
|
|
64
64
|
development process and lets you quickly add popular features, such as billing
|
|
65
65
|
and webhooks.
|
|
66
66
|
email:
|
|
67
|
-
-
|
|
67
|
+
- dev-tools-education@shopify.com
|
|
68
68
|
executables: []
|
|
69
69
|
extensions:
|
|
70
70
|
- ext/shopify-cli/extconf.rb
|
|
@@ -83,10 +83,12 @@ files:
|
|
|
83
83
|
- ".tmp/.gitkeep"
|
|
84
84
|
- ".tmp/sv/.gitkeep"
|
|
85
85
|
- ".travis.yml"
|
|
86
|
+
- CHANGELOG.md
|
|
86
87
|
- Gemfile
|
|
87
88
|
- Gemfile.lock
|
|
88
|
-
- LICENSE
|
|
89
|
+
- LICENSE
|
|
89
90
|
- README.md
|
|
91
|
+
- RELEASING.md
|
|
90
92
|
- Rakefile
|
|
91
93
|
- SECURITY.md
|
|
92
94
|
- Vagrantfile
|
|
@@ -109,6 +111,10 @@ files:
|
|
|
109
111
|
- docs/core/index.md
|
|
110
112
|
- docs/css/docs.css
|
|
111
113
|
- docs/getting-started/index.md
|
|
114
|
+
- docs/getting-started/install/index.md
|
|
115
|
+
- docs/getting-started/migrate/index.md
|
|
116
|
+
- docs/getting-started/uninstall/index.md
|
|
117
|
+
- docs/getting-started/upgrade/index.md
|
|
112
118
|
- docs/help/start-app/index.md
|
|
113
119
|
- docs/images/header.png
|
|
114
120
|
- docs/index.md
|
|
@@ -147,9 +153,9 @@ files:
|
|
|
147
153
|
- lib/project_types/extension/features/argo_setup.rb
|
|
148
154
|
- lib/project_types/extension/features/argo_setup_step.rb
|
|
149
155
|
- lib/project_types/extension/features/argo_setup_steps.rb
|
|
150
|
-
- lib/project_types/extension/features/tunnel_url.rb
|
|
151
156
|
- lib/project_types/extension/forms/create.rb
|
|
152
157
|
- lib/project_types/extension/forms/register.rb
|
|
158
|
+
- lib/project_types/extension/graphql/get_app_by_api_key.graphql
|
|
153
159
|
- lib/project_types/extension/messages/message_loading.rb
|
|
154
160
|
- lib/project_types/extension/messages/messages.rb
|
|
155
161
|
- lib/project_types/extension/models/app.rb
|
|
@@ -159,10 +165,12 @@ files:
|
|
|
159
165
|
- lib/project_types/extension/models/types/subscription_management.rb
|
|
160
166
|
- lib/project_types/extension/models/validation_error.rb
|
|
161
167
|
- lib/project_types/extension/models/version.rb
|
|
168
|
+
- lib/project_types/extension/tasks/converters/app_converter.rb
|
|
162
169
|
- lib/project_types/extension/tasks/converters/registration_converter.rb
|
|
163
170
|
- lib/project_types/extension/tasks/converters/validation_error_converter.rb
|
|
164
171
|
- lib/project_types/extension/tasks/converters/version_converter.rb
|
|
165
172
|
- lib/project_types/extension/tasks/create_extension.rb
|
|
173
|
+
- lib/project_types/extension/tasks/get_app.rb
|
|
166
174
|
- lib/project_types/extension/tasks/get_apps.rb
|
|
167
175
|
- lib/project_types/extension/tasks/update_draft.rb
|
|
168
176
|
- lib/project_types/extension/tasks/user_errors.rb
|
|
@@ -226,20 +234,20 @@ files:
|
|
|
226
234
|
- lib/project_types/script/layers/domain/extension_point.rb
|
|
227
235
|
- lib/project_types/script/layers/domain/push_package.rb
|
|
228
236
|
- lib/project_types/script/layers/domain/script.rb
|
|
229
|
-
- lib/project_types/script/layers/infrastructure/
|
|
237
|
+
- lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb
|
|
238
|
+
- lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb
|
|
230
239
|
- lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb
|
|
231
|
-
- lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb
|
|
232
|
-
- lib/project_types/script/layers/infrastructure/dependency_manager.rb
|
|
233
240
|
- lib/project_types/script/layers/infrastructure/errors.rb
|
|
234
241
|
- lib/project_types/script/layers/infrastructure/extension_point_repository.rb
|
|
242
|
+
- lib/project_types/script/layers/infrastructure/project_creator.rb
|
|
235
243
|
- lib/project_types/script/layers/infrastructure/push_package_repository.rb
|
|
236
|
-
- lib/project_types/script/layers/infrastructure/script_builder.rb
|
|
237
244
|
- lib/project_types/script/layers/infrastructure/script_repository.rb
|
|
238
245
|
- lib/project_types/script/layers/infrastructure/script_service.rb
|
|
239
|
-
- lib/project_types/script/layers/infrastructure/
|
|
246
|
+
- lib/project_types/script/layers/infrastructure/task_runner.rb
|
|
240
247
|
- lib/project_types/script/messages/messages.rb
|
|
241
248
|
- lib/project_types/script/script_project.rb
|
|
242
249
|
- lib/project_types/script/templates/ts/as-pect.config.js
|
|
250
|
+
- lib/project_types/script/templates/ts/as-pect.d.ts
|
|
243
251
|
- lib/project_types/script/ui/error_handler.rb
|
|
244
252
|
- lib/project_types/script/ui/strict_spinner.rb
|
|
245
253
|
- lib/rubygems_plugin.rb
|
|
@@ -259,6 +267,7 @@ files:
|
|
|
259
267
|
- lib/shopify-cli/core.rb
|
|
260
268
|
- lib/shopify-cli/core/entry_point.rb
|
|
261
269
|
- lib/shopify-cli/core/executor.rb
|
|
270
|
+
- lib/shopify-cli/core/finalize.rb
|
|
262
271
|
- lib/shopify-cli/core/help_resolver.rb
|
|
263
272
|
- lib/shopify-cli/core/monorail.rb
|
|
264
273
|
- lib/shopify-cli/db.rb
|
|
@@ -288,6 +297,7 @@ files:
|
|
|
288
297
|
- lib/shopify-cli/tasks/ensure_dev_store.rb
|
|
289
298
|
- lib/shopify-cli/tasks/ensure_env.rb
|
|
290
299
|
- lib/shopify-cli/tasks/ensure_loopback_url.rb
|
|
300
|
+
- lib/shopify-cli/tasks/select_org_and_shop.rb
|
|
291
301
|
- lib/shopify-cli/tasks/update_dashboard_urls.rb
|
|
292
302
|
- lib/shopify-cli/tunnel.rb
|
|
293
303
|
- lib/shopify-cli/version.rb
|
|
@@ -316,11 +326,15 @@ files:
|
|
|
316
326
|
- vendor/deps/cli-ui/REVISION
|
|
317
327
|
- vendor/deps/cli-ui/lib/cli/ui.rb
|
|
318
328
|
- vendor/deps/cli-ui/lib/cli/ui/ansi.rb
|
|
319
|
-
- vendor/deps/cli-ui/lib/cli/ui/box.rb
|
|
320
329
|
- vendor/deps/cli-ui/lib/cli/ui/color.rb
|
|
321
330
|
- vendor/deps/cli-ui/lib/cli/ui/formatter.rb
|
|
322
331
|
- vendor/deps/cli-ui/lib/cli/ui/frame.rb
|
|
332
|
+
- vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb
|
|
333
|
+
- vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb
|
|
334
|
+
- vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb
|
|
335
|
+
- vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb
|
|
323
336
|
- vendor/deps/cli-ui/lib/cli/ui/glyph.rb
|
|
337
|
+
- vendor/deps/cli-ui/lib/cli/ui/printer.rb
|
|
324
338
|
- vendor/deps/cli-ui/lib/cli/ui/progress.rb
|
|
325
339
|
- vendor/deps/cli-ui/lib/cli/ui/prompt.rb
|
|
326
340
|
- vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb
|
|
@@ -332,6 +346,9 @@ files:
|
|
|
332
346
|
- vendor/deps/cli-ui/lib/cli/ui/terminal.rb
|
|
333
347
|
- vendor/deps/cli-ui/lib/cli/ui/truncater.rb
|
|
334
348
|
- vendor/deps/cli-ui/lib/cli/ui/version.rb
|
|
349
|
+
- vendor/deps/cli-ui/lib/cli/ui/widgets.rb
|
|
350
|
+
- vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb
|
|
351
|
+
- vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb
|
|
335
352
|
- vendor/deps/smart_properties/REVISION
|
|
336
353
|
- vendor/deps/smart_properties/lib/smart_properties.rb
|
|
337
354
|
- vendor/deps/smart_properties/lib/smart_properties/errors.rb
|
|
@@ -345,7 +362,7 @@ files:
|
|
|
345
362
|
- vendor/lib/semantic/version.rb
|
|
346
363
|
homepage: https://shopify.github.io/shopify-app-cli/
|
|
347
364
|
licenses:
|
|
348
|
-
-
|
|
365
|
+
- MIT
|
|
349
366
|
metadata:
|
|
350
367
|
allowed_push_host: https://rubygems.org
|
|
351
368
|
homepage_uri: https://shopify.github.io/shopify-app-cli/
|
|
@@ -360,7 +377,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
360
377
|
requirements:
|
|
361
378
|
- - ">="
|
|
362
379
|
- !ruby/object:Gem::Version
|
|
363
|
-
version: 2.
|
|
380
|
+
version: '2.5'
|
|
364
381
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
382
|
requirements:
|
|
366
383
|
- - ">="
|