@redneckz/wildless-cms-uni-blocks 0.15.334 → 0.15.336

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.
@@ -5,5 +5,6 @@ export declare class ContentPageRepository {
5
5
  static readonly inst: ContentPageRepository;
6
6
  constructor(options?: TransformationOptions);
7
7
  listAllContentPages(): Promise<string[]>;
8
+ readPage(filePath: string): Promise<ContentPageDef>;
8
9
  generatePage(filePath: string): Promise<ContentPageDef>;
9
10
  }
@@ -5,5 +5,6 @@ export declare class ContentPageRepository {
5
5
  static readonly inst: ContentPageRepository;
6
6
  constructor(options?: TransformationOptions);
7
7
  listAllContentPages(): Promise<string[]>;
8
+ readPage(filePath: string): Promise<ContentPageDef>;
8
9
  generatePage(filePath: string): Promise<ContentPageDef>;
9
10
  }
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  };
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ContentPageRepository = void 0;
6
+ const fs_1 = __importDefault(require("fs"));
6
7
  const glob_1 = __importDefault(require("glob"));
7
8
  const util_1 = __importDefault(require("util"));
8
9
  const transformContentPage_1 = require("./transformContentPage");
9
10
  const find = util_1.default.promisify(glob_1.default);
11
+ const readFile = util_1.default.promisify(fs_1.default.readFile);
10
12
  class ContentPageRepository {
11
13
  options;
12
14
  static inst = new ContentPageRepository();
@@ -19,6 +21,9 @@ class ContentPageRepository {
19
21
  listAllContentPages() {
20
22
  return find(`${this.options.contentDir}/**/*.page.json`);
21
23
  }
24
+ async readPage(filePath) {
25
+ return JSON.parse(await readFile(filePath, 'utf-8'));
26
+ }
22
27
  generatePage(filePath) {
23
28
  return (0, transformContentPage_1.transformContentPage)(filePath, this.options);
24
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAA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,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,YAAY,CAAC,QAAgB;QAC3B,OAAO,IAAA,2CAAoB,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;;AApBH,sDAqBC"}
@@ -5,5 +5,6 @@ export declare class ContentPageRepository {
5
5
  static readonly inst: ContentPageRepository;
6
6
  constructor(options?: TransformationOptions);
7
7
  listAllContentPages(): Promise<string[]>;
8
+ readPage(filePath: string): Promise<ContentPageDef>;
8
9
  generatePage(filePath: string): Promise<ContentPageDef>;
9
10
  }
@@ -1,7 +1,9 @@
1
+ import fs from 'fs';
1
2
  import glob from 'glob';
2
3
  import util from 'util';
3
4
  import { transformContentPage } from './transformContentPage.js';
4
5
  const find = util.promisify(glob);
6
+ const readFile = util.promisify(fs.readFile);
5
7
  export class ContentPageRepository {
6
8
  options;
7
9
  static inst = new ContentPageRepository();
@@ -14,6 +16,9 @@ export class ContentPageRepository {
14
16
  listAllContentPages() {
15
17
  return find(`${this.options.contentDir}/**/*.page.json`);
16
18
  }
19
+ async readPage(filePath) {
20
+ return JSON.parse(await readFile(filePath, 'utf-8'));
21
+ }
17
22
  generatePage(filePath) {
18
23
  return transformContentPage(filePath, this.options);
19
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,OAAO,qBAAqB;IAIb;IAHZ,MAAM,CAAU,IAAI,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAE1D,YACmB,UAAiC;QAChD,UAAU,EAAE,SAAS;QACr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O,CAAC,CAAC;IACtD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import fs from 'fs';
1
2
  import glob from 'glob';
2
3
  import util from 'util';
3
4
  import { type ContentPageDef } from '../model/ContentPageDef';
@@ -5,6 +6,7 @@ import { type TransformationOptions } from './TransformationOptions';
5
6
  import { transformContentPage } from './transformContentPage';
6
7
 
7
8
  const find = util.promisify(glob);
9
+ const readFile = util.promisify(fs.readFile);
8
10
 
9
11
  export class ContentPageRepository {
10
12
  public static readonly inst = new ContentPageRepository();
@@ -20,6 +22,10 @@ export class ContentPageRepository {
20
22
  return find(`${this.options.contentDir}/**/*.page.json`);
21
23
  }
22
24
 
25
+ async readPage(filePath: string): Promise<ContentPageDef> {
26
+ return JSON.parse(await readFile(filePath, 'utf-8'));
27
+ }
28
+
23
29
  generatePage(filePath: string): Promise<ContentPageDef> {
24
30
  return transformContentPage(filePath, this.options);
25
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.15.334",
3
+ "version": "0.15.336",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,3 +1,4 @@
1
+ import fs from 'fs';
1
2
  import glob from 'glob';
2
3
  import util from 'util';
3
4
  import { type ContentPageDef } from '../model/ContentPageDef';
@@ -5,6 +6,7 @@ import { type TransformationOptions } from './TransformationOptions';
5
6
  import { transformContentPage } from './transformContentPage';
6
7
 
7
8
  const find = util.promisify(glob);
9
+ const readFile = util.promisify(fs.readFile);
8
10
 
9
11
  export class ContentPageRepository {
10
12
  public static readonly inst = new ContentPageRepository();
@@ -20,6 +22,10 @@ export class ContentPageRepository {
20
22
  return find(`${this.options.contentDir}/**/*.page.json`);
21
23
  }
22
24
 
25
+ async readPage(filePath: string): Promise<ContentPageDef> {
26
+ return JSON.parse(await readFile(filePath, 'utf-8'));
27
+ }
28
+
23
29
  generatePage(filePath: string): Promise<ContentPageDef> {
24
30
  return transformContentPage(filePath, this.options);
25
31
  }