@seamlet/astro 2.2.1 → 2.2.2
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/CHANGELOG.md +7 -3
- package/README.md +8 -8
- package/dist/feeds.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/schema.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
- The examples of the README, the comments and the tests name no real site: `my-site`, «Моя кофейня», `example.ru`. A CMS a feature needs is named by the version of the description it reads. Nothing behaves differently.
|
|
6
|
+
|
|
3
7
|
## 2.2.1
|
|
4
8
|
|
|
5
9
|
- The Russian texts a visitor and the owner read are edited to the copy rules of `.claude/skills/russian-copy`; nothing behaves differently. `RequestForm.astro` says «Заявка отправлена. Ответим по контактам, которые вы оставили.» once a request is sent and «Заявка не ушла. Всё, что вы ввели, осталось в форме — отправьте ещё раз через минуту.» when it is not; the hidden trap field reads «Оставьте это поле пустым». `REQUEST_ISSUE_TEXTS`: «Слишком длинный текст — сократите его», «Проверьте почту: нужен адрес вида name@mail.ru», «Выберите вариант из списка». The labels of the presets: `note` of `openingHoursField()` is «Примечание», `summary` of `productFields()` «Строка для карточки», `image` of `seoFields()` «Картинка для ссылки в соцсетях». `privacyPolicyTextOf` fixes two sentences of section 5 that did not agree in grammar; its legal meaning is the same.
|
|
@@ -29,7 +33,7 @@ A site with a form adds the page `/consent` (or passes `consentHref`).
|
|
|
29
33
|
|
|
30
34
|
- Documents: `file({ label })` holds a PDF the owner uploads in the CMS, `{ src, name }` (`FileValue`): a price list, a menu, a contract. An empty name of a file asks for its file (`missing-file-src`). A static build copies the uploaded documents its pages link to, as it copies the photos, and the route of uploads serves them on request; `isUploadedFile` names both.
|
|
31
35
|
|
|
32
|
-
A site with a file field needs a CMS that reads 1.4
|
|
36
|
+
A site with a file field needs a CMS that reads 1.4. Code with an exhaustive `switch` over `FieldKind` or over the issues of `parseContent` gets the new member to handle.
|
|
33
37
|
|
|
34
38
|
## 1.3.0
|
|
35
39
|
|
|
@@ -37,7 +41,7 @@ A site with a file field needs a CMS that reads 1.4 (cms.seamlet.ru from its rel
|
|
|
37
41
|
- `readRequestEntries(body)` reads a request's body into its words, and `readRequestValues(form, entries)` checks a request the same way in the browser and in the CMS, with issues by field (`required`, `too-long`, `invalid-phone`, `invalid-email`, `unknown-option`) and their texts (`REQUEST_ISSUE_TEXTS`).
|
|
38
42
|
- The events `seamlet:request-send` (cancelable), `seamlet:request-sent` and `seamlet:request-failed` on the form let the site's code send a request its own way or follow it.
|
|
39
43
|
|
|
40
|
-
A site with forms needs a CMS that reads descriptions of 1.3
|
|
44
|
+
A site with forms needs a CMS that reads descriptions of 1.3. Code with an exhaustive `switch` over `SiteDescriptionProblem` gets its new members to handle.
|
|
41
45
|
|
|
42
46
|
## 1.2.1
|
|
43
47
|
|
|
@@ -55,7 +59,7 @@ A site with forms needs a CMS that reads descriptions of 1.3 (cms.seamlet.ru fro
|
|
|
55
59
|
- `site.pageOf(rest, content)` and `site.staticPaths(content)` render every page of a site from one `[...page]` route, the pages of records too. `site.pageAt` renders the site's own pages only, and is deprecated.
|
|
56
60
|
- The preview answers an address of no page at once, without asking the CMS or reading the draft.
|
|
57
61
|
|
|
58
|
-
A site with a `slug` or pages of records needs a CMS that reads descriptions of 1.1
|
|
62
|
+
A site with a `slug` or pages of records needs a CMS that reads descriptions of 1.1: an older one refuses the kind `slug`. Code with an exhaustive `switch` over `Field`, `ContentIssue`, `SchemaProblemReason` or `SiteDescriptionProblem` gets their new members to handle.
|
|
59
63
|
|
|
60
64
|
## 1.0.0
|
|
61
65
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Connects an [Astro](https://astro.build) site to the Seamlet CMS ([source](https
|
|
|
7
7
|
The quick way, in an Astro project:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx @seamlet/astro init --title "
|
|
10
|
+
npx @seamlet/astro init --title "Моя кофейня" # seamlet.json, src/schema.ts, src/seamlet.ts, a first page component
|
|
11
11
|
npx astro add @seamlet/astro node # the integration, and an adapter for the preview
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -23,8 +23,8 @@ npx astro add @seamlet/astro node # the integration, and an ad
|
|
|
23
23
|
|
|
24
24
|
```json
|
|
25
25
|
{
|
|
26
|
-
"id": "
|
|
27
|
-
"title": "
|
|
26
|
+
"id": "cafe",
|
|
27
|
+
"title": "Моя кофейня",
|
|
28
28
|
"cms": "https://cms.seamlet.ru"
|
|
29
29
|
}
|
|
30
30
|
```
|
|
@@ -297,7 +297,7 @@ A reference to a record removed since is kept, with the issue `missing-record`:
|
|
|
297
297
|
|
|
298
298
|
## Pages of records
|
|
299
299
|
|
|
300
|
-
A collection can have a page for each of its records: a product, a dish, an article. The site writes one component, and the owner who adds a record in the CMS gets its page, which the CMS's editor opens and edits like any other page (a CMS that reads descriptions of version 1.1
|
|
300
|
+
A collection can have a page for each of its records: a product, a dish, an article. The site writes one component, and the owner who adds a record in the CMS gets its page, which the CMS's editor opens and edits like any other page (a CMS that reads descriptions of version 1.1). `recordPages` names the collection and the address of its pages, `[record]` standing for the record:
|
|
301
301
|
|
|
302
302
|
```ts
|
|
303
303
|
// src/schema.ts
|
|
@@ -469,14 +469,14 @@ import { productPages } from "../../schema";
|
|
|
469
469
|
export async function GET() {
|
|
470
470
|
const content = await site.loadPublishedContent();
|
|
471
471
|
const offers = productOffersOf(content.products, {
|
|
472
|
-
siteUrl: "https://
|
|
472
|
+
siteUrl: "https://example.ru",
|
|
473
473
|
pathOf: productPages.pathOf,
|
|
474
474
|
});
|
|
475
475
|
const feed = yandexFeedOf(
|
|
476
476
|
{
|
|
477
|
-
name: "
|
|
478
|
-
company: "ООО
|
|
479
|
-
url: "https://
|
|
477
|
+
name: "Ромашка",
|
|
478
|
+
company: "ООО «Ромашка»",
|
|
479
|
+
url: "https://example.ru",
|
|
480
480
|
},
|
|
481
481
|
offers,
|
|
482
482
|
new Date(),
|
package/dist/feeds.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface FeedOffer {
|
|
|
17
17
|
}
|
|
18
18
|
type ProductRecord = RecordOf<ReturnType<typeof productFields>>;
|
|
19
19
|
interface ProductOffersOptions {
|
|
20
|
-
/** The site's address: `https://
|
|
20
|
+
/** The site's address: `https://example.ru`. */
|
|
21
21
|
readonly siteUrl: string;
|
|
22
22
|
/** The page of a product (`recordPages(...).pathOf`), or none: the catalog's page is used. */
|
|
23
23
|
readonly pathOf?: (product: ProductRecord) => string | undefined;
|
|
@@ -38,9 +38,9 @@ interface AvitoSeller {
|
|
|
38
38
|
declare function avitoFeedOf(seller: AvitoSeller, offers: readonly FeedOffer[], fieldsOf?: (offer: FeedOffer) => Readonly<Record<string, string>>): string;
|
|
39
39
|
|
|
40
40
|
interface YandexShop {
|
|
41
|
-
/** The short name buyers know:
|
|
41
|
+
/** The short name buyers know: «Ромашка». */
|
|
42
42
|
readonly name: string;
|
|
43
|
-
/** The company's full name: «ООО
|
|
43
|
+
/** The company's full name: «ООО «Ромашка»». */
|
|
44
44
|
readonly company: string;
|
|
45
45
|
/** The site's address. */
|
|
46
46
|
readonly url: string;
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,7 @@ import { readFile as readFile2 } from "fs/promises";
|
|
|
98
98
|
import { fileURLToPath } from "url";
|
|
99
99
|
var FIELD_RULES = {
|
|
100
100
|
id: "the site's id in the CMS: lower-case letters, digits and single hyphens, such as coffee-shop",
|
|
101
|
-
title: "how the CMS names the site, such as \xAB\
|
|
101
|
+
title: "how the CMS names the site, such as \xAB\u041C\u043E\u044F \u043A\u043E\u0444\u0435\u0439\u043D\u044F\xBB",
|
|
102
102
|
cms: "the address of the CMS, such as https://cms.seamlet.ru"
|
|
103
103
|
};
|
|
104
104
|
async function loadSiteConfig(root, cmsOverride) {
|
package/dist/schema.d.ts
CHANGED
|
@@ -129,7 +129,7 @@ declare const SITE_CONFIG_FILE = "seamlet.json";
|
|
|
129
129
|
interface SiteConfig {
|
|
130
130
|
/** The site's id in the CMS: its address there (`/sites/<id>`) and the name of its content. */
|
|
131
131
|
readonly id: string;
|
|
132
|
-
/** How the CMS names the site:
|
|
132
|
+
/** How the CMS names the site: «Моя кофейня». */
|
|
133
133
|
readonly title: string;
|
|
134
134
|
/** The origin of the CMS the site belongs to: `https://cms.seamlet.ru`. */
|
|
135
135
|
readonly cms: string;
|
|
@@ -221,7 +221,7 @@ declare function requestsPathOf(siteId: string): string;
|
|
|
221
221
|
|
|
222
222
|
/** The business that collects the data: as its documents name it. */
|
|
223
223
|
interface PolicyOperator {
|
|
224
|
-
/** «ООО
|
|
224
|
+
/** «ООО «Ромашка»» or «ИП Иванов Иван Иванович». */
|
|
225
225
|
readonly name: string;
|
|
226
226
|
readonly inn: string;
|
|
227
227
|
readonly address: string;
|
package/package.json
CHANGED