helm-env-delta 1.13.1 → 1.14.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/README.md
CHANGED
|
@@ -706,7 +706,9 @@ outputFormat:
|
|
|
706
706
|
arraySort: # Sort arrays
|
|
707
707
|
'services/**/values.yaml':
|
|
708
708
|
- path: 'env'
|
|
709
|
-
sortBy: 'name'
|
|
709
|
+
sortBy: 'name' # Sort object array by field
|
|
710
|
+
order: 'asc'
|
|
711
|
+
- path: 'volumes' # No sortBy → sort scalar array by value
|
|
710
712
|
order: 'asc'
|
|
711
713
|
|
|
712
714
|
quoteValues: # Force quoting
|
|
@@ -71,7 +71,7 @@ declare const stopRuleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
71
71
|
}, z.core.$strict>], "type">;
|
|
72
72
|
declare const arraySortRuleSchema: z.ZodObject<{
|
|
73
73
|
path: z.ZodString;
|
|
74
|
-
sortBy: z.ZodString
|
|
74
|
+
sortBy: z.ZodOptional<z.ZodString>;
|
|
75
75
|
order: z.ZodDefault<z.ZodEnum<{
|
|
76
76
|
asc: "asc";
|
|
77
77
|
desc: "desc";
|
|
@@ -120,7 +120,7 @@ declare const baseConfigSchema: z.ZodObject<{
|
|
|
120
120
|
}, z.core.$strip>>>>;
|
|
121
121
|
arraySort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
122
122
|
path: z.ZodString;
|
|
123
|
-
sortBy: z.ZodString
|
|
123
|
+
sortBy: z.ZodOptional<z.ZodString>;
|
|
124
124
|
order: z.ZodDefault<z.ZodEnum<{
|
|
125
125
|
asc: "asc";
|
|
126
126
|
desc: "desc";
|
|
@@ -243,7 +243,7 @@ declare const finalConfigSchema: z.ZodObject<{
|
|
|
243
243
|
}, z.core.$strip>>>>;
|
|
244
244
|
arraySort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
245
245
|
path: z.ZodString;
|
|
246
|
-
sortBy: z.ZodString
|
|
246
|
+
sortBy: z.ZodOptional<z.ZodString>;
|
|
247
247
|
order: z.ZodDefault<z.ZodEnum<{
|
|
248
248
|
asc: "asc";
|
|
249
249
|
desc: "desc";
|
|
@@ -318,7 +318,7 @@ declare const formatOnlyConfigSchema: z.ZodObject<{
|
|
|
318
318
|
}, z.core.$strip>>>>;
|
|
319
319
|
arraySort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
320
320
|
path: z.ZodString;
|
|
321
|
-
sortBy: z.ZodString
|
|
321
|
+
sortBy: z.ZodOptional<z.ZodString>;
|
|
322
322
|
order: z.ZodDefault<z.ZodEnum<{
|
|
323
323
|
asc: "asc";
|
|
324
324
|
desc: "desc";
|
|
@@ -76,7 +76,7 @@ const stopRuleSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
76
76
|
]);
|
|
77
77
|
const arraySortRuleSchema = zod_1.z.object({
|
|
78
78
|
path: zod_1.z.string().min(1),
|
|
79
|
-
sortBy: zod_1.z.string().min(1),
|
|
79
|
+
sortBy: zod_1.z.string().min(1).optional(),
|
|
80
80
|
order: zod_1.z.enum(['asc', 'desc']).default('asc')
|
|
81
81
|
});
|
|
82
82
|
const keySortRuleSchema = zod_1.z.object({ path: zod_1.z.string().min(1) });
|
|
@@ -308,6 +308,13 @@ const isPotentialMatch = (currentPath, targetPath) => {
|
|
|
308
308
|
const sortYamlSeq = (seq, sortByField, order) => {
|
|
309
309
|
if (!seq.items || seq.items.length === 0)
|
|
310
310
|
return;
|
|
311
|
+
const firstItem = seq.items.find((item) => item != undefined);
|
|
312
|
+
if (firstItem !== undefined) {
|
|
313
|
+
if (sortByField === undefined && (0, yamlTypeGuards_1.isYamlMap)(firstItem))
|
|
314
|
+
return;
|
|
315
|
+
if (sortByField !== undefined && (0, yamlTypeGuards_1.isScalar)(firstItem))
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
311
318
|
const itemsWithSortKeys = [];
|
|
312
319
|
for (const item of seq.items) {
|
|
313
320
|
const sortKey = extractSortKey(item, sortByField);
|
|
@@ -319,6 +326,16 @@ const sortYamlSeq = (seq, sortByField, order) => {
|
|
|
319
326
|
seq.items = [...itemsWithKeys, ...itemsWithoutKeys].map((entry) => entry.item);
|
|
320
327
|
};
|
|
321
328
|
const extractSortKey = (item, sortByField) => {
|
|
329
|
+
if (sortByField === undefined) {
|
|
330
|
+
if ((0, yamlTypeGuards_1.isScalar)(item)) {
|
|
331
|
+
const value = item.value;
|
|
332
|
+
if (typeof value === 'string')
|
|
333
|
+
return value;
|
|
334
|
+
if (typeof value === 'number')
|
|
335
|
+
return value;
|
|
336
|
+
}
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
322
339
|
if (!(0, yamlTypeGuards_1.isYamlMap)(item))
|
|
323
340
|
return undefined;
|
|
324
341
|
for (const pair of item.items) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helm-env-delta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "HelmEnvDelta – environment-aware YAML delta and sync for GitOps",
|
|
5
5
|
"author": "BCsabaEngine",
|
|
6
6
|
"license": "ISC",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"automation"
|
|
65
65
|
],
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@eslint/js": "^10.0.
|
|
67
|
+
"@eslint/js": "^10.0.1",
|
|
68
68
|
"@types/node": "^25.3.0",
|
|
69
69
|
"@types/picomatch": "^4.0.2",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^8.56.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
71
71
|
"@vitest/coverage-v8": "^4.0.18",
|
|
72
|
-
"eslint": "^10.0.
|
|
72
|
+
"eslint": "^10.0.2",
|
|
73
73
|
"eslint-config-prettier": "^10.1.8",
|
|
74
74
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
75
75
|
"eslint-plugin-unicorn": "^63.0.0",
|