Skip to content

Commit fc38f0d

Browse files
committed
2.2.0
1 parent 22b9b3d commit fc38f0d

7 files changed

Lines changed: 107 additions & 47 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ my_config.json
3232
.DS_Store
3333
npm-debug.log
3434
dist
35-
typings

package-lock.json

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docker-cli-js",
3-
"version": "2.1.1",
3+
"version": "2.2.0",
44
"description": "A node.js wrapper for the docker command line interface CLI",
55
"main": "dist/index.js",
66
"typings": "dist/index",
@@ -29,18 +29,21 @@
2929
},
3030
"homepage": "https://github.com/Quobject/docker-cli-js",
3131
"devDependencies": {
32+
"@types/node": "^7.0.18",
33+
"@types/blue-tape": "^0.1.31",
3234
"blue-tape": "^0.2.0",
3335
"rimraf": "^2.5.2",
3436
"tap-diff": "^0.1.1",
35-
"ts-node": "^0.7.3",
37+
"ts-node": "^3.0.4",
3638
"tslint": "^3.10.2",
37-
"typescript": "^1.8.10"
39+
"typescript": "^2.3.2"
3840
},
3941
"dependencies": {
42+
43+
"@types/lodash": "^4.14.76",
4044
"cli-table-2-json": "^1.0.8",
4145
"dockermachine-cli-js": "^3.0.2",
4246
"lodash": "^4.12.0",
43-
"core-js": "^2.4.0",
4447
"nodeify-ts": "^1.0.1"
4548
}
4649
}

src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ test('docker-cli-js', t => {
4040
t.test('build', t => {
4141

4242
const options = new Options(
43-
/* machineName */ null,
44-
/* currentWorkingDirectory */ path.join(__dirname, '..', 'test', 'nginx')
43+
/* machineName */ undefined,
44+
/* currentWorkingDirectory */ path.join(__dirname, '..', 'test', 'nginx'),
4545
);
4646

4747
let docker = new Docker(options);

src/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { DockerMachine } from 'dockermachine-cli-js';
77
const exec = child_process.exec;
88

99
const array2Oject = function (lines: Array<string>): Object {
10-
return lines.reduce(function (object, linep) {
10+
return lines.reduce(function (object: any, linep) {
1111
const line = linep.trim();
1212
if (line.length === 0) {
1313
return object;
@@ -23,15 +23,15 @@ const array2Oject = function (lines: Array<string>): Object {
2323
};
2424

2525

26-
const extractResult = function (result) {
26+
const extractResult = function (result: any) {
2727

2828
const extracterArray = [
2929
{
3030
re: / build /,
31-
run: function (resultp) {
31+
run: function (resultp: any) {
3232
const lines = resultp.raw.split(os.EOL);
3333

34-
lines.forEach(function (line) {
34+
lines.forEach(function (line: any) {
3535
const re = /Successfully built (.*)$/;
3636
const str = line;
3737
let m;
@@ -54,7 +54,7 @@ const extractResult = function (result) {
5454
},
5555
{
5656
re: / run /,
57-
run: function (resultp) {
57+
run: function (resultp: any) {
5858
resultp.containerId = resultp.raw.trim();
5959

6060

@@ -63,7 +63,7 @@ const extractResult = function (result) {
6363
},
6464
{
6565
re: / ps /,
66-
run: function (resultp) {
66+
run: function (resultp: any) {
6767
const lines = resultp.raw.split(os.EOL);
6868

6969
resultp.containerList = cliTable2Json(lines);
@@ -73,7 +73,7 @@ const extractResult = function (result) {
7373
},
7474
{
7575
re: / images /,
76-
run: function (resultp) {
76+
run: function (resultp: any) {
7777
const lines = resultp.raw.split(os.EOL);
7878

7979
//const debug = require('debug')('docker-cli-js:lib/index.js extractResult images');
@@ -85,7 +85,7 @@ const extractResult = function (result) {
8585
},
8686
{
8787
re: / network ls /,
88-
run: function (resultp) {
88+
run: function (resultp: any) {
8989
const lines = resultp.raw.split(os.EOL);
9090

9191
//const debug = require('debug')('docker-cli-js:lib/index.js extractResult images');
@@ -97,7 +97,7 @@ const extractResult = function (result) {
9797
},
9898
{
9999
re: / inspect /,
100-
run: function (resultp) {
100+
run: function (resultp: any) {
101101
const object = JSON.parse(resultp.raw);
102102

103103
resultp.object = object;
@@ -107,7 +107,7 @@ const extractResult = function (result) {
107107
},
108108
{
109109
re: / info /,
110-
run: function (resultp) {
110+
run: function (resultp: any) {
111111
const lines = resultp.raw.split(os.EOL);
112112
resultp.object = array2Oject(lines);
113113

@@ -140,11 +140,11 @@ const extractResult = function (result) {
140140
export class Docker {
141141

142142
constructor(private options: IOptions = {
143-
currentWorkingDirectory: null,
144-
machineName: null,
143+
currentWorkingDirectory: undefined,
144+
machineName: undefined,
145145
}) { }
146146

147-
public command(command: string, callback?: (err, data) => void) {
147+
public command(command: string, callback?: (err: any, data: any) => void) {
148148
let docker = this;
149149
let execCommand = 'docker ';
150150
let machineconfig = '';

tsconfig.json

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,57 @@
11
{
22
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es5",
5-
"moduleResolution": "node",
6-
"noImplicitAny": false,
7-
"noLib": false,
8-
"declaration": true,
9-
"sourceMap": true,
10-
"removeComments": true,
11-
"outDir": "dist/"
3+
/* Basic Options */
4+
"target": "ES6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
5+
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
6+
// "lib": [], /* Specify library files to be included in the compilation: */
7+
// "allowJs": true, /* Allow javascript files to be compiled. */
8+
// "checkJs": true, /* Report errors in .js files. */
9+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10+
"declaration": true, /* Generates corresponding '.d.ts' file. */
11+
// "sourceMap": true, /* Generates corresponding '.map' file. */
12+
// "outFile": "./", /* Concatenate and emit output to single file. */
13+
"outDir": "dist", /* Redirect output structure to the directory. */
14+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
15+
// "removeComments": true, /* Do not emit comments to output. */
16+
// "noEmit": true, /* Do not emit outputs. */
17+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
18+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
19+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20+
21+
/* Strict Type-Checking Options */
22+
"strict": true, /* Enable all strict type-checking options. */
23+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
24+
// "strictNullChecks": true, /* Enable strict null checks. */
25+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
26+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
27+
28+
/* Additional Checks */
29+
// "noUnusedLocals": true, /* Report errors on unused locals. */
30+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
31+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
32+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
33+
34+
/* Module Resolution Options */
35+
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
36+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
37+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
38+
//"rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
39+
"typeRoots": [ "node_modules/@types" ] /* List of folders to include type definitions from. */
40+
// "types": [], /* Type declaration files to be included in compilation. */
41+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
42+
43+
/* Source Map Options */
44+
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
45+
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
46+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
47+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
48+
49+
/* Experimental Options */
50+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
51+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators.
1252
},
13-
"files": [
14-
"src/index.ts",
15-
"src/index.spec.ts",
16-
"typings/index.d.ts"
53+
"include": [
54+
"src/**/*.ts"
1755
],
18-
"compileOnSave": false
56+
"exclude": [ "dist/**/*" ]
1957
}

typings.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)