@salesforce/cli 2.114.5-dev.1 → 2.115.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 +1 -1
- package/dist/hooks/preparse.js +18 -1
- package/npm-shrinkwrap.json +1602 -1505
- package/oclif.lock +765 -663
- package/oclif.manifest.json +2 -2
- package/package.json +6 -7
package/README.md
CHANGED
package/dist/hooks/preparse.js
CHANGED
|
@@ -71,7 +71,24 @@ const hook = async function ({ argv, options, context }) {
|
|
|
71
71
|
return [name, undefined];
|
|
72
72
|
}
|
|
73
73
|
const crlf = contents.search('\r\n') !== -1;
|
|
74
|
-
|
|
74
|
+
let values;
|
|
75
|
+
if (ext === '.json') {
|
|
76
|
+
// JSON files: parse and re-stringify (existing behavior)
|
|
77
|
+
values = [JSON.stringify(JSON.parse(contents))];
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// Non-JSON files: split by lines and filter full-line comments
|
|
81
|
+
const lines = contents?.trim().split(crlf ? '\r\n' : '\n') || [];
|
|
82
|
+
values = lines.filter((line) => {
|
|
83
|
+
const trimmed = line.trim();
|
|
84
|
+
// Filter out lines that are only whitespace + comment (full-line comments)
|
|
85
|
+
if (trimmed.startsWith('#') || trimmed.startsWith('//')) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
// Keep all other lines unchanged, including empty lines
|
|
89
|
+
return true;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
75
92
|
return [name, values];
|
|
76
93
|
}));
|
|
77
94
|
const newArgv = [...argv];
|