Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add deprecation notice for node versions 6 and 8 #32

Merged
merged 3 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js
sudo: false
node_js:
- 6
- 8
- 10
- 12
cache:
npm: false
script:
- npm run prepare
- npm run lint
Expand All @@ -17,4 +18,5 @@ deploy:
skip_cleanup: true
script: npx semantic-release
on:
node: 10
node: 12
repo: IBM/node-sdk-core
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
This project contains the core functionality used by Node SDK's generated by the IBM OpenAPI 3 SDK Generator (`openapi-sdkgen`).
Code generated by `openapi-sdkgen` will depend on the functionality contained in this project.

## Notice
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.

## Installation
`npm install ibm-cloud-sdk-core`

Expand Down
13 changes: 13 additions & 0 deletions lib/base_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import extend = require('extend');
import semver = require('semver');
import vcapServices = require('vcap_services');
import { computeBasicAuthHeader, IamTokenManagerV1, Icp4dTokenManagerV1 } from '../auth';
import { stripTrailingSlash } from './helper';
Expand Down Expand Up @@ -165,6 +166,18 @@ export class BaseService {
'the "new" keyword is required to create Watson service instances'
);
}

// deprecate node versions 6 and 8
// these will be removed in v5
const isNodeSix = semver.satisfies(process.version, '6.x');
const isNodeEight = semver.satisfies(process.version, '8.x');
if (isNodeSix) {
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.');
}
if (isNodeEight) {
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.');
}

const options = extend({}, userOptions);

const _options = this.initCredentials(options);
Expand Down
87 changes: 84 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"mime-types": "~2.1.18",
"object.omit": "~3.0.0",
"object.pick": "~1.3.0",
"semver": "^6.2.0",
"vcap_services": "~0.3.4"
},
"engines": {
Expand Down