@uscreen.de/dev-service 0.11.20 → 0.12.0

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,5 +1,6 @@
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
4
  [![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)
4
5
 
5
6
  > Manage docker services for local development
@@ -9,7 +10,7 @@
9
10
  - a local or remote docker host
10
11
  - a docker client connected to that host
11
12
  - `docker` and `docker-compose` located in your `$PATH`
12
- - `node` v12.20 or higher, v14.13 or higher, or v15 or higher
13
+ - `node` v14.13 or higher, or v15 or higher
13
14
 
14
15
  ## Install
15
16
 
@@ -193,6 +194,7 @@ All provided services use their respective default ports:
193
194
  | nginx | 80, 443 |
194
195
  | rabbitmq | 5672, 15672 |
195
196
  | elasticsearch | 9200 |
197
+ | mariadb | 3306 |
196
198
 
197
199
  ### nginx
198
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uscreen.de/dev-service",
3
- "version": "0.11.20",
3
+ "version": "0.12.0",
4
4
  "description": "cli to manage services in dev repos",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "author": "Martin Herting <herting@uscreen.de>",
24
24
  "license": "MIT",
25
25
  "engines": {
26
- "node": "^12.20 || ^14.13 || >=15"
26
+ "node": "^14.13 || >=15"
27
27
  },
28
28
  "scripts": {
29
29
  "test": "c8 --all tap --no-coverage test/**/*.test.js",
@@ -41,18 +41,18 @@
41
41
  ],
42
42
  "devDependencies": {
43
43
  "@uscreen.de/eslint-config-prettystandard-node": "^0.2.10",
44
- "husky": ">=6",
44
+ "husky": ">=8.0.2",
45
45
  "lint-staged": ">=13.0.3",
46
- "tap": "^16.3.0"
46
+ "tap": "^16.3.2"
47
47
  },
48
48
  "dependencies": {
49
49
  "c8": "^7.12.0",
50
- "commander": "^9.4.0",
50
+ "commander": "^9.4.1",
51
51
  "fs-extra": "^10.0.1",
52
52
  "nanoid": "^4.0.0",
53
53
  "parse-json": "^6.0.2",
54
54
  "read-pkg": "^7.1.0",
55
- "yaml": "^2.1.1"
55
+ "yaml": "^2.1.3"
56
56
  },
57
57
  "lint-staged": {
58
58
  "*.js": "eslint --cache --fix"
package/src/install.js CHANGED
@@ -44,7 +44,7 @@ const fillTemplate = (template, data, removeSections, keepSections) => {
44
44
 
45
45
  for (const r of removeSections) {
46
46
  template = template.replace(
47
- new RegExp(`{{${r}}}(.|\n)*{{/${r}}}\n?`, 'gm'),
47
+ new RegExp(`{{${r}}}(.|\n)*?{{/${r}}}\n?`, 'gm'),
48
48
  ''
49
49
  )
50
50
  }
package/src/utils.js CHANGED
@@ -37,7 +37,7 @@ export const readPackageJson = () => {
37
37
  * Escape string for use in docker
38
38
  */
39
39
  export const escape = (name) =>
40
- name.replace(/^[^a-zA-Z0-9]*/, '').replace(/[^a-zA-Z0-9.-]/g, '-')
40
+ name.replace(/^[^a-zA-Z0-9]*/, '').replace(/[^a-zA-Z0-9-]/g, '-')
41
41
 
42
42
  /**
43
43
  * Checks if compose directory exists and contains files
@@ -6,6 +6,9 @@ services:
6
6
  container_name: {{container_name}}
7
7
  ports:
8
8
  - 9200:9200
9
+ {{mapped-volumes}}
10
+ user: ${CURRENT_UID}
11
+ {{/mapped-volumes}}
9
12
  environment:
10
13
  - cluster.name={{projectname}}-elasticsearch-cluster
11
14
  - cluster.routing.allocation.disk.threshold_enabled=false
@@ -0,0 +1,25 @@
1
+ version: '2.4'
2
+
3
+ services:
4
+ mariadb:
5
+ image: {{image}}
6
+ container_name: {{container_name}}
7
+ ports:
8
+ - 3306:3306
9
+ {{mapped-volumes}}
10
+ user: ${CURRENT_UID}
11
+ {{/mapped-volumes}}
12
+ environment:
13
+ - MARIADB_ROOT_PASSWORD=rootpassword
14
+ volumes:
15
+ {{mapped-volumes}}
16
+ - ../.volumes/mariadb-data:/var/lib/mysql:delegated
17
+ {{/mapped-volumes}}
18
+ {{named-volumes}}
19
+ - mariadb-data:/var/lib/mysql:delegated
20
+
21
+ volumes:
22
+ mariadb-data:
23
+ external:
24
+ name: {{volumesPrefix}}-mariadb-data
25
+ {{/named-volumes}}
@@ -6,6 +6,9 @@ services:
6
6
  container_name: {{container_name}}
7
7
  ports:
8
8
  - 27017:27017
9
+ {{mapped-volumes}}
10
+ user: ${CURRENT_UID}
11
+ {{/mapped-volumes}}
9
12
  volumes:
10
13
  {{mapped-volumes}}
11
14
  - ../.volumes/mongo-data:/data/db:delegated
@@ -8,6 +8,9 @@ services:
8
8
  ports:
9
9
  - 5672:5672
10
10
  - 15672:15672
11
+ {{mapped-volumes}}
12
+ user: ${CURRENT_UID}
13
+ {{/mapped-volumes}}
11
14
  volumes:
12
15
  {{mapped-volumes}}
13
16
  - ../.volumes/rabbit-data:/var/lib/rabbitmq/mnesia/rabbit@{{container_name}}-host