@salesforce/sf-plugins-core 2.0.0-beta.6 → 2.0.0-beta.7
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/lib/compatibility.d.ts +1 -1
- package/lib/compatibility.js +7 -3
- package/package.json +2 -2
package/lib/compatibility.d.ts
CHANGED
|
@@ -47,5 +47,5 @@ export type ArrayWithDeprecationOptions = {
|
|
|
47
47
|
/**
|
|
48
48
|
* @deprecated
|
|
49
49
|
*/
|
|
50
|
-
export declare const arrayWithDeprecation: import("@oclif/core/lib/interfaces/parser").FlagDefinition<string, ArrayWithDeprecationOptions>;
|
|
50
|
+
export declare const arrayWithDeprecation: import("@oclif/core/lib/interfaces/parser").FlagDefinition<string[], ArrayWithDeprecationOptions>;
|
|
51
51
|
//# sourceMappingURL=compatibility.d.ts.map
|
package/lib/compatibility.js
CHANGED
|
@@ -86,12 +86,16 @@ exports.optionalHubFlagWithDeprecations = (0, orgFlags_1.optionalHubFlag)({
|
|
|
86
86
|
exports.arrayWithDeprecation = core_1.Flags.custom({
|
|
87
87
|
multiple: true,
|
|
88
88
|
delimiter: ',',
|
|
89
|
-
parse: async (input) => {
|
|
90
|
-
const inputParts = input.split(',').map((i) => i.trim());
|
|
89
|
+
parse: async (input, ctx) => {
|
|
90
|
+
const inputParts = ctx.token.input.split(',').map((i) => i.trim());
|
|
91
91
|
if (inputParts.length > 1) {
|
|
92
92
|
await core_2.Lifecycle.getInstance().emitWarning(messages.getMessage('warning.arrayInputFormat'));
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
// This is a weird consequence of implementing an array flag. The oclif parser splits the input (e.g. "thing1,thing2")
|
|
95
|
+
// on the delimiter and passes each value individually to the parse function. However, the return type needs to be
|
|
96
|
+
// string[] so that upstream consumers have the correct flag typings. So we simply wrap the individual elements in
|
|
97
|
+
// an array to satisfy typescript. Oclif ensures that the user ends up with a flat array of parsed strings.
|
|
98
|
+
return [input];
|
|
95
99
|
},
|
|
96
100
|
});
|
|
97
101
|
//# sourceMappingURL=compatibility.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sf-plugins-core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.7",
|
|
4
4
|
"description": "Utils for writing Salesforce CLI plugins",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"/messages"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@oclif/core": "^2.0.
|
|
35
|
+
"@oclif/core": "^2.0.7",
|
|
36
36
|
"@salesforce/core": "^3.32.12",
|
|
37
37
|
"@salesforce/kit": "^1.8.3",
|
|
38
38
|
"@salesforce/ts-types": "^1.7.1",
|