Skip to content

Commit c74ee6c

Browse files
authored
chore(release): add postinstall script to warn users of name change (cloudevents#293)
Since we have recently changed the name of this module to 'cloudevents', users may not be aware that version 2.0.2 is out of date, since it won't automatically be upgraded on `npm install`. This commit adds a postinstall script to warn users of this fact, and adds a bold, top-level warning to the README. Fixes: cloudevents#291 Signed-off-by: Lance Ball <lball@redhat.com> squash
1 parent b3d9dd2 commit c74ee6c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# JavaScript SDK for CloudEvents
22

3+
## WARNING: This module has changed its name to 'cloudevents'.
4+
### PLEASE CONSIDER UPGRADING YOUR DEPENDENCY
5+
6+
`npm install cloudevents`
7+
8+
---
9+
310
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bd66e7c52002481993cd6d610534b0f7)](https://www.codacy.com/app/fabiojose/sdk-javascript?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cloudevents/sdk-javascript&amp;utm_campaign=Badge_Grade)
411
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/bd66e7c52002481993cd6d610534b0f7)](https://www.codacy.com/app/fabiojose/sdk-javascript?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cloudevents/sdk-javascript&amp;utm_campaign=Badge_Coverage)
512
![Node.js CI](https://github.com/cloudevents/sdk-javascript/workflows/Node.js%20CI/badge.svg)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | bash -s report -l JavaScript -r coverage/lcov.info",
1717
"generate-docs": "typedoc --tsconfig ./tsconfig.json --plugin typedoc-plugin-markdown src",
1818
"release": "standard-version",
19-
"prepublish": "npm run build"
19+
"prepublish": "npm run build",
20+
"postinstall": "node ./postinstall/message.js"
2021
},
2122
"files": [
2223
"index.js",

postinstall/message.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// eslint-disable-next-line no-console
2+
console.log("\x1b[1m\x1b[31m%s\x1b[0m",`
3+
>>>> Thank you for using cloudevents-sdk! <<<<
4+
5+
Note: As of version 3.0.0, this project has been renamed to 'cloudevents'.
6+
To use the latest version of this module, please run:
7+
8+
npm install cloudevents
9+
10+
`);

0 commit comments

Comments
 (0)