@komaci/cli 242.3.1 → 244.1.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/build/cmds/modgen/index.js +6 -0
- package/build/cmds/modgen/lib/readAndParseBundle.d.ts +1 -1
- package/build/cmds/modgen/lib/readAndParseBundle.js +5 -1
- package/build/cmds/modgen/lib/run.js +2 -2
- package/build/cmds/modgen/types.d.ts +1 -0
- package/build/lib/log.js +5 -2
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdirSync, existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { basename, dirname, extname, resolve } from 'path';
|
|
3
|
-
import { collectBundleMetadata } from '@lwc
|
|
3
|
+
import { collectBundleMetadata } from '@lwc/metadata';
|
|
4
4
|
import { generateKomaciModule, processGeneratorInputAndState } from '@komaci/esm-generator';
|
|
5
5
|
/**
|
|
6
6
|
* Finds all .js, .mjs, .css, and .html files within the given directory, reads their contents, and combines them into a bundle,
|
|
@@ -68,6 +68,9 @@ export function readAndParseBundle(path, configOverrides) {
|
|
|
68
68
|
const inputFiles = Object.fromEntries(metadata.files
|
|
69
69
|
.map(({ fileName, komaciDoc }) => [fileName, komaciDoc])
|
|
70
70
|
.filter(([, komaciDoc]) => !!komaciDoc));
|
|
71
|
+
const luvioMetadataFileMap = new Map(metadata.files.filter((file) => file.fileType == 'js' &&
|
|
72
|
+
file.luvioMetadata != undefined &&
|
|
73
|
+
file.luvioMetadata.gqlTag.length > 0).map((file) => [file.fileName, file.luvioMetadata]));
|
|
71
74
|
const generatorInput = {
|
|
72
75
|
moduleInfo: {
|
|
73
76
|
name,
|
|
@@ -76,6 +79,7 @@ export function readAndParseBundle(path, configOverrides) {
|
|
|
76
79
|
files: inputFiles,
|
|
77
80
|
},
|
|
78
81
|
srcFileMap,
|
|
82
|
+
luvioMetadata: luvioMetadataFileMap.size >= 1 ? luvioMetadataFileMap : undefined,
|
|
79
83
|
};
|
|
80
84
|
const modGenOutput = generateKomaciModule(generatorInput);
|
|
81
85
|
return {
|
|
@@ -6,7 +6,7 @@ const { log, warn } = logger;
|
|
|
6
6
|
* @param cmdOptions
|
|
7
7
|
*/
|
|
8
8
|
export function run(cmdOptions) {
|
|
9
|
-
const { paths = [], disableKomaci = false, bundleType: type } = cmdOptions;
|
|
9
|
+
const { paths = [], disableKomaci = false, bundleType: type, luvioMetadata } = cmdOptions;
|
|
10
10
|
if (paths.length) {
|
|
11
11
|
if (cmdOptions.withExceptions) {
|
|
12
12
|
const errors = [];
|
|
@@ -24,7 +24,7 @@ export function run(cmdOptions) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
const parsedBundles = paths.map((path) => readAndParseBundle(path, { enableKomaci: !disableKomaci, type }));
|
|
27
|
+
const parsedBundles = paths.map((path) => readAndParseBundle(path, { enableKomaci: !disableKomaci, type, enableLuvio: luvioMetadata }));
|
|
28
28
|
for (const parsedBundle of parsedBundles) {
|
|
29
29
|
const { input: { bundleConfig = null } = {}, output } = parsedBundle || {};
|
|
30
30
|
const { type, namespace, name, namespaceMapping = {}, enableKomaci = false, files = [], } = bundleConfig || {};
|
package/build/lib/log.js
CHANGED
|
@@ -8,8 +8,11 @@ const { red, yellow, blue } = chalk;
|
|
|
8
8
|
* @returns Seralized version of the object,
|
|
9
9
|
*/
|
|
10
10
|
export function serialize(obj, pretty = true) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
if (pretty) {
|
|
12
|
+
const options = { depth: 5, colors: true };
|
|
13
|
+
return inspect(obj, options);
|
|
14
|
+
}
|
|
15
|
+
return JSON.stringify(obj, null, 2);
|
|
13
16
|
}
|
|
14
17
|
export default {
|
|
15
18
|
log,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@komaci/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "244.1.0",
|
|
4
4
|
"description": "CLI utility that enables developers to use komaci from the command line.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/AndrewHuffman/komaci/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@komaci/esm-generator": "
|
|
28
|
-
"@lwc/metadata": "2.
|
|
27
|
+
"@komaci/esm-generator": "244.1.0",
|
|
28
|
+
"@lwc/metadata": "2.32.0-0",
|
|
29
29
|
"@lwc/sfdc-compiler-utils": "2.22.0-0",
|
|
30
30
|
"chalk": "^5.0.1",
|
|
31
31
|
"command-line-args": "^5.2.1"
|