pgroll 0.0.5 → 0.0.7

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.
@@ -11,10 +11,13 @@ let migrator;
11
11
  program
12
12
  .version('0.0.1')
13
13
  .description('Database migration tool')
14
- .option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migration)')
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)(), opts.migrationDir);
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')
@@ -23,6 +26,7 @@ program
23
26
  try {
24
27
  yield migrator.up({ eventHandler: console.log });
25
28
  console.log('Migrations up completed successfully.');
29
+ process.exit(0);
26
30
  }
27
31
  catch (error) {
28
32
  console.error('Error during migrations up:', error);
@@ -36,6 +40,7 @@ program
36
40
  try {
37
41
  yield migrator.down({ eventHandler: console.log });
38
42
  console.log('Migrations down completed successfully.');
43
+ process.exit(0);
39
44
  }
40
45
  catch (error) {
41
46
  console.error('Error during migrations down:', error);
@@ -50,6 +55,7 @@ program
50
55
  const result = (0, utils_1.createFile)(migrator.migrationsDir, fileName);
51
56
  for (const f of result)
52
57
  console.log(`Successfully created migration files: ${f}`);
58
+ process.exit(0);
53
59
  });
54
60
  program
55
61
  .command('go')
@@ -63,6 +69,7 @@ program
63
69
  }
64
70
  try {
65
71
  yield migrator.go(parsedVersion, { eventHandler: console.log });
72
+ process.exit(0);
66
73
  }
67
74
  catch (error) {
68
75
  console.error('Error during migrations:', error);
@@ -9,10 +9,13 @@ let migrator;
9
9
  program
10
10
  .version('0.0.1')
11
11
  .description('Database migration tool')
12
- .option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migration)')
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(), opts.migrationDir);
15
+ migrator = new Migrator(postgres({
16
+ onnotice: () => {
17
+ }
18
+ }), opts.migrationDir);
16
19
  });
17
20
  program
18
21
  .command('up')
@@ -21,6 +24,7 @@ program
21
24
  try {
22
25
  yield migrator.up({ eventHandler: console.log });
23
26
  console.log('Migrations up completed successfully.');
27
+ process.exit(0);
24
28
  }
25
29
  catch (error) {
26
30
  console.error('Error during migrations up:', error);
@@ -34,6 +38,7 @@ program
34
38
  try {
35
39
  yield migrator.down({ eventHandler: console.log });
36
40
  console.log('Migrations down completed successfully.');
41
+ process.exit(0);
37
42
  }
38
43
  catch (error) {
39
44
  console.error('Error during migrations down:', error);
@@ -48,6 +53,7 @@ program
48
53
  const result = createFile(migrator.migrationsDir, fileName);
49
54
  for (const f of result)
50
55
  console.log(`Successfully created migration files: ${f}`);
56
+ process.exit(0);
51
57
  });
52
58
  program
53
59
  .command('go')
@@ -61,6 +67,7 @@ program
61
67
  }
62
68
  try {
63
69
  yield migrator.go(parsedVersion, { eventHandler: console.log });
70
+ process.exit(0);
64
71
  }
65
72
  catch (error) {
66
73
  console.error('Error during migrations:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgroll",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Postgres migration tool",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",
@@ -34,7 +34,8 @@
34
34
  "fmtc": "prettier --check .",
35
35
  "lint": "eslint . --fix",
36
36
  "lintc": "eslint .",
37
- "test": "jest"
37
+ "test": "jest",
38
+ "pp": "pnpm build && node update-version && npm publish --access=public"
38
39
  },
39
40
  "packageManager": "pnpm@9.4.0",
40
41
  "engines": {
@@ -50,7 +51,7 @@
50
51
  "@eslint/js": "^9.5.0",
51
52
  "@types/jest": "^29.5.12",
52
53
  "@types/node": "^20.14.8",
53
- "@typescript-eslint/eslint-plugin": "^7.13.1",
54
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
54
55
  "eslint": "^9.5.0",
55
56
  "eslint-config-prettier": "^9.1.0",
56
57
  "eslint-import-resolver-typescript": "^3.6.1",
@@ -63,11 +64,11 @@
63
64
  "prettier": "^3.3.2",
64
65
  "ts-jest": "^29.1.5",
65
66
  "tsx": "^4.15.7",
66
- "typescript": "=5.4.5"
67
+ "typescript": "^5.5.2"
67
68
  },
68
69
  "dependencies": {
69
70
  "commander": "^12.1.0",
70
71
  "postgres": "^3.4.4",
71
72
  "tslib": "^2.6.3"
72
73
  }
73
- }
74
+ }