coralite 0.28.2 → 0.28.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.
- package/bin/coralite.js +21 -0
- package/dist/lib/coralite.d.ts +7 -2
- package/dist/lib/coralite.d.ts.map +1 -1
- package/dist/lib/index.js +5 -0
- package/dist/lib/index.js.map +2 -2
- package/dist/plugins/static-assets.d.ts +1 -1
- package/dist/plugins/static-assets.d.ts.map +1 -1
- package/dist/types/core.d.ts +18 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/bin/coralite.js
CHANGED
|
@@ -24,6 +24,7 @@ program
|
|
|
24
24
|
.option('-s, --skip-render-attribute <key...>', 'Parse elements but exclude them from final render output', [])
|
|
25
25
|
.option('-d, --dry-run', 'Run in dry-run mode')
|
|
26
26
|
.option('--standalone <path>', 'Output directory for standalone client-side web components')
|
|
27
|
+
.option('-a, --assets <mapping...>', 'Static assets to copy. Format: pkg:path:dest (or pkg:path)')
|
|
27
28
|
|
|
28
29
|
program.parse(process.argv)
|
|
29
30
|
program.on('error', (err) => {
|
|
@@ -46,6 +47,25 @@ const options = program.opts()
|
|
|
46
47
|
const pages = options.pages
|
|
47
48
|
const output = options.output
|
|
48
49
|
const ignoreByAttribute = []
|
|
50
|
+
let assets
|
|
51
|
+
|
|
52
|
+
if (options.assets) {
|
|
53
|
+
assets = []
|
|
54
|
+
for (const assetStr of options.assets) {
|
|
55
|
+
const parts = assetStr.split(':')
|
|
56
|
+
if (parts.length < 2) {
|
|
57
|
+
console.error('Failed to parse asset:', assetStr)
|
|
58
|
+
console.error('Invalid format. Expected pkg:path:dest or pkg:path')
|
|
59
|
+
process.exit(1)
|
|
60
|
+
}
|
|
61
|
+
const [pkg, path, dest] = parts
|
|
62
|
+
assets.push({
|
|
63
|
+
pkg,
|
|
64
|
+
path,
|
|
65
|
+
dest: dest || path
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
}
|
|
49
69
|
|
|
50
70
|
const coraliteOptions = {
|
|
51
71
|
components: options.components,
|
|
@@ -55,6 +75,7 @@ const coraliteOptions = {
|
|
|
55
75
|
mode: options.mode,
|
|
56
76
|
standaloneOutput: options.standalone,
|
|
57
77
|
output,
|
|
78
|
+
assets,
|
|
58
79
|
plugins: []
|
|
59
80
|
}
|
|
60
81
|
|
package/dist/lib/coralite.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* @param {CoralitePluginInstance[]} [options.plugins=[]]
|
|
27
27
|
* @param {string} options.pages - The path to the directory containing pages that will be rendered using the provided components.
|
|
28
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
|
|
29
30
|
* @param {Array<string | Attribute>} [options.ignoreByAttribute] - Elements to ignore with attribute name value pair
|
|
30
31
|
* @param {Array<string | Attribute>} [options.skipRenderByAttribute] - Element attributes to parse but exclude from final render output
|
|
31
32
|
* @param {string} [options.standaloneOutput] - Output directory for standalone client-side web components
|
|
@@ -40,11 +41,12 @@
|
|
|
40
41
|
* skipRenderByAttribute: ['data-skip-render']
|
|
41
42
|
* });
|
|
42
43
|
*/
|
|
43
|
-
export function Coralite({ components, pages, plugins, ignoreByAttribute, skipRenderByAttribute, mode, standaloneOutput, output }: {
|
|
44
|
+
export function Coralite({ components, pages, plugins, assets, ignoreByAttribute, skipRenderByAttribute, mode, standaloneOutput, output }: {
|
|
44
45
|
components: string;
|
|
45
46
|
plugins?: CoralitePluginInstance[];
|
|
46
47
|
pages: string;
|
|
47
48
|
mode?: string;
|
|
49
|
+
assets?: import("../types/core.js").CoraliteStaticAsset[];
|
|
48
50
|
ignoreByAttribute?: Array<string | Attribute>;
|
|
49
51
|
skipRenderByAttribute?: Array<string | Attribute>;
|
|
50
52
|
standaloneOutput?: string;
|
|
@@ -79,6 +81,7 @@ export class Coralite {
|
|
|
79
81
|
* @param {CoralitePluginInstance[]} [options.plugins=[]]
|
|
80
82
|
* @param {string} options.pages - The path to the directory containing pages that will be rendered using the provided components.
|
|
81
83
|
* @param {string} [options.mode='production'] - Build mode: "development" or "production"
|
|
84
|
+
* @param {import('../types/core.js').CoraliteStaticAsset[]} [options.assets] - Static assets to copy during build
|
|
82
85
|
* @param {Array<string | Attribute>} [options.ignoreByAttribute] - Elements to ignore with attribute name value pair
|
|
83
86
|
* @param {Array<string | Attribute>} [options.skipRenderByAttribute] - Element attributes to parse but exclude from final render output
|
|
84
87
|
* @param {string} [options.standaloneOutput] - Output directory for standalone client-side web components
|
|
@@ -93,11 +96,12 @@ export class Coralite {
|
|
|
93
96
|
* skipRenderByAttribute: ['data-skip-render']
|
|
94
97
|
* });
|
|
95
98
|
*/
|
|
96
|
-
constructor({ components, pages, plugins, ignoreByAttribute, skipRenderByAttribute, mode, standaloneOutput, output }: {
|
|
99
|
+
constructor({ components, pages, plugins, assets, ignoreByAttribute, skipRenderByAttribute, mode, standaloneOutput, output }: {
|
|
97
100
|
components: string;
|
|
98
101
|
plugins?: CoralitePluginInstance[];
|
|
99
102
|
pages: string;
|
|
100
103
|
mode?: string;
|
|
104
|
+
assets?: import("../types/core.js").CoraliteStaticAsset[];
|
|
101
105
|
ignoreByAttribute?: Array<string | Attribute>;
|
|
102
106
|
skipRenderByAttribute?: Array<string | Attribute>;
|
|
103
107
|
standaloneOutput?: string;
|
|
@@ -107,6 +111,7 @@ export class Coralite {
|
|
|
107
111
|
components: string;
|
|
108
112
|
pages: string;
|
|
109
113
|
plugins: CoralitePluginInstance[];
|
|
114
|
+
assets: import("../types/core.js").CoraliteStaticAsset[];
|
|
110
115
|
ignoreByAttribute: (string | import("../types/document.js").Attribute)[];
|
|
111
116
|
skipRenderByAttribute: (string | import("../types/document.js").Attribute)[];
|
|
112
117
|
mode: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,2IAnBG;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,gBAAgB,GAAjC,MAAM;IACW,MAAM,GAAvB,MAAM;CACd,QAyLF;;IA5ND;;;;;;;;;;;;;;;;;OAiBG;IAEH;;OAEG;IAEH;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,8HAnBG;QAAwB,UAAU,EAA1B,MAAM;QAC6B,OAAO,GAA1C,sBAAsB,EAAE;QACR,KAAK,EAArB,MAAM;QACW,IAAI,GAArB,MAAM;QACqD,MAAM,GAAjE,OAAO,kBAAkB,EAAE,mBAAmB,EAAE;QACZ,iBAAiB,GAArD,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QACW,qBAAqB,GAAzD,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QACR,gBAAgB,GAAjC,MAAM;QACW,MAAM,GAAvB,MAAM;KACd,EAyLF;IAjJC;;;;;;;;;;;;;;MAWC;IAED,oDAAoD;IACpD,eADW,GAAG,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAClB;IAG9B;;;;;;;;;;;;;;MAcC;IAGD,8BAAyC;IAGzC;;;;;;;;8BA68BS,oBAAoB,GAAG,eAAe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B;QACE,OAAO,EAA7B,eAAe;QACQ,QAAQ,EAA/B,gBAAgB;QACH,SAAS,EAAtB,MAAM;QACO,aAAa;KAElC,GAAU,OAAO,CAAC,oBAAoB,CAAC,CAiHzC;IAED;;;;;;;;;;;;;OAaG;IACH,yBAFa,OAAO,CAAC,oBAAoB,CAAC,CAOzC;IAED;;;;;;;;;;OAUG;IACH,mBAVsB,CAAC,wBAMZ,WAAW,GAAC,cAAc,GAAC,cAAc,GAAC,gBAAgB,GAAC,mBAAmB,GAAC,mBAAmB,GAAC,oBAAoB,GAAC,mBAAmB,GAAC,eAAe,GAAC,cAAc,QAC1K,CAAC,GACA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAc5B;IAED;;;;;;;OAOG;IACH,qBAHW,WAAW,GAAC,cAAc,GAAC,cAAc,GAAC,gBAAgB,GAAC,mBAAmB,GAAC,mBAAmB,GAAC,oBAAoB,GAAC,mBAAmB,GAAC,eAAe,GAAC,cAAc,4BAapL;;;wCAxlCU,cAAc,KACZ,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG;4CApyBY,oBAAoB;+BAFrC,mBAAmB;4CAAnB,mBAAmB;8BA9Bf,qBAAqB;0BAFmB,YAAY;4BAAZ,YAAY;6BADxC,WAAW;4BAAX,WAAW;8BACiB,YAAY;+BAAZ,YAAY;0CAgCxD,mBAAmB;qCAAnB,mBAAmB;0CAMN,gBAAgB;+BAxBxB,iBAAiB;oCAkBtB,mBAAmB;0CAAnB,mBAAmB;qCAAnB,mBAAmB;sCAAnB,mBAAmB;oCAAnB,mBAAmB"}
|
package/dist/lib/index.js
CHANGED
|
@@ -10663,6 +10663,7 @@ function Coralite({
|
|
|
10663
10663
|
components,
|
|
10664
10664
|
pages,
|
|
10665
10665
|
plugins,
|
|
10666
|
+
assets,
|
|
10666
10667
|
ignoreByAttribute,
|
|
10667
10668
|
skipRenderByAttribute,
|
|
10668
10669
|
mode = "production",
|
|
@@ -10686,6 +10687,7 @@ function Coralite({
|
|
|
10686
10687
|
components,
|
|
10687
10688
|
pages,
|
|
10688
10689
|
plugins,
|
|
10690
|
+
assets,
|
|
10689
10691
|
ignoreByAttribute,
|
|
10690
10692
|
skipRenderByAttribute,
|
|
10691
10693
|
mode,
|
|
@@ -10729,6 +10731,9 @@ function Coralite({
|
|
|
10729
10731
|
}
|
|
10730
10732
|
};
|
|
10731
10733
|
plugins.unshift(defineComponent, refsPlugin, metadataPlugin);
|
|
10734
|
+
if (assets) {
|
|
10735
|
+
plugins.unshift(staticAssetPlugin(assets));
|
|
10736
|
+
}
|
|
10732
10737
|
const source = this._source;
|
|
10733
10738
|
for (let i = 0; i < plugins.length; i++) {
|
|
10734
10739
|
const plugin = plugins[i];
|