pgroll 0.0.7 → 0.0.8

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  # pgroll
4
4
 
5
- `pgroll` is a lightweight and flexible database migration tool for PostgreSQL
5
+ `pgroll` is a thread-safe, lightweight and flexible database migration tool for PostgreSQL
6
6
 
7
7
  PostgreSQL clients currently supporting:
8
8
 
@@ -56,5 +56,5 @@ npx pgroll go <version>
56
56
  4. Create New Migration Files:
57
57
 
58
58
  ```bash
59
- npx roll create <migration-name>
59
+ npx pgroll create <migration-name>
60
60
  ```
@@ -9,9 +9,9 @@ const getMigrationFiles = (dir, direction) => {
9
9
  .readdirSync(dir)
10
10
  .filter(file => file.endsWith(`_${direction}.sql`));
11
11
  if (direction == 'up') {
12
- return files.sort();
12
+ return files.toSorted((a, b) => a.localeCompare(b));
13
13
  }
14
- return files.sort((a, b) => b.localeCompare(a));
14
+ return files.toSorted((a, b) => b.localeCompare(a));
15
15
  };
16
16
  exports.getMigrationFiles = getMigrationFiles;
17
17
  const createFolderIfNotExists = (filePath) => {
@@ -5,9 +5,9 @@ export const getMigrationFiles = (dir, direction) => {
5
5
  .readdirSync(dir)
6
6
  .filter(file => file.endsWith(`_${direction}.sql`));
7
7
  if (direction == 'up') {
8
- return files.sort();
8
+ return files.toSorted((a, b) => a.localeCompare(b));
9
9
  }
10
- return files.sort((a, b) => b.localeCompare(a));
10
+ return files.toSorted((a, b) => b.localeCompare(a));
11
11
  };
12
12
  export const createFolderIfNotExists = (filePath) => {
13
13
  if (!fs.existsSync(filePath)) {
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "pgroll",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Postgres migration tool",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",
7
7
  "types": "dist/cjs/src/index.d.ts",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/tnht95/pgroll"
10
+ "url": "git+https://github.com/tnht95/pgroll.git"
11
11
  },
12
12
  "files": [
13
13
  "dist/cjs/src",
14
14
  "dist/esm/src"
15
15
  ],
16
16
  "bin": {
17
- "pgroll": "./dist/cjs/src/cli.js"
17
+ "pgroll": "dist/cjs/src/cli.js"
18
18
  },
19
19
  "keywords": [
20
20
  "postgres",
@@ -25,50 +25,49 @@
25
25
  "typescript"
26
26
  ],
27
27
  "scripts": {
28
+ "preinstall": "npx only-allow pnpm",
28
29
  "dev": "tsx ./src/cli.ts",
29
30
  "build-cjs": "tsc -p tsconfig.cjs.json",
30
31
  "build-esm": "tsc -p tsconfig.esm.json",
31
32
  "build": "rm -rf dist && pnpm build-cjs && pnpm build-esm",
32
33
  "start": "node ./dist/index.js",
33
- "fmt": "prettier --write .",
34
- "fmtc": "prettier --check .",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check .",
35
36
  "lint": "eslint . --fix",
36
- "lintc": "eslint .",
37
+ "lint:check": "eslint .",
37
38
  "test": "jest",
38
39
  "pp": "pnpm build && node update-version && npm publish --access=public"
39
40
  },
40
- "packageManager": "pnpm@9.4.0",
41
+ "packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316",
41
42
  "engines": {
42
- "node": ">=20.14.0",
43
- "npm": "please-use-pnpm",
44
- "yarn": "please-use-pnpm",
45
- "pnpm": ">=9.4.0"
43
+ "node": ">=v24.13.0"
46
44
  },
47
45
  "license": "ISC",
48
46
  "devDependencies": {
49
- "@eslint/compat": "^1.1.0",
50
- "@eslint/eslintrc": "^3.1.0",
51
- "@eslint/js": "^9.5.0",
52
- "@types/jest": "^29.5.12",
53
- "@types/node": "^20.14.8",
54
- "@typescript-eslint/eslint-plugin": "^7.14.1",
55
- "eslint": "^9.5.0",
56
- "eslint-config-prettier": "^9.1.0",
57
- "eslint-import-resolver-typescript": "^3.6.1",
58
- "eslint-plugin-import": "^2.29.1",
59
- "eslint-plugin-jest": "^28.6.0",
60
- "eslint-plugin-promise": "^6.2.0",
61
- "eslint-plugin-sonarjs": "^1.0.3",
62
- "eslint-plugin-unicorn": "^54.0.0",
63
- "jest": "^29.7.0",
64
- "prettier": "^3.3.2",
65
- "ts-jest": "^29.1.5",
66
- "tsx": "^4.15.7",
67
- "typescript": "^5.5.2"
47
+ "@eslint/compat": "^2.0.1",
48
+ "@eslint/eslintrc": "^3.3.3",
49
+ "@eslint/js": "^9.39.2",
50
+ "@types/jest": "^30.0.0",
51
+ "@types/node": "^25.0.9",
52
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
53
+ "eslint": "^9.39.2",
54
+ "eslint-config-prettier": "^10.1.8",
55
+ "eslint-import-resolver-typescript": "^4.4.4",
56
+ "eslint-plugin-import": "^2.32.0",
57
+ "eslint-plugin-jest": "^29.12.1",
58
+ "eslint-plugin-promise": "^7.2.1",
59
+ "eslint-plugin-sonarjs": "^3.0.5",
60
+ "eslint-plugin-unicorn": "^62.0.0",
61
+ "jest": "^30.2.0",
62
+ "prettier": "^3.8.0",
63
+ "ts-jest": "^29.4.6",
64
+ "tsx": "^4.21.0",
65
+ "typescript": "^5.9.3",
66
+ "typescript-eslint": "^8.53.1"
68
67
  },
69
68
  "dependencies": {
70
- "commander": "^12.1.0",
71
- "postgres": "^3.4.4",
72
- "tslib": "^2.6.3"
69
+ "commander": "^14.0.2",
70
+ "postgres": "^3.4.8",
71
+ "tslib": "^2.8.1"
73
72
  }
74
73
  }