Skip to content

Commit

Permalink
chore: add postinstall deprecation warning to old packages (#13304)
Browse files Browse the repository at this point in the history
* chore: add postinstall deprecation warning to old packages

* Update packages/carbon-components-react/scripts/postinstall.js

Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>

* Update packages/carbon-components/scripts/postinstall.js

Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>

---------

Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
  • Loading branch information
francinelucca and tay1orjones authored Mar 17, 2023
1 parent fe45a38 commit 843ff10
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions packages/carbon-components-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"scripts": {
"build": "yarn clean && node tasks/build-styles.js && node tasks/build.js",
"clean": "rimraf es lib",
"postinstall": "carbon-telemetry collect --install"
"postinstall": "carbon-telemetry collect --install && node scripts/postinstall.js"
},
"peerDependencies": {
"react": "^16.8.6 || ^17.0.1",
Expand All @@ -41,7 +41,8 @@
"dependencies": {
"@carbon/react": "^1.25.0",
"@carbon/styles": "^1.25.0",
"@carbon/telemetry": "0.1.0"
"@carbon/telemetry": "0.1.0",
"chalk": "1.1.3"
},
"devDependencies": {
"@babel/core": "^7.18.2",
Expand Down
15 changes: 15 additions & 0 deletions packages/carbon-components-react/scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const chalk = require('chalk');

console.warn(
chalk.yellow('Warning: ') +
chalk.cyan('carbon-components-react') +
" will soon be deprecated and no longer receive updates. We recommend to move to it's replacement, " +
chalk.cyan('@carbon/react') +
' at your earliest convenience. Please visit ' +
chalk.dim.underline.italic(
'https://github.com/carbon-design-system/carbon/discussions/12179'
) +
' for more information on the package strategy, deprecation, and plan of action.'
);
5 changes: 3 additions & 2 deletions packages/carbon-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
},
"scripts": {
"build": "node tasks/build-styles.js",
"postinstall": "carbon-telemetry collect --install"
"postinstall": "carbon-telemetry collect --install && node scripts/postinstall.js"
},
"peerDependencies": {
"sass": "^1.33.0"
},
"dependencies": {
"@carbon/styles": "^1.25.0",
"@carbon/telemetry": "0.1.0"
"@carbon/telemetry": "0.1.0",
"chalk": "1.1.3"
},
"devDependencies": {
"@carbon/test-utils": "^10.27.0",
Expand Down
15 changes: 15 additions & 0 deletions packages/carbon-components/scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const chalk = require('chalk');

console.warn(
chalk.yellow('Warning: ') +
chalk.cyan('carbon-components') +
" will soon be deprecated and no longer receive updates. We recommend to move to it's replacement, " +
chalk.cyan('@carbon/styles') +
' at your earliest convenience. Please visit ' +
chalk.dim.underline.italic(
'https://github.com/carbon-design-system/carbon/discussions/12179'
) +
' for more information on the package strategy, deprecation, and plan of action.'
);
38 changes: 38 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9362,6 +9362,13 @@ __metadata:
languageName: node
linkType: hard

"ansi-styles@npm:^2.2.1":
version: 2.2.1
resolution: "ansi-styles@npm:2.2.1"
checksum: ebc0e00381f2a29000d1dac8466a640ce11943cef3bda3cd0020dc042e31e1058ab59bf6169cd794a54c3a7338a61ebc404b7c91e004092dd20e028c432c9c2c
languageName: node
linkType: hard

"ansi-styles@npm:^3.2.0, ansi-styles@npm:^3.2.1":
version: 3.2.1
resolution: "ansi-styles@npm:3.2.1"
Expand Down Expand Up @@ -11248,6 +11255,7 @@ __metadata:
babel-plugin-dev-expression: ^0.2.3
babel-preset-carbon: ^0.4.0
browserslist-config-carbon: ^11.1.0
chalk: 1.1.3
fs-extra: ^10.0.0
react: ^17.0.2
react-dom: ^17.0.2
Expand Down Expand Up @@ -11280,6 +11288,7 @@ __metadata:
"@carbon/styles": ^1.25.0
"@carbon/telemetry": 0.1.0
"@carbon/test-utils": ^10.27.0
chalk: 1.1.3
fs-extra: ^10.0.0
rimraf: ^4.0.0
sass: ^1.51.0
Expand Down Expand Up @@ -11371,6 +11380,19 @@ __metadata:
languageName: node
linkType: hard

"chalk@npm:1.1.3":
version: 1.1.3
resolution: "chalk@npm:1.1.3"
dependencies:
ansi-styles: ^2.2.1
escape-string-regexp: ^1.0.2
has-ansi: ^2.0.0
strip-ansi: ^3.0.0
supports-color: ^2.0.0
checksum: 9d2ea6b98fc2b7878829eec223abcf404622db6c48396a9b9257f6d0ead2acf18231ae368d6a664a83f272b0679158da12e97b5229f794939e555cc574478acd
languageName: node
linkType: hard

"chalk@npm:4.1.0":
version: 4.1.0
resolution: "chalk@npm:4.1.0"
Expand Down Expand Up @@ -17587,6 +17609,15 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"has-ansi@npm:^2.0.0":
version: 2.0.0
resolution: "has-ansi@npm:2.0.0"
dependencies:
ansi-regex: ^2.0.0
checksum: 1b51daa0214440db171ff359d0a2d17bc20061164c57e76234f614c91dbd2a79ddd68dfc8ee73629366f7be45a6df5f2ea9de83f52e1ca24433f2cc78c35d8ec
languageName: node
linkType: hard

"has-bigints@npm:^1.0.2":
version: 1.0.2
resolution: "has-bigints@npm:1.0.2"
Expand Down Expand Up @@ -30347,6 +30378,13 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"supports-color@npm:^2.0.0":
version: 2.0.0
resolution: "supports-color@npm:2.0.0"
checksum: 602538c5812b9006404370b5a4b885d3e2a1f6567d314f8b4a41974ffe7d08e525bf92ae0f9c7030e3b4c78e4e34ace55d6a67a74f1571bc205959f5972f88f0
languageName: node
linkType: hard

"supports-color@npm:^5.3.0":
version: 5.5.0
resolution: "supports-color@npm:5.5.0"
Expand Down

0 comments on commit 843ff10

Please sign in to comment.