orionplace-react 0.5.0 → 0.6.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 +10 -1
- package/bin/orionplace-react.mjs +7 -0
- package/package.json +1 -1
- package/runtime/marketplace.d.mts +97 -0
- package/runtime/marketplace.mjs +519 -3
- package/src/project-readme.mjs +23 -2
- package/src/setup.mjs +1 -0
- package/src/sitemap.mjs +93 -0
- package/templates/app/_storefront/CategoryPage.tsx +6 -2
- package/templates/app/_storefront/SearchPage.tsx +7 -2
- package/templates/app/_storefront/SellersPage.tsx +9 -3
- package/templates/app/_storefront/storefrontRoutes.tsx +31 -10
- package/templates/app/_storefront/useProductSearch.ts +97 -26
- package/templates/app/robots.txt/route.ts +11 -0
- package/templates/app/sitemap.xml/route.ts +12 -0
- package/templates/components/orionplace/account/ProfileDetailsForm.README.md +4 -0
- package/templates/components/orionplace/account/ProfileDetailsForm.tsx +7 -2
- package/templates/components/orionplace/cart/CartCheckoutDetails.README.md +4 -0
- package/templates/components/orionplace/cart/CartCheckoutDetails.tsx +20 -9
- package/templates/interfaces/orionplace/accounts/IProfileData.ts +2 -0
- package/templates/interfaces/orionplace/appBase/IApploadUserProfile.ts +2 -0
- package/templates/lib/orionplace/cartLabels.ts +2 -0
- package/templates/lib/orionplace/pageMetadata.ts +24 -4
- package/templates/lib/orionplace/pageSeo.ts +68 -0
- package/templates/lib/orionplace/productListLocation.ts +130 -0
- package/templates/lib/orionplace/productSearch.ts +48 -0
- package/templates/lib/orionplace/profile.ts +12 -0
- package/templates/lib/orionplace/profileLabels.ts +2 -0
- package/templates/lib/orionplace/serverMetadata.ts +7 -0
- package/templates/proxy.ts +8 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ account, journal and support, in English and Russian. The package includes a
|
|
|
8
8
|
setup CLI and the full storefront source, so every page and component in your
|
|
9
9
|
project is yours to change.
|
|
10
10
|
|
|
11
|
-
- **Setup CLI:** `init`, `set backend`, `add frontend`, `set mimic` and `update`.
|
|
11
|
+
- **Setup CLI:** `init`, `set backend`, `add frontend`, `set mimic`, `sitemap rebuild` and `update`.
|
|
12
12
|
- **Server install:** `install` builds the storefront on your Linux server and
|
|
13
13
|
runs it as a system service behind nginx with HTTPS.
|
|
14
14
|
- **API gateway:** the browser calls `/api/...` on your own domain; the server
|
|
@@ -318,6 +318,8 @@ npx orionplace-react add frontend shop.example.com
|
|
|
318
318
|
npx orionplace-react add frontend www.shop.example.com
|
|
319
319
|
npx orionplace-react remove frontend www.shop.example.com
|
|
320
320
|
npx orionplace-react set mimic shop.example.com
|
|
321
|
+
npx orionplace-react sitemap rebuild [shop.example.com]
|
|
322
|
+
npx orionplace-react sitemap status
|
|
321
323
|
sudo npx orionplace-react install
|
|
322
324
|
npx orionplace-react status
|
|
323
325
|
sudo npx orionplace-react restart
|
|
@@ -334,8 +336,15 @@ npm run orionplace:remove-frontend -- www.shop.example.com
|
|
|
334
336
|
npm run orionplace:mimic -- shop.example.com
|
|
335
337
|
npm run orionplace:help
|
|
336
338
|
npm run orionplace:update
|
|
339
|
+
npm run orionplace:sitemap
|
|
337
340
|
```
|
|
338
341
|
|
|
342
|
+
The storefront serves `/robots.txt` and `/sitemap.xml` (public pages, categories,
|
|
343
|
+
products and journal publications in every language). The sitemap is rebuilt
|
|
344
|
+
from the backend once an hour; `npm run orionplace:sitemap` rebuilds it at once,
|
|
345
|
+
for example after new publications, and the running storefront serves it without
|
|
346
|
+
a restart.
|
|
347
|
+
|
|
339
348
|
`npm set` belongs to npm's own configuration system; use the commands above.
|
|
340
349
|
The setup commands configure local integration files. They do not provision a
|
|
341
350
|
backend, change your account or create DNS records. `install` deploys the
|
package/bin/orionplace-react.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { setupProject } from '../src/setup.mjs';
|
|
|
3
3
|
import { updateProject } from '../src/update.mjs';
|
|
4
4
|
import { installService } from '../src/install.mjs';
|
|
5
5
|
import { SERVICE_ACTIONS, SERVICE_ALIASES, controlService, findApp, printService } from '../src/service.mjs';
|
|
6
|
+
import { sitemapCommand } from '../src/sitemap.mjs';
|
|
6
7
|
import { readFile } from 'node:fs/promises';
|
|
7
8
|
import { resolve } from 'node:path';
|
|
8
9
|
import { createInterface } from 'node:readline/promises';
|
|
@@ -30,6 +31,9 @@ Commands for an existing project (run from its root):
|
|
|
30
31
|
npx orionplace-react remove frontend <shop.example.com>
|
|
31
32
|
npx orionplace-react set mimic <existing-frontend.example.com>
|
|
32
33
|
npx orionplace-react set frontend <shop.example.com>
|
|
34
|
+
npx orionplace-react sitemap rebuild [domain] rebuild /sitemap.xml now (every frontend, or one);
|
|
35
|
+
the running storefront serves it at once
|
|
36
|
+
npx orionplace-react sitemap status [domain] when each sitemap was built
|
|
33
37
|
|
|
34
38
|
On your Linux server (run from the project root):
|
|
35
39
|
sudo npx orionplace-react install
|
|
@@ -131,6 +135,9 @@ try {
|
|
|
131
135
|
}
|
|
132
136
|
const done = await controlService({ action: command, cwd, name: install.name, lines: positional[1] ?? 100, follow, dryRun });
|
|
133
137
|
process.exitCode = printService(done);
|
|
138
|
+
} else if (command === 'sitemap' && positional.length <= 3) {
|
|
139
|
+
if (dryRun) throw new Error('--dry-run is not a sitemap option; sitemap status shows the state without changes.');
|
|
140
|
+
process.exitCode = await sitemapCommand({ cwd, action: target, domain: positional[2] });
|
|
134
141
|
} else if (command === 'init' && positional.length <= 2) {
|
|
135
142
|
result = await setupProject({ cwd: target ? resolve(cwd, target) : cwd, dryRun });
|
|
136
143
|
} else if (command === 'update' && positional.length === 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orionplace-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Next.js 16 storefront for your Orionplace marketplace: setup CLI, server API gateway, typed store and ready-made catalog, cart, checkout and account components in English and Russian, plus an Android app build.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,3 +25,100 @@ export declare function forwardMarketplace(
|
|
|
25
25
|
request: Request,
|
|
26
26
|
configuration?: MarketplaceConfiguration,
|
|
27
27
|
): Promise<Response>;
|
|
28
|
+
|
|
29
|
+
export interface MarketplaceSitemapPage {
|
|
30
|
+
path: string;
|
|
31
|
+
lastmod?: string | null;
|
|
32
|
+
locales?: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare function marketplacePublicOrigin(
|
|
36
|
+
request: Request,
|
|
37
|
+
tenantDomain?: string,
|
|
38
|
+
): string;
|
|
39
|
+
|
|
40
|
+
export declare function noindexPathPrefixes(value?: string): string[];
|
|
41
|
+
|
|
42
|
+
export declare function marketplaceNoindexPath(
|
|
43
|
+
pathname: string,
|
|
44
|
+
value?: string,
|
|
45
|
+
): boolean;
|
|
46
|
+
|
|
47
|
+
export declare function sitemapIndexedPages(
|
|
48
|
+
pages: MarketplaceSitemapPage[],
|
|
49
|
+
value?: string,
|
|
50
|
+
): MarketplaceSitemapPage[];
|
|
51
|
+
|
|
52
|
+
export declare function marketplaceRobots(origin: string): string;
|
|
53
|
+
|
|
54
|
+
export declare function marketplaceRobotsResponse(
|
|
55
|
+
request: Request,
|
|
56
|
+
configuration?: MarketplaceConfiguration,
|
|
57
|
+
): Promise<Response>;
|
|
58
|
+
|
|
59
|
+
export declare function sitemapLocales(locales: unknown): string[];
|
|
60
|
+
|
|
61
|
+
export declare function sitemapLastmod(
|
|
62
|
+
value: unknown,
|
|
63
|
+
now?: number,
|
|
64
|
+
): string | null;
|
|
65
|
+
|
|
66
|
+
export declare function sitemapApiPath(
|
|
67
|
+
paths: unknown,
|
|
68
|
+
name: string,
|
|
69
|
+
): string | null;
|
|
70
|
+
|
|
71
|
+
export declare function sitemapCategoryIds(categories: unknown): number[];
|
|
72
|
+
|
|
73
|
+
export declare function marketplaceSitemapXml(
|
|
74
|
+
origin: string,
|
|
75
|
+
pages: MarketplaceSitemapPage[],
|
|
76
|
+
locales: string[],
|
|
77
|
+
): string;
|
|
78
|
+
|
|
79
|
+
export declare function marketplaceSitemapResponse(
|
|
80
|
+
request: Request,
|
|
81
|
+
configuration?: MarketplaceConfiguration,
|
|
82
|
+
): Promise<Response>;
|
|
83
|
+
|
|
84
|
+
export interface MarketplaceSitemap {
|
|
85
|
+
version: number;
|
|
86
|
+
domain: string;
|
|
87
|
+
built: string;
|
|
88
|
+
locales: string[];
|
|
89
|
+
pages: MarketplaceSitemapPage[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface MarketplaceSitemapRebuild {
|
|
93
|
+
domain: string;
|
|
94
|
+
path: string;
|
|
95
|
+
built: string;
|
|
96
|
+
urls: number;
|
|
97
|
+
pages: number;
|
|
98
|
+
publications: number;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export declare const SITEMAP_LIFETIME: number;
|
|
102
|
+
|
|
103
|
+
export declare function readMarketplaceDomain(
|
|
104
|
+
domain: string,
|
|
105
|
+
options?: { root?: string },
|
|
106
|
+
): Promise<MarketplaceTenant>;
|
|
107
|
+
|
|
108
|
+
export declare function marketplaceConfigDirectory(root?: string): string;
|
|
109
|
+
|
|
110
|
+
export declare function marketplaceDomains(root?: string): Promise<string[]>;
|
|
111
|
+
|
|
112
|
+
export declare function sitemapCacheDirectory(root?: string): string;
|
|
113
|
+
|
|
114
|
+
export declare function readSitemapCache(
|
|
115
|
+
domain: string,
|
|
116
|
+
root?: string,
|
|
117
|
+
): Promise<MarketplaceSitemap | null>;
|
|
118
|
+
|
|
119
|
+
export declare function sitemapUrlCount(sitemap: MarketplaceSitemap): number;
|
|
120
|
+
|
|
121
|
+
export declare function rebuildMarketplaceSitemap(
|
|
122
|
+
domain: string,
|
|
123
|
+
options?: { root?: string },
|
|
124
|
+
): Promise<MarketplaceSitemapRebuild>;
|