@lightdash/cli 3.12.0 → 3.12.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slugUpdate.d.ts","sourceRoot":"","sources":["../../src/handlers/slugUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,WAAW,EAIX,KAAK,wBAAwB,EAChC,MAAM,mBAAmB,CAAC;AAa3B,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,WAAW,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,SAAS,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,QAAQ,EACF;QACI,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC;QACxD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC,GACD,SAAS,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAIF,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"slugUpdate.d.ts","sourceRoot":"","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C/B,yBAAyB,EAuB3B,CAAC;AAuDF,eAAO,MAAM,oBAAoB,SACvB,mBAAmB,KAC1B,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAuD7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACb,MAAM,WACV,wBAAwB,KAClC,OAAO,CAAC,IAAI,CAmBd,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACb,MAAM,cACP,MAAM,GAAG,SAAS,QACxB,MAAM,MACR,MAAM,iBACI,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,SAAS,KACxD,OAAO,CAAC,mBAAmB,CAuB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,YACjB,iBAAiB,KAC3B,OAAO,CAAC,IAAI,CAyDd,CAAC"}
|
|
@@ -57,6 +57,23 @@ const assertMovesAreSafe = async (moves) => {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
+
// Comment-only or scalar YAML (e.g. chart-type context files) parses to null or a primitive
|
|
61
|
+
const isYamlMapping = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
62
|
+
const readYamlDocuments = async (root) => {
|
|
63
|
+
const documents = [];
|
|
64
|
+
for (const filePath of await getYamlFiles(root)) {
|
|
65
|
+
// eslint-disable-next-line no-await-in-loop
|
|
66
|
+
const source = await fs_1.promises.readFile(filePath, 'utf8');
|
|
67
|
+
const document = (0, yaml_1.parseDocument)(source);
|
|
68
|
+
if (document.errors.length > 0) {
|
|
69
|
+
throw new common_1.ParameterError(`Could not parse "${filePath}": ${document.errors
|
|
70
|
+
.map(({ message }) => message)
|
|
71
|
+
.join('; ')}`);
|
|
72
|
+
}
|
|
73
|
+
documents.push({ filePath, document });
|
|
74
|
+
}
|
|
75
|
+
return documents;
|
|
76
|
+
};
|
|
60
77
|
const planLocalSlugUpdate = async (customPath, from, to, resourceType = common_1.ContentType.CHART) => {
|
|
61
78
|
const root = (0, contentAsCodePaths_1.getDownloadFolder)(customPath);
|
|
62
79
|
const fileUpdates = [];
|
|
@@ -77,17 +94,14 @@ const planLocalSlugUpdate = async (customPath, from, to, resourceType = common_1
|
|
|
77
94
|
referencesUpdated,
|
|
78
95
|
};
|
|
79
96
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.join('; ')}`);
|
|
88
|
-
}
|
|
97
|
+
const contentDocuments = (await readYamlDocuments(root)).flatMap(({ filePath, document }) => {
|
|
98
|
+
const contents = document.toJS();
|
|
99
|
+
return isYamlMapping(contents)
|
|
100
|
+
? [{ filePath, document, parsed: contents }]
|
|
101
|
+
: [];
|
|
102
|
+
});
|
|
103
|
+
for (const { filePath, document, parsed } of contentDocuments) {
|
|
89
104
|
let changed = false;
|
|
90
|
-
const parsed = document.toJS();
|
|
91
105
|
const isChart = parsed.contentType === common_1.ContentType.CHART ||
|
|
92
106
|
parsed.metricQuery !== undefined;
|
|
93
107
|
const isDashboard = parsed.contentType === common_1.ContentType.DASHBOARD ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash/cli",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.2",
|
|
4
4
|
"description": "Lightdash CLI tool",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@actions/core": "1.11.1",
|
|
23
23
|
"@aws-sdk/credential-providers": "3.995.0",
|
|
24
24
|
"@casl/ability": "6.8.0",
|
|
25
|
-
"@lightdash/common": "3.12.
|
|
26
|
-
"@lightdash/warehouses": "3.12.
|
|
25
|
+
"@lightdash/common": "3.12.2",
|
|
26
|
+
"@lightdash/warehouses": "3.12.2",
|
|
27
27
|
"@sidvind/better-ajv-errors": "7.0.0",
|
|
28
28
|
"@types/columnify": "1.5.1",
|
|
29
29
|
"ajv": "8.18.0",
|