@uscreen.de/dev-service 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # dev-service
2
2
 
3
- [![Test CI](https://github.com/uscreen/dev-service/actions/workflows/node.js.yml/badge.svg)](https://github.com/uscreen/dev-service/actions/workflows/node.js.yml)
3
+ [![Test CI](https://github.com/uscreen/dev-service/actions/workflows/main.yml/badge.svg)](https://github.com/uscreen/dev-service/actions/workflows/node.js.yml)
4
+ [![Test Coverage](https://coveralls.io/repos/github/uscreen/dev-service/badge.svg?branch=master)](https://coveralls.io/github/uscreen/dev-service?branch=master)
4
5
  [![Known Vulnerabilities](https://snyk.io/test/github/uscreen/dev-service/badge.svg?targetFile=package.json)](https://snyk.io/test/github/uscreen/dev-service?targetFile=package.json)
6
+ [![NPM Version](https://badge.fury.io/js/@uscreen.de%2Fdev-service.svg)](https://badge.fury.io/js/@uscreen.de%2Fdev-service)
5
7
 
6
8
  > Manage docker services for local development
7
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uscreen.de/dev-service",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "cli to manage services in dev repos",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "homepage": "https://github.com/uscreen/dev-service",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com:uscreen/dev-service.git"
21
+ "url": "git+https://github.com/uscreen/dev-service.git"
22
22
  },
23
23
  "author": "Martin Herting <herting@uscreen.de>",
24
24
  "license": "MIT",
@@ -26,9 +26,9 @@
26
26
  "node": "^14.13 || >=15"
27
27
  },
28
28
  "scripts": {
29
- "test": "c8 --all tap --no-coverage test/**/*.test.js",
30
- "test:cov": "c8 --all --reporter html tap --no-coverage test/**/*.test.js && open coverage/index.html",
31
- "test:ci": "c8 --all --reporter text-summary tap --no-coverage test/**/*.test.js",
29
+ "test": "c8 tap",
30
+ "test:cov": "c8 --reporter=html --reporter=text tap",
31
+ "test:ci": "c8 --reporter=lcovonly tap",
32
32
  "prepare": "husky install"
33
33
  },
34
34
  "gitHooks": {
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "c8": "^7.12.0",
50
- "commander": "^9.4.1",
50
+ "commander": "^10.0.0",
51
51
  "fs-extra": "^11.1.0",
52
52
  "nanoid": "^4.0.0",
53
53
  "parse-json": "^6.0.2",
package/src/check.js CHANGED
@@ -224,8 +224,6 @@ const getProcess = async (pid) =>
224
224
  cmd: args.join(' ')
225
225
  }))
226
226
 
227
- if (!processes[0]) return resolve(null)
228
-
229
227
  resolve(processes[0])
230
228
  }
231
229
  )
package/src/utils.js CHANGED
@@ -58,9 +58,10 @@ export const getComposeFiles = () =>
58
58
  const getComposePath = (containerId) =>
59
59
  new Promise((resolve, reject) => {
60
60
  exec(`docker inspect ${containerId}`, function (err, stdout, stderr) {
61
- if (err || stderr.toString().trim()) {
62
- return reject(err)
63
- }
61
+ if (err) reject(err)
62
+
63
+ const errMessage = stderr.toString().trim()
64
+ if (errMessage) reject(new Error(errMessage))
64
65
 
65
66
  const [data] = JSON.parse(stdout)
66
67
 
@@ -70,7 +71,7 @@ const getComposePath = (containerId) =>
70
71
  data.Config.Labels &&
71
72
  data.Config.Labels['com.docker.compose.project.working_dir']
72
73
 
73
- resolve(result || null)
74
+ resolve(result)
74
75
  })
75
76
  })
76
77
 
@@ -92,9 +93,7 @@ export const getComposePaths = () =>
92
93
 
93
94
  resolve(paths)
94
95
  })
95
- .catch((err) => {
96
- reject(err)
97
- })
96
+ .catch(reject)
98
97
  })
99
98
  })
100
99