@paroicms/site-generator-plugin 0.30.2 → 0.30.3

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.
@@ -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', '3');
11
+ insert into PaMetadata (dbSchema, k, val) values ('site-generator', 'dbSchemaVersion', '4');
12
12
 
13
13
  create table PgSession (
14
14
  id varchar(100) not null primary key,
@@ -128,7 +128,7 @@ export async function updateGeneratedSiteStepSetAsCompleted(ctx, stepHandle, val
128
128
  });
129
129
  });
130
130
  }
131
- const InsertedAT = type({ id: "string", "+": "reject" });
131
+ const InsertedIdAT = type({ id: "number", "+": "reject" });
132
132
  export async function insertIssueEvent(ctx, values) {
133
133
  const { cn, sessionId } = ctx;
134
134
  const [inserted] = await cn("PgIssueEvent")
@@ -141,5 +141,6 @@ export async function insertIssueEvent(ctx, values) {
141
141
  siteId: values.siteId,
142
142
  })
143
143
  .returning("id");
144
- return InsertedAT.assert(inserted);
144
+ const insertedId = String(InsertedIdAT.assert(inserted).id);
145
+ return { id: insertedId };
145
146
  }
@@ -1,6 +1,6 @@
1
1
  import { executeDdl, generateDatabaseId, setMetadataDbSchemaVersion, setMetadataValue, } from "@paroicms/internal-server-lib";
2
2
  export const dbSchemaName = "site-generator";
3
- export const currentDbSchemaVersion = 3;
3
+ export const currentDbSchemaVersion = 4;
4
4
  export async function migrateSiteGeneratorDb(cn, { fromVersion, logger, ddlFile }) {
5
5
  const toVersion = currentDbSchemaVersion;
6
6
  let currentVersion = fromVersion;
@@ -20,6 +20,13 @@ export async function migrateSiteGeneratorDb(cn, { fromVersion, logger, ddlFile
20
20
  await setMetadataDbSchemaVersion(cn, { dbSchemaName, value: 3 });
21
21
  currentVersion = 3;
22
22
  }
23
+ if (currentVersion === 3) {
24
+ await cn.schema.table("PgIssueEvent", (table) => {
25
+ table.string("siteId", 100).nullable();
26
+ });
27
+ await setMetadataDbSchemaVersion(cn, { dbSchemaName, value: 4 });
28
+ currentVersion = 4;
29
+ }
23
30
  if (currentVersion !== toVersion) {
24
31
  throw new Error(`version of ${dbSchemaName} database should be '${toVersion}', but is '${currentVersion}'`);
25
32
  }
@@ -30,21 +30,20 @@ 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[@paroicms/tiptap-editor-plugin]]`.
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/tiptap-editor-plugin]]` or `[gallery, "htmlContent[@paroicms/tiptap-editor-plugin]"]`.
34
34
  - Except if there are specific instructions in the website description, here is the default value for the `_site` node type: `["logo", "footerMention[@paroicms/tiptap-editor-plugin]"]`.
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
35
  - This task is about predefined fields only. Custom fields will be added in a further step.
37
36
 
38
37
  Here is an example of expected output:
39
38
 
40
39
  <correct_example>
41
40
  _site: [logo, "footerMention[@paroicms/tiptap-editor-plugin]"]
42
- home: ["htmlContent[@paroicms/tiptap-editor-plugin]"]
41
+ home: [gallery, "htmlContent[@paroicms/tiptap-editor-plugin]"]
43
42
  searchPage: []
44
43
  contactPage: ["introduction[@paroicms/tiptap-editor-plugin]"]
45
44
  regularDocumentExemple1: [gallery, "htmlContent[@paroicms/tiptap-editor-plugin]"]
46
45
  partExemple2: [title, image, "htmlContent[@paroicms/tiptap-editor-plugin]"]
47
- aBlogPostExample: ["leadParagraph[@paroicms/tiptap-editor-plugin]", "htmlContent[@paroicms/tiptap-editor-plugin]"]
46
+ aBlogPostExample: [gallery, "leadParagraph[@paroicms/tiptap-editor-plugin]", "htmlContent[@paroicms/tiptap-editor-plugin]"]
48
47
  </correct_example>
49
48
 
50
49
  Provide the YAML result within <yaml_result> tags. Do not write any explanation or commentary outside the tags.