Skip to content

Commit

Permalink
feat: allow specifying a deprecation message regardless of stability (#…
Browse files Browse the repository at this point in the history
…146)

Previously, `jsii` required the package's stability to be `deprecated`
if there cas a `deprecated` message configured. This is however
problematic when a `stable` package reaches End-of-Support and the
maintainer wants to signal this in npmjs.com.

Instead of failing, only log a warning to possibly raise awareness on an
unintended configuration.

Foward-ports: aws/jsii#4145



---

By submitting this pull request, I confirm that my contribution is made
under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
RomainMuller authored Jun 13, 2023
1 parent 25d8148 commit 545015c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/project-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function _validateStability(stability: string | undefined, deprecated: string |
if (!stability && deprecated) {
stability = spec.Stability.Deprecated;
} else if (deprecated && stability !== spec.Stability.Deprecated) {
throw new Error(
console.warn(
`Package is deprecated (${deprecated}), but it's stability is ${stability} and not ${spec.Stability.Deprecated}`,
);
}
Expand Down

0 comments on commit 545015c

Please sign in to comment.