@h3ravel/arquebus 0.4.0 → 0.4.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.
- package/bin/index.cjs +18 -29
- package/bin/index.js +19 -30
- package/dist/index.cjs +3 -14
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +4 -15
- package/dist/migrations/index.cjs +3 -14
- package/dist/migrations/index.d.cts +0 -1
- package/dist/migrations/index.d.ts +0 -1
- package/dist/migrations/index.js +4 -15
- package/package.json +16 -16
package/bin/index.cjs
CHANGED
|
@@ -5089,13 +5089,13 @@ var Migrator = class {
|
|
|
5089
5089
|
async runUp(file, batch, _pretend) {
|
|
5090
5090
|
const migration = await this.resolvePath(file);
|
|
5091
5091
|
const name$1 = this.getMigrationName(file);
|
|
5092
|
-
await
|
|
5092
|
+
await __h3ravel_shared.TaskManager.taskRunner(name$1, () => this.runMigration(migration, "up"));
|
|
5093
5093
|
await this.repository.log(name$1, batch);
|
|
5094
5094
|
}
|
|
5095
5095
|
async runDown(file, migration, _pretend) {
|
|
5096
5096
|
const instance = await this.resolvePath(file);
|
|
5097
5097
|
const name$1 = this.getMigrationName(file);
|
|
5098
|
-
await
|
|
5098
|
+
await __h3ravel_shared.TaskManager.taskRunner(name$1, () => this.runMigration(instance, "down"));
|
|
5099
5099
|
await this.repository.delete(migration);
|
|
5100
5100
|
}
|
|
5101
5101
|
async rollback(paths = [], options = {}) {
|
|
@@ -5146,7 +5146,7 @@ var Migrator = class {
|
|
|
5146
5146
|
const inspector = SchemaInspector.inspect(connection);
|
|
5147
5147
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5148
5148
|
/** Drop all existing tables */
|
|
5149
|
-
for (const table of await inspector.tables())
|
|
5149
|
+
for (const table of await inspector.tables()) await __h3ravel_shared.TaskManager.taskRunner(`Dropping ${__h3ravel_shared.Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5150
5150
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5151
5151
|
/** Create the migration repository */
|
|
5152
5152
|
await this.repository.createRepository();
|
|
@@ -5227,17 +5227,6 @@ var Migrator = class {
|
|
|
5227
5227
|
write(...args) {
|
|
5228
5228
|
if (this.output) console.log(...args);
|
|
5229
5229
|
}
|
|
5230
|
-
async taskRunner(description$1, task) {
|
|
5231
|
-
const startTime = process.hrtime();
|
|
5232
|
-
let result = false;
|
|
5233
|
-
try {
|
|
5234
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5235
|
-
} finally {
|
|
5236
|
-
const endTime = process.hrtime(startTime);
|
|
5237
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5238
|
-
__h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[description$1, "green"]], "", false), [__h3ravel_shared.Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), __h3ravel_shared.Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5239
|
-
}
|
|
5240
|
-
}
|
|
5241
5230
|
};
|
|
5242
5231
|
var migrator_default = Migrator;
|
|
5243
5232
|
|
|
@@ -5608,18 +5597,18 @@ var scripts = {
|
|
|
5608
5597
|
var husky = { "hooks": { "pre-commit": "lint-staged" } };
|
|
5609
5598
|
var lint_staged = { "*.{js,json}": ["prettier --write", "git add"] };
|
|
5610
5599
|
var dependencies = {
|
|
5611
|
-
"@h3ravel/shared": "^0.
|
|
5612
|
-
"chalk": "^5.6.
|
|
5600
|
+
"@h3ravel/shared": "^0.18.1",
|
|
5601
|
+
"chalk": "^5.6.2",
|
|
5613
5602
|
"collect.js": "^4.36.1",
|
|
5614
|
-
"commander": "^14.0.
|
|
5603
|
+
"commander": "^14.0.1",
|
|
5615
5604
|
"cross-env": "^10.0.0",
|
|
5616
|
-
"dayjs": "^1.11.
|
|
5617
|
-
"dotenv": "^17.2.
|
|
5605
|
+
"dayjs": "^1.11.18",
|
|
5606
|
+
"dotenv": "^17.2.2",
|
|
5618
5607
|
"escalade": "^3.2.0",
|
|
5619
5608
|
"husky": "^9.1.7",
|
|
5620
5609
|
"knex": "^3.1.0",
|
|
5621
|
-
"lint-staged": "^16.
|
|
5622
|
-
"mysql2": "^3.
|
|
5610
|
+
"lint-staged": "^16.2.0",
|
|
5611
|
+
"mysql2": "^3.15.0",
|
|
5623
5612
|
"pg": "^8.16.3",
|
|
5624
5613
|
"pluralize": "^8.0.0",
|
|
5625
5614
|
"prettier": "^3.6.2",
|
|
@@ -5628,21 +5617,21 @@ var dependencies = {
|
|
|
5628
5617
|
"tedious": "^19.0.0"
|
|
5629
5618
|
};
|
|
5630
5619
|
var devDependencies = {
|
|
5631
|
-
"@eslint/js": "^9.
|
|
5632
|
-
"@types/node": "^24.
|
|
5620
|
+
"@eslint/js": "^9.36.0",
|
|
5621
|
+
"@types/node": "^24.5.2",
|
|
5633
5622
|
"@types/pluralize": "^0.0.33",
|
|
5634
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
5635
|
-
"@typescript-eslint/parser": "^8.
|
|
5623
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
5624
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
5636
5625
|
"@vitest/coverage-v8": "^3.2.4",
|
|
5637
|
-
"eslint": "^9.
|
|
5626
|
+
"eslint": "^9.36.0",
|
|
5638
5627
|
"jsdom": "^26.1.0",
|
|
5639
5628
|
"sqlite3": "5.1.7",
|
|
5640
|
-
"terser": "^5.
|
|
5629
|
+
"terser": "^5.44.0",
|
|
5641
5630
|
"ts-node": "^10.9.2",
|
|
5642
5631
|
"tsdown": "^0.15.4",
|
|
5643
|
-
"tsx": "^4.20.
|
|
5632
|
+
"tsx": "^4.20.5",
|
|
5644
5633
|
"typescript": "^5.9.2",
|
|
5645
|
-
"typescript-eslint": "^8.
|
|
5634
|
+
"typescript-eslint": "^8.44.0",
|
|
5646
5635
|
"vite-tsconfig-paths": "^5.1.4",
|
|
5647
5636
|
"vitest": "^3.2.4"
|
|
5648
5637
|
};
|
package/bin/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import escalade from "escalade/sync";
|
|
|
6
6
|
import path from "path";
|
|
7
7
|
import resolveFrom from "resolve-from";
|
|
8
8
|
import fs, { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
9
|
-
import { Logger } from "@h3ravel/shared";
|
|
9
|
+
import { Logger, TaskManager } from "@h3ravel/shared";
|
|
10
10
|
import { assign, camel, diff, flat, get, isArray, isEmpty, isEqual, isString, omit, pick, set, snake, trim } from "radashi";
|
|
11
11
|
import advancedFormat from "dayjs/plugin/advancedFormat.js";
|
|
12
12
|
import dayjs from "dayjs";
|
|
@@ -5052,13 +5052,13 @@ var Migrator = class {
|
|
|
5052
5052
|
async runUp(file, batch, _pretend) {
|
|
5053
5053
|
const migration = await this.resolvePath(file);
|
|
5054
5054
|
const name$1 = this.getMigrationName(file);
|
|
5055
|
-
await
|
|
5055
|
+
await TaskManager.taskRunner(name$1, () => this.runMigration(migration, "up"));
|
|
5056
5056
|
await this.repository.log(name$1, batch);
|
|
5057
5057
|
}
|
|
5058
5058
|
async runDown(file, migration, _pretend) {
|
|
5059
5059
|
const instance = await this.resolvePath(file);
|
|
5060
5060
|
const name$1 = this.getMigrationName(file);
|
|
5061
|
-
await
|
|
5061
|
+
await TaskManager.taskRunner(name$1, () => this.runMigration(instance, "down"));
|
|
5062
5062
|
await this.repository.delete(migration);
|
|
5063
5063
|
}
|
|
5064
5064
|
async rollback(paths = [], options = {}) {
|
|
@@ -5109,7 +5109,7 @@ var Migrator = class {
|
|
|
5109
5109
|
const inspector = SchemaInspector.inspect(connection);
|
|
5110
5110
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5111
5111
|
/** Drop all existing tables */
|
|
5112
|
-
for (const table of await inspector.tables())
|
|
5112
|
+
for (const table of await inspector.tables()) await TaskManager.taskRunner(`Dropping ${Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5113
5113
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5114
5114
|
/** Create the migration repository */
|
|
5115
5115
|
await this.repository.createRepository();
|
|
@@ -5190,17 +5190,6 @@ var Migrator = class {
|
|
|
5190
5190
|
write(...args) {
|
|
5191
5191
|
if (this.output) console.log(...args);
|
|
5192
5192
|
}
|
|
5193
|
-
async taskRunner(description$1, task) {
|
|
5194
|
-
const startTime = process.hrtime();
|
|
5195
|
-
let result = false;
|
|
5196
|
-
try {
|
|
5197
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5198
|
-
} finally {
|
|
5199
|
-
const endTime = process.hrtime(startTime);
|
|
5200
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5201
|
-
Logger.twoColumnLog(Logger.parse([[description$1, "green"]], "", false), [Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5202
|
-
}
|
|
5203
|
-
}
|
|
5204
5193
|
};
|
|
5205
5194
|
var migrator_default = Migrator;
|
|
5206
5195
|
|
|
@@ -5571,18 +5560,18 @@ var scripts = {
|
|
|
5571
5560
|
var husky = { "hooks": { "pre-commit": "lint-staged" } };
|
|
5572
5561
|
var lint_staged = { "*.{js,json}": ["prettier --write", "git add"] };
|
|
5573
5562
|
var dependencies = {
|
|
5574
|
-
"@h3ravel/shared": "^0.
|
|
5575
|
-
"chalk": "^5.6.
|
|
5563
|
+
"@h3ravel/shared": "^0.18.1",
|
|
5564
|
+
"chalk": "^5.6.2",
|
|
5576
5565
|
"collect.js": "^4.36.1",
|
|
5577
|
-
"commander": "^14.0.
|
|
5566
|
+
"commander": "^14.0.1",
|
|
5578
5567
|
"cross-env": "^10.0.0",
|
|
5579
|
-
"dayjs": "^1.11.
|
|
5580
|
-
"dotenv": "^17.2.
|
|
5568
|
+
"dayjs": "^1.11.18",
|
|
5569
|
+
"dotenv": "^17.2.2",
|
|
5581
5570
|
"escalade": "^3.2.0",
|
|
5582
5571
|
"husky": "^9.1.7",
|
|
5583
5572
|
"knex": "^3.1.0",
|
|
5584
|
-
"lint-staged": "^16.
|
|
5585
|
-
"mysql2": "^3.
|
|
5573
|
+
"lint-staged": "^16.2.0",
|
|
5574
|
+
"mysql2": "^3.15.0",
|
|
5586
5575
|
"pg": "^8.16.3",
|
|
5587
5576
|
"pluralize": "^8.0.0",
|
|
5588
5577
|
"prettier": "^3.6.2",
|
|
@@ -5591,21 +5580,21 @@ var dependencies = {
|
|
|
5591
5580
|
"tedious": "^19.0.0"
|
|
5592
5581
|
};
|
|
5593
5582
|
var devDependencies = {
|
|
5594
|
-
"@eslint/js": "^9.
|
|
5595
|
-
"@types/node": "^24.
|
|
5583
|
+
"@eslint/js": "^9.36.0",
|
|
5584
|
+
"@types/node": "^24.5.2",
|
|
5596
5585
|
"@types/pluralize": "^0.0.33",
|
|
5597
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
5598
|
-
"@typescript-eslint/parser": "^8.
|
|
5586
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
5587
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
5599
5588
|
"@vitest/coverage-v8": "^3.2.4",
|
|
5600
|
-
"eslint": "^9.
|
|
5589
|
+
"eslint": "^9.36.0",
|
|
5601
5590
|
"jsdom": "^26.1.0",
|
|
5602
5591
|
"sqlite3": "5.1.7",
|
|
5603
|
-
"terser": "^5.
|
|
5592
|
+
"terser": "^5.44.0",
|
|
5604
5593
|
"ts-node": "^10.9.2",
|
|
5605
5594
|
"tsdown": "^0.15.4",
|
|
5606
|
-
"tsx": "^4.20.
|
|
5595
|
+
"tsx": "^4.20.5",
|
|
5607
5596
|
"typescript": "^5.9.2",
|
|
5608
|
-
"typescript-eslint": "^8.
|
|
5597
|
+
"typescript-eslint": "^8.44.0",
|
|
5609
5598
|
"vite-tsconfig-paths": "^5.1.4",
|
|
5610
5599
|
"vitest": "^3.2.4"
|
|
5611
5600
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -5039,13 +5039,13 @@ var Migrator = class {
|
|
|
5039
5039
|
async runUp(file, batch, _pretend) {
|
|
5040
5040
|
const migration = await this.resolvePath(file);
|
|
5041
5041
|
const name = this.getMigrationName(file);
|
|
5042
|
-
await
|
|
5042
|
+
await __h3ravel_shared.TaskManager.taskRunner(name, () => this.runMigration(migration, "up"));
|
|
5043
5043
|
await this.repository.log(name, batch);
|
|
5044
5044
|
}
|
|
5045
5045
|
async runDown(file, migration, _pretend) {
|
|
5046
5046
|
const instance = await this.resolvePath(file);
|
|
5047
5047
|
const name = this.getMigrationName(file);
|
|
5048
|
-
await
|
|
5048
|
+
await __h3ravel_shared.TaskManager.taskRunner(name, () => this.runMigration(instance, "down"));
|
|
5049
5049
|
await this.repository.delete(migration);
|
|
5050
5050
|
}
|
|
5051
5051
|
async rollback(paths = [], options = {}) {
|
|
@@ -5096,7 +5096,7 @@ var Migrator = class {
|
|
|
5096
5096
|
const inspector = SchemaInspector.inspect(connection);
|
|
5097
5097
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5098
5098
|
/** Drop all existing tables */
|
|
5099
|
-
for (const table of await inspector.tables())
|
|
5099
|
+
for (const table of await inspector.tables()) await __h3ravel_shared.TaskManager.taskRunner(`Dropping ${__h3ravel_shared.Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5100
5100
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5101
5101
|
/** Create the migration repository */
|
|
5102
5102
|
await this.repository.createRepository();
|
|
@@ -5177,17 +5177,6 @@ var Migrator = class {
|
|
|
5177
5177
|
write(...args) {
|
|
5178
5178
|
if (this.output) console.log(...args);
|
|
5179
5179
|
}
|
|
5180
|
-
async taskRunner(description, task) {
|
|
5181
|
-
const startTime = process.hrtime();
|
|
5182
|
-
let result = false;
|
|
5183
|
-
try {
|
|
5184
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5185
|
-
} finally {
|
|
5186
|
-
const endTime = process.hrtime(startTime);
|
|
5187
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5188
|
-
__h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[description, "green"]], "", false), [__h3ravel_shared.Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), __h3ravel_shared.Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5189
|
-
}
|
|
5190
|
-
}
|
|
5191
5180
|
};
|
|
5192
5181
|
var migrator_default = Migrator;
|
|
5193
5182
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1394,7 +1394,6 @@ declare class Migrator {
|
|
|
1394
1394
|
deleteRepository(): void;
|
|
1395
1395
|
setOutput(output: boolean): this;
|
|
1396
1396
|
write(...args: any[]): void;
|
|
1397
|
-
taskRunner(description: string, task: (() => Promise<any>) | (() => any)): Promise<void>;
|
|
1398
1397
|
}
|
|
1399
1398
|
//#endregion
|
|
1400
1399
|
//#region src/migrate.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1394,7 +1394,6 @@ declare class Migrator {
|
|
|
1394
1394
|
deleteRepository(): void;
|
|
1395
1395
|
setOutput(output: boolean): this;
|
|
1396
1396
|
write(...args: any[]): void;
|
|
1397
|
-
taskRunner(description: string, task: (() => Promise<any>) | (() => any)): Promise<void>;
|
|
1398
1397
|
}
|
|
1399
1398
|
//#endregion
|
|
1400
1399
|
//#region src/migrate.d.ts
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import Knex$1 from "knex";
|
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { existsSync } from "fs";
|
|
9
9
|
import pluralize from "pluralize";
|
|
10
|
-
import { Logger } from "@h3ravel/shared";
|
|
10
|
+
import { Logger, TaskManager } from "@h3ravel/shared";
|
|
11
11
|
import fs from "node:fs/promises";
|
|
12
12
|
import { access } from "fs/promises";
|
|
13
13
|
import escalade from "escalade/sync";
|
|
@@ -5008,13 +5008,13 @@ var Migrator = class {
|
|
|
5008
5008
|
async runUp(file, batch, _pretend) {
|
|
5009
5009
|
const migration = await this.resolvePath(file);
|
|
5010
5010
|
const name = this.getMigrationName(file);
|
|
5011
|
-
await
|
|
5011
|
+
await TaskManager.taskRunner(name, () => this.runMigration(migration, "up"));
|
|
5012
5012
|
await this.repository.log(name, batch);
|
|
5013
5013
|
}
|
|
5014
5014
|
async runDown(file, migration, _pretend) {
|
|
5015
5015
|
const instance = await this.resolvePath(file);
|
|
5016
5016
|
const name = this.getMigrationName(file);
|
|
5017
|
-
await
|
|
5017
|
+
await TaskManager.taskRunner(name, () => this.runMigration(instance, "down"));
|
|
5018
5018
|
await this.repository.delete(migration);
|
|
5019
5019
|
}
|
|
5020
5020
|
async rollback(paths = [], options = {}) {
|
|
@@ -5065,7 +5065,7 @@ var Migrator = class {
|
|
|
5065
5065
|
const inspector = SchemaInspector.inspect(connection);
|
|
5066
5066
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5067
5067
|
/** Drop all existing tables */
|
|
5068
|
-
for (const table of await inspector.tables())
|
|
5068
|
+
for (const table of await inspector.tables()) await TaskManager.taskRunner(`Dropping ${Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5069
5069
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5070
5070
|
/** Create the migration repository */
|
|
5071
5071
|
await this.repository.createRepository();
|
|
@@ -5146,17 +5146,6 @@ var Migrator = class {
|
|
|
5146
5146
|
write(...args) {
|
|
5147
5147
|
if (this.output) console.log(...args);
|
|
5148
5148
|
}
|
|
5149
|
-
async taskRunner(description, task) {
|
|
5150
|
-
const startTime = process.hrtime();
|
|
5151
|
-
let result = false;
|
|
5152
|
-
try {
|
|
5153
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5154
|
-
} finally {
|
|
5155
|
-
const endTime = process.hrtime(startTime);
|
|
5156
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5157
|
-
Logger.twoColumnLog(Logger.parse([[description, "green"]], "", false), [Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5158
|
-
}
|
|
5159
|
-
}
|
|
5160
5149
|
};
|
|
5161
5150
|
var migrator_default = Migrator;
|
|
5162
5151
|
|
|
@@ -5034,13 +5034,13 @@ var Migrator = class {
|
|
|
5034
5034
|
async runUp(file, batch, _pretend) {
|
|
5035
5035
|
const migration = await this.resolvePath(file);
|
|
5036
5036
|
const name = this.getMigrationName(file);
|
|
5037
|
-
await
|
|
5037
|
+
await __h3ravel_shared.TaskManager.taskRunner(name, () => this.runMigration(migration, "up"));
|
|
5038
5038
|
await this.repository.log(name, batch);
|
|
5039
5039
|
}
|
|
5040
5040
|
async runDown(file, migration, _pretend) {
|
|
5041
5041
|
const instance = await this.resolvePath(file);
|
|
5042
5042
|
const name = this.getMigrationName(file);
|
|
5043
|
-
await
|
|
5043
|
+
await __h3ravel_shared.TaskManager.taskRunner(name, () => this.runMigration(instance, "down"));
|
|
5044
5044
|
await this.repository.delete(migration);
|
|
5045
5045
|
}
|
|
5046
5046
|
async rollback(paths = [], options = {}) {
|
|
@@ -5091,7 +5091,7 @@ var Migrator = class {
|
|
|
5091
5091
|
const inspector = SchemaInspector.inspect(connection);
|
|
5092
5092
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5093
5093
|
/** Drop all existing tables */
|
|
5094
|
-
for (const table of await inspector.tables())
|
|
5094
|
+
for (const table of await inspector.tables()) await __h3ravel_shared.TaskManager.taskRunner(`Dropping ${__h3ravel_shared.Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5095
5095
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5096
5096
|
/** Create the migration repository */
|
|
5097
5097
|
await this.repository.createRepository();
|
|
@@ -5172,17 +5172,6 @@ var Migrator = class {
|
|
|
5172
5172
|
write(...args) {
|
|
5173
5173
|
if (this.output) console.log(...args);
|
|
5174
5174
|
}
|
|
5175
|
-
async taskRunner(description, task) {
|
|
5176
|
-
const startTime = process.hrtime();
|
|
5177
|
-
let result = false;
|
|
5178
|
-
try {
|
|
5179
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5180
|
-
} finally {
|
|
5181
|
-
const endTime = process.hrtime(startTime);
|
|
5182
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5183
|
-
__h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[description, "green"]], "", false), [__h3ravel_shared.Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), __h3ravel_shared.Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5184
|
-
}
|
|
5185
|
-
}
|
|
5186
5175
|
};
|
|
5187
5176
|
var migrator_default = Migrator;
|
|
5188
5177
|
|
|
@@ -1349,7 +1349,6 @@ declare class Migrator {
|
|
|
1349
1349
|
deleteRepository(): void;
|
|
1350
1350
|
setOutput(output: boolean): this;
|
|
1351
1351
|
write(...args: any[]): void;
|
|
1352
|
-
taskRunner(description: string, task: (() => Promise<any>) | (() => any)): Promise<void>;
|
|
1353
1352
|
}
|
|
1354
1353
|
//#endregion
|
|
1355
1354
|
//#region src/migrate.d.ts
|
|
@@ -1346,7 +1346,6 @@ declare class Migrator {
|
|
|
1346
1346
|
deleteRepository(): void;
|
|
1347
1347
|
setOutput(output: boolean): this;
|
|
1348
1348
|
write(...args: any[]): void;
|
|
1349
|
-
taskRunner(description: string, task: (() => Promise<any>) | (() => any)): Promise<void>;
|
|
1350
1349
|
}
|
|
1351
1350
|
//#endregion
|
|
1352
1351
|
//#region src/migrate.d.ts
|
package/dist/migrations/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __export } from "./chunk-PECeCxCb.js";
|
|
2
|
-
import { Logger } from "@h3ravel/shared";
|
|
2
|
+
import { Logger, TaskManager } from "@h3ravel/shared";
|
|
3
3
|
import { assign, camel, diff, flat, get, isArray, isEmpty, isEqual, isString, omit, pick, set, snake, trim } from "radashi";
|
|
4
4
|
import advancedFormat from "dayjs/plugin/advancedFormat.js";
|
|
5
5
|
import dayjs from "dayjs";
|
|
@@ -4988,13 +4988,13 @@ var Migrator = class {
|
|
|
4988
4988
|
async runUp(file, batch, _pretend) {
|
|
4989
4989
|
const migration = await this.resolvePath(file);
|
|
4990
4990
|
const name = this.getMigrationName(file);
|
|
4991
|
-
await
|
|
4991
|
+
await TaskManager.taskRunner(name, () => this.runMigration(migration, "up"));
|
|
4992
4992
|
await this.repository.log(name, batch);
|
|
4993
4993
|
}
|
|
4994
4994
|
async runDown(file, migration, _pretend) {
|
|
4995
4995
|
const instance = await this.resolvePath(file);
|
|
4996
4996
|
const name = this.getMigrationName(file);
|
|
4997
|
-
await
|
|
4997
|
+
await TaskManager.taskRunner(name, () => this.runMigration(instance, "down"));
|
|
4998
4998
|
await this.repository.delete(migration);
|
|
4999
4999
|
}
|
|
5000
5000
|
async rollback(paths = [], options = {}) {
|
|
@@ -5045,7 +5045,7 @@ var Migrator = class {
|
|
|
5045
5045
|
const inspector = SchemaInspector.inspect(connection);
|
|
5046
5046
|
await connection.raw("SET foreign_key_checks = 0");
|
|
5047
5047
|
/** Drop all existing tables */
|
|
5048
|
-
for (const table of await inspector.tables())
|
|
5048
|
+
for (const table of await inspector.tables()) await TaskManager.taskRunner(`Dropping ${Logger.parse([[table, "grey"]], "", false)} table`, () => connection.schema.dropTableIfExists(table));
|
|
5049
5049
|
await connection.raw("SET foreign_key_checks = 1");
|
|
5050
5050
|
/** Create the migration repository */
|
|
5051
5051
|
await this.repository.createRepository();
|
|
@@ -5126,17 +5126,6 @@ var Migrator = class {
|
|
|
5126
5126
|
write(...args) {
|
|
5127
5127
|
if (this.output) console.log(...args);
|
|
5128
5128
|
}
|
|
5129
|
-
async taskRunner(description, task) {
|
|
5130
|
-
const startTime = process.hrtime();
|
|
5131
|
-
let result = false;
|
|
5132
|
-
try {
|
|
5133
|
-
result = await Promise.all([(task || (() => true))()].flat());
|
|
5134
|
-
} finally {
|
|
5135
|
-
const endTime = process.hrtime(startTime);
|
|
5136
|
-
const duration = (endTime[0] * 1e9 + endTime[1]) / 1e6;
|
|
5137
|
-
Logger.twoColumnLog(Logger.parse([[description, "green"]], "", false), [Logger.parse([[`${Math.floor(duration)}ms`, "gray"]], "", false), Logger.parse([[result !== false ? "✔" : "✘", result !== false ? "green" : "red"]], "", false)].join(" "));
|
|
5138
|
-
}
|
|
5139
|
-
}
|
|
5140
5129
|
};
|
|
5141
5130
|
var migrator_default = Migrator;
|
|
5142
5131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/arquebus",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.",
|
|
5
5
|
"homepage": "https://h3ravel.toneflix.net/arquebus",
|
|
6
6
|
"bin": {
|
|
@@ -123,18 +123,18 @@
|
|
|
123
123
|
]
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@h3ravel/shared": "^0.
|
|
127
|
-
"chalk": "^5.6.
|
|
126
|
+
"@h3ravel/shared": "^0.18.1",
|
|
127
|
+
"chalk": "^5.6.2",
|
|
128
128
|
"collect.js": "^4.36.1",
|
|
129
|
-
"commander": "^14.0.
|
|
129
|
+
"commander": "^14.0.1",
|
|
130
130
|
"cross-env": "^10.0.0",
|
|
131
|
-
"dayjs": "^1.11.
|
|
132
|
-
"dotenv": "^17.2.
|
|
131
|
+
"dayjs": "^1.11.18",
|
|
132
|
+
"dotenv": "^17.2.2",
|
|
133
133
|
"escalade": "^3.2.0",
|
|
134
134
|
"husky": "^9.1.7",
|
|
135
135
|
"knex": "^3.1.0",
|
|
136
|
-
"lint-staged": "^16.
|
|
137
|
-
"mysql2": "^3.
|
|
136
|
+
"lint-staged": "^16.2.0",
|
|
137
|
+
"mysql2": "^3.15.0",
|
|
138
138
|
"pg": "^8.16.3",
|
|
139
139
|
"pluralize": "^8.0.0",
|
|
140
140
|
"prettier": "^3.6.2",
|
|
@@ -143,21 +143,21 @@
|
|
|
143
143
|
"tedious": "^19.0.0"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
|
-
"@eslint/js": "^9.
|
|
147
|
-
"@types/node": "^24.
|
|
146
|
+
"@eslint/js": "^9.36.0",
|
|
147
|
+
"@types/node": "^24.5.2",
|
|
148
148
|
"@types/pluralize": "^0.0.33",
|
|
149
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
150
|
-
"@typescript-eslint/parser": "^8.
|
|
149
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
150
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
151
151
|
"@vitest/coverage-v8": "^3.2.4",
|
|
152
|
-
"eslint": "^9.
|
|
152
|
+
"eslint": "^9.36.0",
|
|
153
153
|
"jsdom": "^26.1.0",
|
|
154
154
|
"sqlite3": "5.1.7",
|
|
155
|
-
"terser": "^5.
|
|
155
|
+
"terser": "^5.44.0",
|
|
156
156
|
"ts-node": "^10.9.2",
|
|
157
157
|
"tsdown": "^0.15.4",
|
|
158
|
-
"tsx": "^4.20.
|
|
158
|
+
"tsx": "^4.20.5",
|
|
159
159
|
"typescript": "^5.9.2",
|
|
160
|
-
"typescript-eslint": "^8.
|
|
160
|
+
"typescript-eslint": "^8.44.0",
|
|
161
161
|
"vite-tsconfig-paths": "^5.1.4",
|
|
162
162
|
"vitest": "^3.2.4"
|
|
163
163
|
},
|