mythix-orm-postgresql 1.12.0 → 1.13.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/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 24.13.0
@@ -0,0 +1,15 @@
1
+ services:
2
+ postgres:
3
+ image: postgres:17-alpine
4
+ container_name: mythix-orm-postgresql-test
5
+ environment:
6
+ POSTGRES_USER: mythix
7
+ POSTGRES_PASSWORD: 9WrY4wfERFKJRhRUaa
8
+ POSTGRES_DB: mythix-test
9
+ ports:
10
+ - "5439:5432"
11
+ healthcheck:
12
+ test: ["CMD-SHELL", "pg_isready -U mythix -d mythix-test"]
13
+ interval: 2s
14
+ timeout: 5s
15
+ retries: 10
package/package.json CHANGED
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "name": "mythix-orm-postgresql",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "PostgreSQL driver for Mythix ORM",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",
7
+ "engines": {
8
+ "node": ">=18.0.0"
9
+ },
7
10
  "scripts": {
8
- "coverage": "clear ; node ./node_modules/.bin/nyc ./node_modules/.bin/jasmine",
9
- "test": "node ./node_modules/.bin/jasmine",
11
+ "coverage": "clear ; ./scripts/run-tests.sh --coverage",
12
+ "test": "./scripts/run-tests.sh",
13
+ "test:raw": "node ./node_modules/.bin/jasmine",
10
14
  "test-debug": "node --inspect-brk ./node_modules/.bin/jasmine",
11
- "test-watch": "watch 'clear ; node ./node_modules/.bin/jasmine' . --wait=2 --interval=1"
15
+ "test-watch": "watch 'clear ; ./scripts/run-tests.sh' . --wait=2 --interval=1",
16
+ "db:start": "docker compose up -d --wait",
17
+ "db:stop": "docker compose down",
18
+ "db:logs": "docker compose logs -f"
12
19
  },
13
20
  "repository": {
14
21
  "type": "git",
@@ -33,21 +40,21 @@
33
40
  },
34
41
  "homepage": "https://github.com/th317erd/mythix-orm-postgresql#readme",
35
42
  "peerDependencies": {
36
- "mythix-orm": "^1.14.0",
37
- "mythix-orm-sql-base": "^1.12.0"
43
+ "mythix-orm": "^1.14.1",
44
+ "mythix-orm-sql-base": "^1.12.1"
38
45
  },
39
46
  "dependencies": {
40
- "luxon": "^3.2.1",
47
+ "luxon": "^3.7.2",
41
48
  "nife": "^1.12.1",
42
- "pg": "^8.8.0",
49
+ "pg": "^8.16.0",
43
50
  "pg-format": "^1.0.4",
44
- "uuid": "^9.0.0"
51
+ "uuid": "^11.1.0"
45
52
  },
46
53
  "devDependencies": {
47
54
  "@spothero/eslint-plugin-spothero": "github:spothero/eslint-plugin-spothero",
48
- "eslint": "^8.31.0",
49
- "jasmine": "^4.5.0",
50
- "nyc": "^15.1.0"
55
+ "eslint": "^8.57.1",
56
+ "jasmine": "^5.6.0",
57
+ "nyc": "^17.1.0"
51
58
  },
52
59
  "nyc": {
53
60
  "reporter": [
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
6
+ CONTAINER_NAME="mythix-orm-postgresql-test"
7
+ COVERAGE=false
8
+
9
+ # Parse arguments
10
+ ARGS=()
11
+ for arg in "$@"; do
12
+ if [[ "$arg" == "--coverage" ]]; then
13
+ COVERAGE=true
14
+ else
15
+ ARGS+=("$arg")
16
+ fi
17
+ done
18
+
19
+ cd "$PROJECT_DIR"
20
+
21
+ # Check if Docker is available
22
+ if ! command -v docker &> /dev/null; then
23
+ echo "Error: Docker is not installed or not in PATH" >&2
24
+ exit 1
25
+ fi
26
+
27
+ # Check if container is running
28
+ if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
29
+ echo "Starting PostgreSQL container..."
30
+ docker compose up -d --wait
31
+ fi
32
+
33
+ # Run tests with correct port
34
+ if [[ "$COVERAGE" == true ]]; then
35
+ PGPORT=5439 node ./node_modules/.bin/nyc ./node_modules/.bin/jasmine "${ARGS[@]}"
36
+ else
37
+ PGPORT=5439 node ./node_modules/.bin/jasmine "${ARGS[@]}"
38
+ fi