pgroll 0.0.6 → 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 +2 -2
- package/dist/cjs/src/cli.js +4 -1
- package/dist/cjs/src/utils.js +2 -2
- package/dist/esm/src/cli.js +4 -1
- package/dist/esm/src/utils.js +2 -2
- package/package.json +35 -35
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
|
|
59
|
+
npx pgroll create <migration-name>
|
|
60
60
|
```
|
package/dist/cjs/src/cli.js
CHANGED
|
@@ -14,7 +14,10 @@ program
|
|
|
14
14
|
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migrations)')
|
|
15
15
|
.hook('preAction', cmd => {
|
|
16
16
|
const opts = cmd.opts();
|
|
17
|
-
migrator = new index_1.Migrator((0, postgres_1.default)(
|
|
17
|
+
migrator = new index_1.Migrator((0, postgres_1.default)({
|
|
18
|
+
onnotice: () => {
|
|
19
|
+
}
|
|
20
|
+
}), opts.migrationDir);
|
|
18
21
|
});
|
|
19
22
|
program
|
|
20
23
|
.command('up')
|
package/dist/cjs/src/utils.js
CHANGED
|
@@ -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.
|
|
12
|
+
return files.toSorted((a, b) => a.localeCompare(b));
|
|
13
13
|
}
|
|
14
|
-
return files.
|
|
14
|
+
return files.toSorted((a, b) => b.localeCompare(a));
|
|
15
15
|
};
|
|
16
16
|
exports.getMigrationFiles = getMigrationFiles;
|
|
17
17
|
const createFolderIfNotExists = (filePath) => {
|
package/dist/esm/src/cli.js
CHANGED
|
@@ -12,7 +12,10 @@ program
|
|
|
12
12
|
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migrations)')
|
|
13
13
|
.hook('preAction', cmd => {
|
|
14
14
|
const opts = cmd.opts();
|
|
15
|
-
migrator = new Migrator(postgres(
|
|
15
|
+
migrator = new Migrator(postgres({
|
|
16
|
+
onnotice: () => {
|
|
17
|
+
}
|
|
18
|
+
}), opts.migrationDir);
|
|
16
19
|
});
|
|
17
20
|
program
|
|
18
21
|
.command('up')
|
package/dist/esm/src/utils.js
CHANGED
|
@@ -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.
|
|
8
|
+
return files.toSorted((a, b) => a.localeCompare(b));
|
|
9
9
|
}
|
|
10
|
-
return files.
|
|
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.
|
|
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": "
|
|
17
|
+
"pgroll": "dist/cjs/src/cli.js"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"postgres",
|
|
@@ -25,49 +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
|
-
"
|
|
34
|
-
"
|
|
34
|
+
"format": "prettier --write .",
|
|
35
|
+
"format:check": "prettier --check .",
|
|
35
36
|
"lint": "eslint . --fix",
|
|
36
|
-
"
|
|
37
|
-
"test": "jest"
|
|
37
|
+
"lint:check": "eslint .",
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"pp": "pnpm build && node update-version && npm publish --access=public"
|
|
38
40
|
},
|
|
39
|
-
"packageManager": "pnpm@
|
|
41
|
+
"packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316",
|
|
40
42
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
42
|
-
"npm": "please-use-pnpm",
|
|
43
|
-
"yarn": "please-use-pnpm",
|
|
44
|
-
"pnpm": ">=9.4.0"
|
|
43
|
+
"node": ">=v24.13.0"
|
|
45
44
|
},
|
|
46
45
|
"license": "ISC",
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@eslint/compat": "^
|
|
49
|
-
"@eslint/eslintrc": "^3.
|
|
50
|
-
"@eslint/js": "^9.
|
|
51
|
-
"@types/jest": "^
|
|
52
|
-
"@types/node": "^
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
54
|
-
"eslint": "^9.
|
|
55
|
-
"eslint-config-prettier": "^
|
|
56
|
-
"eslint-import-resolver-typescript": "^
|
|
57
|
-
"eslint-plugin-import": "^2.
|
|
58
|
-
"eslint-plugin-jest": "^
|
|
59
|
-
"eslint-plugin-promise": "^
|
|
60
|
-
"eslint-plugin-sonarjs": "^
|
|
61
|
-
"eslint-plugin-unicorn": "^
|
|
62
|
-
"jest": "^
|
|
63
|
-
"prettier": "^3.
|
|
64
|
-
"ts-jest": "^29.
|
|
65
|
-
"tsx": "^4.
|
|
66
|
-
"typescript": "
|
|
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"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"commander": "^
|
|
70
|
-
"postgres": "^3.4.
|
|
71
|
-
"tslib": "^2.
|
|
69
|
+
"commander": "^14.0.2",
|
|
70
|
+
"postgres": "^3.4.8",
|
|
71
|
+
"tslib": "^2.8.1"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|