Skip to content

Commit 9e3c667

Browse files
authored
fix: add deprecation notice for node versions 6 and 8 (#32)
* fix: add deprecation notice for node versions 6 and 8 in both readme and base service * ci: disable caching in travis
1 parent 8291285 commit 9e3c667

File tree

5 files changed

+106
-6
lines changed

5 files changed

+106
-6
lines changed

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 6
5-
- 8
64
- 10
5+
- 12
6+
cache:
7+
npm: false
78
script:
89
- npm run prepare
910
- npm run lint
@@ -17,4 +18,5 @@ deploy:
1718
skip_cleanup: true
1819
script: npx semantic-release
1920
on:
20-
node: 10
21+
node: 12
22+
repo: IBM/node-sdk-core

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
This project contains the core functionality used by Node SDK's generated by the IBM OpenAPI 3 SDK Generator (`openapi-sdkgen`).
88
Code generated by `openapi-sdkgen` will depend on the functionality contained in this project.
99

10+
## Notice
11+
Support for Node versions **6** and **8** is deprecated and will be officially dropped in the next major release, which is expected to be in September, 2019. Version 6 reached end of life in April 2019 and Version 8 reaches end of life on 31 December 2019.
12+
1013
## Installation
1114
`npm install ibm-cloud-sdk-core`
1215

lib/base_service.ts

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import extend = require('extend');
18+
import semver = require('semver');
1819
import vcapServices = require('vcap_services');
1920
import { computeBasicAuthHeader, IamTokenManagerV1, Icp4dTokenManagerV1 } from '../auth';
2021
import { stripTrailingSlash } from './helper';
@@ -165,6 +166,18 @@ export class BaseService {
165166
'the "new" keyword is required to create Watson service instances'
166167
);
167168
}
169+
170+
// deprecate node versions 6 and 8
171+
// these will be removed in v5
172+
const isNodeSix = semver.satisfies(process.version, '6.x');
173+
const isNodeEight = semver.satisfies(process.version, '8.x');
174+
if (isNodeSix) {
175+
console.warn('Node v6 will not be supported in the SDK in the next major release (09/2019). Version 6 reached end of life in April 2019.');
176+
}
177+
if (isNodeEight) {
178+
console.warn('Node v8 will not be supported in the SDK in the next major release (09/2019). Version 8 reaches end of life on 31 December 2019.');
179+
}
180+
168181
const options = extend({}, userOptions);
169182

170183
const _options = this.initCredentials(options);

package-lock.json

+84-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"mime-types": "~2.1.18",
6666
"object.omit": "~3.0.0",
6767
"object.pick": "~1.3.0",
68+
"semver": "^6.2.0",
6869
"vcap_services": "~0.3.4"
6970
},
7071
"engines": {

0 commit comments

Comments
 (0)