@jarwizz/create-jarshop 0.1.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/generator.d.ts +11 -1
- package/dist/generator.js +45 -11
- package/dist/generator.js.map +1 -1
- package/dist/presets.d.ts +26 -0
- package/dist/presets.js +94 -0
- package/dist/presets.js.map +1 -0
- package/dist/template/CONTEXT.md +4 -2
- package/dist/template/README.md +255 -3
- package/dist/template/env.example.template +19 -0
- package/dist/template/gitignore.template +1 -0
- package/dist/template/jarshop.config.ts +31 -0
- package/dist/template/package.json +4 -0
- package/dist/template/pnpm-lock.yaml +3284 -1815
- package/dist/template/pnpm-workspace.yaml +6 -1
- package/dist/template/src/client/features.ts +41 -0
- package/dist/template/src/client/invoicing.ts +29 -0
- package/dist/template/src/dev-storefront-environment.test.ts +45 -0
- package/dist/template/src/dev-storefront-environment.ts +32 -0
- package/dist/template/src/dev-storefront.ts +3 -12
- package/dist/template/src/environment.d.ts +8 -0
- package/dist/template/src/invoice-email-recover.ts +59 -0
- package/dist/template/src/jarshop-config-loader.ts +118 -0
- package/dist/template/src/jarshop-config.test.ts +335 -0
- package/dist/template/src/jarshop-config.ts +439 -0
- package/dist/template/src/jarshop-features.test.ts +222 -0
- package/dist/template/src/jarshop-features.ts +112 -0
- package/dist/template/src/operation-codes.ts +34 -0
- package/dist/template/src/packeta-config.test.ts +95 -0
- package/dist/template/src/packeta-countries.test.ts +161 -0
- package/dist/template/src/packeta-countries.ts +120 -0
- package/dist/template/src/packeta-validation.test.ts +35 -0
- package/dist/template/src/packeta-validation.ts +52 -0
- package/dist/template/src/payment-return-url.test.ts +57 -0
- package/dist/template/src/payment-return-url.ts +34 -0
- package/dist/template/src/plugins/jarshop-checkout/confirmation-view.test.ts +79 -0
- package/dist/template/src/plugins/jarshop-checkout/confirmation.ts +51 -0
- package/dist/template/src/plugins/jarshop-checkout/dashboard/index.tsx +1 -0
- package/dist/template/src/plugins/jarshop-checkout/invoice-delivery.plugin.ts +79 -0
- package/dist/template/src/plugins/jarshop-checkout/invoice-email-events.ts +35 -0
- package/dist/template/src/plugins/jarshop-checkout/invoice-email-lifecycle.ts +235 -0
- package/dist/template/src/plugins/jarshop-checkout/invoice-email-worker.test.ts +426 -0
- package/dist/template/src/plugins/jarshop-checkout/invoice-email.test.ts +107 -0
- package/dist/template/src/plugins/jarshop-checkout/jarshop-checkout.plugin.ts +161 -57
- package/dist/template/src/plugins/jarshop-checkout/market-channels.test.ts +58 -0
- package/dist/template/src/plugins/jarshop-checkout/market-channels.ts +87 -0
- package/dist/template/src/plugins/jarshop-checkout/operation-code-check.ts +36 -0
- package/dist/template/src/plugins/jarshop-checkout/order-email-configuration.entity.ts +1 -1
- package/dist/template/src/plugins/jarshop-checkout/order-email-configuration.ts +1 -0
- package/dist/template/src/plugins/jarshop-checkout/order-email-delivery-core.ts +94 -1
- package/dist/template/src/plugins/jarshop-checkout/order-email-delivery.entity.ts +1 -0
- package/dist/template/src/plugins/jarshop-checkout/order-email-outbox.ts +83 -1
- package/dist/template/src/plugins/jarshop-checkout/order-email-worker.ts +136 -1
- package/dist/template/src/plugins/jarshop-checkout/shipping-tax.test.ts +109 -0
- package/dist/template/src/plugins/jarshop-checkout/shipping.test.ts +156 -0
- package/dist/template/src/plugins/jarshop-checkout/shipping.ts +75 -11
- package/dist/template/src/seed.ts +427 -184
- package/dist/template/src/vendure-config.ts +258 -113
- package/dist/template/storefront/README.md +7 -0
- package/dist/template/storefront/app/[locale]/[slug]/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/account/login/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/account/page.tsx +10 -4
- package/dist/template/storefront/app/[locale]/account/password-reset/callback/route.ts +4 -2
- package/dist/template/storefront/app/[locale]/account/password-reset/complete/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/account/password-reset/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/account/register/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/account/verify/complete/route.ts +4 -2
- package/dist/template/storefront/app/[locale]/account/verify/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/cart/page.tsx +3 -2
- package/dist/template/storefront/app/[locale]/checkout/actions.ts +43 -0
- package/dist/template/storefront/app/[locale]/checkout/checkout-form.tsx +188 -36
- package/dist/template/storefront/app/[locale]/checkout/confirmation/route.ts +2 -2
- package/dist/template/storefront/app/[locale]/checkout/packeta-chooser.tsx +96 -0
- package/dist/template/storefront/app/[locale]/checkout/page.tsx +60 -2
- package/dist/template/storefront/app/[locale]/checkout/payment-return/actions.ts +55 -0
- package/dist/template/storefront/app/[locale]/checkout/payment-return/page.tsx +32 -0
- package/dist/template/storefront/app/[locale]/checkout/payment-return/payment-return.tsx +84 -0
- package/dist/template/storefront/app/[locale]/checkout/success/page.tsx +32 -2
- package/dist/template/storefront/app/[locale]/layout.tsx +3 -2
- package/dist/template/storefront/app/[locale]/page.tsx +3 -2
- package/dist/template/storefront/app/globals.css +16 -0
- package/dist/template/storefront/app/layout.tsx +6 -2
- package/dist/template/storefront/lib/cart.ts +2 -4
- package/dist/template/storefront/lib/checkout-contract.test.ts +18 -1
- package/dist/template/storefront/lib/checkout-contract.ts +8 -0
- package/dist/template/storefront/lib/checkout-countries.test.ts +61 -0
- package/dist/template/storefront/lib/checkout-countries.ts +67 -0
- package/dist/template/storefront/lib/checkout.ts +22 -11
- package/dist/template/storefront/lib/commerce.ts +262 -2
- package/dist/template/storefront/lib/confirmation.test.ts +116 -0
- package/dist/template/storefront/lib/confirmation.ts +13 -7
- package/dist/template/storefront/lib/i18n.test.ts +32 -12
- package/dist/template/storefront/lib/i18n.ts +29 -8
- package/dist/template/storefront/lib/market-config.ts +40 -0
- package/dist/template/storefront/lib/market-routing.test.ts +107 -0
- package/dist/template/storefront/lib/market-routing.ts +57 -0
- package/dist/template/storefront/lib/market.ts +51 -0
- package/dist/template/storefront/lib/packeta-selection.test.ts +141 -0
- package/dist/template/storefront/lib/packeta-selection.ts +98 -0
- package/dist/template/storefront/lib/payment-return-actions.test.ts +61 -0
- package/dist/template/storefront/lib/payment-return-page.test.ts +30 -0
- package/dist/template/storefront/lib/payment-return-polling.test.ts +37 -0
- package/dist/template/storefront/lib/payment-return-polling.ts +58 -0
- package/dist/template/storefront/messages/en.json +13 -1
- package/dist/template/storefront/messages/sk.json +13 -1
- package/dist/template/storefront/package.json +2 -1
- package/dist/template/storefront/proxy.ts +35 -0
- package/dist/template/turbo.json +5 -1
- package/dist/template-manifest.json +1 -1
- package/dist/template.js +1 -0
- package/dist/template.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,21 +28,33 @@
|
|
|
28
28
|
"checkout.phone": "Telefón",
|
|
29
29
|
"checkout.terms": "Súhlasím s obchodnými podmienkami",
|
|
30
30
|
"checkout.shippingMethod": "Spôsob dopravy",
|
|
31
|
+
"checkout.paymentMethod": "Spôsob platby",
|
|
31
32
|
"checkout.pickup": "Osobný odber — zdarma",
|
|
32
33
|
"checkout.courier": "Kuriér — 4,90 EUR",
|
|
33
34
|
"checkout.street": "Ulica a číslo",
|
|
34
35
|
"checkout.city": "Mesto",
|
|
35
36
|
"checkout.postalCode": "PSČ",
|
|
36
37
|
"checkout.country": "Krajina",
|
|
37
|
-
"checkout.slovakia": "Slovensko",
|
|
38
38
|
"checkout.pickupSummary": "Osobný odber: 0 EUR. Platba: dobierka.",
|
|
39
39
|
"checkout.courierSummary": "Kuriér: 4,90 EUR. Platba: dobierka.",
|
|
40
|
+
"checkout.packetaSummary": "Packeta: vybrané výdajné miesto. Platba: dobierka.",
|
|
40
41
|
"checkout.submitPickup": "Objednať osobný odber na dobierku",
|
|
41
42
|
"checkout.submitCourier": "Objednať doručenie kuriérom na dobierku",
|
|
43
|
+
"checkout.submitPacketa": "Objednať Packetu na dobierku",
|
|
44
|
+
"checkout.acceptedPickupPoint": "Overené výdajné miesto",
|
|
45
|
+
"checkout.packetaConfigurationFailure": "Packeta je dočasne nedostupná.",
|
|
46
|
+
"checkout.packetaRetry": "Skúsiť znova",
|
|
42
47
|
"checkout.priceChanged": "Cena v košíku sa zmenila. Skontroluj aktualizované sumy a skús to znova.",
|
|
43
48
|
"checkout.insufficientStock": "Niektoré položky už nemajú požadované množstvo. Uprav košík a skús to znova.",
|
|
44
49
|
"success.title": "Objednávka odoslaná",
|
|
45
50
|
"success.orderCode": "Kód objednávky",
|
|
51
|
+
"success.shippingAddress": "Doručovacia adresa",
|
|
52
|
+
"paymentReturn.checking": "Overujeme tvoju platbu…",
|
|
53
|
+
"paymentReturn.paid": "Platba je potvrdená.",
|
|
54
|
+
"paymentReturn.failed": "Platba nebola dokončená.",
|
|
55
|
+
"paymentReturn.retry": "Vrátiť sa k objednávke",
|
|
56
|
+
"paymentReturn.pending": "Platbu ešte potvrdzujeme.",
|
|
57
|
+
"paymentReturn.unavailable": "Potvrdenie objednávky nie je dostupné.",
|
|
46
58
|
"account.title": "Môj účet",
|
|
47
59
|
"account.name": "Meno",
|
|
48
60
|
"account.email": "E-mail",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"test:storefront": "vitest run --config vitest.config.ts"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@jarwizz/commerce-sdk": "0.
|
|
22
|
+
"@jarwizz/commerce-sdk": "0.7.0",
|
|
23
|
+
"@jarwizz/feature-packeta": "0.2.0",
|
|
23
24
|
"@swc/helpers": "0.5.15",
|
|
24
25
|
"@valkey/valkey-glide": "2.5.1",
|
|
25
26
|
"next": "16.2.12",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from "next/server";
|
|
2
|
+
|
|
3
|
+
import { routeMarketRequest } from "./lib/market-routing";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Keeps every page on its market: an unknown production host and a path
|
|
7
|
+
* language the market does not serve never render a page of their own.
|
|
8
|
+
*/
|
|
9
|
+
export function proxy(request: NextRequest): NextResponse {
|
|
10
|
+
const host =
|
|
11
|
+
request.headers.get("x-forwarded-host") ?? request.headers.get("host");
|
|
12
|
+
const route = routeMarketRequest({
|
|
13
|
+
host,
|
|
14
|
+
pathname: request.nextUrl.pathname,
|
|
15
|
+
search: request.nextUrl.search,
|
|
16
|
+
});
|
|
17
|
+
if (route.kind === "serve") return NextResponse.next();
|
|
18
|
+
if (route.kind === "not-found") {
|
|
19
|
+
return new NextResponse("Not Found", { status: 404 });
|
|
20
|
+
}
|
|
21
|
+
// Redirect on the host the shopper used, which also chose the market, and
|
|
22
|
+
// not on the address the storefront listens on behind a proxy.
|
|
23
|
+
const protocol =
|
|
24
|
+
request.headers.get("x-forwarded-proto")?.split(",")[0]?.trim() ||
|
|
25
|
+
request.nextUrl.protocol.replace(/:$/u, "");
|
|
26
|
+
const origin = host
|
|
27
|
+
? `${protocol}://${host.split(",")[0]!.trim()}`
|
|
28
|
+
: request.nextUrl.origin;
|
|
29
|
+
return NextResponse.redirect(new URL(route.location, origin), 307);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const config = {
|
|
33
|
+
// Next's own assets and files with an extension are not market pages.
|
|
34
|
+
matcher: ["/((?!_next/|.*\\..*).*)"],
|
|
35
|
+
};
|
package/dist/template/turbo.json
CHANGED
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"typecheck:storefront": {},
|
|
10
10
|
"test:vendure": {},
|
|
11
11
|
"test:storefront": {},
|
|
12
|
-
"dev:server": {
|
|
12
|
+
"dev:server": {
|
|
13
|
+
"cache": false,
|
|
14
|
+
"persistent": true,
|
|
15
|
+
"passThroughEnv": ["JARSHOP_FAKE_PACKETA_VALIDATION"]
|
|
16
|
+
},
|
|
13
17
|
"dev:worker": { "cache": false, "persistent": true },
|
|
14
18
|
"dev:dashboard": { "cache": false, "persistent": true },
|
|
15
19
|
"dev:storefront": { "cache": false, "persistent": true }
|
package/dist/template.js
CHANGED
package/dist/template.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,MAAM;IACN,cAAc;IACd,aAAa;IACb,gBAAgB;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,MAAM;IACN,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,IAAY;IACpD,OAAO,CAAC,IAAI;SACT,KAAK,CAAC,QAAQ,CAAC;SACf,IAAI,CACH,CAAC,OAAO,EAAE,EAAE,CACV,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAChE,CAAC;AACN,CAAC;AAOD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY;IAClD,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,KAAK,UAAU,IAAI,CAAC,OAAe,EAAE,MAAc;QACjD,MAAM,OAAO,GAAG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