sasat 0.19.19 → 0.19.21

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.
@@ -1,2 +1,2 @@
1
1
  import { DBClient } from './connectors/dbClient.js';
2
- export declare const getDbClient: (connectionOption?: Partial<import("mysql2/typings/mysql/lib/Connection.js").ConnectionOptions> | undefined, poolOption?: Partial<import("mysql2/typings/mysql/lib/Pool.js").PoolOptions> | undefined) => DBClient;
2
+ export declare const getDbClient: (connectionOption?: Partial<import("mysql2").ConnectionOptions> | undefined, poolOption?: Partial<import("mysql2").PoolOptions> | undefined) => DBClient;
@@ -28,7 +28,7 @@ export const getCurrentMigration = async () => {
28
28
  "direction enum('up', 'down') not null, migrated_at timestamp default current_timestamp)");
29
29
  const result = await client.rawQuery(`SELECT name, direction
30
30
  FROM ${migrationTable}
31
- ORDER BY migrated_at ASC`);
31
+ ORDER BY id ASC`);
32
32
  if (!result.length)
33
33
  return;
34
34
  const runs = calcRunMigrationFileNames(result);
@@ -8,17 +8,17 @@ export const readMigration = async (store, tsFileName, direction) => {
8
8
  const instance = new module.default();
9
9
  if (direction === Direction.Up) {
10
10
  if (instance.beforeUp)
11
- instance.beforeUp();
12
- instance.up(store);
11
+ await instance.beforeUp();
12
+ await instance.up(store);
13
13
  if (instance.afterUp)
14
- instance.afterUp();
14
+ await instance.afterUp();
15
15
  }
16
16
  else {
17
17
  if (instance.beforeDown)
18
- instance.beforeDown();
19
- instance.down(store);
18
+ await instance.beforeDown();
19
+ await instance.down(store);
20
20
  if (instance.afterDown)
21
- instance.afterDown();
21
+ await instance.afterDown();
22
22
  }
23
23
  return store;
24
24
  };
@@ -1,9 +1,9 @@
1
1
  import { MigrationStore } from './storeMigrator.js';
2
2
  export interface SasatMigration {
3
- up: (store: MigrationStore) => void;
4
- down: (store: MigrationStore) => void;
5
- beforeUp?: () => void;
6
- afterUp?: () => void;
7
- beforeDown?: () => void;
8
- afterDown?: () => void;
3
+ up: (store: MigrationStore) => void | Promise<void>;
4
+ down: (store: MigrationStore) => void | Promise<void>;
5
+ beforeUp?: () => void | Promise<void>;
6
+ afterUp?: () => void | Promise<void>;
7
+ beforeDown?: () => void | Promise<void>;
8
+ afterDown?: () => void | Promise<void>;
9
9
  }
@@ -1,3 +1,3 @@
1
1
  import { GraphQLResolveInfo } from 'graphql';
2
2
  import { Fields } from './field.js';
3
- export declare const gqlResolveInfoToField: <T extends Fields<any, Record<string, unknown>> = Fields<unknown, Record<string, unknown>>>(info: GraphQLResolveInfo) => T;
3
+ export declare const gqlResolveInfoToField: <T extends Fields<any> = Fields<unknown>>(info: GraphQLResolveInfo) => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasat",
3
- "version": "0.19.19",
3
+ "version": "0.19.21",
4
4
  "repository": "https://github.com/nin138/sasat.git",
5
5
  "author": "nin138 <ninian138@gmail.com>",
6
6
  "license": "MIT",
@@ -21,51 +21,52 @@
21
21
  "test:single": "env-cmd jest --silent=false --verbose false",
22
22
  "test:base": "node --experimental-vm-modules node_modules/.bin/jest",
23
23
  "resetdb": "docker-compose exec db sh -c \"mysql -u root < /docker-entrypoint-initdb.d/temp.sql\"",
24
- "prepare": "yarn build && husky install",
24
+ "prepare": "yarn build",
25
+ "postinstall": "husky install",
25
26
  "sasat": "yarn env-cmd ts-node-esm ./src/cli/cli.ts",
26
27
  "server": "yarn env-cmd ts-node-esm -r tsconfig-paths/register ./test/testServer.ts"
27
28
  },
28
29
  "dependencies": {
29
30
  "cac": "^6.7.14",
30
- "chalk": "^5.0.1",
31
- "fs-extra": "^11.0.0",
32
- "graphql": "^16.6.0",
31
+ "chalk": "^5.3.0",
32
+ "fs-extra": "^11.1.1",
33
+ "graphql": "^16.7.1",
33
34
  "graphql-subscriptions": "^2.0.0",
34
- "hashids": "^2.2.10",
35
+ "hashids": "^2.3.0",
35
36
  "js-yaml": "^4.1.0",
36
- "mysql2": "^3.1.2",
37
+ "mysql2": "^3.4.4",
37
38
  "pluralize": "^8.0.0",
38
- "prettier": "^2.7.1",
39
+ "prettier": "^2.8.8",
39
40
  "sqlstring": "^2.3.3",
40
- "typescript": "^4.9.5"
41
+ "typescript": "^5.1.6"
41
42
  },
42
43
  "devDependencies": {
43
- "@apollo/server": "^4.3.0",
44
+ "@apollo/server": "^4.7.5",
44
45
  "@types/fs-extra": "11.0.1",
45
46
  "@types/jest": "29.5.2",
46
47
  "@types/js-yaml": "4.0.5",
47
- "@types/node": "18.16.18",
48
+ "@types/node": "20.3.3",
48
49
  "@types/pluralize": "0.0.29",
49
50
  "@types/prettier": "2.7.3",
50
51
  "@types/sqlstring": "2.3.0",
51
- "@typescript-eslint/eslint-plugin": "5.59.11",
52
- "@typescript-eslint/parser": "5.59.11",
52
+ "@typescript-eslint/eslint-plugin": "5.61.0",
53
+ "@typescript-eslint/parser": "5.61.0",
53
54
  "env-cmd": "10.1.0",
54
- "eslint": "8.42.0",
55
+ "eslint": "8.44.0",
55
56
  "eslint-config-prettier": "8.8.0",
56
- "eslint-plugin-import": "^2.26.0",
57
+ "eslint-plugin-import": "^2.27.5",
57
58
  "eslint-plugin-prettier": "4.2.1",
58
59
  "husky": "8.0.3",
59
- "jest": "29.5.0",
60
- "lint-staged": "13.2.2",
60
+ "jest": "29.6.0",
61
+ "lint-staged": "13.2.3",
61
62
  "sasat": "link:./lib",
62
- "ts-jest": "29.0.5",
63
+ "ts-jest": "29.1.1",
63
64
  "ts-node": "10.9.1",
64
- "tsconfig-paths": "4.1.2"
65
+ "tsconfig-paths": "4.2.0"
65
66
  },
66
67
  "peerDependencies": {
67
68
  "@apollo/server": "^4.0.0",
68
- "typescript": "^3.7.4 || ^4.0.0"
69
+ "typescript": "^3.7.4 || ^4.0.0 || ^5.0.0"
69
70
  },
70
71
  "lint-staged": {
71
72
  "*.ts": [