shopify-cli 2.13.0 → 2.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +5 -0
- data/.github/CONTRIBUTING.md +1 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- data/.github/workflows/stale.yml +46 -0
- data/CHANGELOG.md +36 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +43 -11
- data/Rakefile +43 -0
- data/ext/javy/hashes/javy-arm-macos-v0.2.1.gz.sha256 +1 -0
- data/ext/javy/hashes/javy-x86_64-linux-v0.2.1.gz.sha256 +1 -0
- data/ext/javy/hashes/javy-x86_64-macos-v0.2.1.gz.sha256 +1 -0
- data/ext/javy/hashes/javy-x86_64-windows-v0.2.1.gz.sha256 +1 -0
- data/ext/javy/version +1 -1
- data/ext/shopify-extensions/version +1 -1
- data/lib/project_types/extension/forms/questions/ask_template.rb +5 -8
- data/lib/project_types/extension/messages/messages.rb +10 -0
- data/lib/project_types/extension/models/development_server_requirements.rb +13 -7
- data/lib/project_types/extension/models/npm_package.rb +19 -1
- data/lib/project_types/extension/models/server_config/development_renderer.rb +4 -3
- data/lib/project_types/extension/models/server_config/root.rb +2 -0
- data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +13 -0
- data/lib/project_types/script/cli.rb +0 -4
- data/lib/project_types/script/config/extension_points.yml +18 -6
- data/lib/project_types/script/layers/application/build_script.rb +3 -18
- data/lib/project_types/script/layers/application/push_script.rb +12 -10
- data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +0 -1
- data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +0 -1
- data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +2 -10
- data/lib/project_types/script/layers/infrastructure/languages/wasm_task_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -23
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +1 -1
- data/lib/project_types/script/messages/messages.rb +2 -2
- data/lib/project_types/theme/commands/package.rb +1 -0
- data/lib/project_types/theme/commands/pull.rb +2 -2
- data/lib/project_types/theme/commands/push.rb +2 -2
- data/lib/project_types/theme/conversions/base_glob.rb +20 -5
- data/lib/project_types/theme/messages/messages.rb +9 -0
- data/lib/shopify_cli/changelog.rb +76 -0
- data/lib/shopify_cli/command.rb +8 -7
- data/lib/shopify_cli/commands/app/deploy.rb +0 -1
- data/lib/shopify_cli/context.rb +2 -2
- data/lib/shopify_cli/core/entry_point.rb +1 -1
- data/lib/shopify_cli/core/monorail.rb +14 -6
- data/lib/shopify_cli/environment.rb +19 -11
- data/lib/shopify_cli/exception_reporter.rb +2 -0
- data/lib/shopify_cli/messages/messages.rb +11 -5
- data/lib/shopify_cli/packager.rb +1 -1
- data/lib/shopify_cli/release.rb +94 -0
- data/lib/shopify_cli/result.rb +14 -0
- data/lib/shopify_cli/sed.rb +19 -0
- data/lib/shopify_cli/services/app/create/node_service.rb +2 -14
- data/lib/shopify_cli/services/app/create/php_service.rb +1 -6
- data/lib/shopify_cli/services/app/create/rails_service.rb +4 -12
- data/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +5 -5
- data/lib/shopify_cli/theme/dev_server/watcher.rb +10 -2
- data/lib/shopify_cli/theme/development_theme.rb +2 -5
- data/lib/shopify_cli/theme/syncer.rb +20 -25
- data/lib/shopify_cli/theme/theme.rb +28 -31
- data/lib/shopify_cli/theme/theme_admin_api.rb +72 -0
- data/lib/shopify_cli/transform_data_structure.rb +3 -2
- data/lib/shopify_cli/tunnel.rb +9 -0
- data/lib/shopify_cli/version.rb +1 -1
- data/shipit.yml +3 -0
- data/shopify-cli.gemspec +12 -3
- metadata +18 -10
- data/lib/project_types/rails/ruby.rb +0 -17
- data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +0 -36
- data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +0 -109
@@ -1,17 +0,0 @@
|
|
1
|
-
module Rails
|
2
|
-
class Ruby
|
3
|
-
include SmartProperties
|
4
|
-
|
5
|
-
VERSION_STRING = /ruby ([\d\.]+)/
|
6
|
-
|
7
|
-
property :ctx, accepts: ShopifyCLI::Context, required: true
|
8
|
-
|
9
|
-
class << self
|
10
|
-
def version(ctx)
|
11
|
-
require "semantic/semantic"
|
12
|
-
out, _ = ctx.capture2("ruby", "-v")
|
13
|
-
Semantic::Version.new(VERSION_STRING.match(out)[1])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Script
|
4
|
-
module Layers
|
5
|
-
module Infrastructure
|
6
|
-
module Languages
|
7
|
-
class AssemblyScriptProjectCreator < ProjectCreator
|
8
|
-
def setup_dependencies
|
9
|
-
task_runner = Infrastructure::Languages::AssemblyScriptTaskRunner.new(ctx)
|
10
|
-
task_runner.set_npm_config
|
11
|
-
super
|
12
|
-
|
13
|
-
update_package_json_name
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def update_package_json_name
|
19
|
-
file_content = ctx.read("package.json")
|
20
|
-
hash = file_content_to_hash(file_content)
|
21
|
-
hash["name"] = project_name
|
22
|
-
ctx.write("package.json", hash_to_file_content(hash))
|
23
|
-
end
|
24
|
-
|
25
|
-
def file_content_to_hash(content)
|
26
|
-
JSON.parse(content)
|
27
|
-
end
|
28
|
-
|
29
|
-
def hash_to_file_content(hash)
|
30
|
-
JSON.pretty_generate(hash)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,109 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Script
|
4
|
-
module Layers
|
5
|
-
module Infrastructure
|
6
|
-
module Languages
|
7
|
-
class AssemblyScriptTaskRunner < TaskRunner
|
8
|
-
NODE_MIN_VERSION = "14.15.0"
|
9
|
-
NPM_MIN_VERSION = "5.2.0"
|
10
|
-
|
11
|
-
BYTECODE_FILE = "build/script.wasm"
|
12
|
-
METADATA_FILE = "build/metadata.json"
|
13
|
-
SCRIPT_SDK_BUILD = "npm run build"
|
14
|
-
NPM_SET_REGISTRY_COMMAND = "npm --userconfig ./.npmrc config set @shopify:registry https://registry.npmjs.com"
|
15
|
-
NPM_SET_ENGINE_STRICT_COMMAND = "npm --userconfig ./.npmrc config set engine-strict true"
|
16
|
-
NPM_INSTALL_COMMAND = "npm install --no-audit --no-optional --legacy-peer-deps --loglevel error"
|
17
|
-
|
18
|
-
def build
|
19
|
-
compile
|
20
|
-
bytecode
|
21
|
-
end
|
22
|
-
|
23
|
-
def install_dependencies
|
24
|
-
run_cmd_with_env_check(NPM_INSTALL_COMMAND)
|
25
|
-
|
26
|
-
rescue Errors::SystemCallFailureError => e
|
27
|
-
raise Errors::DependencyInstallError, e.out
|
28
|
-
end
|
29
|
-
|
30
|
-
def dependencies_installed?
|
31
|
-
# Assuming if node_modules folder exist at root of script folder, all deps are installed
|
32
|
-
ctx.dir_exist?("node_modules")
|
33
|
-
end
|
34
|
-
|
35
|
-
def metadata_file_location
|
36
|
-
METADATA_FILE
|
37
|
-
end
|
38
|
-
|
39
|
-
def library_version(library_name)
|
40
|
-
output = JSON.parse(run_cmd_with_env_check("npm -s list --json"))
|
41
|
-
library_version_from_npm_list(output, library_name)
|
42
|
-
rescue Errors::SystemCallFailureError => error
|
43
|
-
library_version_from_npm_list_error_output(error, library_name)
|
44
|
-
end
|
45
|
-
|
46
|
-
def set_npm_config
|
47
|
-
run_cmd_with_env_check(NPM_SET_REGISTRY_COMMAND)
|
48
|
-
run_cmd_with_env_check(NPM_SET_ENGINE_STRICT_COMMAND)
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def ensure_environment
|
54
|
-
return if defined?(@environment_checked)
|
55
|
-
@environment_checked = true
|
56
|
-
|
57
|
-
ToolVersionChecker.check_node(minimum_version: NODE_MIN_VERSION)
|
58
|
-
ToolVersionChecker.check_npm(minimum_version: NPM_MIN_VERSION)
|
59
|
-
end
|
60
|
-
|
61
|
-
def run_cmd_with_env_check(cmd)
|
62
|
-
ensure_environment
|
63
|
-
CommandRunner.new(ctx: ctx).call(cmd)
|
64
|
-
end
|
65
|
-
|
66
|
-
def library_version_from_npm_list_error_output(error, library_name)
|
67
|
-
# npm list can return a failure status code, even when returning the correct data.
|
68
|
-
# This causes the CommandRunner to throw a SystemCallFailure error that contains the data.
|
69
|
-
# In here, we check that the output contains `npm list`'s structure and extract the version.
|
70
|
-
output = JSON.parse(error.out)
|
71
|
-
raise error unless output.key?("dependencies")
|
72
|
-
|
73
|
-
library_version_from_npm_list(output, library_name)
|
74
|
-
rescue JSON::ParserError
|
75
|
-
raise error
|
76
|
-
end
|
77
|
-
|
78
|
-
def library_version_from_npm_list(output, library_name)
|
79
|
-
output.dig("dependencies", library_name, "version").tap do |version|
|
80
|
-
raise Errors::APILibraryNotFoundError, library_name unless version
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def compile
|
85
|
-
check_compilation_dependencies!
|
86
|
-
run_cmd_with_env_check(SCRIPT_SDK_BUILD)
|
87
|
-
end
|
88
|
-
|
89
|
-
def check_compilation_dependencies!
|
90
|
-
pkg = JSON.parse(File.read("package.json"))
|
91
|
-
build_script = pkg.dig("scripts", "build")
|
92
|
-
|
93
|
-
raise Errors::BuildScriptNotFoundError,
|
94
|
-
"Build script not found" if build_script.nil?
|
95
|
-
end
|
96
|
-
|
97
|
-
def bytecode
|
98
|
-
raise Errors::WebAssemblyBinaryNotFoundError unless ctx.file_exist?(BYTECODE_FILE)
|
99
|
-
|
100
|
-
contents = ctx.binread(BYTECODE_FILE)
|
101
|
-
ctx.rm(BYTECODE_FILE)
|
102
|
-
|
103
|
-
contents
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|