Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
fix: deprecation type
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 18, 2023
1 parent c060cd7 commit 7b66aa9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022, Salesforce.com, Inc.
Copyright (c) 2023, Salesforce.com, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"!lib/**/*.map"
],
"dependencies": {
"@oclif/core": "^1.23.0",
"@oclif/core": "^1.24.1",
"@oclif/test": "^2.2.19",
"@salesforce/core": "^3.32.12",
"@salesforce/kit": "^1.8.2",
Expand Down Expand Up @@ -71,4 +71,4 @@
"publishConfig": {
"access": "public"
}
}
}
8 changes: 5 additions & 3 deletions src/sfdxFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function option<T>(
}

export namespace flags {
export type Any<T> = Partial<Interfaces.Flag<T>> & SfdxProperties;
export type Any<T> = Omit<Partial<Interfaces.Flag<T>>, 'deprecated'> & SfdxProperties;
export type Array<T = string> = Option<T[]> & { delimiter?: string };
export type BaseBoolean<T> = Partial<Interfaces.BooleanFlag<T>>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -138,7 +138,8 @@ export namespace flags {
export type Number = Option<number> & NumericBounds;
export type NumericBounds = Bounds<number>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Option<T = any> = Partial<CustomOptionFlag<T>> & SfdxProperties & Validatable;
export type Option<T = any> = Omit<Partial<CustomOptionFlag<T>>, 'deprecated'> & SfdxProperties & Validatable;
// export type Option<T = any> = Omit<Partial<CustomOptionFlag<T>>, 'deprecated'> & SfdxProperties & Validatable;
export type Output = Interfaces.FlagOutput;
// allow numeric bounds for back compat
export type Seconds = Option<Duration> & Bounds<Duration | number>;
Expand Down Expand Up @@ -217,7 +218,8 @@ function buildInteger(options: flags.Number): flags.Discriminated<flags.Number>
function buildOption<T>(
options: { parse: (val: string, ctx: unknown) => Promise<T> } & flags.Option<T>
): flags.Discriminated<flags.Option<T>> {
return merge('option', OclifFlags.option(options), options);
const optsFlag = OclifFlags.option(options);
return merge('option', optsFlag, options);
}

function buildString(options: flags.String): flags.Discriminated<flags.String> {
Expand Down
2 changes: 1 addition & 1 deletion src/ux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export type Deprecation = {
/**
* A deprecation warning message configuration type. A typical instance can pass `name`,
* `type`, and `version` for a standard message. Alternatively, the `messageOverride` can
* be used as a special case deprecated message. Used when formating a deprecation message.
* be used as a special case deprecated message. Used when formatting a deprecation message.
*/
export type DeprecationDefinition = {
to?: string;
Expand Down
41 changes: 40 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@
is-wsl "^2.1.1"
tslib "^2.3.1"

"@oclif/core@^1.23.0", "@oclif/core@^1.23.1":
"@oclif/core@^1.23.1":
version "1.23.1"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.23.1.tgz#bebbbc4e02a4c1a4216d64165f892037f8a1e14a"
integrity sha512-nz7wVGesJ1Qg74p1KNKluZpQ3Z042mqdaRlczEI4Xwqj5s9jjdDBCDHNkiGzV4UAKzicVzipNj6qqhyUWKYnaA==
Expand Down Expand Up @@ -604,6 +604,40 @@
widest-line "^3.1.0"
wrap-ansi "^7.0.0"

"@oclif/core@^1.24.1":
version "1.24.1"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.24.1.tgz#b10324fc8dfbe70539a4479509b25a9dd867aed3"
integrity sha512-CQFCsj9fUALfTNGXR9qaP3yXiF9TuL6GKph1NwXMe2yzpAE4Zz8X8uFpi916rE3oAHEPX6bR9fhdUiBGgDBuGw==
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^3.0.4"
ansi-escapes "^4.3.2"
ansi-styles "^4.3.0"
cardinal "^2.1.1"
chalk "^4.1.2"
clean-stack "^3.0.1"
cli-progress "^3.10.0"
debug "^4.3.4"
ejs "^3.1.6"
fs-extra "^9.1.0"
get-package-type "^0.1.0"
globby "^11.1.0"
hyperlinker "^1.0.0"
indent-string "^4.0.0"
is-wsl "^2.2.0"
js-yaml "^3.14.1"
natural-orderby "^2.0.3"
object-treeify "^1.1.33"
password-prompt "^1.1.2"
semver "^7.3.7"
string-width "^4.2.3"
strip-ansi "^6.0.1"
supports-color "^8.1.1"
supports-hyperlinks "^2.2.0"
tslib "^2.4.1"
widest-line "^3.1.0"
wrap-ansi "^7.0.0"

"@oclif/dev-cli@^1":
version "1.26.10"
resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.26.10.tgz#d8df3a79009b68552f5e7f249d1d19ca52278382"
Expand Down Expand Up @@ -702,6 +736,11 @@
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-3.0.3.tgz#e679ad10535e31d333f809f7a71335cc9aef1e55"
integrity sha512-KX8gMYA9ujBPOd1HFsV9e0iEx7Uoj8AG/3YsW4TtWQTg4lJvr82qNm7o/cFQfYRIt+jw7Ew/4oL4A22zOT+IRA==

"@oclif/screen@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-3.0.4.tgz#663db0ecaf23f3184e7f01886ed578060e4a7f1c"
integrity sha512-IMsTN1dXEXaOSre27j/ywGbBjrzx0FNd1XmuhCWCB9NTPrhWI1Ifbz+YLSEcstfQfocYsrbrIessxXb2oon4lA==

"@oclif/test@^2.2.19":
version "2.2.19"
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-2.2.19.tgz#6e60a2aff0ba514b479342b1bd5e27fe859a2947"
Expand Down

0 comments on commit 7b66aa9

Please sign in to comment.