@rr0/cms 0.1.8 → 0.1.10

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.
@@ -1,10 +1,10 @@
1
- import { AllDataService } from "data/AllDataService.js";
1
+ import { AllDataService } from "./data/AllDataService.js";
2
2
  import { TimeElementFactory } from "./time/TimeElementFactory.js";
3
3
  import { ContentVisitor } from "./RR0ContentStep.js";
4
4
  import { HtmlRR0SsgContext } from "./RR0SsgContext.js";
5
- import { RR0Data } from "data/RR0Data.js";
5
+ import { RR0Data } from "./data/RR0Data.js";
6
6
  import { EventRenderer } from "./time/EventRenderer.js";
7
- import { RR0Event } from "event/RR0Event.js";
7
+ import { RR0Event } from "./event/RR0Event.js";
8
8
  export declare class DefaultContentVisitor implements ContentVisitor {
9
9
  protected service: AllDataService;
10
10
  protected eventRenderer: EventRenderer<RR0Event>;
@@ -1,5 +1,5 @@
1
1
  import { Chapter } from "./Chapters.js";
2
- import { Source } from "source/Source.js";
2
+ import { Source } from "../source/Source.js";
3
3
  export interface Book extends Source {
4
4
  type: "book";
5
5
  /**
package/dist/build.js CHANGED
@@ -19,7 +19,7 @@ import { OpenGraphCommand } from "./OpenGraphCommand.js";
19
19
  import { DescriptionReplaceCommand } from "./DescriptionReplaceCommand.js";
20
20
  import { BookContentVisitor, BookDirectoryStep } from "./book/index.js";
21
21
  import path from "path";
22
- import { IndexedReplacerFactory } from "index/IndexedReplacerFactory.js";
22
+ import { IndexedReplacerFactory } from "./index/IndexedReplacerFactory.js";
23
23
  import { APIFactory, CodeReplacerFactory } from "./tech/index.js";
24
24
  import { RR0ContentStep } from "./RR0ContentStep.js";
25
25
  import { AllDataService, TypedDataFactory } from "./data/index.js";
@@ -1,8 +1,8 @@
1
1
  import { Occupation } from "./Occupation.js";
2
2
  import { Gender } from "@rr0/common";
3
3
  import { CountryCode } from "../org/country/CountryCode.js";
4
- import { RR0Data } from "data/RR0Data.js";
5
- import { RR0Event } from "event/RR0Event.js";
4
+ import { RR0Data } from "../data/RR0Data.js";
5
+ import { RR0Event } from "../event/RR0Event.js";
6
6
  export declare class People implements RR0Data {
7
7
  firstNames: string[];
8
8
  lastName: string;
@@ -1,6 +1,6 @@
1
- import { RR0Data } from "data/RR0Data.js";
1
+ import { RR0Data } from "../data/RR0Data.js";
2
2
  import { PlaceLocation } from "./PlaceLocation.js";
3
- import { RR0Event } from "event/RR0Event.js";
3
+ import { RR0Event } from "../event/RR0Event.js";
4
4
  export type Elevation = {
5
5
  elevation: number;
6
6
  data?: any;
@@ -1,6 +1,6 @@
1
- import { TypedDataFactory } from "data/TypedDataFactory.js";
1
+ import { TypedDataFactory } from "../../../../../data/TypedDataFactory.js";
2
2
  import { RR0Case } from "./RR0Case.js";
3
- import { RR0EventFactory } from "event/RR0EventFactory.js";
3
+ import { RR0EventFactory } from "../../../../../event/RR0EventFactory.js";
4
4
  export declare class CaseFactory extends TypedDataFactory<RR0Case> {
5
5
  constructor(eventFactory: RR0EventFactory);
6
6
  }
@@ -1,4 +1,4 @@
1
- import { TypedDataFactory } from "data/TypedDataFactory.js";
1
+ import { TypedDataFactory } from "../../../../../data/TypedDataFactory.js";
2
2
  export class CaseFactory extends TypedDataFactory {
3
3
  constructor(eventFactory) {
4
4
  super(eventFactory, "case");
@@ -1,5 +1,5 @@
1
1
  import { Source } from "./Source.js";
2
- import { AllDataService } from "data/AllDataService.js";
2
+ import { AllDataService } from "../data/AllDataService.js";
3
3
  import { HttpSource } from "../time/datasource/HttpSource.js";
4
4
  import { SourceRegistry } from "./SourceRegistry.js";
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { TimeContext } from "../time/TimeContext.js";
2
- import { RR0Data } from "data/RR0Data.js";
2
+ import { RR0Data } from "../data/RR0Data.js";
3
3
  export type Publication = {
4
4
  /**
5
5
  * The editor of the publication
@@ -1,6 +1,6 @@
1
1
  import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
2
  import { Source } from "./Source.js";
3
- import { AllDataService } from "data/AllDataService.js";
3
+ import { AllDataService } from "../data/AllDataService.js";
4
4
  import { HttpSource } from "../time/datasource/HttpSource.js";
5
5
  /**
6
6
  * Create Source objects.
@@ -1,4 +1,4 @@
1
- import { RR0Data } from "data/RR0Data.js";
1
+ import { RR0Data } from "../../../data/RR0Data.js";
2
2
  export interface API extends RR0Data {
3
3
  type: "api";
4
4
  }
@@ -6,6 +6,7 @@ import { RR0CaseMapping } from "./rr0/index.js";
6
6
  export declare abstract class DatasourceTestCase<S> {
7
7
  readonly mapping: RR0CaseMapping<S>;
8
8
  readonly sourceCases: S[];
9
+ protected readonly intlOptions: Intl.DateTimeFormatOptions;
9
10
  timeTextBuilder: TimeTextBuilder;
10
11
  protected constructor(mapping: RR0CaseMapping<S>, sourceCases: S[]);
11
12
  checkCaseHTML(context: HtmlRR0SsgContext, nativeCase: S, item: HTMLLIElement, dataDate: Date): void;
@@ -5,14 +5,22 @@ import { SourceFactory, SourceRenderer } from "../../source/index.js";
5
5
  import { NoteFileCounter, NoteRenderer } from "../../note/index.js";
6
6
  import { AllDataService } from "../../data/index.js";
7
7
  import { HttpSource } from "./HttpSource.js";
8
- import { rr0TestUtil } from "../../test/index.js";
9
8
  import { TimeElementFactory } from "../TimeElementFactory.js";
10
9
  import { TimeRenderer } from "../TimeRenderer.js";
11
10
  export class DatasourceTestCase {
12
11
  constructor(mapping, sourceCases) {
13
12
  this.mapping = mapping;
14
13
  this.sourceCases = sourceCases;
15
- this.timeTextBuilder = new TimeTextBuilder(rr0TestUtil.intlOptions);
14
+ this.intlOptions = {
15
+ year: "numeric",
16
+ month: "long",
17
+ day: "numeric",
18
+ weekday: "long",
19
+ hour: "2-digit",
20
+ minute: "2-digit",
21
+ timeZoneName: "short"
22
+ };
23
+ this.timeTextBuilder = new TimeTextBuilder(this.intlOptions);
16
24
  }
17
25
  checkCaseHTML(context, nativeCase, item, dataDate) {
18
26
  const expected = this.mapping.mapper.map(context, nativeCase, dataDate);
@@ -32,7 +40,7 @@ export class DatasourceTestCase {
32
40
  const dataService = new AllDataService([]);
33
41
  const baseUrl = "https://rr0.org";
34
42
  const http = new HttpSource();
35
- const sourceFactory = new SourceFactory(dataService, http, baseUrl, rr0TestUtil.intlOptions);
43
+ const sourceFactory = new SourceFactory(dataService, http, baseUrl, this.intlOptions);
36
44
  const timeElementFactory = new TimeElementFactory(new TimeRenderer([], this.timeTextBuilder));
37
45
  const eventRenderer = new CaseSummaryRenderer(new NoteRenderer(new NoteFileCounter()), sourceFactory, new SourceRenderer(this.timeTextBuilder), timeElementFactory);
38
46
  const items = [];
@@ -10,6 +10,7 @@ export declare class UrecatHttpDatasource extends UrecatDatasource {
10
10
  [key: string]: number;
11
11
  };
12
12
  protected readonly http: HttpSource;
13
+ protected readonly intlOptions: Intl.DateTimeFormatOptions;
13
14
  constructor(baseUrl: URL, searchPath?: string);
14
15
  queryUrl(context: RR0SsgContext): URL;
15
16
  getWitnesses(witnessesStr: string): UrecatWitness[];
@@ -1,16 +1,24 @@
1
+ import { JSDOM } from "jsdom";
1
2
  import { HttpSource } from "../HttpSource.js";
2
3
  import { ObjectUtil, UrlUtil } from "../../../util/index.js";
3
- import { JSDOM } from "jsdom";
4
4
  import { TimeTextBuilder } from "../../TimeTextBuilder.js";
5
5
  import { MessageUtils } from "../../../lang/index.js";
6
6
  import { UrecatDatasource } from "./UrecatDatasource.js";
7
- import { rr0TestUtil } from "../../../test/index.js";
8
7
  export class UrecatHttpDatasource extends UrecatDatasource {
9
8
  constructor(baseUrl, searchPath = "ce3") {
10
9
  super(["Gross, Patrick"], "URECAT");
11
10
  this.baseUrl = baseUrl;
12
11
  this.searchPath = searchPath;
13
12
  this.http = new HttpSource();
13
+ this.intlOptions = {
14
+ year: "numeric",
15
+ month: "long",
16
+ day: "numeric",
17
+ weekday: "long",
18
+ hour: "2-digit",
19
+ minute: "2-digit",
20
+ timeZoneName: "short"
21
+ };
14
22
  }
15
23
  queryUrl(context) {
16
24
  var _a;
@@ -103,7 +111,7 @@ export class UrecatHttpDatasource extends UrecatDatasource {
103
111
  const caseContext = this.getDate(context, url, row);
104
112
  const { placeName, departmentOrState, country } = this.getLocation(columns[1]);
105
113
  const witnesses = this.getWitnesses(columns[2].textContent);
106
- const timeStr = new TimeTextBuilder(rr0TestUtil.intlOptions).build(caseContext, true, {
114
+ const timeStr = new TimeTextBuilder(this.intlOptions).build(caseContext, true, {
107
115
  year: "numeric",
108
116
  month: "long",
109
117
  day: "numeric",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rr0/cms",
3
3
  "type": "module",
4
4
  "author": "rr0@rr0.org",
5
- "version": "0.1.8",
5
+ "version": "0.1.10",
6
6
  "description": "Content Management System",
7
7
  "exports": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",