mktcms 0.1.48 → 0.2.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mktcms",
3
3
  "configKey": "mktcms",
4
- "version": "0.1.48",
4
+ "version": "0.2.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -2,12 +2,14 @@ import { z } from "zod";
2
2
  import { defineEventHandler, getValidatedQuery, readValidatedBody } from "h3";
3
3
  import { useStorage } from "nitropack/runtime";
4
4
  import { stringify } from "yaml";
5
+ import { simpleGit } from "simple-git";
5
6
  const querySchema = z.object({
6
7
  path: z.string().min(1)
7
8
  });
8
9
  const bodySchema = z.object({
9
10
  frontmatter: z.record(z.string(), z.any()),
10
- markdown: z.string()
11
+ markdown: z.string(),
12
+ commitMessage: z.string().optional()
11
13
  });
12
14
  function buildContent(frontmatter, markdown) {
13
15
  if (Object.keys(frontmatter).length === 0) {
@@ -20,10 +22,13 @@ ${markdown}`;
20
22
  }
21
23
  export default defineEventHandler(async (event) => {
22
24
  const { path } = await getValidatedQuery(event, (query) => querySchema.parse(query));
23
- const { frontmatter, markdown } = await readValidatedBody(event, (body) => bodySchema.parse(body));
25
+ const { frontmatter, markdown, commitMessage } = await readValidatedBody(event, (body) => bodySchema.parse(body));
24
26
  const decodedPath = decodeURIComponent(path);
25
27
  const content = buildContent(frontmatter, markdown);
26
28
  const storage = useStorage("content");
27
29
  await storage.setItem(decodedPath, content);
30
+ const git = simpleGit();
31
+ await git.add(".");
32
+ await git.commit(commitMessage || `\xC4nderung durch Kunden`);
28
33
  return { success: true };
29
34
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mktcms",
3
- "version": "0.1.48",
3
+ "version": "0.2.1",
4
4
  "description": "Simple CMS module for Nuxt",
5
5
  "repository": "mktcode/mktcms",
6
6
  "license": "MIT",
@@ -45,10 +45,11 @@
45
45
  "csv-stringify": "^6.6.0",
46
46
  "defu": "^6.1.4",
47
47
  "ejs": "^4.0.1",
48
- "monaco-editor": "^0.55.1",
49
48
  "marked": "^17.0.1",
49
+ "monaco-editor": "^0.55.1",
50
50
  "nodemailer": "^7.0.12",
51
51
  "sharp": "^0.34.5",
52
+ "simple-git": "^3.30.0",
52
53
  "unzipper": "^0.12.3",
53
54
  "yaml": "^2.8.2",
54
55
  "zod": "^4.3.5"