简体   繁体   English

如何将 shopify 主题应用程序扩展从 cli 2.0 迁移到 cli 3.0?

[英]How to migrate shopify theme app extension from cli 2.0 to cli 3.0?

I'm asking this because I created an app that's not a shopify cli app template.我问这个是因为我创建了一个不是 shopify cli 应用程序模板的应用程序。 As a result, in cli 3.0, they deprecated the cli2.0 command for the theme app extension.因此,在 cli 3.0 中,他们弃用了主题应用程序扩展的 cli2.0 命令。 It is not understandable how to use new commands according to the shopify documentation.根据shopify文档,如何使用新命令是看不懂的。

like cli 2.0 have these steps to create theme app extension.(take a look below image) enter image description here像 cli 2.0 有这些步骤来创建主题应用程序扩展。(看看下面的图片)在这里输入图片描述

but in cli 3.0 description they removed all commands so now big question how to migrate or create theme app extension without using cli app templete.但在 cli 3.0 描述中,他们删除了所有命令,所以现在很大的问题是如何在不使用 cli 应用程序模板的情况下迁移或创建主题应用程序扩展。

I'm trying to explain how to migrate or create theme app extension in shopify without using shopify app templete.我正在尝试解释如何在不使用 shopify 应用模板的情况下在 shopify 中迁移或创建主题应用扩展。 so expecting to get an answer around this.所以期待得到解决这个问题的答案。

To classify a directory as an extension, given directory must include a config file with a.toml extension.要将目录分类为扩展名,给定目录必须包含一个扩展名为 .toml 的配置文件。 Quote from documentation : 引用文档

If you're migrating a theme app extension, then do the following:如果您要迁移主题应用程序扩展,请执行以下操作:

  1. Create a shopify.theme.extension.toml in the extension's directory.在扩展目录中创建一个 shopify.theme.extension.toml。

    The TOML should contain the following information: TOML 应包含以下信息:

    name: The name of your app extension.名称:您的应用程序扩展的名称。 name should match the EXTENSION_TITLE from your extension's.env file.名称应与扩展程序的 .env 文件中的 EXTENSION_TITLE 相匹配。

    type: Enter theme.类型:输入主题。

    shopify.theme.extension.toml: shopify.theme.extension.toml:

     name = "My theme extension" type = "theme"
  2. Optional: delete any remaining.env, extension.config.yml, and.shopify-cli.yml files.可选:删除所有剩余的 .env、extension.config.yml 和 .shopify-cli.yml 文件。

I found it.我找到了。 Follow below steps :按照以下步骤操作

  1. Create package.json file at root of your project directory and copy content from shopify doc and paste在项目目录的根目录下创建package.json文件并从shopify 文档复制内容并粘贴

  2. npm install

  3. npm run shopify app generate extension

  4. npm run deploy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将我的 shopify 应用程序迁移到 shopify cli 3.0 - Unable to migrate my shopify app to shopify cli 3.0 如何从 Shopify 中的主题应用程序扩展访问自定义应用程序 API? - How To Access Custom App API From Theme App Extension in Shopify? Shopify CLI 3.0 从前端到后端进行 REST API 调用 - Shopify CLI 3.0 making REST API call from frontend to backend shopify cli:主题部署仅更改文件 - shopify cli: theme deploy changed file only 如何在使用 Shopify CLI、React 和 Shopify App Bridge 构建的 Shopify 应用中使用路线 - How to use routes in Shopify app built using Shopify CLI , React and Shopify App Bridge Zapier Cli-是否可以将订单项从Shopify发送到我的Zapier CLI应用程序? - Zapier Cli - Is there a way to send line items from Shopify to my Zapier CLI App? 如何在主题扩展液体文件中访问 Shopify 应用程序拥有的元字段? - How to access Shopify app owned metafields in theme extension liquid files? 如何阻止重定向 URL 被 Shopify CLI 擦除? - How to stop redirect URL from being wiped by Shopify CLI? 如何使用 CLI 从 Shopify API 检索产品 - How to retrieve products from Shopify API using CLI Shopify CLI - 提供应用程序时出现 Ngrok 错误 - Shopify CLI - Ngrok error when serving app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM