shopify-cli 2.0.1 → 2.0.2
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/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/THEMEKIT_MIGRATION.md +18 -0
- data/lib/graphql/api_versions.graphql +1 -1
- data/lib/project_types/extension/extension_project.rb +12 -1
- data/lib/project_types/extension/extension_project_keys.rb +1 -0
- data/lib/project_types/extension/messages/messages.rb +6 -6
- data/lib/project_types/node/messages/messages.rb +1 -1
- data/lib/project_types/rails/messages/messages.rb +18 -18
- data/lib/project_types/script/graphql/app_script_update_or_create.graphql +3 -3
- data/lib/project_types/theme/messages/messages.rb +3 -3
- data/lib/shopify-cli/admin_api.rb +6 -2
- data/lib/shopify-cli/api.rb +2 -2
- data/lib/shopify-cli/core/monorail.rb +6 -2
- data/lib/shopify-cli/messages/messages.rb +9 -8
- data/lib/shopify-cli/packager.rb +5 -5
- data/lib/shopify-cli/theme/dev_server.rb +1 -1
- data/lib/shopify-cli/theme/dev_server/local_assets.rb +1 -1
- data/lib/shopify-cli/theme/file.rb +2 -2
- data/lib/shopify-cli/theme/syncer.rb +9 -5
- data/lib/shopify-cli/theme/theme.rb +5 -5
- data/lib/shopify-cli/tunnel.rb +1 -1
- data/lib/shopify-cli/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e891dd1947743de4abbd7ef4e2c7e40a60e313eed78e33e5813c1fbb72369b22
|
4
|
+
data.tar.gz: 2af5852d53518d1089fabd4420cc6a432bccf99585d935812f8c347d9ad42d45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02fa4e4ed76dc0576474246772e332d7a21d0242807ceb407244a0af8dfe3c21c9e1eced54283a11ed304c0ae74ae81becc040c7f9c0242c9b35e8171f3182a4
|
7
|
+
data.tar.gz: 5c587408bffbb49a09c087f2810b5b65b754de6fb2c3c8c158996446198817c7e2c0a21143544d7e7bc8ef74e4407fd4389d805ed298432c64656d202745fe86
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Unreleased
|
2
2
|
------
|
3
3
|
|
4
|
+
Version 2.0.2
|
5
|
+
-------------
|
6
|
+
* [#1305](https://github.com/Shopify/shopify-cli/pull/1305): Fix `Uninitialized constant Net::WriteTimeout` error
|
7
|
+
* [#1319](https://github.com/Shopify/shopify-cli/pull/1319): Fix `theme pull` not pulling some files
|
8
|
+
* [#1321](https://github.com/Shopify/shopify-cli/pull/1321): Fix error when pulling images with `theme pull`
|
9
|
+
* [#1322](https://github.com/Shopify/shopify-cli/pull/1322): Fix error when running `shopify theme language-server --help`
|
10
|
+
* [#1324](https://github.com/Shopify/shopify-cli/pull/1324): Fix issue [#1308](https://github.com/Shopify/shopify-cli/issues/1308) where a non-English language on Partner Account breaks how CLI determines latest API version.
|
11
|
+
* [#1343](https://github.com/Shopify/shopify-cli/pull/1343): Fix inconsistent use of periods vs ellipsis in messages. This replaces periods with ellipsis.
|
12
|
+
|
4
13
|
Version 2.0.1
|
5
14
|
-------------
|
6
15
|
* [#1295](https://github.com/Shopify/shopify-cli/pull/1295): Ignore files at the root of a theme app extension project
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -101,9 +101,11 @@ Run:
|
|
101
101
|
|
102
102
|
To start the server. The server includes hot reload for CSS & Sections.
|
103
103
|
|
104
|
+
**Note:** Shopify CLI is the recommended and officially supported tool for developing themes and creating CI/CD workflows. Please refer to the [Theme Kit Migration Guide](https://github.com/Shopify/shopify-cli/blob/main/THEMEKIT_MIGRATION.md) for details.
|
105
|
+
|
104
106
|
### Contributing
|
105
107
|
|
106
|
-
Shopify CLI is an [open source tool](https://github.com/Shopify/shopify-cli/blob/main
|
108
|
+
Shopify CLI is an [open source tool](https://github.com/Shopify/shopify-cli/blob/main/LICENSE) and everyone is welcome to help the community by [contributing](https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md) to the project.
|
107
109
|
|
108
110
|
### Where to get help
|
109
111
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Theme Kit Migration
|
2
|
+
|
3
|
+
Shopify CLI is the recommended and officially supported tool for developing Themes and creating CI/CD workflows.
|
4
|
+
|
5
|
+
This guide shows how to achieve equivalent flows with the new version of the CLI.
|
6
|
+
|
7
|
+
## Equivalent commands
|
8
|
+
|
9
|
+
| Theme Kit Command | Shopify CLI Equivalent | Objective |
|
10
|
+
|---|---|---|
|
11
|
+
|`theme deploy`|`shopify theme push`| Deploy a local (to the CLI) version of the Theme in the current working directory to a remote store.|
|
12
|
+
|`theme new`|`shopify theme init`| Scaffold a new theme. In the case of the CLI it clones Dawn to be used as a reference Theme. Alternatively, it's possible to simply clone Dawn `git clone git@github.com:Shopify/dawn.git` and use it with the CLI.
|
13
|
+
|`theme download`|`shopify theme pull`| Download your remote theme files.|
|
14
|
+
|`theme watch` & `theme open` | `shopify theme serve` | Start a theme server to locally preview changes with CSS & Section hot reload enabled|
|
15
|
+
|-| `shopify theme check`| Run the Theme Check linter on your theme codebase.|
|
16
|
+
|-|`shopify theme publish`| Set a remote theme as the live theme.|
|
17
|
+
|-|`shopify theme package`|Pack your Theme as a zip file ready for distribution and submission to the Theme Store.|
|
18
|
+
|`theme remove`| `shopify theme delete`| Theme kit removes files from the Theme whereas Shopify CLI will remotely destroy the specified theme.|
|
@@ -15,7 +15,13 @@ module Extension
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def write_env_file(
|
18
|
-
context:,
|
18
|
+
context:,
|
19
|
+
title:,
|
20
|
+
api_key: "",
|
21
|
+
api_secret: "",
|
22
|
+
registration_id: nil,
|
23
|
+
registration_uuid: nil,
|
24
|
+
resource_url: nil
|
19
25
|
)
|
20
26
|
ShopifyCli::Resources::EnvFile.new(
|
21
27
|
api_key: api_key,
|
@@ -24,6 +30,7 @@ module Extension
|
|
24
30
|
ExtensionProjectKeys::TITLE_KEY => title,
|
25
31
|
ExtensionProjectKeys::REGISTRATION_ID_KEY => registration_id,
|
26
32
|
ExtensionProjectKeys::REGISTRATION_UUID_KEY => registration_uuid || generate_temporary_uuid,
|
33
|
+
ExtensionProjectKeys::RESOURCE_URL_KEY => resource_url,
|
27
34
|
}.compact
|
28
35
|
).write(context)
|
29
36
|
|
@@ -71,6 +78,10 @@ module Extension
|
|
71
78
|
get_extra_field(ExtensionProjectKeys::REGISTRATION_UUID_KEY)
|
72
79
|
end
|
73
80
|
|
81
|
+
def resource_url
|
82
|
+
get_extra_field(ExtensionProjectKeys::RESOURCE_URL_KEY)
|
83
|
+
end
|
84
|
+
|
74
85
|
def reload
|
75
86
|
@env = nil
|
76
87
|
end
|
@@ -43,7 +43,7 @@ module Extension
|
|
43
43
|
no_apps: "{{x}} You don’t have any apps.",
|
44
44
|
learn_about_apps: "{{*}} Learn more about building apps at <https://shopify.dev/concepts/apps>, " \
|
45
45
|
"or try creating a new app using {{command:shopify [node|rails] create}}.",
|
46
|
-
loading_apps: "Loading your apps
|
46
|
+
loading_apps: "Loading your apps…",
|
47
47
|
no_available_extensions: "{{x}} There are no available extensions for this app.",
|
48
48
|
},
|
49
49
|
connect: {
|
@@ -51,7 +51,7 @@ module Extension
|
|
51
51
|
incomplete_configuration: "Cannot connect extension due to missing configuration information",
|
52
52
|
invalid_api_key: "The API key %s does not match any of your apps.",
|
53
53
|
ask_registration: "Which extension would you like to connect to?",
|
54
|
-
loading_extensions: "Loading your extensions
|
54
|
+
loading_extensions: "Loading your extensions…",
|
55
55
|
no_extensions: "{{x}} You don't have any extensions of type %s",
|
56
56
|
learn_about_extensions: "{{*}} Learn more about building extensions at <https://shopify.dev/concepts/apps>, " \
|
57
57
|
"or try creating a new extension using {{command:shopify extension create}}.",
|
@@ -65,7 +65,7 @@ module Extension
|
|
65
65
|
Build your extension to prepare for deployment.
|
66
66
|
Usage: {{command:%s extension build}}
|
67
67
|
HELP
|
68
|
-
frame_title: "Building extension with: %s
|
68
|
+
frame_title: "Building extension with: %s…",
|
69
69
|
build_failure_message: "Failed to build extension code.",
|
70
70
|
},
|
71
71
|
register: {
|
@@ -76,7 +76,7 @@ module Extension
|
|
76
76
|
{{command:--api-key=API_KEY}} The API key used to register an app with the extension. This can be found on the app page on Partners Dashboard.
|
77
77
|
HELP
|
78
78
|
frame_title: "Registering Extension",
|
79
|
-
waiting_text: "Registering with Shopify
|
79
|
+
waiting_text: "Registering with Shopify…",
|
80
80
|
already_registered: "Extension is already registered.",
|
81
81
|
confirm_info: "This will create a new extension registration for %s, which can’t be undone.",
|
82
82
|
confirm_question: "Would you like to register this extension? (y/n)",
|
@@ -90,7 +90,7 @@ module Extension
|
|
90
90
|
Usage: {{command:%s extension push}}
|
91
91
|
HELP
|
92
92
|
frame_title: "Pushing your extension to Shopify",
|
93
|
-
waiting_text: "Pushing code to Shopify
|
93
|
+
waiting_text: "Pushing code to Shopify…",
|
94
94
|
pushed_with_errors: "{{x}} Code pushed to Shopify with errors on %s.",
|
95
95
|
push_with_errors_info: "{{*}} Fix these errors and run {{command:shopify extension push}} to " \
|
96
96
|
"revalidate your extension.",
|
@@ -104,7 +104,7 @@ module Extension
|
|
104
104
|
Options:
|
105
105
|
{{command:--tunnel=TUNNEL}} Establish an ngrok tunnel (default: false)
|
106
106
|
HELP
|
107
|
-
frame_title: "Serving extension
|
107
|
+
frame_title: "Serving extension…",
|
108
108
|
no_available_ports_found: "No available ports found to run extension.",
|
109
109
|
serve_failure_message: "Failed to run extension code.",
|
110
110
|
serve_missing_information: "Missing shop or api_key.",
|
@@ -17,7 +17,7 @@ module Rails
|
|
17
17
|
checking_installation_path: "Checking path %s for gem %s",
|
18
18
|
installed: "Installed %s gem",
|
19
19
|
installed_debug: "%s installed: %s",
|
20
|
-
installing: "Installing %s gem
|
20
|
+
installing: "Installing %s gem…",
|
21
21
|
setting_gem_home: "GEM_HOME being set to %s",
|
22
22
|
setting_gem_path: "GEM_PATH being set to %s",
|
23
23
|
},
|
@@ -62,15 +62,15 @@ module Rails
|
|
62
62
|
open_new_shell: "{{*}} {{yellow:After installing %s, please open a new Command Prompt or PowerShell " \
|
63
63
|
"window to continue.}}",
|
64
64
|
},
|
65
|
-
installing_bundler: "Installing bundler
|
66
|
-
generating_app: "Generating new rails app project in %s
|
67
|
-
adding_shopify_gem: "{{v}} Adding shopify_app gem
|
65
|
+
installing_bundler: "Installing bundler…",
|
66
|
+
generating_app: "Generating new rails app project in %s…",
|
67
|
+
adding_shopify_gem: "{{v}} Adding shopify_app gem…",
|
68
68
|
node_version: "node %s",
|
69
69
|
yarn_version: "yarn %s",
|
70
|
-
running_bundle_install: "Running bundle install
|
71
|
-
running_generator: "Running shopify_app generator
|
72
|
-
running_migrations: "Running migrations
|
73
|
-
running_webpacker_install: "Running webpacker:install
|
70
|
+
running_bundle_install: "Running bundle install…",
|
71
|
+
running_generator: "Running shopify_app generator…",
|
72
|
+
running_migrations: "Running migrations…",
|
73
|
+
running_webpacker_install: "Running webpacker:install…",
|
74
74
|
},
|
75
75
|
|
76
76
|
deploy: {
|
@@ -89,18 +89,18 @@ module Rails
|
|
89
89
|
Deploy the current Rails project to Heroku
|
90
90
|
Usage: {{command:%s rails deploy heroku}}
|
91
91
|
HELP
|
92
|
-
downloading: "Downloading Heroku CLI
|
92
|
+
downloading: "Downloading Heroku CLI…",
|
93
93
|
downloaded: "Downloaded Heroku CLI",
|
94
|
-
installing: "Installing Heroku CLI
|
94
|
+
installing: "Installing Heroku CLI…",
|
95
95
|
installed: "Installed Heroku CLI",
|
96
96
|
authenticated_with_account: "{{v}} Authenticated with Heroku as {{green:%s}}",
|
97
|
-
authenticating: "Authenticating with Heroku
|
97
|
+
authenticating: "Authenticating with Heroku…",
|
98
98
|
authenticated: "{{v}} Authenticated with Heroku",
|
99
|
-
deploying: "Deploying to Heroku
|
99
|
+
deploying: "Deploying to Heroku…",
|
100
100
|
deployed: "{{v}} Deployed to Heroku",
|
101
101
|
db_check: {
|
102
|
-
validating: "Validating application
|
103
|
-
checking: "Checking database type
|
102
|
+
validating: "Validating application…",
|
103
|
+
checking: "Checking database type…",
|
104
104
|
validated: "Database type \"%s\" validated for platform \"Heroku\"",
|
105
105
|
problem: "A problem was encountered while checking your database type.",
|
106
106
|
sqlite: <<~SQLITE,
|
@@ -110,7 +110,7 @@ module Rails
|
|
110
110
|
SQLITE
|
111
111
|
},
|
112
112
|
git: {
|
113
|
-
checking: "Checking git repo
|
113
|
+
checking: "Checking git repo…",
|
114
114
|
initialized: "Git repo initialized",
|
115
115
|
what_branch: "What branch would you like to deploy?",
|
116
116
|
branch_selected: "{{v}} Git branch {{green:%s}} selected for deploy",
|
@@ -119,10 +119,10 @@ module Rails
|
|
119
119
|
no_apps_found: "No existing Heroku app found. What would you like to do?",
|
120
120
|
name: "What is your Heroku app’s name?",
|
121
121
|
select: "Specify an existing Heroku app",
|
122
|
-
selecting: "Selecting Heroku app %s
|
122
|
+
selecting: "Selecting Heroku app %s…",
|
123
123
|
selected: "{{v}} Heroku app {{green:%s}} selected",
|
124
124
|
create: "Create a new Heroku app",
|
125
|
-
creating: "Creating new Heroku app
|
125
|
+
creating: "Creating new Heroku app…",
|
126
126
|
created: "{{v}} New Heroku app created",
|
127
127
|
},
|
128
128
|
},
|
@@ -180,7 +180,7 @@ module Rails
|
|
180
180
|
{{*}} To install and start using your app, open this URL in your browser:
|
181
181
|
{{green:%s}}
|
182
182
|
MESSAGE
|
183
|
-
running_server: "Running server
|
183
|
+
running_server: "Running server…",
|
184
184
|
},
|
185
185
|
|
186
186
|
tunnel: {
|
@@ -9,9 +9,9 @@ mutation AppScriptUpdateOrCreate(
|
|
9
9
|
$schemaMinorVersion: String,
|
10
10
|
$useMsgpack: Boolean,
|
11
11
|
$uuid: String,
|
12
|
-
$configurationUi: Boolean
|
13
|
-
$scriptJsonVersion: String
|
14
|
-
$configurationDefinition: String
|
12
|
+
$configurationUi: Boolean!,
|
13
|
+
$scriptJsonVersion: String!,
|
14
|
+
$configurationDefinition: String!,
|
15
15
|
) {
|
16
16
|
appScriptUpdateOrCreate(
|
17
17
|
extensionPointName: $extensionPointName
|
@@ -90,7 +90,7 @@ module Theme
|
|
90
90
|
Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.
|
91
91
|
Usage: {{command:%s theme serve}}
|
92
92
|
HELP
|
93
|
-
serve: "Viewing theme
|
93
|
+
serve: "Viewing theme…",
|
94
94
|
open_fail: "Couldn't open the theme",
|
95
95
|
},
|
96
96
|
check: {
|
@@ -134,9 +134,9 @@ module Theme
|
|
134
134
|
},
|
135
135
|
language_server: {
|
136
136
|
help: <<~HELP,
|
137
|
-
{{command:%s theme language-server}}: Start a Language Server Protocol server.
|
137
|
+
{{command:%1$s theme language-server}}: Start a Language Server Protocol server.
|
138
138
|
|
139
|
-
Usage: {{command:%s theme language-server}}
|
139
|
+
Usage: {{command:%1$s theme language-server}}
|
140
140
|
HELP
|
141
141
|
},
|
142
142
|
pull: {
|
@@ -134,8 +134,12 @@ module ShopifyCli
|
|
134
134
|
)
|
135
135
|
CLI::Kit::Util.begin do
|
136
136
|
versions = client.query("api_versions")["data"]["publicApiVersions"]
|
137
|
-
|
138
|
-
|
137
|
+
# return the most recent supported version
|
138
|
+
versions
|
139
|
+
.select { |version| version["supported"] }
|
140
|
+
.map { |version| version["handle"] }
|
141
|
+
.sort
|
142
|
+
.reverse[0]
|
139
143
|
end.retry_after(API::APIRequestUnauthorizedError, retries: 1) do
|
140
144
|
ShopifyCli::IdentityAuth.new(ctx: ctx).reauthenticate
|
141
145
|
end
|
data/lib/shopify-cli/api.rb
CHANGED
@@ -81,7 +81,7 @@ module ShopifyCli
|
|
81
81
|
else
|
82
82
|
raise APIRequestUnexpectedError.new("#{response.code}\n#{response.body}", response: response)
|
83
83
|
end
|
84
|
-
rescue
|
84
|
+
rescue Errno::ETIMEDOUT, Timeout::Error
|
85
85
|
raise APIRequestTimeoutError.new("Timeout")
|
86
86
|
end.retry_after(APIRequestRetriableError, retries: 3) do |e|
|
87
87
|
sleep(1) if e.is_a?(APIRequestThrottledError)
|
@@ -108,7 +108,7 @@ module ShopifyCli
|
|
108
108
|
{
|
109
109
|
"User-Agent" => "Shopify CLI; v=#{ShopifyCli::VERSION}",
|
110
110
|
"Sec-CH-UA" => "Shopify CLI; v=#{ShopifyCli::VERSION} sha=#{ShopifyCli.sha}",
|
111
|
-
"Sec-CH-UA-PLATFORM" => ctx.os,
|
111
|
+
"Sec-CH-UA-PLATFORM" => ctx.os.to_s,
|
112
112
|
}.tap do |headers|
|
113
113
|
headers["X-Shopify-Cli-Employee"] = "1" if Shopifolk.acting_as_shopify_organization?
|
114
114
|
end.merge(auth_headers(token))
|
@@ -90,7 +90,7 @@ module ShopifyCli
|
|
90
90
|
{
|
91
91
|
schema_id: INVOCATIONS_SCHEMA,
|
92
92
|
payload: {
|
93
|
-
project_type:
|
93
|
+
project_type: project_type_from_dir_or_cmd(commands[0]).to_s,
|
94
94
|
command: commands.join(" "),
|
95
95
|
args: args.join(" "),
|
96
96
|
time_start: start_time,
|
@@ -104,7 +104,7 @@ module ShopifyCli
|
|
104
104
|
is_employee: ShopifyCli::Shopifolk.acting_as_shopify_organization?,
|
105
105
|
}.tap do |payload|
|
106
106
|
payload[:api_key] = metadata.delete(:api_key)
|
107
|
-
payload[:partner_id] = metadata.delete(:organization_id)
|
107
|
+
payload[:partner_id] = metadata.delete(:organization_id) || ShopifyCli::DB.get(:organization_id)
|
108
108
|
if Project.has_current?
|
109
109
|
project = Project.current(force_reload: true)
|
110
110
|
payload[:api_key] = project.env&.api_key
|
@@ -114,6 +114,10 @@ module ShopifyCli
|
|
114
114
|
end,
|
115
115
|
}
|
116
116
|
end
|
117
|
+
|
118
|
+
def project_type_from_dir_or_cmd(command)
|
119
|
+
Project.current_project_type || (command unless ShopifyCli::Commands.core_command?(command)) || nil
|
120
|
+
end
|
117
121
|
end
|
118
122
|
end
|
119
123
|
end
|
@@ -28,7 +28,7 @@ module ShopifyCli
|
|
28
28
|
},
|
29
29
|
|
30
30
|
env_file: {
|
31
|
-
saving_header: "writing %s file
|
31
|
+
saving_header: "writing %s file…",
|
32
32
|
saving: "writing %s file",
|
33
33
|
saved: "%s saved to project root",
|
34
34
|
},
|
@@ -69,7 +69,7 @@ module ShopifyCli
|
|
69
69
|
no_commits_made: "No git commits have been made. Please make at least one commit.",
|
70
70
|
},
|
71
71
|
|
72
|
-
cloning: "Cloning %s into %s
|
72
|
+
cloning: "Cloning %s into %s…",
|
73
73
|
cloned: "{{v}} Cloned into %s",
|
74
74
|
},
|
75
75
|
|
@@ -103,9 +103,9 @@ module ShopifyCli
|
|
103
103
|
install_error: "An error occurred while installing dependencies",
|
104
104
|
},
|
105
105
|
|
106
|
-
installing: "Installing dependencies with %s
|
106
|
+
installing: "Installing dependencies with %s…",
|
107
107
|
installed: "Dependencies installed",
|
108
|
-
npm_installing_deps: "Installing %d dependencies
|
108
|
+
npm_installing_deps: "Installing %d dependencies…",
|
109
109
|
npm_installed_deps: "%d npm dependencies installed",
|
110
110
|
},
|
111
111
|
|
@@ -257,7 +257,7 @@ module ShopifyCli
|
|
257
257
|
count_help: "Number of resources to generate",
|
258
258
|
},
|
259
259
|
|
260
|
-
populating: "Populating %d %ss
|
260
|
+
populating: "Populating %d %ss…",
|
261
261
|
|
262
262
|
completion_message: <<~COMPLETION_MESSAGE,
|
263
263
|
Successfully added %d %s to {{green:%s}}
|
@@ -345,7 +345,7 @@ module ShopifyCli
|
|
345
345
|
confirm_store: {
|
346
346
|
prompt: "You are currently logged into {{green:%s}}. Do you want to proceed using this store?",
|
347
347
|
confirmation: "Proceeding using {{green:%s}}",
|
348
|
-
cancelling: "Cancelling
|
348
|
+
cancelling: "Cancelling…",
|
349
349
|
},
|
350
350
|
ensure_env: {
|
351
351
|
organization_select: "To which partner organization does this project belong?",
|
@@ -414,7 +414,9 @@ module ShopifyCli
|
|
414
414
|
"please make sure %s exists within %s before trying again",
|
415
415
|
},
|
416
416
|
|
417
|
+
installing: "Installing ngrok…",
|
417
418
|
not_running: "{{green:x}} ngrok tunnel not running",
|
419
|
+
prereq_command_location: "%s @ %s",
|
418
420
|
signup_suggestion: <<~MESSAGE,
|
419
421
|
{{*}} To avoid tunnels that timeout, it is recommended to signup for a free ngrok
|
420
422
|
account at {{underline:https://ngrok.com/signup}}. After you signup, install your
|
@@ -423,9 +425,8 @@ module ShopifyCli
|
|
423
425
|
start: "{{v}} ngrok tunnel running at {{underline:%s}}",
|
424
426
|
start_with_account: "{{v}} ngrok tunnel running at {{underline:%s}}, with account %s",
|
425
427
|
stopped: "{{green:x}} ngrok tunnel stopped",
|
426
|
-
timed_out: "{{x}} ngrok tunnel has timed out, restarting
|
428
|
+
timed_out: "{{x}} ngrok tunnel has timed out, restarting…",
|
427
429
|
will_timeout: "{{*}} This tunnel will timeout in {{red:%s}}",
|
428
|
-
prereq_command_location: "%s @ %s",
|
429
430
|
},
|
430
431
|
|
431
432
|
version: {
|
data/lib/shopify-cli/packager.rb
CHANGED
@@ -16,7 +16,7 @@ module ShopifyCli
|
|
16
16
|
|
17
17
|
puts "\nBuilding Debian package"
|
18
18
|
|
19
|
-
puts "Generating metadata files
|
19
|
+
puts "Generating metadata files…"
|
20
20
|
Dir.glob("#{debian_dir}/*").each { |file| File.delete(file) }
|
21
21
|
|
22
22
|
metadata_files = %w(control preinst prerm)
|
@@ -28,7 +28,7 @@ module ShopifyCli
|
|
28
28
|
File.open(file_path, "w", 0775) { |f| f.write(file_contents) }
|
29
29
|
end
|
30
30
|
|
31
|
-
puts "Building package
|
31
|
+
puts "Building package…"
|
32
32
|
Dir.chdir(root_dir)
|
33
33
|
raise "Failed to build package" unless system("dpkg-deb", "-b", "shopify-cli")
|
34
34
|
|
@@ -49,14 +49,14 @@ module ShopifyCli
|
|
49
49
|
spec_path = File.join(root_dir, "shopify-cli.spec")
|
50
50
|
puts "\nBuilding RPM package"
|
51
51
|
|
52
|
-
puts "Generating spec file
|
52
|
+
puts "Generating spec file…"
|
53
53
|
File.delete(spec_path) if File.exist?(spec_path)
|
54
54
|
|
55
55
|
spec_contents = File.read(File.join(root_dir, "shopify-cli.spec.base"))
|
56
56
|
spec_contents = spec_contents.gsub("SHOPIFY_CLI_VERSION", ShopifyCli::VERSION)
|
57
57
|
File.write(spec_path, spec_contents)
|
58
58
|
|
59
|
-
puts "Building package
|
59
|
+
puts "Building package…"
|
60
60
|
Dir.chdir(root_dir)
|
61
61
|
system("rpmbuild", "-bb", File.basename(spec_path))
|
62
62
|
|
@@ -72,7 +72,7 @@ module ShopifyCli
|
|
72
72
|
build_path = File.join(BUILDS_DIR, "shopify-cli.rb")
|
73
73
|
puts "\nBuilding Homebrew package"
|
74
74
|
|
75
|
-
puts "Generating formula
|
75
|
+
puts "Generating formula…"
|
76
76
|
File.delete(build_path) if File.exist?(build_path)
|
77
77
|
|
78
78
|
spec_contents = File.read(File.join(root_dir, "shopify-cli.base.rb"))
|
@@ -72,7 +72,7 @@ module ShopifyCli
|
|
72
72
|
def replace_asset_urls(body)
|
73
73
|
replaced_body = body.join.gsub(ASSET_REGEX) do |match|
|
74
74
|
path = Pathname.new(Regexp.last_match[1])
|
75
|
-
if @theme.
|
75
|
+
if @theme.static_asset_paths.include?(path)
|
76
76
|
"/#{path}"
|
77
77
|
else
|
78
78
|
match
|
@@ -149,7 +149,7 @@ module ShopifyCli
|
|
149
149
|
# Process lower-priority files in the background
|
150
150
|
|
151
151
|
# Assets are served locally, so can be uploaded in the background
|
152
|
-
enqueue_updates(@theme.
|
152
|
+
enqueue_updates(@theme.static_asset_files)
|
153
153
|
|
154
154
|
unless delay_low_priority_files
|
155
155
|
wait!(&block)
|
@@ -254,8 +254,12 @@ module ShopifyCli
|
|
254
254
|
|
255
255
|
update_checksums(body)
|
256
256
|
|
257
|
-
|
258
|
-
|
257
|
+
attachment = body.dig("asset", "attachment")
|
258
|
+
value = if attachment
|
259
|
+
file.write(Base64.decode64(attachment), 0, mode: "wb")
|
260
|
+
else
|
261
|
+
file.write(body.dig("asset", "value"))
|
262
|
+
end
|
259
263
|
|
260
264
|
response
|
261
265
|
end
|
@@ -277,7 +281,7 @@ module ShopifyCli
|
|
277
281
|
|
278
282
|
def update_checksums(api_response)
|
279
283
|
api_response.values.flatten.each do |asset|
|
280
|
-
if asset["key"]
|
284
|
+
if asset["key"]
|
281
285
|
@checksums[asset["key"]] = asset["checksum"]
|
282
286
|
end
|
283
287
|
end
|
@@ -310,7 +314,7 @@ module ShopifyCli
|
|
310
314
|
|
311
315
|
def backoff_if_near_limit!(used, limit)
|
312
316
|
if used > limit - @threads.size
|
313
|
-
@ctx.debug("Near API call limit, waiting 2 sec
|
317
|
+
@ctx.debug("Near API call limit, waiting 2 sec…")
|
314
318
|
@backoff_mutex.synchronize { sleep 2 }
|
315
319
|
end
|
316
320
|
end
|
@@ -20,11 +20,11 @@ module ShopifyCli
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def theme_files
|
23
|
-
glob(["**/*.liquid", "**/*.json", "assets/*"])
|
23
|
+
glob(["**/*.liquid", "**/*.json", "assets/*"]).uniq
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
glob("assets/*")
|
26
|
+
def static_asset_files
|
27
|
+
glob("assets/*").reject(&:liquid?)
|
28
28
|
end
|
29
29
|
|
30
30
|
def liquid_files
|
@@ -43,8 +43,8 @@ module ShopifyCli
|
|
43
43
|
theme_files.include?(self[file])
|
44
44
|
end
|
45
45
|
|
46
|
-
def
|
47
|
-
|
46
|
+
def static_asset_paths
|
47
|
+
static_asset_files.map(&:relative_path)
|
48
48
|
end
|
49
49
|
|
50
50
|
def [](file)
|
data/lib/shopify-cli/tunnel.rb
CHANGED
@@ -149,7 +149,7 @@ module ShopifyCli
|
|
149
149
|
check_prereq_command(ctx, "curl")
|
150
150
|
check_prereq_command(ctx, ctx.linux? ? "unzip" : "tar")
|
151
151
|
spinner = CLI::UI::SpinGroup.new
|
152
|
-
spinner.add("
|
152
|
+
spinner.add(ctx.message("core.tunnel.installing")) do
|
153
153
|
zip_dest = File.join(ShopifyCli.cache_dir, "ngrok.zip")
|
154
154
|
unless File.exist?(zip_dest)
|
155
155
|
ctx.system("curl", "-o", zip_dest, DOWNLOAD_URLS[ctx.os], chdir: ShopifyCli.cache_dir)
|
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: 2.0.
|
4
|
+
version: 2.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: 2021-
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- RELEASING.md
|
122
122
|
- Rakefile
|
123
123
|
- SECURITY.md
|
124
|
+
- THEMEKIT_MIGRATION.md
|
124
125
|
- bin/load_shopify.rb
|
125
126
|
- bin/shopify
|
126
127
|
- dev.yml
|