@sqb/migrator 4.19.6 → 4.20.1

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.
@@ -10,19 +10,16 @@ const migration_package_js_1 = require("../migration-package.js");
10
10
  const types_js_1 = require("../types.js");
11
11
  const pgAdapter = new postgres_1.PgAdapter();
12
12
  class PgMigrationAdapter extends migration_adapter_js_1.MigrationAdapter {
13
- constructor() {
14
- super(...arguments);
15
- this._infoSchema = 'public';
16
- this._version = 0;
17
- this._status = types_js_1.MigrationStatus.idle;
18
- this.defaultVariables = {
19
- tablespace: 'pg_default',
20
- schema: 'public',
21
- owner: 'postgres',
22
- };
23
- this.summaryTable = 'migration_summary';
24
- this.eventTable = 'migration_events';
25
- }
13
+ _infoSchema = 'public';
14
+ _version = 0;
15
+ _status = types_js_1.MigrationStatus.idle;
16
+ defaultVariables = {
17
+ tablespace: 'pg_default',
18
+ schema: 'public',
19
+ owner: 'postgres',
20
+ };
21
+ summaryTable = 'migration_summary';
22
+ eventTable = 'migration_events';
26
23
  get packageName() {
27
24
  return this._migrationPackage.name;
28
25
  }
@@ -133,9 +133,9 @@ async function loadMigrations(baseDir, pattern) {
133
133
  if (path_1.default.basename(filename, ext) !== 'migration')
134
134
  continue;
135
135
  let json;
136
- if (['.js', '.ts', '.cjs', '.mjs'].includes(ext)) {
136
+ if (['.js', '.ts', '.cjs', '.mjs', 'mts', 'cts'].includes(ext)) {
137
137
  json = await Promise.resolve(`${filename}`).then(s => tslib_1.__importStar(require(s)));
138
- if (json.__esModule)
138
+ if (json.default?.version)
139
139
  json = json.default;
140
140
  }
141
141
  else if (ext === '.json') {
@@ -6,19 +6,16 @@ import { isCustomMigrationTask, isInsertDataMigrationTask, isSqlScriptMigrationT
6
6
  import { MigrationStatus } from '../types.js';
7
7
  const pgAdapter = new PgAdapter();
8
8
  export class PgMigrationAdapter extends MigrationAdapter {
9
- constructor() {
10
- super(...arguments);
11
- this._infoSchema = 'public';
12
- this._version = 0;
13
- this._status = MigrationStatus.idle;
14
- this.defaultVariables = {
15
- tablespace: 'pg_default',
16
- schema: 'public',
17
- owner: 'postgres',
18
- };
19
- this.summaryTable = 'migration_summary';
20
- this.eventTable = 'migration_events';
21
- }
9
+ _infoSchema = 'public';
10
+ _version = 0;
11
+ _status = MigrationStatus.idle;
12
+ defaultVariables = {
13
+ tablespace: 'pg_default',
14
+ schema: 'public',
15
+ owner: 'postgres',
16
+ };
17
+ summaryTable = 'migration_summary';
18
+ eventTable = 'migration_events';
22
19
  get packageName() {
23
20
  return this._migrationPackage.name;
24
21
  }
@@ -126,9 +126,9 @@ async function loadMigrations(baseDir, pattern) {
126
126
  if (path.basename(filename, ext) !== 'migration')
127
127
  continue;
128
128
  let json;
129
- if (['.js', '.ts', '.cjs', '.mjs'].includes(ext)) {
129
+ if (['.js', '.ts', '.cjs', '.mjs', 'mts', 'cts'].includes(ext)) {
130
130
  json = await import(filename);
131
- if (json.__esModule)
131
+ if (json.default?.version)
132
132
  json = json.default;
133
133
  }
134
134
  else if (ext === '.json') {
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@sqb/migrator",
3
3
  "description": "Database migrator for SQB",
4
- "version": "4.19.6",
4
+ "version": "4.20.1",
5
5
  "author": "Panates",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
8
- "fast-glob": "^3.3.2",
8
+ "cross-dirname": "^0.1.0",
9
+ "fast-glob": "^3.3.3",
9
10
  "strict-typed-events": "^2.8.0",
10
- "ts-gems": "^3.6.0",
11
+ "ts-gems": "^3.11.3",
11
12
  "tslib": "^2.8.1"
12
13
  },
13
14
  "peerDependencies": {
14
- "@sqb/builder": "^4.19.6",
15
- "@sqb/connect": "^4.19.6",
16
- "@sqb/postgres": "^4.19.6"
15
+ "@sqb/builder": "^4.20.1",
16
+ "@sqb/connect": "^4.20.1",
17
+ "@sqb/postgres": "^4.20.1"
17
18
  },
18
19
  "type": "module",
19
20
  "exports": {
@@ -39,12 +40,11 @@
39
40
  ],
40
41
  "repository": {
41
42
  "type": "git",
42
- "url": "https://github.com/sqbjs/sqb.git",
43
+ "url": "https://github.com/panates/sqb.git",
43
44
  "directory": "packages/migrator"
44
45
  },
45
46
  "engines": {
46
- "node": ">=16.0",
47
- "npm": ">=7.0.0"
47
+ "node": ">=18.0"
48
48
  },
49
49
  "files": [
50
50
  "bin/",