Bootstraps from Shopify's official shopify-app-template-remix (cloned directly rather than via `shopify app init`, which requires an interactive Partner login unavailable in this session): - Prisma (SQLite dev / Postgres-ready) with baseline Session model + migration - Vitest configured for unit tests, Playwright configured for E2E - Redis client + BullMQ worker skeleton (app/lib/redis.server.ts, jobs/worker.ts) - shopify.app.toml: minimal scopes, GDPR + orders webhooks wired (stub handlers), app proxy config for the future storefront widget - Stripped template-repo-only meta files (CLA, issue templates, demo product page) and replaced CI with a lint+typecheck+test workflow - Bumped @shopify/shopify-app-session-storage-prisma to resolve a duplicate @shopify/shopify-api install that broke typecheck - Dropped the Jest-only ESLint config (template default) since the project standardizes on Vitest per IMPLEMENTATION_PLAN.md Verified: npm install, lint, typecheck, unit tests, prisma migrate dev, and npm run build all pass on Node 22 LTS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
import { redirect } from "@remix-run/node";
|
|
import { Form, useLoaderData } from "@remix-run/react";
|
|
|
|
import { login } from "../../shopify.server";
|
|
|
|
import styles from "./styles.module.css";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const url = new URL(request.url);
|
|
|
|
if (url.searchParams.get("shop")) {
|
|
throw redirect(`/app?${url.searchParams.toString()}`);
|
|
}
|
|
|
|
return { showForm: Boolean(login) };
|
|
};
|
|
|
|
export default function App() {
|
|
const { showForm } = useLoaderData<typeof loader>();
|
|
|
|
return (
|
|
<div className={styles.index}>
|
|
<div className={styles.content}>
|
|
<h1 className={styles.heading}>A short heading about [your app]</h1>
|
|
<p className={styles.text}>
|
|
A tagline about [your app] that describes your value proposition.
|
|
</p>
|
|
{showForm && (
|
|
<Form className={styles.form} method="post" action="/auth/login">
|
|
<label className={styles.label}>
|
|
<span>Shop domain</span>
|
|
<input className={styles.input} type="text" name="shop" />
|
|
<span>e.g: my-shop-domain.myshopify.com</span>
|
|
</label>
|
|
<button className={styles.button} type="submit">
|
|
Log in
|
|
</button>
|
|
</Form>
|
|
)}
|
|
<ul className={styles.list}>
|
|
<li>
|
|
<strong>Product feature</strong>. Some detail about your feature and
|
|
its benefit to your customer.
|
|
</li>
|
|
<li>
|
|
<strong>Product feature</strong>. Some detail about your feature and
|
|
its benefit to your customer.
|
|
</li>
|
|
<li>
|
|
<strong>Product feature</strong>. Some detail about your feature and
|
|
its benefit to your customer.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|