diff --git a/CHANGELOG.md b/CHANGELOG.md index c9947050ff..a0a6eef57e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased ------ +* [1432](https://github.com/Shopify/shopify-cli/pull/1432) New method for determining renderer package name + Version 2.2.0 ------ * [#1424](https://github.com/Shopify/shopify-cli/pull/1424/): Add `--resourceUrl` flag to extension serve command diff --git a/lib/project_types/extension/commands/push.rb b/lib/project_types/extension/commands/push.rb index c2c2e35191..6a385b55bb 100644 --- a/lib/project_types/extension/commands/push.rb +++ b/lib/project_types/extension/commands/push.rb @@ -11,7 +11,6 @@ class Push < ExtensionCommand def call(args, name) Command::Register.new(@ctx).call(args, name) unless project.registered? Command::Build.new(@ctx).call(args, name) unless specification_handler.specification.options[:skip_build] - CLI::UI::Frame.open(@ctx.message("push.frame_title")) do updated_draft_version = update_draft show_message(updated_draft_version) diff --git a/lib/project_types/extension/features/argo.rb b/lib/project_types/extension/features/argo.rb index 08316c329a..45f1c3cebe 100644 --- a/lib/project_types/extension/features/argo.rb +++ b/lib/project_types/extension/features/argo.rb @@ -19,16 +19,6 @@ class Argo YARN_RUN_SCRIPT_NAME = %w(build).freeze private_constant :YARN_INSTALL_COMMAND, :YARN_INSTALL_PARAMETERS, :YARN_RUN_COMMAND, :YARN_RUN_SCRIPT_NAME - UI_EXTENSIONS_CHECKOUT = "@shopify/checkout-ui-extensions" - UI_EXTENSIONS_ADMIN = "@shopify/admin-ui-extensions" - UI_EXTENSIONS_POST_PURCHASE = "@shopify/post-purchase-ui-extensions" - - PACKAGE_NAMES = [ - UI_EXTENSIONS_CHECKOUT, - UI_EXTENSIONS_ADMIN, - UI_EXTENSIONS_POST_PURCHASE, - ].freeze - def create(directory_name, identifier, context) Features::ArgoSetup.new(git_template: git_template).call(directory_name, identifier, context) end @@ -54,7 +44,7 @@ def config(context) def renderer_package(context) js_system = ShopifyCli::JsSystem.new(ctx: context) Tasks::FindNpmPackages - .exactly_one_of(*PACKAGE_NAMES, js_system: js_system) + .exactly_one_of(renderer_package_name, js_system: js_system) .unwrap { |err| raise err } rescue Extension::PackageResolutionFailed context.abort( diff --git a/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb b/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb index 736b01e28b..c2b4e2b129 100644 --- a/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +++ b/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb @@ -6,6 +6,7 @@ module Models module SpecificationHandlers class CheckoutPostPurchase < Default PERMITTED_CONFIG_KEYS = [:metafields] + RENDERER_PACKAGE_NAME = "@shopify/post-purchase-ui-extensions" def config(context) { @@ -13,6 +14,15 @@ def config(context) **argo.config(context), } end + + protected + + def argo + Features::Argo.new( + git_template: specification.features.argo.git_template, + renderer_package_name: RENDERER_PACKAGE_NAME + ) + end end end end