@phtngyn/cms 0.1.0-beta.2 → 0.1.0-beta.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.
- package/README.md +52 -35
- package/bin/cms.mjs +2 -0
- package/package.json +5 -5
- package/src/{Configuration-CA_jvQKG.js → Configuration-CDMYfTre.js} +3 -3
- package/src/{Configuration-CA_jvQKG.js.map → Configuration-CDMYfTre.js.map} +1 -1
- package/src/Configuration.d.ts +60 -2
- package/src/Configuration.js.map +1 -1
- package/src/ContentTransfer-C3Av9sWz.js +53 -0
- package/src/ContentTransfer-C3Av9sWz.js.map +1 -0
- package/src/{DocumentEngine-CgiBQU4g.js → DocumentEngine-J7g-emdf.js} +4 -4
- package/src/{DocumentEngine-CgiBQU4g.js.map → DocumentEngine-J7g-emdf.js.map} +1 -1
- package/src/DocumentModel.d.ts +33 -2
- package/src/{Forms-DxbkU3_5.js → Forms-Dj6NuW66.js} +2 -2
- package/src/{Forms-DxbkU3_5.js.map → Forms-Dj6NuW66.js.map} +1 -1
- package/src/Forms.d.ts +17 -1
- package/src/Forms.js.map +1 -1
- package/src/I18n.d.ts +20 -2
- package/src/Module.js +2 -3
- package/src/Module.js.map +1 -1
- package/src/{S3MediaObjects-JKMAWyVB.js → S3MediaObjects-CpPSzJto.js} +219 -106
- package/src/S3MediaObjects-CpPSzJto.js.map +1 -0
- package/src/cli/content.js +258 -0
- package/src/cli/content.js.map +1 -0
- package/src/cli.js +71 -0
- package/src/cli.js.map +1 -0
- package/src/{connection-B-iz0Y9Y.js → connection-CBAy2qGy.js} +2 -2
- package/src/{connection-B-iz0Y9Y.js.map → connection-CBAy2qGy.js.map} +1 -1
- package/src/{installation-DgF2M1gL.js → installation-CNfIriVm.js} +21 -23
- package/src/installation-CNfIriVm.js.map +1 -0
- package/src/internal/authoring-catalog.js +2 -2
- package/src/internal/authoring-metadata.js +1 -1
- package/src/internal/configuration.js +6 -10
- package/src/internal/configuration.js.map +1 -1
- package/src/internal/document-model.js +7 -4
- package/src/internal/document-model.js.map +1 -1
- package/src/{location-CFKTeK1K.js → location-BTqdfIzX.js} +2 -2
- package/src/{location-CFKTeK1K.js.map → location-BTqdfIzX.js.map} +1 -1
- package/src/{models-BWm1pTAf.js → models-B4IoTmp7.js} +2 -2
- package/src/{models-BWm1pTAf.js.map → models-B4IoTmp7.js.map} +1 -1
- package/src/{models-DwYioyNV.js → models-Bah5B3bT.js} +4 -21
- package/src/models-Bah5B3bT.js.map +1 -0
- package/src/runtime/delivery/context.js +1 -1
- package/src/runtime/delivery/plugin.js +9 -3
- package/src/runtime/delivery/plugin.js.map +1 -1
- package/src/runtime/delivery/useCmsDocumentSeo.d.ts +3 -0
- package/src/runtime/delivery/useCmsDocumentSeo.js +3 -1
- package/src/runtime/delivery/useCmsDocumentSeo.js.map +1 -1
- package/src/runtime/forms/document.js +1 -1
- package/src/runtime/forms/useCmsForm.js +43 -2
- package/src/runtime/forms/useCmsForm.js.map +1 -1
- package/src/runtime/i18n/translator.js +31 -2
- package/src/runtime/i18n/translator.js.map +1 -1
- package/src/runtime/i18n/useCmsI18n.d.ts +3 -1
- package/src/runtime/i18n/useCmsI18n.js +9 -1
- package/src/runtime/i18n/useCmsI18n.js.map +1 -1
- package/src/runtime/installation.js +1 -1
- package/src/runtime/plugin.js +3 -3
- package/src/runtime/plugin.js.map +1 -1
- package/src/runtime/preview/connection.js +1 -1
- package/src/runtime/preview/controller.js +2 -2
- package/src/runtime/preview/plugin.client.js +3 -3
- package/src/runtime/preview/store.js +1 -1
- package/src/runtime/sitemap.js +1 -1
- package/src/{store-DjJs3I7k.js → store-b2CSXgMt.js} +3 -3
- package/src/{store-DjJs3I7k.js.map → store-b2CSXgMt.js.map} +1 -1
- package/studio/{CreateDocumentDialog-CTeIFlPb.js → CreateDocumentDialog-GGey1uBc.js} +1 -1
- package/studio/{documentPlanning-Bfv-d7OU.js → documentPlanning-DRErYmBU.js} +1490 -1450
- package/studio/host.js +2 -2
- package/src/Configuration-Br7tE9Qt.d.ts +0 -68
- package/src/DocumentModel-BB9igGC7.d.ts +0 -34
- package/src/I18n-DZK4CkJF.d.ts +0 -21
- package/src/S3MediaObjects-JKMAWyVB.js.map +0 -1
- package/src/Seed.d.ts +0 -6
- package/src/Seed.js +0 -34
- package/src/Seed.js.map +0 -1
- package/src/installation-DgF2M1gL.js.map +0 -1
- package/src/models-DwYioyNV.js.map +0 -1
package/src/Seed.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { i as CmsInitialDocumentProvider } from "./Configuration-Br7tE9Qt.js";
|
|
2
|
-
//#region src/Seed.d.ts
|
|
3
|
-
/** Read Markdown documents from a directory when Nuxt loads the CMS configuration. */
|
|
4
|
-
export declare function seedFromDirectory(directory: URL): CmsInitialDocumentProvider;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=Seed.d.ts.map
|
package/src/Seed.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
2
|
-
import { NodeFileSystem, NodePath } from "@effect/platform-node-shared";
|
|
3
|
-
|
|
4
|
-
//#region src/Seed.ts
|
|
5
|
-
const nodeLayer = Layer.merge(NodeFileSystem.layer, NodePath.layer);
|
|
6
|
-
/** Read Markdown documents from a directory when Nuxt loads the CMS configuration. */
|
|
7
|
-
function seedFromDirectory(directory) {
|
|
8
|
-
return () => Effect.runPromise(Effect.gen(function* () {
|
|
9
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
10
|
-
const path = yield* Path.Path;
|
|
11
|
-
const seedDirectory = yield* path.fromFileUrl(directory);
|
|
12
|
-
const files = [...yield* markdownFiles(seedDirectory)].sort((left, right) => right.split("/").length - left.split("/").length || left.localeCompare(right));
|
|
13
|
-
return yield* Effect.forEach(files, (filePath) => fileSystem.readFileString(filePath).pipe(Effect.map((markdown) => ({
|
|
14
|
-
markdown,
|
|
15
|
-
published: true,
|
|
16
|
-
sourcePath: path.relative(seedDirectory, filePath).replaceAll("\\", "/")
|
|
17
|
-
}))));
|
|
18
|
-
}).pipe(Effect.provide(nodeLayer)));
|
|
19
|
-
}
|
|
20
|
-
function markdownFiles(directory) {
|
|
21
|
-
return Effect.gen(function* () {
|
|
22
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
23
|
-
const path = yield* Path.Path;
|
|
24
|
-
const names = yield* fileSystem.readDirectory(directory);
|
|
25
|
-
return (yield* Effect.forEach(names, (name) => Effect.gen(function* () {
|
|
26
|
-
const filePath = path.resolve(directory, name);
|
|
27
|
-
return (yield* fileSystem.stat(filePath)).type === "Directory" ? yield* markdownFiles(filePath) : [filePath];
|
|
28
|
-
}))).flat().filter((filePath) => path.extname(filePath) === ".md");
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
export { seedFromDirectory };
|
|
34
|
-
//# sourceMappingURL=Seed.js.map
|
package/src/Seed.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Seed.js","names":[],"sources":["../../../src/Seed.ts"],"sourcesContent":["import type { CmsInitialDocumentProvider } from './Configuration'\nimport { NodeFileSystem, NodePath } from '@effect/platform-node-shared'\nimport { Effect, FileSystem, Layer, Path, type PlatformError } from 'effect'\n\nconst nodeLayer = Layer.merge(NodeFileSystem.layer, NodePath.layer)\n\n/** Read Markdown documents from a directory when Nuxt loads the CMS configuration. */\nexport function seedFromDirectory(directory: URL): CmsInitialDocumentProvider {\n return () =>\n Effect.runPromise(\n Effect.gen(function* () {\n const fileSystem = yield* FileSystem.FileSystem\n const path = yield* Path.Path\n const seedDirectory = yield* path.fromFileUrl(directory)\n\n const files = [...(yield* markdownFiles(seedDirectory))].sort(\n (left, right) => right.split('/').length - left.split('/').length || left.localeCompare(right),\n )\n\n return yield* Effect.forEach(files, (filePath) =>\n fileSystem.readFileString(filePath).pipe(\n Effect.map((markdown) => ({\n markdown,\n published: true,\n sourcePath: path.relative(seedDirectory, filePath).replaceAll('\\\\', '/'),\n })),\n ),\n )\n }).pipe(Effect.provide(nodeLayer)),\n )\n}\n\nfunction markdownFiles(\n directory: string,\n): Effect.Effect<ReadonlyArray<string>, PlatformError.PlatformError, FileSystem.FileSystem | Path.Path> {\n return Effect.gen(function* () {\n const fileSystem = yield* FileSystem.FileSystem\n const path = yield* Path.Path\n const names = yield* fileSystem.readDirectory(directory)\n\n const nested = yield* Effect.forEach(names, (name) =>\n Effect.gen(function* () {\n const filePath = path.resolve(directory, name)\n const info = yield* fileSystem.stat(filePath)\n\n return info.type === 'Directory' ? yield* markdownFiles(filePath) : [filePath]\n }),\n )\n\n return nested.flat().filter((filePath) => path.extname(filePath) === '.md')\n })\n}\n"],"mappings":";;;;AAIA,MAAM,YAAY,MAAM,MAAM,eAAe,OAAO,SAAS,KAAK;;AAGlE,SAAgB,kBAAkB,WAA4C;CAC5E,aACE,OAAO,WACL,OAAO,IAAI,aAAa;EACtB,MAAM,aAAa,OAAO,WAAW;EACrC,MAAM,OAAO,OAAO,KAAK;EACzB,MAAM,gBAAgB,OAAO,KAAK,YAAY,SAAS;EAEvD,MAAM,QAAQ,CAAC,GAAI,OAAO,cAAc,aAAa,CAAE,CAAC,CAAC,MACtD,MAAM,UAAU,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,UAAU,KAAK,cAAc,KAAK,CAC/F;EAEA,OAAO,OAAO,OAAO,QAAQ,QAAQ,aACnC,WAAW,eAAe,QAAQ,CAAC,CAAC,KAClC,OAAO,KAAK,cAAc;GACxB;GACA,WAAW;GACX,YAAY,KAAK,SAAS,eAAe,QAAQ,CAAC,CAAC,WAAW,MAAM,GAAG;EACzE,EAAE,CACJ,CACF;CACF,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,SAAS,CAAC,CACnC;AACJ;AAEA,SAAS,cACP,WACsG;CACtG,OAAO,OAAO,IAAI,aAAa;EAC7B,MAAM,aAAa,OAAO,WAAW;EACrC,MAAM,OAAO,OAAO,KAAK;EACzB,MAAM,QAAQ,OAAO,WAAW,cAAc,SAAS;EAWvD,QAAO,OATe,OAAO,QAAQ,QAAQ,SAC3C,OAAO,IAAI,aAAa;GACtB,MAAM,WAAW,KAAK,QAAQ,WAAW,IAAI;GAG7C,QAAO,OAFa,WAAW,KAAK,QAAQ,EAEjC,CAAC,SAAS,cAAc,OAAO,cAAc,QAAQ,IAAI,CAAC,QAAQ;EAC/E,CAAC,CACH,EAEa,CAAC,KAAK,CAAC,CAAC,QAAQ,aAAa,KAAK,QAAQ,QAAQ,MAAM,KAAK;CAC5E,CAAC;AACH"}
|