Skip to content

Commit

Permalink
feat(typings): upgrade declaration file to 1.13 (#447)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this removes support for 1.10.
  • Loading branch information
silasbw committed Apr 22, 2019
1 parent a28cfb0 commit 095008e
Show file tree
Hide file tree
Showing 8 changed files with 2,041 additions and 1,602 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ specifications:
## TypeScript

kubernetes-client includes a typings declartion file for Kubernetes
API 1.10 and a complimentry `Client1_10` class:
API 1.13 and a complimentry `Client1_13` class:

```typescript
import * as Api from 'kubernetes-client';

const Client = Api.Client1_10;
const Client = Api.Client1_13;
const config = Api.config;
const client = new Client({ config: config.fromKubeconfig() });
```
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
Client: require('./swagger-client').Client,
Client1_10: require('./swagger-client').Client1_10,
Client1_13: require('./swagger-client').Client1_13,
alias: require('./alias'),
config: require('./config')
}
6 changes: 3 additions & 3 deletions lib/swagger-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ class Client {
}

// eslint-disable-next-line camelcase
class Client1_10 extends Client {
class Client1_13 extends Client {
constructor (options) {
super(Object.assign({}, options, { version: '1.10' }))
super(Object.assign({}, options, { version: '1.13' }))
}
}

module.exports = {
Client,
Client1_10
Client1_13
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"coverage": "nyc mocha 'lib/**/*.test.js'",
"docs": "node scripts/docs.js --builtins",
"typings": "node scripts/typings.js --spec lib/specs/swagger-1.10.json.gz --output typings/index.d.ts",
"typings": "node scripts/typings.js --spec lib/specs/swagger-1.13.json.gz --output typings/index.d.ts",
"lint": "standard --fix",
"release": "standard-version --tag-prefix=''",
"test": "standard && mocha 'lib/**/*.test.js' && npm run test-typings && npm run test-generated",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

OUTPUT=$(mktemp)

node scripts/typings.js --spec lib/specs/swagger-1.10.json.gz --output $OUTPUT
node scripts/typings.js --spec lib/specs/swagger-1.13.json.gz --output $OUTPUT

diff -Naur typings/index.d.ts $OUTPUT
2 changes: 1 addition & 1 deletion scripts/typings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const argv = require('yargs')
.usage('Usage: $0 [options]')
.option('spec', {
alias: 's',
default: './lib/specs/swagger-1.10.json.gz',
default: './lib/specs/swagger-1.13.json.gz',
describe: 'Swagger / OpenAPI specification'
})
.option('output', {
Expand Down
Loading

0 comments on commit 095008e

Please sign in to comment.