@paroicms/site-generator-plugin 0.25.1 → 0.26.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/backend/ddl/site-generator.ddl.sql +1 -1
- package/backend/dist/db/db-init.js +1 -1
- package/backend/dist/db/ddl-migration.js +12 -2
- package/backend/dist/generator/site-generator/site-generator.js +1 -0
- package/backend/dist/generator/site-schema-generator/create-site-schema.js +2 -1
- package/backend/dist/lib/create-raw-context.js +2 -2
- package/backend/prompts/initial-2-fields.md +9 -9
- package/backend/prompts/predefined-fields.json +18 -18
- package/package.json +5 -5
|
@@ -8,7 +8,7 @@ create table PaMetadata (
|
|
|
8
8
|
primary key (dbSchema, k)
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
insert into PaMetadata (dbSchema, k, val) values ('site-generator', 'dbSchemaVersion', '
|
|
11
|
+
insert into PaMetadata (dbSchema, k, val) values ('site-generator', 'dbSchemaVersion', '3');
|
|
12
12
|
|
|
13
13
|
create table PgSession (
|
|
14
14
|
id varchar(100) not null primary key,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import { createOrOpenSqliteConnection, createSqlLogger, getMetadataDbSchemaVersion, } from "@paroicms/internal-server-lib";
|
|
2
|
+
import { join } from "node:path";
|
|
3
3
|
import { projectDir } from "../context.js";
|
|
4
4
|
import { currentDbSchemaVersion, dbSchemaName, migrateSiteGeneratorDb } from "./ddl-migration.js";
|
|
5
5
|
export async function createOrOpenSiteGeneratorConnection({ sqliteFile, canCreate, logger, }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { executeDdl } from "@paroicms/internal-server-lib";
|
|
1
|
+
import { executeDdl, generateDatabaseId, setMetadataDbSchemaVersion, setMetadataValue, } from "@paroicms/internal-server-lib";
|
|
2
2
|
export const dbSchemaName = "site-generator";
|
|
3
|
-
export const currentDbSchemaVersion =
|
|
3
|
+
export const currentDbSchemaVersion = 3;
|
|
4
4
|
export async function migrateSiteGeneratorDb(cn, { fromVersion, logger, ddlFile }) {
|
|
5
5
|
const toVersion = currentDbSchemaVersion;
|
|
6
6
|
let currentVersion = fromVersion;
|
|
@@ -10,6 +10,16 @@ export async function migrateSiteGeneratorDb(cn, { fromVersion, logger, ddlFile
|
|
|
10
10
|
await executeDdl(cn, ddlFile);
|
|
11
11
|
currentVersion = currentDbSchemaVersion;
|
|
12
12
|
}
|
|
13
|
+
if (currentVersion === 2) {
|
|
14
|
+
const databaseId = generateDatabaseId();
|
|
15
|
+
await setMetadataValue(cn, {
|
|
16
|
+
dbSchemaName,
|
|
17
|
+
key: "databaseId",
|
|
18
|
+
value: databaseId,
|
|
19
|
+
});
|
|
20
|
+
await setMetadataDbSchemaVersion(cn, { dbSchemaName, value: 3 });
|
|
21
|
+
currentVersion = 3;
|
|
22
|
+
}
|
|
13
23
|
if (currentVersion !== toVersion) {
|
|
14
24
|
throw new Error(`version of ${dbSchemaName} database should be '${toVersion}', but is '${currentVersion}'`);
|
|
15
25
|
}
|
|
@@ -79,6 +79,7 @@ function getPackageJsonContent(options) {
|
|
|
79
79
|
"@paroicms/contact-form-plugin": "*",
|
|
80
80
|
"@paroicms/content-loading-plugin": "*",
|
|
81
81
|
"@paroicms/internal-link-plugin": "*",
|
|
82
|
+
"@paroicms/list-field-plugin": "*",
|
|
82
83
|
"@paroicms/public-menu-plugin": "*",
|
|
83
84
|
"@paroicms/quill-editor-plugin": "*",
|
|
84
85
|
"@paroicms/video-plugin": "*",
|
|
@@ -2,12 +2,13 @@ import { generateSlug } from "@paroicms/public-anywhere-lib";
|
|
|
2
2
|
export function createSiteSchemaFromAnalysis(analysis) {
|
|
3
3
|
const { siteProperties } = analysis;
|
|
4
4
|
const siteSchema = {
|
|
5
|
-
ParoiCMSSiteSchemaFormatVersion: "
|
|
5
|
+
ParoiCMSSiteSchemaFormatVersion: "10",
|
|
6
6
|
languages: [siteProperties.language],
|
|
7
7
|
plugins: [
|
|
8
8
|
"@paroicms/contact-form-plugin",
|
|
9
9
|
"@paroicms/content-loading-plugin",
|
|
10
10
|
"@paroicms/internal-link-plugin",
|
|
11
|
+
"@paroicms/list-field-plugin",
|
|
11
12
|
"@paroicms/public-menu-plugin",
|
|
12
13
|
"@paroicms/quill-editor-plugin",
|
|
13
14
|
"@paroicms/video-plugin",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import Anthropic from "@anthropic-ai/sdk";
|
|
3
2
|
import { Mistral } from "@mistralai/mistralai";
|
|
4
3
|
import { readOrCreateJwtSecretSync } from "@paroicms/internal-server-lib";
|
|
4
|
+
import { join } from "node:path";
|
|
5
5
|
export function createRawContext(service, options) {
|
|
6
6
|
const { cn, logNextQuery, pluginConf, debugDir } = options;
|
|
7
7
|
const packConf = service.connector.getSitePackConf(pluginConf.packName);
|
|
@@ -26,6 +26,6 @@ export function createRawContext(service, options) {
|
|
|
26
26
|
apiKey: pluginConf.mistralApiKey,
|
|
27
27
|
}),
|
|
28
28
|
mistralModelName: "ministral-8b-2410",
|
|
29
|
-
anthropicModelName: "claude-sonnet-4-
|
|
29
|
+
anthropicModelName: "claude-sonnet-4-5-20250929",
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -30,23 +30,23 @@ Guidelines for creating the dictionnary YAML:
|
|
|
30
30
|
- Documents and parts already contains a _publish date_ and a _draft_ flag.
|
|
31
31
|
- A document already contains a _title_ and a _featured image_, but a part doesn't. That's why the predefined `title` field can be used on part types when needed.
|
|
32
32
|
- Default values:
|
|
33
|
-
- By default, for most of node types, if you are not sure about what could be the best fields, then remember that a document is a webpage and just use a `[htmlContent]`.
|
|
34
|
-
- Except if there are specific instructions in the website description, here is the default value for the `_site` node type: `["logo", "footerMention"]`.
|
|
33
|
+
- By default, for most of node types, if you are not sure about what could be the best fields, then remember that a document is a webpage and just use a `[htmlContent[@paroicms/quill-editor-plugin]]`.
|
|
34
|
+
- Except if there are specific instructions in the website description, here is the default value for the `_site` node type: `["logo", "footerMention[@paroicms/quill-editor-plugin]"]`.
|
|
35
35
|
- Gallery of medias: there is a predefined field named `"gallery"`. It contains a list of medias. The theme can render it as a carousel, a slider, an image gallery, a slideshow, etc.
|
|
36
36
|
- This task is about predefined fields only. Custom fields will be added in a further step.
|
|
37
37
|
|
|
38
38
|
Here is an example of expected output:
|
|
39
39
|
|
|
40
40
|
<correct_example>
|
|
41
|
-
_site: [logo, footerMention]
|
|
42
|
-
home: [htmlContent]
|
|
41
|
+
_site: [logo, "footerMention[@paroicms/quill-editor-plugin]"]
|
|
42
|
+
home: ["htmlContent[@paroicms/quill-editor-plugin]"]
|
|
43
43
|
searchPage: []
|
|
44
|
-
contactPage: ["introduction"]
|
|
45
|
-
regularDocumentExemple1: [gallery, htmlContent]
|
|
46
|
-
partExemple2: [title, image, htmlContent]
|
|
47
|
-
aBlogPostExample: [leadParagraph, htmlContent]
|
|
44
|
+
contactPage: ["introduction[@paroicms/quill-editor-plugin]"]
|
|
45
|
+
regularDocumentExemple1: [gallery, "htmlContent[@paroicms/quill-editor-plugin]"]
|
|
46
|
+
partExemple2: [title, image, "htmlContent[@paroicms/quill-editor-plugin]"]
|
|
47
|
+
aBlogPostExample: ["leadParagraph[@paroicms/quill-editor-plugin]", "htmlContent[@paroicms/quill-editor-plugin]"]
|
|
48
48
|
</correct_example>
|
|
49
49
|
|
|
50
50
|
Provide the YAML result within <yaml_result> tags. Do not write any explanation or commentary outside the tags.
|
|
51
51
|
|
|
52
|
-
Additionally, write within <unused_information_md> tags the information from the user instructions that you weren't able to use here, in the form of a short prompt, in markdown format. Do not invent anything. Do not imagine anything. If there is no remaining information, then let this tag empty.
|
|
52
|
+
Additionally, write within <unused_information_md> tags the information from the user instructions that you weren't able to use here, in the form of a short prompt, in markdown format. Do not invent anything. Do not imagine anything. If there is no remaining information, then let this tag empty.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"
|
|
3
|
+
"qualifiedFieldName": "leadParagraph[@paroicms/quill-editor-plugin]",
|
|
4
4
|
"localized": true,
|
|
5
5
|
"dataType": "json",
|
|
6
6
|
"renderAs": "html",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"description": "Lead paragraph, or \"chapo\", of a post (HTML)"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"
|
|
11
|
+
"qualifiedFieldName": "htmlContent[@paroicms/quill-editor-plugin]",
|
|
12
12
|
"localized": true,
|
|
13
13
|
"dataType": "json",
|
|
14
14
|
"renderAs": "html",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"description": "HTML Content"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"
|
|
19
|
+
"qualifiedFieldName": "introduction[@paroicms/quill-editor-plugin]",
|
|
20
20
|
"localized": true,
|
|
21
21
|
"dataType": "json",
|
|
22
22
|
"renderAs": "html",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"description": "A short introduction (HTML)"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
"
|
|
27
|
+
"qualifiedFieldName": "footerMention[@paroicms/quill-editor-plugin]",
|
|
28
28
|
"dataType": "json",
|
|
29
29
|
"renderAs": "html",
|
|
30
30
|
"normalizeTypography": true,
|
|
@@ -32,88 +32,88 @@
|
|
|
32
32
|
"description": "The footer mention is used to display a legal notice or a disclaimer (HTML). Usually included as a site field."
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
"
|
|
35
|
+
"qualifiedFieldName": "logo",
|
|
36
36
|
"localized": false,
|
|
37
37
|
"dataType": "media",
|
|
38
38
|
"description": "A logo is an image that represents a brand"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
"
|
|
41
|
+
"qualifiedFieldName": "slogan",
|
|
42
42
|
"localized": true,
|
|
43
43
|
"dataType": "string",
|
|
44
44
|
"normalizeTypography": true,
|
|
45
45
|
"description": "A slogan is a memorable motto or phrase as a repetitive expression of an idea or purpose"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"
|
|
48
|
+
"qualifiedFieldName": "phone",
|
|
49
49
|
"localized": false,
|
|
50
50
|
"dataType": "string",
|
|
51
51
|
"description": "Phone number"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
"
|
|
54
|
+
"qualifiedFieldName": "phone2",
|
|
55
55
|
"localized": false,
|
|
56
56
|
"dataType": "string",
|
|
57
57
|
"description": "Secondary phone number"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
"
|
|
60
|
+
"qualifiedFieldName": "title",
|
|
61
61
|
"localized": true,
|
|
62
62
|
"dataType": "string",
|
|
63
63
|
"normalizeTypography": true,
|
|
64
64
|
"description": "Store a title"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
"
|
|
67
|
+
"qualifiedFieldName": "buttonLabel",
|
|
68
68
|
"localized": true,
|
|
69
69
|
"dataType": "string",
|
|
70
70
|
"normalizeTypography": true,
|
|
71
71
|
"description": "This short label can be used in the theme for buttons or menu items"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
"
|
|
74
|
+
"qualifiedFieldName": "gallery",
|
|
75
75
|
"localized": false,
|
|
76
76
|
"dataType": "gallery",
|
|
77
77
|
"description": "A collection of medias. It can be rendered as a carousel, a slider, a slideshow, an image gallery etc."
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
|
-
"
|
|
80
|
+
"qualifiedFieldName": "image",
|
|
81
81
|
"localized": false,
|
|
82
82
|
"dataType": "media",
|
|
83
83
|
"description": "An image"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
"
|
|
86
|
+
"qualifiedFieldName": "backgroundImage",
|
|
87
87
|
"localized": false,
|
|
88
88
|
"dataType": "media",
|
|
89
89
|
"description": "A background image"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
|
-
"
|
|
92
|
+
"qualifiedFieldName": "translatedImage",
|
|
93
93
|
"localized": true,
|
|
94
94
|
"dataType": "media",
|
|
95
95
|
"description": "Image that will be different depending on the language (localized)"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
"
|
|
98
|
+
"qualifiedFieldName": "featuredDocument[@paroicms/internal-link-plugin]",
|
|
99
99
|
"localized": false,
|
|
100
100
|
"dataType": "string",
|
|
101
101
|
"description": "A link to a featured document"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
"
|
|
104
|
+
"qualifiedFieldName": "phones[@paroicms/list-field-plugin]",
|
|
105
105
|
"localized": false,
|
|
106
106
|
"dataType": "json",
|
|
107
107
|
"description": "A list of phone numbers"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
"
|
|
110
|
+
"qualifiedFieldName": "video[@paroicms/video-plugin]",
|
|
111
111
|
"localized": false,
|
|
112
112
|
"dataType": "string",
|
|
113
113
|
"description": "A YouTube video"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
|
-
"
|
|
116
|
+
"qualifiedFieldName": "oneLanguageVideo[@paroicms/video-plugin]",
|
|
117
117
|
"localized": true,
|
|
118
118
|
"dataType": "string",
|
|
119
119
|
"description": "A YouTube video, but different for each language"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/site-generator-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "ParoiCMS Site Generator Plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@anthropic-ai/sdk": "~0.60.0",
|
|
32
32
|
"@mistralai/mistralai": "~1.9.18",
|
|
33
|
-
"@paroicms/script-lib": "0.3.
|
|
33
|
+
"@paroicms/script-lib": "0.3.2",
|
|
34
34
|
"arktype": "~2.1.20",
|
|
35
35
|
"jsonwebtoken": "~9.0.2",
|
|
36
36
|
"knex": "~3.1.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@paroicms/public-server-lib": "0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@paroicms/internal-anywhere-lib": "1.35.
|
|
48
|
-
"@paroicms/internal-server-lib": "1.
|
|
49
|
-
"@paroicms/public-server-lib": "0.
|
|
47
|
+
"@paroicms/internal-anywhere-lib": "1.35.2",
|
|
48
|
+
"@paroicms/internal-server-lib": "1.22.1",
|
|
49
|
+
"@paroicms/public-server-lib": "0.47.0",
|
|
50
50
|
"@types/node": "~24.0.1",
|
|
51
51
|
"marked": "~16.2.0",
|
|
52
52
|
"nodemon": "~3.1.10",
|