@rr0/cms 0.1.11 → 0.1.12
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/book/index.d.ts +0 -1
- package/dist/book/index.js +0 -1
- package/package.json +1 -1
- package/dist/book/BookImport.d.ts +0 -1
- package/dist/book/BookImport.js +0 -27
package/dist/book/index.d.ts
CHANGED
package/dist/book/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/book/BookImport.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ConsoleLogger } from "ssg-api";
|
|
2
|
-
import { CLI } from "../util/cli/CLI.js";
|
|
3
|
-
import { BookService } from "./BookService.js";
|
|
4
|
-
import { PeopleService } from "../people/PeopleService.js";
|
|
5
|
-
import { AllDataService } from "../data/AllDataService.js";
|
|
6
|
-
import { PeopleFactory } from "../people/PeopleFactory.js";
|
|
7
|
-
import { RR0EventFactory } from "../event/RR0EventFactory.js";
|
|
8
|
-
import { TypedDataFactory } from "../data/TypedDataFactory.js";
|
|
9
|
-
import path from "path";
|
|
10
|
-
const logger = new ConsoleLogger("rr0-books");
|
|
11
|
-
const args = new CLI().getArgs();
|
|
12
|
-
const fileName = args.import;
|
|
13
|
-
const dry = args.dry === "true";
|
|
14
|
-
const peopleFactory = new PeopleFactory(new RR0EventFactory());
|
|
15
|
-
const eventFactory = new RR0EventFactory();
|
|
16
|
-
const bookFactory = new TypedDataFactory(eventFactory, "book");
|
|
17
|
-
const dataService = new AllDataService([bookFactory, peopleFactory]);
|
|
18
|
-
const outDir = "out";
|
|
19
|
-
const config = {
|
|
20
|
-
getOutputPath(context) {
|
|
21
|
-
return path.join(outDir, context.file.name);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const books = new BookService(logger, dry, new PeopleService(dataService, peopleFactory), config);
|
|
25
|
-
books.import(fileName).then((result) => {
|
|
26
|
-
logger.log("Wrote", result.length, "books");
|
|
27
|
-
});
|