-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add upgrade prompt at load of jsii and jsii-rosetta 1.x (#4071)
This is to strongly incitate customers upgrade their dependencies, while trying to avoid alarming (there is 18 months left before the End-of-Support is scheduled, which is PLENTY of time). --- 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
1 parent
ac72ee4
commit 2cb15f8
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Note: intentionally using the same environment variable as the compiler here instead of customizing... | ||
if (process.env.JSII_SUPPRESS_UPGRADE_PROMPT == null) { | ||
console.error( | ||
[ | ||
'#######################################################################################################', | ||
'### You are currently using jsii-rosetta@1.x. We recommend upgrading to jsii-rosetta@5.0.x or ###', | ||
'### later. This will allow you to use modern TypeScript syntax, and improves compatibility with ###', | ||
'### many common dependencies. For example, recent versions of @types/node. ###', | ||
'### ###', | ||
'### 5.0.x and subsequent releases of jsii-rosetta use the same major.minor version as the ###', | ||
'### TypeScript compiler they are built on. We recommend declaring a minor-pinned (also known as ###', | ||
'### "tilde") dependency on jsii-rosetta (e.g: `"jsii-rosetta": "5.0.x"` or ###', | ||
'### `"jsii-rosetta": "~5.0.7"`). ###', | ||
'### ###', | ||
'### For more information, see: https://aws.github.io/jsii/compiler-and-rosetta-maintenance/ ###', | ||
'### ###', | ||
'### This warning can be suppressed by setting the JSII_SUPPRESS_UPGRADE_PROMPT environment variable ###', | ||
'#######################################################################################################', | ||
].join('\n'), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './upgrade-prompt'; | ||
|
||
export * from './jsii-diagnostic'; | ||
export * from './symbol-id'; | ||
export * from './helpers'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
if (process.env.JSII_SUPPRESS_UPGRADE_PROMPT == null) { | ||
console.error( | ||
[ | ||
'#######################################################################################################', | ||
'### You are currently using jsii@1.x. We recommend upgrading to jsii@5.0.x or later. This will ###', | ||
'### allow you to use modern TypeScript syntax, and improves compatibility with many common ###', | ||
'### dependencies. For example, recent versions of @types/node. ###', | ||
'### ###', | ||
'### 5.0.x and subsequent releases of jsii use the same major.minor version as the TypeScript ###', | ||
'### compiler they are built on. We recommend declaring a minor-pinned (also known as "tilde") ###', | ||
'### dependency on jsii (e.g: `"jsii": "5.0.x"` or `"jsii": "~5.0.7"`). ###', | ||
'### ###', | ||
'### For more information, see: https://aws.github.io/jsii/compiler-and-rosetta-maintenance/ ###', | ||
'### ###', | ||
'### This warning can be suppressed by setting the JSII_SUPPRESS_UPGRADE_PROMPT environment variable ###', | ||
'#######################################################################################################', | ||
].join('\n'), | ||
); | ||
} |