Skip to content

Commit

Permalink
build: print post install announcement with nodejs instead of bash
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusTheHun committed Mar 20, 2024
1 parent 6d946e1 commit 68a7a84
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storybook-addon-react-router-v6",
"version": "2.0.12",
"version": "2.0.13",
"description": "Use React Router v6 in your stories",
"keywords": [
"storybook-addons",
Expand Down Expand Up @@ -58,7 +58,7 @@
"prepare": "husky install",
"prettier:check": "prettier --check .",
"prettier:write": "prettier --write .",
"postinstall": "[ \"$npm_package_name\" = \"storybook-addon-react-router-v6\" ] && sh scripts/announcement.sh || :"
"postinstall": "node scripts/announcement.js"
},
"dependencies": {
"compare-versions": "^6.0.0",
Expand Down
22 changes: 22 additions & 0 deletions scripts/announcement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const colorEscape = '\x1b[97;103m';
const resetEscape = '\x1b[0m';

function colorize(text) {
return `${colorEscape}${text}${resetEscape}`;
}

const lines = [
'#------------------------------------------------------------------------------------------#',
'# Storybook Addon React Router v6 #',
'# #',
"# The package has been renamed 'storybook-addon-remix-react-router'. #",
'# This is to better reflect the content of this addon. #',
'# #',
'# If you want to use this addon with Storybook 8. You have to use the new package. #',
'# #',
'# npm uninstall storybook-addon-react-router-v6 #',
'# npm i -D storybook-addon-remix-react-router #',
'#------------------------------------------------------------------------------------------#',
];

lines.forEach((line) => console.log(colorize(line)));
13 changes: 0 additions & 13 deletions scripts/announcement.sh

This file was deleted.

0 comments on commit 68a7a84

Please sign in to comment.