astro-accelerator-utils 0.1.22 → 0.2.0
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/index.d.mts +2 -10
- package/index.mjs +2 -18
- package/lib/v1/_factory.d.mts +29 -0
- package/lib/v1/_factory.mjs +58 -0
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Cache } from "./lib/v1/cache.mjs";
|
|
3
|
-
import { DateFormatter } from "./lib/v1/dates.mjs";
|
|
4
|
-
import { Markdown } from "./lib/v1/markdown.mjs";
|
|
5
|
-
import { Navigation } from "./lib/v1/navigation.mjs";
|
|
6
|
-
import { Paging } from "./lib/v1/paging.mjs";
|
|
7
|
-
import { Posts } from "./lib/v1/posts.mjs";
|
|
8
|
-
import { Taxonomy } from "./lib/v1/taxonomy.mjs";
|
|
9
|
-
import { UrlFormatter } from "./lib/v1/urls.mjs";
|
|
1
|
+
import { Factory } from "./lib/v1/_factory.mjs";
|
|
10
2
|
import * as PostFiltering from "./lib/postFiltering.mjs";
|
|
11
3
|
import * as PostOrdering from "./lib/postOrdering.mjs";
|
|
12
|
-
export {
|
|
4
|
+
export { Factory, PostFiltering, PostOrdering };
|
package/index.mjs
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Cache } from './lib/v1/cache.mjs';
|
|
3
|
-
import { DateFormatter } from './lib/v1/dates.mjs';
|
|
4
|
-
import { Markdown } from './lib/v1/markdown.mjs';
|
|
5
|
-
import { Navigation } from './lib/v1/navigation.mjs';
|
|
6
|
-
import { Paging } from './lib/v1/paging.mjs';
|
|
7
|
-
import { Posts } from './lib/v1/posts.mjs';
|
|
8
|
-
import { Taxonomy } from './lib/v1/taxonomy.mjs';
|
|
9
|
-
import { UrlFormatter } from './lib/v1/urls.mjs';
|
|
1
|
+
import { Factory } from './lib/v1/_factory.mjs';
|
|
10
2
|
|
|
11
3
|
import * as PostFiltering from './lib/postFiltering.mjs';
|
|
12
4
|
import * as PostOrdering from './lib/postOrdering.mjs';
|
|
13
5
|
|
|
14
6
|
export {
|
|
15
|
-
|
|
16
|
-
Cache,
|
|
17
|
-
DateFormatter,
|
|
18
|
-
Markdown,
|
|
19
|
-
Navigation,
|
|
20
|
-
Paging,
|
|
21
|
-
Posts,
|
|
22
|
-
Taxonomy,
|
|
23
|
-
UrlFormatter,
|
|
7
|
+
Factory,
|
|
24
8
|
PostFiltering,
|
|
25
9
|
PostOrdering
|
|
26
10
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class Factory {
|
|
2
|
+
/**
|
|
3
|
+
* @param {number} cacheMaxAge
|
|
4
|
+
* @param {Intl.DateTimeFormatOptions} dateOptions
|
|
5
|
+
* @param {string} siteUrl
|
|
6
|
+
*/
|
|
7
|
+
constructor(cacheMaxAge: number, dateOptions: Intl.DateTimeFormatOptions, siteUrl: string);
|
|
8
|
+
cacheMaxAge: number;
|
|
9
|
+
dateOptions: Intl.DateTimeFormatOptions;
|
|
10
|
+
siteUrl: string;
|
|
11
|
+
get authors(): Authors;
|
|
12
|
+
get cache(): Cache;
|
|
13
|
+
get dateFormatter(): DateFormatter;
|
|
14
|
+
get markdown(): Markdown;
|
|
15
|
+
get navigation(): Navigation;
|
|
16
|
+
get paging(): Paging;
|
|
17
|
+
get posts(): Posts;
|
|
18
|
+
get taxonomy(): Taxonomy;
|
|
19
|
+
get urlFormatter(): UrlFormatter;
|
|
20
|
+
}
|
|
21
|
+
import { Authors } from "./authors.mjs";
|
|
22
|
+
import { Cache } from "./cache.mjs";
|
|
23
|
+
import { DateFormatter } from "./dates.mjs";
|
|
24
|
+
import { Markdown } from "./markdown.mjs";
|
|
25
|
+
import { Navigation } from "./navigation.mjs";
|
|
26
|
+
import { Paging } from "./paging.mjs";
|
|
27
|
+
import { Posts } from "./posts.mjs";
|
|
28
|
+
import { Taxonomy } from "./taxonomy.mjs";
|
|
29
|
+
import { UrlFormatter } from "./urls.mjs";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Authors } from './authors.mjs';
|
|
2
|
+
import { Cache } from './cache.mjs';
|
|
3
|
+
import { DateFormatter } from './dates.mjs';
|
|
4
|
+
import { Markdown } from './markdown.mjs';
|
|
5
|
+
import { Navigation } from './navigation.mjs';
|
|
6
|
+
import { Paging } from './paging.mjs';
|
|
7
|
+
import { Posts } from './posts.mjs';
|
|
8
|
+
import { Taxonomy } from './taxonomy.mjs';
|
|
9
|
+
import { UrlFormatter } from './urls.mjs';
|
|
10
|
+
|
|
11
|
+
export class Factory {
|
|
12
|
+
/**
|
|
13
|
+
* @param {number} cacheMaxAge
|
|
14
|
+
* @param {Intl.DateTimeFormatOptions} dateOptions
|
|
15
|
+
* @param {string} siteUrl
|
|
16
|
+
*/
|
|
17
|
+
constructor(cacheMaxAge, dateOptions, siteUrl) {
|
|
18
|
+
this.cacheMaxAge = cacheMaxAge;
|
|
19
|
+
this.dateOptions = dateOptions;
|
|
20
|
+
this.siteUrl = siteUrl;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get authors() {
|
|
24
|
+
return new Authors(this.posts);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get cache() {
|
|
28
|
+
return new Cache(this.cacheMaxAge);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get dateFormatter() {
|
|
32
|
+
return new DateFormatter(this.dateOptions)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get markdown() {
|
|
36
|
+
return new Markdown();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get navigation() {
|
|
40
|
+
return new Navigation(this.posts, this.UrlFormatter);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get paging() {
|
|
44
|
+
return new Paging();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get posts() {
|
|
48
|
+
return new Posts(this.cache);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get taxonomy() {
|
|
52
|
+
return new Taxonomy(this.cache, this.posts, this.UrlFormatter);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get urlFormatter() {
|
|
56
|
+
return new UrlFormatter(this.siteUrl)
|
|
57
|
+
}
|
|
58
|
+
}
|