coralite 0.18.0 → 0.18.2
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/bin/coralite.js +2 -2
- package/dist/lib/collection.d.ts +7 -7
- package/dist/lib/collection.d.ts.map +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/coralite.d.ts +16 -16
- package/dist/lib/coralite.d.ts.map +1 -1
- package/dist/lib/html.d.ts +4 -4
- package/dist/lib/html.d.ts.map +1 -1
- package/dist/lib/index.js +4115 -3
- package/dist/lib/parse.d.ts +7 -7
- package/dist/lib/parse.d.ts.map +1 -1
- package/dist/lib/plugin.d.ts +8 -8
- package/dist/lib/plugin.d.ts.map +1 -1
- package/dist/plugins/define-component.d.ts +9 -9
- package/dist/plugins/define-component.d.ts.map +1 -1
- package/dist/plugins/define-component.js +163 -1
- package/dist/plugins/index.js +2 -1
- package/dist/plugins/refs.js +16 -1
- package/package.json +3 -4
package/bin/coralite.js
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command()
|
|
|
15
15
|
program
|
|
16
16
|
.name('Coralite')
|
|
17
17
|
.description('HTML modules static site generator CLI tool')
|
|
18
|
-
.version('0.18.
|
|
18
|
+
.version('0.18.1')
|
|
19
19
|
.requiredOption('-t, --templates <path>', 'Path to templates directory')
|
|
20
20
|
.requiredOption('-p, --pages <path>', 'Path to pages directory')
|
|
21
21
|
.requiredOption('-o, --output <path>', 'Output directory for the generated site')
|
|
@@ -31,7 +31,7 @@ const configPath = pathToFileURL(join(process.cwd(), 'coralite.config.js'))
|
|
|
31
31
|
let config
|
|
32
32
|
|
|
33
33
|
// check if the configuration file exists at the specified path
|
|
34
|
-
if (existsSync(configPath
|
|
34
|
+
if (existsSync(configPath)) {
|
|
35
35
|
const data = await import(configPath.href)
|
|
36
36
|
|
|
37
37
|
if (data.default) {
|
package/dist/lib/collection.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default CoraliteCollection;
|
|
|
5
5
|
* CoraliteCollectionEventSet,
|
|
6
6
|
* CoraliteCollectionEventUpdate,
|
|
7
7
|
* CoraliteCollectionItem,
|
|
8
|
-
* HTMLData } from '
|
|
8
|
+
* HTMLData } from '../types/index.js'
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* Represents a collection of documents with methods to organize and retrieve them.
|
|
@@ -30,7 +30,7 @@ declare class CoraliteCollection {
|
|
|
30
30
|
* CoraliteCollectionEventSet,
|
|
31
31
|
* CoraliteCollectionEventUpdate,
|
|
32
32
|
* CoraliteCollectionItem,
|
|
33
|
-
* HTMLData } from '
|
|
33
|
+
* HTMLData } from '../types/index.js'
|
|
34
34
|
*/
|
|
35
35
|
/**
|
|
36
36
|
* Represents a collection of documents with methods to organize and retrieve them.
|
|
@@ -130,9 +130,9 @@ declare class CoraliteCollection {
|
|
|
130
130
|
*/
|
|
131
131
|
_loadByPath(filepath: string): Promise<HTMLData>;
|
|
132
132
|
}
|
|
133
|
-
import type { CoraliteCollectionEventSet } from '
|
|
134
|
-
import type { CoraliteCollectionEventUpdate } from '
|
|
135
|
-
import type { CoraliteCollectionEventDelete } from '
|
|
136
|
-
import type { CoraliteCollectionItem } from '
|
|
137
|
-
import type { HTMLData } from '
|
|
133
|
+
import type { CoraliteCollectionEventSet } from '../types/index.js';
|
|
134
|
+
import type { CoraliteCollectionEventUpdate } from '../types/index.js';
|
|
135
|
+
import type { CoraliteCollectionEventDelete } from '../types/index.js';
|
|
136
|
+
import type { CoraliteCollectionItem } from '../types/index.js';
|
|
137
|
+
import type { HTMLData } from '../types/index.js';
|
|
138
138
|
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../lib/collection.js"],"names":[],"mappings":";AAKA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,8CALG;IAAyB,OAAO,GAAxB,MAAM;IAC+B,KAAK,GAA1C,0BAA0B;IACc,QAAQ,GAAh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;;OASG;IACH,sBALG;QAAyB,OAAO,GAAxB,MAAM;QAC+B,KAAK,GAA1C,0BAA0B;QACc,QAAQ,GAAhD,6BAA6B;QACW,QAAQ,GAAhD,6BAA6B;KACvC,EAgDA;IA9CC;;OAEG;IACH,gBAAyC;IAMzC;;;OAGG;IACH,MAFU,sBAAsB,EAAE,CAEpB;IAEd;;;;OAIG;IACH;;MAAoB;IAEpB;;;;OAIG;IACH;;MAAoB;IAEpB;;;OAGG;IACH,QAFU,0BAA0B,GAAG,SAAS,CAErB;IAE3B;;;OAGG;IACH,WAFU,6BAA6B,GAAG,SAAS,CAElB;IAEjC;;;OAGG;IACH,WAFU,6BAA6B,GAAG,SAAS,CAElB;IAGnC;;;;;OAKG;IACH,eAHW,QAAQ,GAAC,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC,CA8C3C;IAED;;;;;OAKG;IACH,kBAHW,QAAQ,GAAG,MAAM,iBA0C3B;IAED;;;;;OAKG;IACH,kBAHW,sBAAsB,GAAC,MAAM,iBA0BvC;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,sBAAsB,GAAG,SAAS,CAQ9C;IAED;;;;OAIG;IACH,uBAHW,MAAM,GACJ,sBAAsB,EAAE,GAAG,SAAS,CAQhD;IAED;;;;;;OAMG;IACH,sBAJW,MAAM,GACJ,OAAO,CAAC,QAAQ,CAAC,CA2B7B;;gDAzPmB,mBAAmB;mDAAnB,mBAAmB;mDAAnB,mBAAmB;4CAAnB,mBAAmB;8BAAnB,mBAAmB"}
|
package/dist/lib/config.d.ts
CHANGED
package/dist/lib/coralite.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* IgnoreByAttribute,
|
|
17
17
|
* CoraliteScriptTextContent,
|
|
18
18
|
* CoraliteDocumentResult,
|
|
19
|
-
* CoraliteFilePath} from '
|
|
19
|
+
* CoraliteFilePath} from '../types/index.js'
|
|
20
20
|
* @import CoraliteCollection from './collection.js'
|
|
21
21
|
* @import {Module} from 'node:vm'
|
|
22
22
|
*/
|
|
@@ -60,7 +60,7 @@ export class Coralite {
|
|
|
60
60
|
* IgnoreByAttribute,
|
|
61
61
|
* CoraliteScriptTextContent,
|
|
62
62
|
* CoraliteDocumentResult,
|
|
63
|
-
* CoraliteFilePath} from '
|
|
63
|
+
* CoraliteFilePath} from '../types/index.js'
|
|
64
64
|
* @import CoraliteCollection from './collection.js'
|
|
65
65
|
* @import {Module} from 'node:vm'
|
|
66
66
|
*/
|
|
@@ -296,8 +296,8 @@ export class Coralite {
|
|
|
296
296
|
_addPluginHook(name: "onPageSet" | "onPageUpdate" | "onPageDelete" | "onTemplateSet" | "onTemplateUpdate" | "onTemplateDelete", callback: Function): void;
|
|
297
297
|
}
|
|
298
298
|
export default Coralite;
|
|
299
|
-
import type { CoralitePluginInstance } from '
|
|
300
|
-
import type { IgnoreByAttribute } from '
|
|
299
|
+
import type { CoralitePluginInstance } from '../types/index.js';
|
|
300
|
+
import type { IgnoreByAttribute } from '../types/index.js';
|
|
301
301
|
import { parseHTML } from '#lib';
|
|
302
302
|
import { parseModule } from '#lib';
|
|
303
303
|
import { getHtmlFiles } from '#lib';
|
|
@@ -305,18 +305,18 @@ import { getHtmlFile } from '#lib';
|
|
|
305
305
|
import { createElement } from '#lib';
|
|
306
306
|
import { createTextNode } from '#lib';
|
|
307
307
|
import type CoraliteCollection from './collection.js';
|
|
308
|
-
import type { CoraliteModuleValue } from '
|
|
309
|
-
import type { CoraliteScriptTextContent } from '
|
|
310
|
-
import type { CoraliteCollectionItem } from '
|
|
311
|
-
import type { CoraliteResult } from '
|
|
312
|
-
import type { CoraliteDocumentRoot } from '
|
|
313
|
-
import type { CoraliteAnyNode } from '
|
|
314
|
-
import type { CoraliteModuleValues } from '
|
|
315
|
-
import type { CoraliteElement } from '
|
|
316
|
-
import type { CoraliteDocument } from '
|
|
317
|
-
import type { CoraliteModule } from '
|
|
318
|
-
import type { CoraliteDirective } from '
|
|
319
|
-
import type { CoraliteFilePath } from '
|
|
308
|
+
import type { CoraliteModuleValue } from '../types/index.js';
|
|
309
|
+
import type { CoraliteScriptTextContent } from '../types/index.js';
|
|
310
|
+
import type { CoraliteCollectionItem } from '../types/index.js';
|
|
311
|
+
import type { CoraliteResult } from '../types/index.js';
|
|
312
|
+
import type { CoraliteDocumentRoot } from '../types/index.js';
|
|
313
|
+
import type { CoraliteAnyNode } from '../types/index.js';
|
|
314
|
+
import type { CoraliteModuleValues } from '../types/index.js';
|
|
315
|
+
import type { CoraliteElement } from '../types/index.js';
|
|
316
|
+
import type { CoraliteDocument } from '../types/index.js';
|
|
317
|
+
import type { CoraliteModule } from '../types/index.js';
|
|
318
|
+
import type { CoraliteDirective } from '../types/index.js';
|
|
319
|
+
import type { CoraliteFilePath } from '../types/index.js';
|
|
320
320
|
import { SourceTextModule } from 'node:vm';
|
|
321
321
|
import type { Module } from 'node:vm';
|
|
322
322
|
//# sourceMappingURL=coralite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;;;;;GAcG;AACH,2EAZG;IAAwB,SAAS,EAAzB,MAAM;IAC6B,OAAO,GAA1C,sBAAsB,EAAE;IACR,KAAK,EAArB,MAAM;IACwB,iBAAiB,GAA/C,iBAAiB,EAAE;CAC3B,
|
|
1
|
+
{"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;;;;;GAcG;AACH,2EAZG;IAAwB,SAAS,EAAzB,MAAM;IAC6B,OAAO,GAA1C,sBAAsB,EAAE;IACR,KAAK,EAArB,MAAM;IACwB,iBAAiB,GAA/C,iBAAiB,EAAE;CAC3B,QA8KF;;IA5MD;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEH;;;;;;;;;;;;;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* CoraliteCollectionEventDelete } from '
|
|
5
|
+
* CoraliteCollectionEventDelete } from '../types/index.js'
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Get HTML
|
|
@@ -39,8 +39,8 @@ export function getHtmlFiles({ path, type, recursive, exclude, onFileSet, onFile
|
|
|
39
39
|
* @throws {Error} If the file cannot be read.
|
|
40
40
|
*/
|
|
41
41
|
export function getHtmlFile(pathname: string): string;
|
|
42
|
-
import type { CoraliteCollectionEventSet } from '
|
|
43
|
-
import type { CoraliteCollectionEventUpdate } from '
|
|
44
|
-
import type { CoraliteCollectionEventDelete } from '
|
|
42
|
+
import type { CoraliteCollectionEventSet } from '../types/index.js';
|
|
43
|
+
import type { CoraliteCollectionEventUpdate } from '../types/index.js';
|
|
44
|
+
import type { CoraliteCollectionEventDelete } from '../types/index.js';
|
|
45
45
|
import CoraliteCollection from './collection.js';
|
|
46
46
|
//# sourceMappingURL=html.d.ts.map
|
package/dist/lib/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../lib/html.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wGAjBG;IAAwB,IAAI,EAApB,MAAM;IACuB,IAAI,EAAjC,MAAM,GAAG,UAAU;IACD,SAAS,GAA3B,OAAO;IACY,OAAO,GAA1B,MAAM,EAAE;IAC6B,SAAS,GAA9C,0BAA0B;IACc,YAAY,GAApD,6BAA6B;IACW,YAAY,GAApD,6BAA6B;CACrC,GAAU,OAAO,CAAC,kBAAkB,CAAC,CA2DvC;AAED;;;;GAIG;AACH,sCAHW,MAAM,UAehB;gDA3FwC,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../lib/html.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wGAjBG;IAAwB,IAAI,EAApB,MAAM;IACuB,IAAI,EAAjC,MAAM,GAAG,UAAU;IACD,SAAS,GAA3B,OAAO;IACY,OAAO,GAA1B,MAAM,EAAE;IAC6B,SAAS,GAA9C,0BAA0B;IACc,YAAY,GAApD,6BAA6B;IACW,YAAY,GAApD,6BAA6B;CACrC,GAAU,OAAO,CAAC,kBAAkB,CAAC,CA2DvC;AAED;;;;GAIG;AACH,sCAHW,MAAM,UAehB;gDA3FwC,mBAAmB;mDAAnB,mBAAmB;mDAAnB,mBAAmB;+BAN7B,iBAAiB"}
|