coralite 0.29.2 → 0.29.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.
@@ -12,24 +12,15 @@
12
12
  * Attribute,
13
13
  * CoraliteComponentResult,
14
14
  * CoraliteValues,
15
- * InstanceContext} from '../types/index.js'
16
- *
17
- * @import { CoralitePluginInstance } from '../types/plugin.js'
15
+ * InstanceContext,
16
+ * CoraliteConfig} from '../types/index.js'
18
17
  */
19
18
  /**
20
19
  * @import {DomSerializerOptions} from 'dom-serializer'
21
20
  */
22
21
  /**
23
22
  * @constructor
24
- * @param {Object} options
25
- * @param {string} options.components - The path to the directory containing Coralite components.
26
- * @param {CoralitePluginInstance[]} [options.plugins=[]]
27
- * @param {string} options.pages - The path to the directory containing pages that will be rendered using the provided components.
28
- * @param {string} [options.mode='production'] - Build mode: "development" or "production"
29
- * @param {import('../types/core.js').CoraliteStaticAsset[]} [options.assets] - Static assets to copy during build
30
- * @param {Array<string | Attribute>} [options.ignoreByAttribute] - Elements to ignore with attribute name value pair
31
- * @param {Array<string | Attribute>} [options.skipRenderByAttribute] - Element attributes to parse but exclude from final render output
32
- * @param {string} [options.output] - Output directory for build artifacts
23
+ * @param {CoraliteConfig} options
33
24
  * @example
34
25
  * const coralite = new Coralite({
35
26
  * components: './path/to/components',
@@ -40,16 +31,7 @@
40
31
  * skipRenderByAttribute: ['data-skip-render']
41
32
  * });
42
33
  */
43
- export function Coralite({ components, pages, plugins, assets, ignoreByAttribute, skipRenderByAttribute, mode, output }: {
44
- components: string;
45
- plugins?: CoralitePluginInstance[];
46
- pages: string;
47
- mode?: string;
48
- assets?: import("../types/core.js").CoraliteStaticAsset[];
49
- ignoreByAttribute?: Array<string | Attribute>;
50
- skipRenderByAttribute?: Array<string | Attribute>;
51
- output?: string;
52
- }): void;
34
+ export function Coralite({ components, pages, plugins, assets, baseURL, ignoreByAttribute, skipRenderByAttribute, mode, output }: CoraliteConfig): void;
53
35
  export class Coralite {
54
36
  /**
55
37
  * @import {
@@ -65,24 +47,15 @@ export class Coralite {
65
47
  * Attribute,
66
48
  * CoraliteComponentResult,
67
49
  * CoraliteValues,
68
- * InstanceContext} from '../types/index.js'
69
- *
70
- * @import { CoralitePluginInstance } from '../types/plugin.js'
50
+ * InstanceContext,
51
+ * CoraliteConfig} from '../types/index.js'
71
52
  */
72
53
  /**
73
54
  * @import {DomSerializerOptions} from 'dom-serializer'
74
55
  */
75
56
  /**
76
57
  * @constructor
77
- * @param {Object} options
78
- * @param {string} options.components - The path to the directory containing Coralite components.
79
- * @param {CoralitePluginInstance[]} [options.plugins=[]]
80
- * @param {string} options.pages - The path to the directory containing pages that will be rendered using the provided components.
81
- * @param {string} [options.mode='production'] - Build mode: "development" or "production"
82
- * @param {import('../types/core.js').CoraliteStaticAsset[]} [options.assets] - Static assets to copy during build
83
- * @param {Array<string | Attribute>} [options.ignoreByAttribute] - Elements to ignore with attribute name value pair
84
- * @param {Array<string | Attribute>} [options.skipRenderByAttribute] - Element attributes to parse but exclude from final render output
85
- * @param {string} [options.output] - Output directory for build artifacts
58
+ * @param {CoraliteConfig} options
86
59
  * @example
87
60
  * const coralite = new Coralite({
88
61
  * components: './path/to/components',
@@ -93,21 +66,13 @@ export class Coralite {
93
66
  * skipRenderByAttribute: ['data-skip-render']
94
67
  * });
95
68
  */
96
- constructor({ components, pages, plugins, assets, ignoreByAttribute, skipRenderByAttribute, mode, output }: {
97
- components: string;
98
- plugins?: CoralitePluginInstance[];
99
- pages: string;
100
- mode?: string;
101
- assets?: import("../types/core.js").CoraliteStaticAsset[];
102
- ignoreByAttribute?: Array<string | Attribute>;
103
- skipRenderByAttribute?: Array<string | Attribute>;
104
- output?: string;
105
- });
69
+ constructor({ components, pages, plugins, assets, baseURL, ignoreByAttribute, skipRenderByAttribute, mode, output }: CoraliteConfig);
106
70
  options: {
107
71
  components: string;
108
72
  pages: string;
109
- plugins: CoralitePluginInstance[];
73
+ plugins: import("../types/plugin.js").CoralitePluginInstance[];
110
74
  assets: import("../types/core.js").CoraliteStaticAsset[];
75
+ baseURL: string;
111
76
  ignoreByAttribute: (string | import("../types/component.js").Attribute)[];
112
77
  skipRenderByAttribute: (string | import("../types/component.js").Attribute)[];
113
78
  mode: string;
@@ -194,6 +159,7 @@ export class Coralite {
194
159
  * @return {AsyncGenerator<CoraliteResult>}
195
160
  */
196
161
  _generatePages(path?: string | string[], values?: any): AsyncGenerator<CoraliteResult>;
162
+ outputFiles: {};
197
163
  /**
198
164
  * Compiles pages and collects the results with controlled concurrency.
199
165
  * Can optionally transform each result via a callback before collecting.
@@ -582,8 +548,7 @@ export class Coralite {
582
548
  }
583
549
  export default Coralite;
584
550
  export type BuildPageHandler = (result: CoraliteResult) => Promise<any> | any;
585
- import type { CoralitePluginInstance } from '../types/plugin.js';
586
- import type { Attribute } from '../types/index.js';
551
+ import type { CoraliteConfig } from '../types/index.js';
587
552
  import type { CoraliteCollectionItem } from '../types/index.js';
588
553
  import { ScriptManager } from './script-manager.js';
589
554
  import { parseHTML } from './parse.js';
@@ -1 +1 @@
1
- {"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yHAlBG;IAAwB,UAAU,EAA1B,MAAM;IAC6B,OAAO,GAA1C,sBAAsB,EAAE;IACR,KAAK,EAArB,MAAM;IACW,IAAI,GAArB,MAAM;IACqD,MAAM,GAAjE,OAAO,kBAAkB,EAAE,mBAAmB,EAAE;IACZ,iBAAiB,GAArD,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IACW,qBAAqB,GAAzD,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IACR,MAAM,GAAvB,MAAM;CACd,QAuLF;;IAzND;;;;;;;;;;;;;;;;;OAiBG;IAEH;;OAEG;IAEH;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,4GAlB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