KO
베타 번역

@core / shipping

1.0.1 ▾
인증됨MIT
GitHub

배송 지역과 요금(정액·무게·금액·X 이상 무료), 예상 배송일, 배송 추적 URL

코드파일 6개컨텍스트약 445토큰검사 통과

설치

$genpm add @core/shipping

포함 내용

  • src/lib/shipping/에 소스 코드, 파일 6개. (15kB)
  • src/lib/shipping/AGENTS.md에 AI 규칙, 그리고 IDE 규칙 파일.
  • @core/cart, @core/contracts, @core/db, @core/money을(를) 자동으로 해결합니다.

README

@core/shipping

genpm license

Shipping zones and rates (flat, weight, order value, free over X) with delivery estimates and tracking URLs

A GenPM module: source code + AI rules + MCP config, injected into your project instead of hidden in node_modules. The code lands in src/lib/shipping, pinned to a verified commit, and you own it.

Install

genpm add @core/shipping

No genpm yet? curl -fsSL https://genpm.net/install.sh | sh (macOS/Linux), irm https://genpm.net/install.ps1 | iex (Windows), or one-off with npx @genpm-net/cli add @core/shipping.

Or let your AI agent do it: run genpm mcp setup once, then ask "add @core/shipping with genpm" in Claude Code, Cursor, VS Code, Windsurf, Codex or Gemini CLI. It shows you a dry-run plan before writing anything.

What it does

Shipping zones (ISO country lists, * = rest of world) and rates per zone: flat price, weight and order-value ranges, free shipping over an amount (after discounts) and delivery estimates in days. Registers the shipping step (order 200) of the @core/cart totals pipeline and builds tracking URLs for common carriers. No label purchase or live carrier quotes. Tables: shipping_zones, shipping_rates.

Setup

After genpm add, follow these steps (your AI agent finds the same steps in src/lib/shipping/AGENTS.md and can do them for you):

  1. Migrations as in src/lib/db/AGENTS.md. Import this module at startup (it registers the totals step).
  2. Create zones and rates in the admin (...shippingAdminResources() in src/genpm/admin.ts, permissions shipping:read|update).
  3. At checkout, store the country and the chosen rate on the cart: setCartMeta(cart.id, { country: 'ES', shippingRateId }); list options with ratesFor(totals, country) and show minDays–maxDays before payment.
  4. Tracking: trackingUrl(carrier, number) when marking an order shipped (@core/orders).
  5. Verify: a cart with country ES gets the cheapest Spanish rate; one over the free threshold pays 0.

What's inside

Paths are relative to src/lib/shipping.

  • index.ts — public API: upsertZone, upsertRate, ratesFor, zoneFor, trackingUrl, CARRIERS, shippingAdminResources.
  • shipping.ts — rules and the totals step. admin.ts — admin resources. schema.ts — tables.

At a glance

Security

GenPM installs a 40-character commit SHA (never a branch), verifies an Ed25519-signed manifest, never runs install scripts and scans AI rules for prompt injection. Details: genpm.net/docs/security.

License

MIT — see LICENSE. Browse the full catalog at genpm.net.

@core/shipping 신고

패키지를 신고하려면 GitHub로 로그인하세요.