rename project from SimpleshopTheme to Berrypod
All modules, configs, paths, and references updated. 836 tests pass, zero warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
defmodule Mix.Tasks.Simpleshop.DownloadImages do
|
||||
defmodule Mix.Tasks.Berrypod.DownloadImages do
|
||||
@moduledoc """
|
||||
Enqueues download jobs for product images that haven't been processed yet.
|
||||
|
||||
## Usage
|
||||
|
||||
mix simpleshop.download_images
|
||||
mix berrypod.download_images
|
||||
|
||||
This task finds all product images with a `src` URL but no linked `image_id`
|
||||
and enqueues them for download via the ImageDownloadWorker.
|
||||
@@ -20,8 +20,8 @@ defmodule Mix.Tasks.Simpleshop.DownloadImages do
|
||||
def run(_args) do
|
||||
Mix.Task.run("app.start")
|
||||
|
||||
alias SimpleshopTheme.Products
|
||||
alias SimpleshopTheme.Sync.ImageDownloadWorker
|
||||
alias Berrypod.Products
|
||||
alias Berrypod.Sync.ImageDownloadWorker
|
||||
|
||||
pending = Products.list_pending_downloads(limit: 10_000)
|
||||
count = length(pending)
|
||||
@@ -2,7 +2,7 @@ defmodule Mix.Tasks.GenerateMockups do
|
||||
@moduledoc """
|
||||
Generates product mockups using Printify or Printful APIs.
|
||||
|
||||
This task automates the creation of product mockups for the SimpleshopTheme
|
||||
This task automates the creation of product mockups for the Berrypod
|
||||
sample content. It downloads artwork from Unsplash, uploads it to the
|
||||
print-on-demand provider, creates products, and downloads the generated mockups.
|
||||
|
||||
@@ -26,8 +26,8 @@ defmodule Mix.Tasks.GenerateMockups do
|
||||
|
||||
use Mix.Task
|
||||
|
||||
alias SimpleshopTheme.Mockups.Generator, as: PrintifyGenerator
|
||||
alias SimpleshopTheme.Mockups.PrintfulGenerator
|
||||
alias Berrypod.Mockups.Generator, as: PrintifyGenerator
|
||||
alias Berrypod.Mockups.PrintfulGenerator
|
||||
|
||||
@shortdoc "Generates product mockups using Printify or Printful API"
|
||||
|
||||
@@ -207,7 +207,7 @@ defmodule Mix.Tasks.GenerateMockups do
|
||||
end
|
||||
|
||||
defp purge_existing_printify_products do
|
||||
alias SimpleshopTheme.Clients.Printify, as: Client
|
||||
alias Berrypod.Clients.Printify, as: Client
|
||||
|
||||
Mix.shell().info("Fetching existing products...")
|
||||
|
||||
|
||||
@@ -133,9 +133,9 @@ defmodule Mix.Tasks.Lighthouse do
|
||||
defp build_prod_assets! do
|
||||
Mix.shell().info("Building production assets...")
|
||||
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme", "--minify"])
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme_shop_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme_admin_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod_shop_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod_admin_css", "--minify"])
|
||||
Mix.Task.run("phx.digest")
|
||||
|
||||
Mix.shell().info(" Assets built and digested.")
|
||||
@@ -144,7 +144,7 @@ defmodule Mix.Tasks.Lighthouse do
|
||||
# -- Server lifecycle --
|
||||
|
||||
defp start_server!(port) do
|
||||
config = Application.get_env(:simpleshop_theme, SimpleshopThemeWeb.Endpoint, [])
|
||||
config = Application.get_env(:berrypod, BerrypodWeb.Endpoint, [])
|
||||
|
||||
config =
|
||||
Keyword.merge(config,
|
||||
@@ -154,7 +154,7 @@ defmodule Mix.Tasks.Lighthouse do
|
||||
cache_static_manifest: "priv/static/cache_manifest.json"
|
||||
)
|
||||
|
||||
Application.put_env(:simpleshop_theme, SimpleshopThemeWeb.Endpoint, config)
|
||||
Application.put_env(:berrypod, BerrypodWeb.Endpoint, config)
|
||||
|
||||
Mix.Task.run("app.start")
|
||||
|
||||
@@ -211,10 +211,10 @@ defmodule Mix.Tasks.Lighthouse do
|
||||
end
|
||||
|
||||
defp count_pending_images do
|
||||
SimpleshopTheme.Media.Image
|
||||
Berrypod.Media.Image
|
||||
|> where([i], i.is_svg == false)
|
||||
|> where([i], i.variants_status != "complete" or is_nil(i.variants_status))
|
||||
|> SimpleshopTheme.Repo.aggregate(:count)
|
||||
|> Berrypod.Repo.aggregate(:count)
|
||||
end
|
||||
|
||||
# -- Lighthouse execution --
|
||||
|
||||
@@ -21,8 +21,8 @@ defmodule Mix.Tasks.RegisterWebhooks do
|
||||
def run([url]) do
|
||||
Mix.Task.run("app.start")
|
||||
|
||||
alias SimpleshopTheme.Products
|
||||
alias SimpleshopTheme.Providers.Printify
|
||||
alias Berrypod.Products
|
||||
alias Berrypod.Providers.Printify
|
||||
|
||||
case Products.get_provider_connection_by_type("printify") do
|
||||
nil ->
|
||||
|
||||
@@ -158,16 +158,16 @@ defmodule Mix.Tasks.Screenshots do
|
||||
defp build_prod_assets! do
|
||||
Mix.shell().info("Building production assets...")
|
||||
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme", "--minify"])
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme_shop_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["simpleshop_theme_admin_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod_shop_css", "--minify"])
|
||||
Mix.Task.run("esbuild", ["berrypod_admin_css", "--minify"])
|
||||
Mix.Task.run("phx.digest")
|
||||
|
||||
Mix.shell().info(" Assets built and digested.")
|
||||
end
|
||||
|
||||
defp start_server!(port) do
|
||||
config = Application.get_env(:simpleshop_theme, SimpleshopThemeWeb.Endpoint, [])
|
||||
config = Application.get_env(:berrypod, BerrypodWeb.Endpoint, [])
|
||||
|
||||
config =
|
||||
Keyword.merge(config,
|
||||
@@ -177,7 +177,7 @@ defmodule Mix.Tasks.Screenshots do
|
||||
cache_static_manifest: "priv/static/cache_manifest.json"
|
||||
)
|
||||
|
||||
Application.put_env(:simpleshop_theme, SimpleshopThemeWeb.Endpoint, config)
|
||||
Application.put_env(:berrypod, BerrypodWeb.Endpoint, config)
|
||||
|
||||
Mix.Task.run("app.start")
|
||||
|
||||
@@ -230,10 +230,10 @@ defmodule Mix.Tasks.Screenshots do
|
||||
end
|
||||
|
||||
defp count_pending_images do
|
||||
SimpleshopTheme.Media.Image
|
||||
Berrypod.Media.Image
|
||||
|> where([i], i.is_svg == false)
|
||||
|> where([i], i.variants_status != "complete" or is_nil(i.variants_status))
|
||||
|> SimpleshopTheme.Repo.aggregate(:count)
|
||||
|> Berrypod.Repo.aggregate(:count)
|
||||
end
|
||||
|
||||
defp resolve_pages(base_url, []) do
|
||||
@@ -246,7 +246,7 @@ defmodule Mix.Tasks.Screenshots do
|
||||
end
|
||||
|
||||
defp dynamic_pages(_base_url) do
|
||||
case SimpleshopTheme.Products.list_visible_products(limit: 1) do
|
||||
case Berrypod.Products.list_visible_products(limit: 1) do
|
||||
[product] ->
|
||||
[{"pdp", "/products/#{product.id}", nil}]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user